@tomtom-org/maps-sdk-plugin-agent-toolkit 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +768 -0
- package/README.md +17 -13
- package/dist/index.d.ts +975 -841
- package/dist/index.es.js +2 -2
- package/dist/{worker-libs-B6xqxvae.js → worker-libs-CGRly7A4.js} +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var sandboxLibrarySource='!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).turf={})}(this,function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if(Array.isArray(t))return t}function r(t,e,n){return e=l(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t)}(t,c()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,x(r.key),r)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=k(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function u(t,e,n){return(e=x(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}function f(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nvar t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,l=Object.create(u.prototype);return d(l,"_invoke",function(n,r,i){var o,a,u,l=0,h=i||[],c=!1,f={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,n){return o=e,a=0,u=t,f.n=n,s}};function v(n,r){for(a=n,u=r,e=0;!c&&l&&!i&&e<h.length;e++){var i,o=h[e],v=f.p,g=o[2];n>3?(i=g===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=v&&((i=n<2&&v<o[1])?(a=0,f.v=r,f.n=o[1]):v<g&&(i=n<3||o[0]>r||r>g)&&(o[4]=n,o[5]=r,f.n=g,a=0))}if(i||n>1)return s;throw c=!0,r}return function(i,h,g){if(l>1)throw TypeError("Generator is already running");for(c&&1===h&&v(h,g),a=h,u=g;(e=a<2?t:u)||!c;){o||(a?a<3?(a>1&&(f.n=-1),v(a,u)):f.n=u:f.v=u);try{if(l=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(u=TypeError("The iterator does not provide a \'"+i+"\' method"),a=1);o=t}else if((e=(c=f.n<0)?u:n.call(r,f))!==s)break}catch(e){o=t,a=1,u=e}finally{l=1}}return{value:e,done:c}}}(n,i,o),!0),l}var s={};function a(){}function u(){}function l(){}e=Object.getPrototypeOf;var h=[][r]?e(e([][r]())):(d(e={},r,function(){return this}),e),c=l.prototype=a.prototype=Object.create(h);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,d(t,i,"GeneratorFunction")),t.prototype=Object.create(c),t}return u.prototype=l,d(c,"constructor",l),d(l,"constructor",u),u.displayName="GeneratorFunction",d(l,i,"GeneratorFunction"),d(c),d(c,i,"Generator"),d(c,r,function(){return this}),d(c,"toString",function(){return"[object Generator]"}),(g=function(){return{w:o,m:f}})()}function d(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}d=function(t,e,n,r){function o(e,n){d(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},d(t,e,n,r)}function p(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(typeof t+" is not iterable")}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function m(t,e){return n(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||k(t,e)||v()}function _(t){return function(t){if(Array.isArray(t))return e(t)}(t)||f(t)||k(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function k(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var w=6371008.8,b={centimeters:637100880,centimetres:637100880,cm:637100880,degrees:360/(2*Math.PI),deg:360/(2*Math.PI),feet:20902260.511392,ft:20902260.511392,inches:39.37*w,in:39.37*w,kilometers:6371.0088,kilometres:6371.0088,km:6371.0088,meters:w,metres:w,m:w,miles:3958.761333810546,mi:3958.761333810546,millimeters:6371008800,millimetres:6371008800,mm:6371008800,nauticalmiles:w/1852,nmi:w/1852,radians:1,rad:1,yards:6967335.223679999,yd:6967335.223679999},I={acres:247105e-9,ac:247105e-9,centimeters:1e4,centimetres:1e4,cm:1e4,feet:10.763910417,ft:10.763910417,hectares:1e-4,ha:1e-4,inches:1550.003100006,in:1550.003100006,kilometers:1e-6,kilometres:1e-6,km:1e-6,meters:1,metres:1,m:1,miles:386e-9,mi:386e-9,nauticalmiles:2.9155334959812285e-7,nmi:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,mm:1e6,yards:1.195990046,yd:1.195990046};function N(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},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 S(t,e){switch(t){case"Point":return M(e).geometry;case"LineString":return T(e).geometry;case"Polygon":return P(e).geometry;case"MultiPoint":return D(e).geometry;case"MultiLineString":return A(e).geometry;case"MultiPolygon":return F(e).geometry;default:throw new Error(t+" is invalid")}}function M(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};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(!W(t[0])||!W(t[1]))throw new Error("coordinates must contain numbers");return N({type:"Point",coordinates:t},e,n)}function L(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return M(t,e)}),n)}function P(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=a(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}catch(t){i.e(t)}finally{i.f()}return N({type:"Polygon",coordinates:t},e,r)}function C(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return P(t,e)}),n)}function T(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return N({type:"LineString",coordinates:t},e,n)}function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return T(t,e)}),n)}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function A(t,e){return N({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function D(t,e){return N({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function F(t,e){return N({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function q(t,e){return N({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t*n}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t/n}function z(t,e){return U(B(t,e))}function j(t){var e=t%360;return e<0&&(e+=360),e}function X(t){return(t%=360)>180?t-360:t<-180?t+360:t}function U(t){return 180*(t%(2*Math.PI))/Math.PI}function V(t){return t%360*Math.PI/180}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number");return Y(B(t,e),n)}function H(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number");var r=I[e];if(!r)throw new Error("invalid original units");var i=I[n];if(!i)throw new Error("invalid final units");return t/r*i}function W(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function J(t){return null!==t&&"object"===E(t)&&!Array.isArray(t)}function K(t){delete t.bbox,"Feature"===t.type?t.geometry&&K(t.geometry):"FeatureCollection"===t.type?t.features.forEach(K):"GeometryCollection"===t.type&&t.geometries.forEach(K)}function Q(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(!W(t))throw new Error("bbox must only contain numbers")})}function $(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(E(t)))throw new Error("id must be a number or a string")}var tt=Object.freeze({__proto__:null,areaFactors:I,azimuthToBearing:X,bearingToAzimuth:j,convertArea:H,convertLength:Z,degreesToRadians:V,earthRadius:w,factors:b,feature:N,featureCollection:R,geometry:S,geometryCollection:q,isNumber:W,isObject:J,lengthToDegrees:z,lengthToRadians:B,lineString:T,lineStrings:O,multiLineString:A,multiPoint:D,multiPolygon:F,point:M,points:L,polygon:P,polygons:C,radiansToDegrees:U,radiansToLength:Y,removeBbox:K,round:G,validateBBox:Q,validateId:$});function et(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)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return _(t);throw new Error("coord must be GeoJSON Point or an Array of numbers")}function nt(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")}function rt(t){if(t.length>1&&W(t[0])&&W(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return rt(t[0]);throw new Error("coordinates must only contain numbers")}function it(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function ot(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function st(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");var r,i=a(t.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;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)}}catch(t){i.e(t)}finally{i.f()}}function at(t){return"Feature"===t.type?t.geometry:t}function ut(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}var lt=Object.freeze({__proto__:null,collectionOf:st,containsNumber:rt,featureOf:ot,geojsonType:it,getCoord:et,getCoords:nt,getGeom:at,getType:ut});function ht(t,e){if(!0===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final)return function(t,e){var n=ht(e,t);return(n=(n+180)%360)>180?n-360:n}(t,e);var n=et(t),r=et(e),i=V(n[0]),o=V(r[0]),s=V(n[1]),a=V(r[1]),u=Math.sin(o-i)*Math.cos(a),l=Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(o-i);return U(Math.atan2(u,l))}function ct(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=et(t),o=V(i[0]),s=V(i[1]),a=V(n),u=B(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(a)),h=U(o+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l))),c=U(l);return void 0!==i[2]?M([h,c,i[2]],r.properties):M([h,c],r.properties)}function ft(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=et(e),o=V(i[1]-r[1]),s=V(i[0]-r[0]),a=V(r[1]),u=V(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return Y(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}function vt(t,e){var n;return(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final?gt(et(e),et(t)):gt(et(t),et(e)))>180?-(360-n):n}function gt(t,e){var n=V(t[1]),r=V(e[1]),i=V(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(U(Math.atan2(i,o))+360)%360}function dt(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,h,c=0,f=0,v=t.type,g="FeatureCollection"===v,d="Feature"===v,p=g?t.features.length:1,y=0;y<p;y++){a=(h=!!(l=g?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var m=0;m<a;m++){var _=0,x=0;if(null!==(s=h?l.geometries[m]:l)){u=s.coordinates;var E=s.type;switch(c=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===e(u,f,y,_,x))return!1;f++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,y,_,x))return!1;f++,"MultiPoint"===E&&_++}"LineString"===E&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(!1===e(u[r][i],f,y,_,x))return!1;f++}"MultiLineString"===E&&_++,"Polygon"===E&&x++}"Polygon"===E&&_++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(x=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(!1===e(u[r][i][o],f,y,_,x))return!1;f++}x++}_++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===dt(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function pt(t,e,n,r){var i=n;return dt(t,function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)},r),i}function yt(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 mt(t,e,n){var r=n;return yt(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function _t(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 xt(t,e,n){var r=n;return _t(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function Et(t){var e=[];return dt(t,function(t){e.push(t)}),e}function kt(t,e){var n,r,i,o,s,a,u,l,h,c,f=0,v="FeatureCollection"===t.type,g="Feature"===t.type,d=v?t.features.length:1;for(n=0;n<d;n++){for(a=v?t.features[n].geometry:g?t.geometry:t,l=v?t.features[n].properties:g?t.properties:{},h=v?t.features[n].bbox:g?t.bbox:void 0,c=v?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,h,c))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,h,c))return!1;f++}}function wt(t,e,n){var r=n;return kt(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r}function bt(t,e){kt(t,function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(N(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(N({type:s,coordinates:l},r),n,u))return!1}})}function It(t,e,n){var r=n;return bt(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r}function Nt(t,e){bt(t,function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==dt(t,function(o,h,c,f,v){if(void 0===s||n>a||f>u||v>l)return s=o,a=n,u=f,l=v,void(i=0);var g=T([s,o],t.properties);if(!1===e(g,n,r,v,i))return!1;i++,s=o})&&void 0}}})}function St(t,e,n){var r=n,i=!1;return Nt(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}function Mt(t,e){if(!t)throw new Error("geojson is required");bt(t,function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(T(o[s],t.properties),n,r,s))return!1}}})}function Lt(t,e,n){var r=n;return Mt(t,function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)}),r}function Pt(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||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 u=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),T([u[s],u[s+1]],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),T([u[o][s],u[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),T([u[i][s],u[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),T([u[i][o][s],u[i][o][s+1]],a,e)}throw new Error("geojson is invalid")}function Ct(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||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 u=n.coordinates;switch(n.type){case"Point":return M(u,a,e);case"MultiPoint":return i<0&&(i=u.length+i),M(u[i],a,e);case"LineString":return s<0&&(s=u.length+s),M(u[s],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),M(u[o][s],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),M(u[i][s],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),M(u[i][o][s],a,e)}throw new Error("geojson is invalid")}var Tt=Object.freeze({__proto__:null,coordAll:Et,coordEach:dt,coordReduce:pt,featureEach:_t,featureReduce:xt,findPoint:Ct,findSegment:Pt,flattenEach:bt,flattenReduce:It,geomEach:kt,geomReduce:wt,lineEach:Mt,lineReduce:Lt,propEach:yt,propReduce:mt,segmentEach:Nt,segmentReduce:St});function Ot(t){return wt(t,function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Rt(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Rt(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},0)}function Rt(t){var e=0;if(t&&t.length>0){e+=Math.abs(Ft(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Ft(t[n]))}return e}var At=20294876564838.72,Dt=Math.PI/180;function Ft(t){var e=t.length-1;if(e<=2)return 0;for(var n=0,r=0;r<e;){var i=t[r],o=t[r+1===e?0:r+1],s=t[r+2>=e?(r+2)%e:r+2],a=i[0]*Dt,u=o[1]*Dt;n+=(s[0]*Dt-a)*Math.sin(u),r++}return n*At}function qt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==e.recompute)return t.bbox;var n=[1/0,1/0,-1/0,-1/0];return dt(t,function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])}),n}function Gt(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(Bt(i=t[t.length-1],e)&r),s=0;s<t.length;s++)(u=!(Bt(a=t[s],e)&r))!==o&&n.push(Yt(i,a,r,e)),u&&n.push(a),i=a,o=u;if(!(t=n).length)break}return n}function Yt(t,e,n,r){return 8&n?[t[0]+(e[0]-t[0])*(r[3]-t[1])/(e[1]-t[1]),r[3]]:4&n?[t[0]+(e[0]-t[0])*(r[1]-t[1])/(e[1]-t[1]),r[1]]:2&n?[r[2],t[1]+(e[1]-t[1])*(r[2]-t[0])/(e[0]-t[0])]:1&n?[r[0],t[1]+(e[1]-t[1])*(r[0]-t[0])/(e[0]-t[0])]:null}function Bt(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function zt(t,e){var n,r=[],i=a(t);try{for(i.s();!(n=i.n()).done;){var o=Gt(n.value,e);o.length>0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}}catch(t){i.e(t)}finally{i.f()}return r}function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return P([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}var Xt=function(){return s(function t(e){i(this,t),this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var n=0;n<this.length;n++)this.points[n].z=this.points[n].z||0;for(var r=0;r<this.length-1;r++){var o=this.points[r],s=this.points[r+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var a=0;a<this.centers.length-1;a++){var u=this.points[a+1].x-(this.centers[a].x+this.centers[a+1].x)/2,l=this.points[a+1].y-(this.centers[a].y+this.centers[a+1].y)/2,h=this.points[a+1].z-(this.centers[a].z+this.centers[a+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[a+1].x+this.sharpness*(this.centers[a].x+u),y:(1-this.sharpness)*this.points[a+1].y+this.sharpness*(this.centers[a].y+l),z:(1-this.sharpness)*this.points[a+1].z+this.sharpness*(this.centers[a].z+h)},{x:(1-this.sharpness)*this.points[a+1].x+this.sharpness*(this.centers[a+1].x+u),y:(1-this.sharpness)*this.points[a+1].y+this.sharpness*(this.centers[a+1].y+l),z:(1-this.sharpness)*this.points[a+1].z+this.sharpness*(this.centers[a+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this},[{key:"cacheSteps",value:function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e}},{key:"vector",value:function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}},{key:"pos",value:function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t),s={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return s}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}])}();function Ut(t){for(var e,n,r=nt(t),i=0,o=1;o<r.length;)e=n||r[0],i+=((n=r[o])[0]-e[0])*(n[1]+e[1]),o++;return i>0}function Vt(t,e){for(var n=0,r=0,i=0,o=0,s=0,a=0,u=0,l=0,h=null,c=null,f=t[0],v=t[1],g=e.length;n<g;n++){r=0;var d=e[n].length-1,p=e[n];if((h=p[0])[0]!==p[d][0]&&h[1]!==p[d][1])throw new Error("First and last coordinates in a ring must be the same");for(s=h[0]-f,a=h[1]-v;r<d;r++)if(l=(c=p[r+1])[1]-v,a<0&&l<0||a>0&&l>0)a=l,s=(h=c)[0]-f;else{if(u=c[0]-t[0],l>0&&a<=0){if((o=s*l-u*a)>0)i+=1;else if(0===o)return 0}else if(a>0&&l<=0){if((o=s*l-u*a)<0)i+=1;else if(0===o)return 0}else if(0===l&&a<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&l<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&0===l){if(u<=0&&s>=0)return 0;if(s<=0&&u>=0)return 0}h=c,a=l,s=u}}return i%2!=0}function Zt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=et(t),i=at(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=0;u<a.length;++u){var l=Vt(r,a[u]);if(0===l&&!n.ignoreBoundary)return!0;if(l)return!0}return!1}function Ht(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=nt(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),Wt(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1}function Wt(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=t[1],l=e[0],h=e[1],c=l-a,f=h-u,v=(n[0]-a)*f-(n[1]-u)*c;if(null!==i){if(Math.abs(v)>i)return!1}else if(0!==v)return!1;return Math.abs(c)===Math.abs(f)&&0===Math.abs(c)?!r&&(n[0]===t[0]&&n[1]===t[1]):r?"start"===r?Math.abs(c)>=Math.abs(f)?c>0?a<o&&o<=l:l<=o&&o<a:f>0?u<s&&s<=h:h<=s&&s<u:"end"===r?Math.abs(c)>=Math.abs(f)?c>0?a<=o&&o<l:l<o&&o<=a:f>0?u<=s&&s<h:h<s&&s<=u:"both"===r&&(Math.abs(c)>=Math.abs(f)?c>0?a<o&&o<l:l<o&&o<a:f>0?u<s&&s<h:h<s&&s<u):Math.abs(c)>=Math.abs(f)?c>0?a<=o&&o<=l:l<=o&&o<=a:f>0?u<=s&&s<=h:h<=s&&s<=u}function Jt(t,e,n,r,i){Kt(t,e,n||0,r||t.length-1,i||$t)}function Kt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Kt(t,e,Math.max(n,Math.floor(e-s*u/o+l)),Math.min(r,Math.floor(e+(o-s)*u/o+l)),i)}var h=t[e],c=n,f=r;for(Qt(t,n,e),i(t[r],h)>0&&Qt(t,n,r);c<f;){for(Qt(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Qt(t,n,f):Qt(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Qt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function $t(t,e){return t<e?-1:t>e?1:0}var te=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,n=[];if(!fe(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;fe(t,a)&&(e.leaf?n.push(s):ce(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}},{key:"collides",value:function(t){var e=this.data;if(!fe(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(fe(t,o)){if(e.leaf||ce(t,o))return!0;n.push(i)}}e=n.pop()}return!1}},{key:"load",value:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this}},{key:"insert",value:function(t){return t&&this._insert(t,this.data.height-1),this}},{key:"clear",value:function(){return this.data=ve([]),this}},{key:"remove",value:function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),a=[],u=[];o||a.length;){if(o||(o=a.pop(),r=a[a.length-1],n=u.pop(),i=!0),o.leaf){var l=ee(t,o.children,e);if(-1!==l)return o.children.splice(l,1),a.push(o),this._condense(a),this}i||o.leaf||!ce(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(a.push(o),u.push(n),n=0,r=o,o=o.children[0])}return this}},{key:"toBBox",value:function(t){return t}},{key:"compareMinX",value:function(t,e){return t.minX-e.minX}},{key:"compareMinY",value:function(t,e){return t.minY-e.minY}},{key:"toJSON",value:function(){return this.data}},{key:"fromJSON",value:function(t){return this.data=t,this}},{key:"_all",value: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}},{key:"_build",value:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return ne(i=ve(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=ve([])).leaf=!1,i.height=r;var a=Math.ceil(o/s),u=a*Math.ceil(Math.sqrt(s));ge(t,e,n,u,this.compareMinX);for(var l=e;l<=n;l+=u){var h=Math.min(l+u-1,n);ge(t,l,h,a,this.compareMinY);for(var c=l;c<=h;c+=a){var f=Math.min(c+a-1,h);i.children.push(this._build(t,c,f,r-1))}}return ne(i,this.toBBox),i}},{key:"_chooseSubtree",value:function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var u=e.children[a],l=ae(u),h=le(t,u)-l;h<o?(o=h,i=l<i?l:i,s=u):h===o&&l<i&&(i=l,s=u)}e=s||e.children[0]}return e}},{key:"_insert",value:function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),ie(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}},{key:"_split",value:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=ve(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ne(n,this.toBBox),ne(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}},{key:"_splitRoot",value:function(t,e){this.data=ve([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ne(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,n){for(var r,i=1/0,o=1/0,s=e;s<=n-e;s++){var a=re(t,0,s,this.toBBox),u=re(t,s,n,this.toBBox),l=he(a,u),h=ae(a)+ae(u);l<i?(i=l,r=s,o=h<o?h:o):l===i&&h<o&&(o=h,r=s)}return r||n-e}},{key:"_chooseSplitAxis",value:function(t,e,n){var r=t.leaf?this.compareMinX:oe,i=t.leaf?this.compareMinY:se;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}},{key:"_allDistMargin",value:function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=re(t,0,e,i),s=re(t,n-e,n,i),a=ue(o)+ue(s),u=e;u<n-e;u++){var l=t.children[u];ie(o,t.leaf?i(l):l),a+=ue(o)}for(var h=n-e-1;h>=e;h--){var c=t.children[h];ie(s,t.leaf?i(c):c),a+=ue(s)}return a}},{key:"_adjustParentBBoxes",value:function(t,e,n){for(var r=n;r>=0;r--)ie(e[r],t)}},{key:"_condense",value:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ne(t[n],this.toBBox)}}])}();function ee(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}function ne(t,e){re(t,0,t.children.length,e,t)}function re(t,e,n,r,i){i||(i=ve(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];ie(i,t.leaf?r(s):s)}return i}function ie(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 oe(t,e){return t.minX-e.minX}function se(t,e){return t.minY-e.minY}function ae(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ue(t){return t.maxX-t.minX+(t.maxY-t.minY)}function le(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function he(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function ce(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function fe(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ve(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ge(t,e,n,r,i){for(var o=[e,n];o.length;)if(!((n=o.pop())-(e=o.pop())<=r)){var s=e+Math.ceil((n-e)/r/2)*r;Jt(t,s,e,n,i),o.push(e,s,s,n)}}var de=Object.freeze({__proto__:null,default:te});function pe(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=qt(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=qt(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}}var ye=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this.tree=new te(e),this.tree.toBBox=pe},[{key:"insert",value:function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:qt(t),this.tree.insert(t),this}},{key:"load",value: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?t.bbox:qt(t),e.push(t)}):_t(t,function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:qt(t),e.push(t)}),this.tree.load(e),this}},{key:"remove",value:function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:qt(t),this.tree.remove(t,e),this}},{key:"clear",value:function(){return this.tree.clear(),this}},{key:"search",value:function(t){return R(this.tree.search(pe(t)))}},{key:"collides",value:function(t){return this.tree.collides(pe(t))}},{key:"all",value:function(){return R(this.tree.all())}},{key:"toJSON",value:function(){return this.tree.toJSON()}},{key:"fromJSON",value:function(t){return this.tree.fromJSON(t),this}}])}();function me(t){return new ye(t)}function _e(t,e){if(!J(e=null!=e?e:{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return dt(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)}),t}function xe(t){if(!t)throw new Error("geojson is required");var e=[];return bt(t,function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=nt(r);break;case"LineString":n=[nt(r)]}n.forEach(function(n){var r=function(t,e){var n=[];return t.reduce(function(t,r){var i=T([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=n<i?n:i,a=r<o?r:o,u=n>i?n:i,l=r>o?r:o;return[s,a,u,l]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}}(t,e)}),R(e)}var Ee=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)},[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}}])}();function ke(t,e){return t<e?-1:t>e?1:0}var we=Object.freeze({__proto__:null,default:Ee}),be=134217729;function Ie(t,e,n,r,i){var o,s,a,u,l=e[0],h=r[0],c=0,f=0;h>l==h>-l?(o=l,l=e[++c]):(o=h,h=r[++f]);var v=0;if(c<t&&f<n)for(h>l==h>-l?(a=o-((s=l+o)-l),l=e[++c]):(a=o-((s=h+o)-h),h=r[++f]),o=s,0!==a&&(i[v++]=a);c<t&&f<n;)h>l==h>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c]):(a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f]),o=s,0!==a&&(i[v++]=a);for(;c<t;)a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c],o=s,0!==a&&(i[v++]=a);for(;f<n;)a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f],o=s,0!==a&&(i[v++]=a);return 0===o&&0!==v||(i[v++]=o),v}function Ne(t){return new Float64Array(t)}var Se=Ne(4),Me=Ne(8),Le=Ne(12),Pe=Ne(16),Ce=Ne(4);function Te(t,e,n,r,i,o){var s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a;if(0===s||0===a||s>0!=a>0)return u;var l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){var a,u,l,h,c,f,v,g,d,p,y,m,_,x,E,k,w,b,I=t-i,N=n-i,S=e-o,M=r-o;c=(E=(g=I-(v=(f=be*I)-(f-I)))*(p=M-(d=(f=be*M)-(f-M)))-((x=I*M)-v*d-g*d-v*p))-(y=E-(w=(g=S-(v=(f=be*S)-(f-S)))*(p=N-(d=(f=be*N)-(f-N)))-((k=S*N)-v*d-g*d-v*p))),Se[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Se[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Se[2]=m-(b-c)+(y-c),Se[3]=b;var L=function(t,e){for(var n=e[0],r=1;r<t;r++)n+=e[r];return n}(4,Se),P=22204460492503146e-32*s;if(L>=P||-L>=P)return L;if(a=t-(I+(c=t-I))+(c-i),l=n-(N+(c=n-N))+(c-i),u=e-(S+(c=e-S))+(c-o),h=r-(M+(c=r-M))+(c-o),0===a&&0===u&&0===l&&0===h)return L;if(P=11093356479670487e-47*s+33306690738754706e-32*Math.abs(L),(L+=I*h+M*a-(S*l+N*u))>=P||-L>=P)return L;c=(E=(g=a-(v=(f=be*a)-(f-a)))*(p=M-(d=(f=be*M)-(f-M)))-((x=a*M)-v*d-g*d-v*p))-(y=E-(w=(g=u-(v=(f=be*u)-(f-u)))*(p=N-(d=(f=be*N)-(f-N)))-((k=u*N)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var C=Ie(4,Se,4,Ce,Me);c=(E=(g=I-(v=(f=be*I)-(f-I)))*(p=h-(d=(f=be*h)-(f-h)))-((x=I*h)-v*d-g*d-v*p))-(y=E-(w=(g=S-(v=(f=be*S)-(f-S)))*(p=l-(d=(f=be*l)-(f-l)))-((k=S*l)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var T=Ie(C,Me,4,Ce,Le);c=(E=(g=a-(v=(f=be*a)-(f-a)))*(p=h-(d=(f=be*h)-(f-h)))-((x=a*h)-v*d-g*d-v*p))-(y=E-(w=(g=u-(v=(f=be*u)-(f-u)))*(p=l-(d=(f=be*l)-(f-l)))-((k=u*l)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var O=Ie(T,Le,4,Ce,Pe);return Pe[O-1]}(t,e,n,r,i,o,l)}function Oe(t,e){var n=new Ee([],Re);return function(t,e){if("FeatureCollection"===t.type)for(var n=t.features,r=0;r<n.length;r++)Ge(n[r],e);else Ge(t,e)}(t,n),function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=new Ee([],Ae);for(;t.length;){var i=t.pop();if(i.isLeftEndpoint){for(var o=new Be(i),s=0;s<r.data.length;s++){var a=r.data[s];if(!e||a.leftSweepEvent.featureId!==i.featureId){var u=ze(o,a);!1!==u&&n.push(u)}}r.push(o)}else!1===i.isLeftEndpoint&&r.pop()}return n}(n,e)}function Re(t,e){return t.p.x>e.p.x?1:t.p.x<e.p.x?-1:t.p.x!==e.p.x||t.featureId===e.featureId&&t.ringId===e.ringId||!t.isLeftEndpoint||e.isLeftEndpoint?t.p.y!==e.p.y?t.p.y>e.p.y?1:-1:1:-1}function Ae(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x<e.rightSweepEvent.p.x?-1:t.rightSweepEvent.p.y!==e.rightSweepEvent.p.y?t.rightSweepEvent.p.y<e.rightSweepEvent.p.y?1:-1:1}var De=0,Fe=0,qe=0;function Ge(t,e){var n="Feature"===t.type?t.geometry:t,r=n.coordinates;"Polygon"!==n.type&&"MultiLineString"!==n.type||(r=[r]),"LineString"===n.type&&(r=[[r]]);for(var i=0;i<r.length;i++)for(var o=0;o<r[i].length;o++){var s=r[i][o][0],a=null;Fe+=1;for(var u=0;u<r[i][o].length-1;u++){a=r[i][o][u+1];var l=new Ye(s,De,Fe,qe),h=new Ye(a,De,Fe,qe+1);l.otherEvent=h,h.otherEvent=l,Re(l,h)>0?(h.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,h.isLeftEndpoint=!1),e.push(l),e.push(h),s=a,qe+=1}}De+=1}var Ye=function(){return s(function t(e,n,r,o){i(this,t),this.p={x:e[0],y:e[1]},this.featureId=n,this.ringId=r,this.eventId=o,this.otherEvent=null,this.isLeftEndpoint=null},[{key:"isSamePoint",value:function(t){return this.p.x===t.p.x&&this.p.y===t.p.y}},{key:"asNewXY",value:function(){return[this.p.x,this.p.y]}}])}();var Be=s(function t(e){i(this,t),this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent});function ze(t,e){if(null===t||null===e)return!1;var n=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y,i=t.rightSweepEvent.p.x,o=t.rightSweepEvent.p.y,s=e.leftSweepEvent.p.x,a=e.leftSweepEvent.p.y,u=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,h=Te(n,r,i,o,s,a),c=Te(n,r,i,o,u,l);if(h>0&&c>0)return!1;if(h<0&&c<0)return!1;if(t.leftSweepEvent.ringId===e.leftSweepEvent.ringId){if(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent))return!1}else{if(t.rightSweepEvent.isSamePoint(e.leftSweepEvent))return e.leftSweepEvent.asNewXY();if(t.rightSweepEvent.isSamePoint(e.rightSweepEvent))return e.rightSweepEvent.asNewXY();if(t.leftSweepEvent.isSamePoint(e.leftSweepEvent))return e.leftSweepEvent.asNewXY();if(t.leftSweepEvent.isSamePoint(e.rightSweepEvent))return e.rightSweepEvent.asNewXY()}var f=(l-a)*(i-n)-(u-s)*(o-r),v=(u-s)*(r-a)-(l-a)*(n-s),g=(i-n)*(r-a)-(o-r)*(n-s);if(0===f)return!1;var d=v/f,p=g/f;return d>=0&&d<=1&&p>=0&&p<=1&&[n+d*(i-n),r+d*(o-r)]}function je(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeDuplicates,i=void 0===r||r,o=n.ignoreSelfIntersections,s=void 0===o||o,a=[];"FeatureCollection"===t.type?a=a.concat(t.features):"Feature"===t.type?a.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||a.push(N(t)),"FeatureCollection"===e.type?a=a.concat(e.features):"Feature"===e.type?a.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||a.push(N(e));var u=Oe(R(a),s),l=[];if(i){var h={};u.forEach(function(t){var e=t.join(",");h[e]||(h[e]=!0,l.push(t))})}else l=u;return R(l.map(function(t){return M(t)}))}var Xe=Object.defineProperty,Ue=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Je=function(t,e,n){return e in t?Xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ke=function(t,e){for(var n in e||(e={}))He.call(e,n)&&Je(t,n,e[n]);if(Ze){var r,i=a(Ze(e));try{for(i.s();!(r=i.n()).done;){n=r.value;We.call(e,n)&&Je(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},Qe=function(t,e){return Ue(t,Ve(e))};function $e(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("lines and inputPoint are required arguments");var r=et(e),i=M([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,s=0,a=-1;return bt(t,function(t,u,l){a!==l&&(a=l,s=0);for(var h=nt(t),c=0;c<h.length-1;c++){var f=M(h[c]),v=et(f),g=M(h[c+1]),d=et(g),p=ft(f,g,n),y=void 0,_=void 0;if(d[0]===r[0]&&d[1]===r[1])y=d,_=!0;else if(v[0]===r[0]&&v[1]===r[1])y=v,_=!1;else{var x=m(sn(v,d,r),2);y=x[0],_=x[1]}var E=ft(e,y,n);if(E<i.properties.pointDistance){var k=ft(f,y,n);(i=M(y,{lineStringIndex:l,segmentIndex:_?c+1:c,totalDistance:o+k,lineDistance:s+k,segmentDistance:k,pointDistance:E,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0})).properties=Qe(Ke({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}o+=p,s+=p}}),i}function tn(t,e){var n=m(t,3),r=n[0],i=n[1],o=n[2],s=m(e,3);return r*s[0]+i*s[1]+o*s[2]}function en(t,e){var n=m(t,3),r=n[0],i=n[1],o=n[2],s=m(e,3),a=s[0],u=s[1],l=s[2];return[i*l-o*u,o*a-r*l,r*u-i*a]}function nn(t){var e=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2))}(t);return[t[0]/e,t[1]/e,t[2]/e]}function rn(t){var e=V(t[1]),n=V(t[0]);return[Math.cos(e)*Math.cos(n),Math.cos(e)*Math.sin(n),Math.sin(e)]}function on(t){var e=m(t,3),n=e[0],r=e[1],i=e[2],o=Math.min(Math.max(i,-1),1),s=U(Math.asin(o));return[U(Math.atan2(r,n)),s]}function sn(t,e,n){var r=rn(t),i=rn(e),o=rn(n),s=en(r,i);if(0===s[0]&&0===s[1]&&0===s[2])return tn(r,i)>0?[_(e),!0]:[_(n),!1];var a=en(s,o);if(0===a[0]&&0===a[1]&&0===a[2])return[_(e),!0];var u=nn(en(a,s)),l=[-u[0],-u[1],-u[2]],h=tn(o,u)>tn(o,l)?u:l,c=nn(s),f=tn(en(r,h),c),v=tn(en(h,i),c);return f>=0&&v>=0?[on(h),!1]:tn(r,o)>tn(i,o)?[_(t),!1]:[_(e),!0]}function an(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=ut(t),r=ut(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var i=_e(e,{precision:7});switch("Feature"!==t.type&&(t=N(t)),r){case"Point":return ln(t,i);case"MultiPoint":return un(t,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return un(t,je(t,i,{ignoreSelfIntersections:!0}))}}function un(t,e){var n=[],r=me();return bt(e,function(e){if(n.forEach(function(t,e){t.id=e}),n.length){var i=r.search(e);if(i.features.length){var o=hn(e,i);n=n.filter(function(t){return t.id!==o.id}),r.remove(o),_t(ln(o,e),function(t){n.push(t),r.insert(t)})}}else n=ln(t,e).features,r.load(R(n))}),R(n)}function ln(t,e){var n=[],r=nt(t)[0],i=nt(t)[t.geometry.coordinates.length-1];if(cn(r,et(e))||cn(i,et(e)))return R([t]);var o=me(),s=xe(t);o.load(s);var a=o.search(e);if(!a.features.length)return R([t]);var u=hn(e,a),l=xt(s,function(t,r,i){var o=nt(r)[1],s=et(e);return i===u.id?(t.push(s),n.push(T(t)),cn(s,o)?[s]:[s,o]):(t.push(o),t)},[r]);return l.length>1&&n.push(T(l)),R(n)}function hn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return _t(e,function(e){var i=$e(e,t).properties.pointDistance;i<r&&(n=e,r=i)}),n}function cn(t,e){return t[0]===e[0]&&t[1]===e[1]}function fn(t,e){var n=at(t),r=at(e),i=n.type,o=r.type,s=n.coordinates,u=r.coordinates;switch(i){case"Point":if("Point"===o)return En(s,u);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(En(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){var n,r=a(e.coordinates);try{for(r.s();!(n=r.n()).done;){var i,o=n.value,s=!1,u=a(t.coordinates);try{for(u.s();!(i=u.n()).done;){if(En(o,i.value)){s=!0;break}}}catch(t){u.e(t)}finally{u.f()}if(!s)return!1}}catch(t){r.e(t)}finally{r.f()}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Ht(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=e.coordinates,i=0;i<r.length;i++){var o=r[i];if(!Ht(o,t))return!1;if(!n)if(Ht(o,t,{ignoreEndVertices:!0}))n=!0;else if(i>0){Ht([(r[i-1][0]+o[0])/2,(r[i-1][1]+o[1])/2],t,{ignoreEndVertices:!0})&&(n=!0)}}return n}(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Ht(o,t))return!1;!r&&Ht(o,t,{ignoreEndVertices:!0})&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return Zt(r,n,{ignoreBoundary:!0});case"LineString":return gn(n,r);case"Polygon":return pn(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Zt(o,t))return!1;r||(r=Zt(o,t,{ignoreBoundary:!0}))}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"MultiPolygon":return function(t,e){return e.coordinates.every(function(e){return pn(t,{type:"Polygon",coordinates:e})})}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":switch(o){case"Point":return function(t,e){return Zt(e,t,{ignoreBoundary:!0})}(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Zt(o,t))return!1;r||(r=Zt(o,t,{ignoreBoundary:!0}))}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"LineString":return function(t,e){return t.coordinates.some(function(t){return gn({type:"Polygon",coordinates:t},e)})}(n,r);case"MultiLineString":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o,s={type:"LineString",coordinates:n.value},u="outside",l=a(t.coordinates);try{for(l.s();!(o=l.n()).done;){var h=dn({type:"Polygon",coordinates:o.value},s);if("interior"===h){u=h;break}"boundary"===h&&(u=h)}}catch(t){l.e(t)}finally{l.f()}if("outside"===u)return!1;"interior"===u&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"Polygon":return function(t,e){var n=qt(e);return t.coordinates.some(function(t){return pn({type:"Polygon",coordinates:t},e,n)})}(n,r);case"MultiPolygon":return function(t,e){var n,r=a(e.coordinates);try{var i,o=function(){var e={type:"Polygon",coordinates:n.value},r=qt(e);if(!t.coordinates.some(function(t){return pn({type:"Polygon",coordinates:t},e,r)}))return{v:!1}};for(r.s();!(n=r.n()).done;)if(i=o())return i.v}catch(t){r.e(t)}finally{r.f()}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function vn(t,e){for(var n=t.coordinates,r=[],i=0;i<n.length-1;i++){var o=T([n[i],n[i+1]]),s=an(o,N(e));0===s.features.length?r.push(o):r.push.apply(r,_(s.features))}return R(r)}function gn(t,e){return"interior"===dn(t,e)}function dn(t,e){if(!xn(qt(t),qt(e)))return"outside";var n,r=a(e.coordinates);try{for(r.s();!(n=r.n()).done;){if(!Zt(n.value,t))return"outside"}}catch(t){r.e(t)}finally{r.f()}var i,o=!1,s=a(vn(e,t).features);try{for(s.s();!(i=s.n()).done;){var u=i.value,l=kn(u.geometry.coordinates[0],u.geometry.coordinates[1]);if(!Zt(l,t))return"outside";!o&&Zt(l,t,{ignoreBoundary:!0})&&(o=!0)}}catch(t){s.e(t)}finally{s.f()}return o?"interior":"boundary"}function pn(t,e,n){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!xn(qt(t),null!=n?n:qt(e)))return!1;var r,i=at(t),o=a(at(e).coordinates);try{for(o.s();!(r=o.n()).done;){var s,u=r.value,l=a(u);try{for(l.s();!(s=l.n()).done;){if(!Zt(s.value,t))return!1}}catch(t){l.e(t)}finally{l.f()}var h,c=a(vn({type:"LineString",coordinates:u},i).features);try{for(c.s();!(h=c.n()).done;){var f=h.value,v=kn(f.geometry.coordinates[0],f.geometry.coordinates[1]);if(!Zt(v,t)&&!_n(v,i))return!1}}catch(t){c.e(t)}finally{c.f()}}}catch(t){o.e(t)}finally{o.f()}return!0}var yn=1e-6;function mn(t,e,n){var r=n[0]-e[0],i=n[1]-e[1],o=r*r+i*i,s=0;o>0&&(s=((t[0]-e[0])*r+(t[1]-e[1])*i)/o,s=Math.max(0,Math.min(1,s)));var a=e[0]+s*r,u=e[1]+s*i,l=t[0]-a,h=t[1]-u;return Math.sqrt(l*l+h*h)}function _n(t,e){return e.coordinates.some(function(e){for(var n=0;n<e.length-1;n++)if(mn(t,e[n],e[n+1])<=yn)return!0;return!1})}function xn(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function En(t,e){return t[0]===e[0]&&t[1]===e[1]}function kn(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function wn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return bn(r,i)}(n,e);case"MultiPolygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return r.forEach(function(t){o.push(bn(t,i))}),R(o)}(n,e);default:throw new Error("invalid poly")}}function bn(t,e){return t.length>1?A(t,e):T(t[0],e)}var In=Object.defineProperty,Nn=function(t,e){return In(t,"name",{value:e,configurable:!0})},Sn=function(){return s(function t(e){var n,r,o;i(this,t),this.direction=!1,this.compareProperties=!0,this.precision=Math.pow(10,-(null!=(n=null==e?void 0:e.precision)?n:17)),this.direction=null!=(r=null==e?void 0:e.direction)&&r,this.compareProperties=null==(o=null==e?void 0:e.compareProperties)||o},[{key:"compare",value:function(t,e){var n=this;if(t.type!==e.type)return!1;if(!Ln(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){var r=Pn(t),i=Pn(e);return r.every(function(t){return i.some(function(e){return n.compare(t,e)})})}}return!1}},{key:"compareCoord",value:function(t,e){var n=this;return t.length===e.length&&t.every(function(t,r){return Math.abs(t-e[r])<n.precision})}},{key:"compareLine",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Ln(t,e))return!1;var i=t,o=e;if(r&&!this.compareCoord(i[0],o[0])){var s=this.fixStartIndex(o,i);if(!s)return!1;o=s}var a=this.compareCoord(i[n],o[n]);return this.direction||a?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},{key:"fixStartIndex",value:function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n}},{key:"comparePath",value:function(t,e){var n=this;return t.every(function(t,r){return n.compareCoord(t,e[r])})}},{key:"comparePolygon",value:function(t,e){var n=this;if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length);return r.every(function(t){return i.some(function(e){return n.compareLine(t,e,1,!0)})})}return!1}},{key:"compareGeometryCollection",value:function(t,e){var n=this;return Ln(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every(function(t,r){return n.compare(t,e.geometries[r])})}},{key:"compareFeature",value:function(t,e){return t.id===e.id&&(!this.compareProperties||Tn(t.properties,e.properties))&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}},{key:"compareFeatureCollection",value:function(t,e){var n=this;return Ln(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every(function(t,r){return n.compare(t,e.features[r])})}},{key:"compareBBox",value:function(t,e){return Boolean(!t.bbox&&!e.bbox)||!(!t.bbox||!e.bbox)&&this.compareCoord(t.bbox,e.bbox)}}])}();Nn(Sn,"GeojsonEquality");var Mn=Sn;function Ln(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}function Pn(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function Cn(t,e,n){return new Mn(n).compare(t,e)}function Tn(t,e){if(null===t&&null===e)return!0;if(null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=t[s],u=e[s],l=An(a)&&An(u);if(l&&!Tn(a,u)||!l&&a!==u)return!1}return!0}Nn(Ln,"sameLength"),Nn(Pn,"explode"),Nn(Cn,"geojsonEquality"),Nn(Tn,"equal");var On,Rn,An=Nn(function(t){return null!=t&&"object"===E(t)},"isObject");function Dn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="object"===E(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var r=ut(t),i=[];switch(r){case"LineString":i=Fn(t,r);break;case"MultiLineString":case"Polygon":nt(t).forEach(function(t){i.push(Fn(t,r))});break;case"MultiPolygon":nt(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(Fn(t,r))}),i.push(e)});break;case"Point":return t;case"MultiPoint":var o={};nt(t).forEach(function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(o,e)||(i.push(t),o[e]=!0)});break;default:throw new Error(r+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=i,t):{type:r,coordinates:i}:!0===n?(t.geometry.coordinates=i,t):N({type:r,coordinates:i},t.properties,{bbox:t.bbox,id:t.id})}function Fn(t,e){var n=nt(t);if(2===n.length&&!qn(n[0],n[1]))return n;var r=[],i=0,o=1,s=2;for(r.push(n[i]);s<n.length;)Ht(n[o],T([n[i],n[s]]))?o=s:(r.push(n[o]),i=o,s=++o),s++;if(r.push(n[o]),"Polygon"===e||"MultiPolygon"===e){if(Ht(r[0],T([r[1],r[r.length-2]]))&&(r.shift(),r.pop(),r.push(r[0])),r.length<4)throw new Error("invalid polygon, fewer than 4 points");if(!qn(r[0],r[r.length-1]))throw new Error("invalid polygon, first and last points not equal")}return r}function qn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Gn(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).precision;if("number"!=typeof(n=null==n||isNaN(n)?6:n)||!(n>=0))throw new Error("precision must be a positive number");return at(t).type===at(e).type&&Cn(Dn(t),Dn(e),{precision:n})}function Yn(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return Bn(n,r);case"Polygon":return jn(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return Bn(r,n);case"LineString":return function(t,e){var n=je(t,e);if(0===n.features.length)return!1;var r,i=a(n.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!(Gn(o,M(t.coordinates[0]))||Gn(o,M(t.coordinates[t.coordinates.length-1]))||Gn(o,M(e.coordinates[0]))||Gn(o,M(e.coordinates[e.coordinates.length-1]))))return!0}}catch(t){i.e(t)}finally{i.f()}return!1}(n,r);case"Polygon":return zn(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"MultiPoint":return jn(r,n);case"LineString":return zn(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Bn(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++){for(var s=!1,a=0;a<e.coordinates.length-1;a++){var u=!0;if(0!==a&&a!==e.coordinates.length-2||(u=!1),Xn(e.coordinates[a],e.coordinates[a+1],t.coordinates[o],u)){s=!0;break}}s?n=!0:r=!0}return n&&r}function zn(t,e){return je(t,wn(e)).features.length>0}function jn(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++)Zt(M(t.coordinates[o]),e)?n=!0:r=!0;return r&&n}function Xn(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0===i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}function Un(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{ignoreSelfIntersections:!0}).ignoreSelfIntersections,r=void 0===n||n,i=!0;return bt(t,function(t){bt(e,function(e){if(!1===i)return!1;i=function(t,e,n){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,i=e.coordinates,!(r[0]===i[0]&&r[1]===i[1]);case"LineString":return!Vn(e,t);case"Polygon":return!Zt(t,e)}break;case"LineString":switch(e.type){case"Point":return!Vn(t,e);case"LineString":return!function(t,e,n){var r=je(t,e,{ignoreSelfIntersections:n});if(r.features.length>0)return!0;var i,o=a(t.coordinates);try{for(o.s();!(i=o.n()).done;){if(Vn(e,{type:"Point",coordinates:i.value}))return!0}}catch(t){o.e(t)}finally{o.f()}var s,u=a(e.coordinates);try{for(u.s();!(s=u.n()).done;){if(Vn(t,{type:"Point",coordinates:s.value}))return!0}}catch(t){u.e(t)}finally{u.f()}return!1}(t,e,n);case"Polygon":return!Zn(e,t,n)}break;case"Polygon":switch(e.type){case"Point":return!Zt(e,t);case"LineString":return!Zn(t,e,n);case"Polygon":return!function(t,e,n){var r,i=a(t.coordinates[0]);try{for(i.s();!(r=i.n()).done;){if(Zt(r.value,e))return!0}}catch(t){i.e(t)}finally{i.f()}var o,s=a(e.coordinates[0]);try{for(s.s();!(o=s.n()).done;){if(Zt(o.value,t))return!0}}catch(t){s.e(t)}finally{s.f()}var u=je(wn(t),wn(e),{ignoreSelfIntersections:n});if(u.features.length>0)return!0;return!1}(e,t,n)}}var r,i;return!1}(t.geometry,e.geometry,r)})}),i}function Vn(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(Hn(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function Zn(t,e,n){var r,i=a(e.coordinates);try{for(i.s();!(r=i.n()).done;){if(Zt(r.value,t))return!0}}catch(t){i.e(t)}finally{i.f()}return je(e,wn(t),{ignoreSelfIntersections:n}).features.length>0}function Hn(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 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function Wn(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections;return!Un(t,e,{ignoreSelfIntersections:void 0===n||n})}function Jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Kn(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch(t){}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}),n}var Qn=(Rn||(Rn=1,On=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==E(e)&&"object"==E(n)){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}),On),$n=Jn(Qn);function tr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=me(),a=xe(t);s.load(a);var u=[];return Nt(e,function(t){var e=!1;if(t){var n=t;if(0!==i){var a=z(i,"kilometers"),l=qt(t);n=[l[0]-a,l[1]-a,l[2]+a,l[3]+a]}_t(s.search(n),function(n){if(!1===e){var o=nt(t).sort(),s=nt(n).sort();if($n(o,s))e=!0,r=r?er(r,t)||r:t;else if(0===i?Ht(o[0],n)&&Ht(o[1],n):$e(n,o[0]).properties.pointDistance<=i&&$e(n,o[1]).properties.pointDistance<=i)e=!0,r=r?er(r,t)||r:t;else if(0===i?Ht(s[0],t)&&Ht(s[1],t):$e(t,s[0]).properties.pointDistance<=i&&$e(t,s[1]).properties.pointDistance<=i)if(r){var a=er(r,n);a?r=a:u.push(n)}else r=n}}),!1===e&&r&&(o.push(r),u.length&&(o=o.concat(u),u=[]),r=void 0)}}),r&&o.push(r),R(o)}function er(t,e){var n=nt(e),r=nt(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;if($n(n[0],i))s.unshift(n[1]);else if($n(n[0],o))s.push(n[1]);else if($n(n[1],i))s.unshift(n[0]);else{if(!$n(n[1],o))return;s.push(n[0])}return t}function nr(t,e){var n=j(vt(t[0],t[1])),r=j(vt(e[0],e[1]));return n===r||(r-n)%180==0}function rr(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function ir(t,e){return!!or(e.coordinates[0],t.coordinates)||!!or(e.coordinates[e.coordinates.length-1],t.coordinates)}function or(t,e){return t[0]===e[0]&&t[1]===e[1]}var sr=new Set(["Point","LineString","MultiLineString","MultiPoint","Polygon","MultiPolygon"]);function ar(t){return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}function ur(t){for(var e=0;e<t.length-1;e++)for(var n=t[e],r=e+1;r<t.length-2;r++){if(Ht(n,T([t[r],t[r+1]])))return!0}return!1}function lr(t,e,n){for(var r=P(t),i=n+1;i<e.length;i++)if(!Un(r,P(e[i]))&&Yn(r,T(e[i][0])))return!1;return!0}function hr(t,e){return fn(e,t)}function cr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=qt(t);return M([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}var fr,vr={exports:{}};var gr=(fr||(fr=1,function(t){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function a(t,e,n){return a=s()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&o(i,n.prototype),i},a.apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)},u(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}function h(t,e){if(e&&("object"==E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function c(t){var e=s();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function f(t,e,n){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}},f(t,e,n||t)}function v(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=g(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=e.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=e.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==e.JOIN_ROUND&&(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(t){this._joinStyle=t}},{key:"setSimplifyFactor",value:function(t){this._simplifyFactor=t<0?0:t}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(t){this._endCapStyle=t}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(t){this._mitreLimit=t}},{key:"setSingleSided",value:function(t){this._isSingleSided=t}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}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)}}},{key:"bufferDistanceError",value:function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)}}]),e}();y.CAP_ROUND=1,y.CAP_FLAT=2,y.CAP_SQUARE=3,y.JOIN_ROUND=1,y.JOIN_MITRE=2,y.JOIN_BEVEL=3,y.DEFAULT_QUADRANT_SEGMENTS=8,y.DEFAULT_MITRE_LIMIT=5,y.DEFAULT_SIMPLIFY_FACTOR=.01;var m=function(e){r(o,e);var i=c(o);function o(e){var n;return t(this,o),(n=i.call(this,e)).name=Object.keys({Exception:o})[0],n}return n(o,[{key:"toString",value:function(){return this.message}}]),o}(u(Error)),_=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({IllegalArgumentException:i})[0],r}return i}(m),x=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}();function k(){}function w(){}function b(){}var I,N,S,M,L,P,C,T,O=function(){function e(){t(this,e)}return n(e,null,[{key:"equalsWithTolerance",value:function(t,e,n){return Math.abs(t-e)<=n}}]),e}(),R=function(){function e(n,r){t(this,e),this.low=r||0,this.high=n||0}return n(e,null,[{key:"toBinaryString",value:function(t){var e,n="";for(e=2147483648;e>0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]),e}();function A(){}function D(){}A.NaN=NaN,A.isNaN=function(t){return Number.isNaN(t)},A.isInfinite=function(t){return!Number.isFinite(t)},A.MAX_VALUE=Number.MAX_VALUE,A.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,A.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?(P=2146435072,C=new Float64Array(1),T=new Int32Array(C.buffer),A.doubleToLongBits=function(t){C[0]=t;var e=0|T[0],n=0|T[1];return(n&P)===P&&!!(1048575&n)&&0!==e&&(e=0,n=2146959360),new R(n,e)},A.longBitsToDouble=function(t){return T[0]=t.low,T[1]=t.high,C[0]}):(I=1023,N=Math.log2,S=Math.floor,M=Math.pow,L=function(){for(var t=53;t>0;t--){var e=M(2,t)-1;if(S(N(e))+1===t)return e}return 0}(),A.doubleToLongBits=function(t){var e,n,r,i,o,s,a,u,l;if(t<0||1/t===Number.NEGATIVE_INFINITY?(s=1<<31,t=-t):s=0,0===t)return new R(u=s,l=0);if(t===1/0)return new R(u=2146435072|s,l=0);if(t!=t)return new R(u=2146959360,l=0);if(i=0,l=0,(e=S(t))>1)if(e<=L)(i=S(N(e)))<=20?(l=0,u=e<<20-i&1048575):(l=e%(n=M(2,r=i-20))<<32-r,u=e/n&1048575);else for(r=e,l=0;0!==(r=S(n=r/2));)i++,l>>>=1,l|=(1&u)<<31,u>>>=1,n!==r&&(u|=524288);if(a=i+I,o=0===e,e=t-e,i<52&&0!==e)for(r=0;;){if((n=2*e)>=1?(e=n-1,o?(a--,o=!1):(r<<=1,r|=1,i++)):(e=n,o?0==--a&&(i++,o=!1):(r<<=1,i++)),20===i)u|=r,r=0;else if(52===i){l|=r;break}if(1===n){i<20?u|=r<<20-i:i<52&&(l|=r<<52-i);break}}return u|=a<<20,new R(u|=s,l)},A.longBitsToDouble=function(t){var e,n,r,i,o=t.high,s=t.low,a=o&1<<31?-1:1;for(r=((2146435072&o)>>20)-I,i=0,n=1<<19,e=1;e<=20;e++)o&n&&(i+=M(2,-e)),n>>>=1;for(n=1<<31,e=21;e<=52;e++)s&n&&(i+=M(2,-e)),n>>>=1;if(-1023===r){if(0===i)return 0*a;r=-1022}else{if(1024===r)return 0===i?a/0:NaN;i+=1}return a*i*M(2,r)});var F=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({RuntimeException:i})[0],r}return i}(m),q=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){if(0===arguments.length)F.constructor_.call(this);else if(1===arguments.length){var t=arguments[0];F.constructor_.call(this,t)}}}]),o}(F),G=function(){function e(){t(this,e)}return n(e,null,[{key:"shouldNeverReachHere",value:function(){if(0===arguments.length)e.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new q("Should never reach here"+(null!==t?": "+t:""))}}},{key:"isTrue",value:function(){if(1===arguments.length){var t=arguments[0];e.isTrue(t,null)}else if(2===arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new q:new q(n)}}},{key:"equals",value:function(){if(2===arguments.length){var t=arguments[0],n=arguments[1];e.equals(t,n,null)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(!i.equals(r))throw new q("Expected "+r+" but encountered "+i+(null!==o?": "+o:""))}}}]),e}(),Y=new ArrayBuffer(8),B=new Float64Array(Y),z=new Int32Array(Y),j=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(){return A.NaN}},{key:"setOrdinate",value:function(t,n){switch(t){case e.X:this.x=n;break;case e.Y:this.y=n;break;case e.Z:this.setZ(n);break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"equals2D",value: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!!O.equalsWithTolerance(this.x,e.x,n)&&!!O.equalsWithTolerance(this.y,e.y,n)}}},{key:"setM",value:function(t){throw new _("Invalid ordinate index: "+e.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(t){switch(t){case e.X:return this.x;case e.Y:return this.y;case e.Z:return this.getZ()}throw new _("Invalid ordinate index: "+t)}},{key:"equals3D",value:function(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||A.isNaN(this.getZ())&&A.isNaN(t.getZ()))}},{key:"equals",value:function(t){return t instanceof e&&this.equals2D(t)}},{key:"equalInZ",value:function(t,e){return O.equalsWithTolerance(this.getZ(),t.getZ(),e)}},{key:"setX",value:function(t){this.x=t}},{key:"compareTo",value: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}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(t){this.z=t}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return G.shouldNeverReachHere("this shouldn\'t happen because this class is Cloneable"),null;throw t}}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+r*r)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(t){this.y=t}},{key:"distance",value:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*t+e.hashCode(this.x))+e.hashCode(this.y)}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}},{key:"interfaces_",get:function(){return[k,w,b]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)e.constructor_.call(this,0,0);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){var n=arguments[0],r=arguments[1];e.constructor_.call(this,n,r,e.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.x=i,this.y=o,this.z=s}}},{key:"hashCode",value:function(t){return B[0]=t,z[0]^z[1]}}]),e}(),X=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compare",value:function(t,n){var r=e.compare(t.x,n.x);if(0!==r)return r;var i=e.compare(t.y,n.y);return 0!==i?i:this._dimensionsToTest<=2?0:e.compare(t.getZ(),n.getZ())}},{key:"interfaces_",get:function(){return[D]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,0===arguments.length)e.constructor_.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}},{key:"compare",value:function(t,e){return t<e?-1:t>e?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0}}]),e}();j.DimensionalComparator=X,j.NULL_ORDINATE=A.NaN,j.X=0,j.Y=1,j.Z=2,j.M=3;var U=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()}},{key:"intersection",value:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new e;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny;return new e(n,this._maxx<t._maxx?this._maxx:t._maxx,r,this._maxy<t._maxy?this._maxy:t._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof e){var n=arguments[0];return!this.isNull()&&!n.isNull()&&n.getMinX()>=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}}},{key:"intersects",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){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 j){var n=arguments[0];return this.intersects(n.x,n.y)}}else if(2===arguments.length){if(arguments[0]instanceof j&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1];return!(this.isNull()||(r.x<i.x?r.x:i.x)>this._maxx||(r.x>i.x?r.x:i.x)<this._minx||(r.y<i.y?r.y:i.y)>this._maxy||(r.y>i.y?r.y:i.y)<this._miny)}if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return!this.isNull()&&!(o>this._maxx||o<this._minx||s>this._maxy||s<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return Math.sqrt(t*t+e*e)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];if(n.isNull())return null;this.isNull()?(this._minx=n.getMinX(),this._maxx=n.getMaxX(),this._miny=n.getMinY(),this._maxy=n.getMaxY()):(n._minx<this._minx&&(this._minx=n._minx),n._maxx>this._maxx&&(this._maxx=n._maxx),n._miny<this._miny&&(this._miny=n._miny),n._maxy>this._maxy&&(this._maxy=n._maxy))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value: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}},{key:"translate",value:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e}},{key:"expandBy",value: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()}}},{key:"contains",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof j){var n=arguments[0];return this.covers(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return this.covers(r,i)}}},{key:"centre",value:function(){return this.isNull()?null:new j((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}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];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value: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)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*(t=37*(t=37*t+j.hashCode(this._minx))+j.hashCode(this._maxx))+j.hashCode(this._miny))+j.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[k,b]}}],[{key:"constructor_",value:function(){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 j){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){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)}}},{key:"intersects",value: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),l=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(l>u||h<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),h=Math.max(r.y,i.y),l>u||h<a))}}}]),e}(),V=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(t){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(t){return this===t||this.equalsExact(t,0)}},{key:"geometryChanged",value:function(){this.apply(e.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(t){return null!==t&&this.norm().equalsExact(t.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var t;if(1===arguments.length){var e=arguments[0];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return t=n,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(n,r)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(t){if(t.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n}},{key:"norm",value:function(){var t=this.copy();return t.normalize(),t}},{key:"reverse",value:function(){var t=this.reverseInternal();return null!=this.envelope&&(t.envelope=this.envelope.copy()),t.setSRID(this.getSRID()),t}},{key:"copy",value:function(){var t=this.copyInternal();return t.envelope=null==this._envelope?null:this._envelope.copy(),t._SRID=this._SRID,t._userData=this._userData,t}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new U(this._envelope)}},{key:"setSRID",value:function(t){this._SRID=t}},{key:"setUserData",value:function(t){this._userData=t}},{key:"compare",value: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}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(t){return this.getClass()===t.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===e.TYPECODE_MULTIPOINT||this.getTypeCode()===e.TYPECODE_MULTILINESTRING||this.getTypeCode()===e.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[w,k,b]}},{key:"getClass",value:function(){return e}}],[{key:"hasNonEmptyElements",value:function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1}}]),e}();V.constructor_=function(t){t&&(this._envelope=null,this._userData=null,this._factory=t,this._SRID=t.getSRID())},V.TYPECODE_POINT=0,V.TYPECODE_MULTIPOINT=1,V.TYPECODE_LINESTRING=2,V.TYPECODE_LINEARRING=3,V.TYPECODE_MULTILINESTRING=4,V.TYPECODE_POLYGON=5,V.TYPECODE_MULTIPOLYGON=6,V.TYPECODE_GEOMETRYCOLLECTION=7,V.TYPENAME_POINT="Point",V.TYPENAME_MULTIPOINT="MultiPoint",V.TYPENAME_LINESTRING="LineString",V.TYPENAME_LINEARRING="LinearRing",V.TYPENAME_MULTILINESTRING="MultiLineString",V.TYPENAME_POLYGON="Polygon",V.TYPENAME_MULTIPOLYGON="MultiPolygon",V.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",V.geometryChangedFilter={get interfaces_(){return[x]},filter:function(t){t.geometryChangedAction()}};var Z=function(){function e(){t(this,e)}return n(e,null,[{key:"toLocationSymbol",value:function(t){switch(t){case e.EXTERIOR:return"e";case e.BOUNDARY:return"b";case e.INTERIOR:return"i";case e.NONE:return"-"}throw new _("Unknown location value: "+t)}}]),e}();Z.INTERIOR=0,Z.BOUNDARY=1,Z.EXTERIOR=2,Z.NONE=-1;var H=function(){function e(){t(this,e)}return n(e,[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}]),e}(),W=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({NoSuchElementException:i})[0],r}return i}(m),J=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({UnsupportedOperationException:i})[0],r}return i}(m),K=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.apply(this,arguments)}return n(o,[{key:"contains",value:function(){}}]),o}(H),Q=function(e,i){r(s,e);var o=c(s);function s(e){var n;return t(this,s),(n=o.call(this)).map=new Map,e instanceof H&&n.addAll(e),n}return n(s,[{key:"contains",value:function(t){var e=t.hashCode?t.hashCode():t;return!!this.map.has(e)}},{key:"add",value:function(t){var e=t.hashCode?t.hashCode():t;return!this.map.has(e)&&!!this.map.set(e,t)}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"remove",value:function(){throw new J}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return 0===this.map.size}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new $(this.map)}},{key:i,value:function(){return this.map}}]),s}(K,Symbol.iterator),$=function(){function e(n){t(this,e),this.iterator=n.values();var r=this.iterator.next(),i=r.done,o=r.value;this.done=i,this.value=o}return n(e,[{key:"next",value:function(){if(this.done)throw new W;var t=this.value,e=this.iterator.next(),n=e.done,r=e.value;return this.done=n,this.value=r,t}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new J}}]),e}(),tt=function(){function e(){t(this,e)}return n(e,null,[{key:"opposite",value:function(t){return t===e.LEFT?e.RIGHT:t===e.RIGHT?e.LEFT:t}}]),e}();tt.ON=0,tt.LEFT=1,tt.RIGHT=2;var et=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({EmptyStackException:i})[0],r}return i}(m),nt=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({IndexOutOfBoundsException:i})[0],r}return i}(m),rt=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.apply(this,arguments)}return n(o,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}]),o}(H),it=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).array=[],e}return n(o,[{key:"add",value:function(t){return this.array.push(t),!0}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new nt;return this.array[t]}},{key:"push",value:function(t){return this.array.push(t),t}},{key:"pop",value:function(){if(0===this.array.length)throw new et;return this.array.pop()}},{key:"peek",value:function(){if(0===this.array.length)throw new et;return this.array[this.array.length-1]}},{key:"empty",value:function(){return 0===this.array.length}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(t){return this.array.indexOf(t)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),o}(rt);function ot(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}var st=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),at=function(){function e(n){t(this,e),this.value=n}return n(e,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(t){return this.value<t?-1:this.value>t?1:0}}],[{key:"compare",value:function(t,e){return t<e?-1:t>e?1:0}},{key:"isNan",value:function(t){return Number.isNaN(t)}},{key:"valueOf",value:function(t){return new e(t)}}]),e}(),ut=function(){function e(){t(this,e)}return n(e,null,[{key:"isWhitespace",value:function(t){return t<=32&&t>=0||127===t}},{key:"toUpperCase",value:function(t){return t.toUpperCase()}}]),e}(),lt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"le",value:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<=t._lo}},{key:"extractSignificantDigits",value:function(t,n){var r=this.abs(),i=e.magnitude(r._hi),o=e.TEN.pow(i);(r=r.divide(o)).gt(e.TEN)?(r=r.divide(e.TEN),i+=1):r.lt(e.ONE)&&(r=r.multiply(e.TEN),i-=1);for(var s=i+1,a=new st,u=e.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var h=Math.trunc(r._hi);if(h<0)break;var c=!1,f=0;h>9?(c=!0,f="9"):f="0"+h,a.append(f),r=r.subtract(e.valueOf(h)).multiply(e.TEN),c&&r.selfAdd(e.TEN);var v=!0,g=e.magnitude(r._hi);if(g<0&&Math.abs(g)>=u-l&&(v=!1),!v)break}return n[0]=i,a.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}},{key:"equals",value:function(){if(1===arguments.length&&arguments[0]instanceof e){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}},{key:"isZero",value:function(){return 0===this._hi&&0===this._lo}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(t){return this.le(t)?this:t}},{key:"selfDivide",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfDivide(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null,c=null,f=null;return l=this._hi/r,f=(o=(h=e.SPLIT*l)-(o=h-l))*(a=(f=e.SPLIT*r)-(a=f-r))-(c=l*r)+o*(u=r-a)+(s=l-o)*a+s*u,f=l+(h=(this._hi-c-f+this._lo-l*i)/r),this._hi=f,this._lo=l-f+h,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;return r=(s=this._hi/t._hi)-(n=(a=e.SPLIT*s)-(n=a-s)),l=n*(i=(l=e.SPLIT*t._hi)-(i=l-t._hi))-(u=s*t._hi)+n*(o=t._hi-i)+r*i+r*o,new e(l=s+(a=(this._hi-u-l+this._lo-s*t._lo)/t._hi),s-l+a)}if("number"==typeof arguments[0]){var h=arguments[0];return A.isNaN(h)?e.createNaN():e.copy(this).selfDivide(h,0)}}},{key:"ge",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}},{key:"pow",value:function(t){if(0===t)return e.valueOf(1);var n=new e(this),r=e.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&r.selfMultiply(n),(i/=2)>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal():r}},{key:"ceil",value:function(){if(this.isNaN())return e.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new e(t,n)}},{key:"compareTo",value: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}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}},{key:"max",value:function(t){return this.ge(t)?this:t}},{key:"sqrt",value:function(){if(this.isZero())return e.valueOf(0);if(this.isNegative())return e.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=e.valueOf(n),i=this.subtract(r.sqr())._hi*(.5*t);return r.add(i)}},{key:"selfAdd",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0],r=null,i=null,o=null,s=null,a=null,u=null;return s=(o=this._hi+n)-(a=o-this._hi),i=(u=(s=n-a+(this._hi-s))+this._lo)+(o-(r=o+u)),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(2===arguments.length){var l=arguments[0],h=arguments[1],c=null,f=null,v=null,g=null,d=null,p=null,y=null;g=this._hi+l,f=this._lo+h,d=g-(p=g-this._hi),v=f-(y=f-this._lo);var m=(c=g+(p=(d=l-p+(this._hi-d))+f))+(p=(v=h-y+(this._lo-v))+(p+(g-c))),_=p+(c-m);return this._hi=m,this._lo=_,this}}},{key:"selfMultiply",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfMultiply(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null;o=(l=e.SPLIT*this._hi)-this._hi,h=e.SPLIT*r,o=l-o,s=this._hi-o,a=h-r;var c=(l=this._hi*r)+(h=o*(a=h-a)-l+o*(u=r-a)+s*a+s*u+(this._hi*i+this._lo*r)),f=h+(o=l-c);return this._hi=c,this._lo=f,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return e.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new e(t,n)}},{key:"negate",value:function(){return this.isNaN()?this:new e(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}},{key:"multiply",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return t.isNaN()?e.createNaN():e.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var n=arguments[0];return A.isNaN(n)?e.createNaN():e.copy(this).selfMultiply(n,0)}}},{key:"isNaN",value:function(){return A.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var t=e.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;if("."===r.charAt(0))o="0"+r;else if(i<0)o="0."+e.stringOfChar("0",-i)+r;else if(-1===r.indexOf(".")){var s=i-r.length;o=r+e.stringOfChar("0",s)+".0"}return this.isNegative()?"-"+o:o}},{key:"reciprocal",value:function(){var t,n,r,i,o=null,s=null,a=null,u=null;t=(r=1/this._hi)-(o=(a=e.SPLIT*r)-(o=a-r)),s=(u=e.SPLIT*this._hi)-this._hi;var l=r+(a=(1-(i=r*this._hi)-(u=o*(s=u-s)-i+o*(n=this._hi-s)+t*s+t*n)-r*this._lo)/this._hi);return new e(l,r-l+a)}},{key:"toSciNotation",value:function(){if(this.isZero())return e.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!1,n),i=e.SCI_NOT_EXPONENT_CHAR+n[0];if("0"===r.charAt(0))throw new IllegalStateException("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i}},{key:"abs",value:function(){return this.isNaN()?e.NaN:this.isNegative()?this.negate():new e(this)}},{key:"isPositive",value:function(){return this._hi>0||0===this._hi&&this._lo>0}},{key:"lt",value:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<t._lo}},{key:"add",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return e.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var n=arguments[0];return e.copy(this).selfAdd(n)}}},{key:"init",value: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 e){var n=arguments[0];this._hi=n._hi,this._lo=n._lo}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}}},{key:"gt",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>t._lo}},{key:"isNegative",value:function(){return this._hi<0||0===this._hi&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?e.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[b,k,w]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];e.constructor_.call(this,e.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}},{key:"determinant",value:function(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];return e.determinant(e.valueOf(t),e.valueOf(n),e.valueOf(r),e.valueOf(i))}if(arguments[3]instanceof e&&arguments[2]instanceof e&&arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[1],s=arguments[2],a=arguments[3];return arguments[0].multiply(a).selfSubtract(o.multiply(s))}}},{key:"sqr",value:function(t){return e.valueOf(t).selfMultiply(t)}},{key:"valueOf",value:function(){if("string"==typeof arguments[0]){var t=arguments[0];return e.parse(t)}if("number"==typeof arguments[0])return new e(arguments[0])}},{key:"sqrt",value:function(t){return e.valueOf(t).sqrt()}},{key:"parse",value:function(t){for(var n=0,r=t.length;ut.isWhitespace(t.charAt(n));)n++;var i=!1;if(n<r){var o=t.charAt(n);"-"!==o&&"+"!==o||(n++,"-"===o&&(i=!0))}for(var s=new e,a=0,u=0,l=0,h=!1;!(n>=r);){var c=t.charAt(n);if(n++,ut.isDigit(c)){var f=c-"0";s.selfMultiply(e.TEN),s.selfAdd(f),a++}else{if("."!==c){if("e"===c||"E"===c){var v=t.substring(n);try{l=at.parseInt(v)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+v+" in string "+t):e}break}throw new NumberFormatException("Unexpected character \'"+c+"\' at position "+n+" in string "+t)}u=a,h=!0}}var g=s;h||(u=a);var d=a-u-l;if(0===d)g=s;else if(d>0){var p=e.TEN.pow(d);g=s.divide(p)}else if(d<0){var y=e.TEN.pow(-d);g=s.multiply(y)}return i?g.negate():g}},{key:"createNaN",value:function(){return new e(A.NaN,A.NaN)}},{key:"copy",value:function(t){return new e(t)}},{key:"magnitude",value: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}},{key:"stringOfChar",value:function(t,e){for(var n=new st,r=0;r<e;r++)n.append(t);return n.toString()}}]),e}();lt.PI=new lt(3.141592653589793,12246467991473532e-32),lt.TWO_PI=new lt(6.283185307179586,24492935982947064e-32),lt.PI_2=new lt(1.5707963267948966,6123233995736766e-32),lt.E=new lt(2.718281828459045,14456468917292502e-32),lt.NaN=new lt(A.NaN,A.NaN),lt.EPS=123259516440783e-46,lt.SPLIT=134217729,lt.MAX_PRINT_DIGITS=32,lt.TEN=lt.valueOf(10),lt.ONE=lt.valueOf(1),lt.SCI_NOT_EXPONENT_CHAR="E",lt.SCI_NOT_ZERO="0.0E0";var ht=function(){function e(){t(this,e)}return n(e,null,[{key:"orientationIndex",value:function(t,n,r){var i=e.orientationIndexFilter(t,n,r);if(i<=1)return i;var o=lt.valueOf(n.x).selfAdd(-t.x),s=lt.valueOf(n.y).selfAdd(-t.y),a=lt.valueOf(r.x).selfAdd(-n.x),u=lt.valueOf(r.y).selfAdd(-n.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof lt&&arguments[2]instanceof lt&&arguments[0]instanceof lt&&arguments[1]instanceof lt){var t=arguments[1],e=arguments[2],n=arguments[3];return arguments[0].multiply(n).selfSubtract(t.multiply(e)).signum()}if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=lt.valueOf(r),u=lt.valueOf(i),l=lt.valueOf(o),h=lt.valueOf(s);return a.multiply(h).selfSubtract(u.multiply(l)).signum()}}},{key:"intersection",value:function(t,e,n,r){var i=new lt(t.y).selfSubtract(e.y),o=new lt(e.x).selfSubtract(t.x),s=new lt(t.x).selfMultiply(e.y).selfSubtract(new lt(e.x).selfMultiply(t.y)),a=new lt(n.y).selfSubtract(r.y),u=new lt(r.x).selfSubtract(n.x),l=new lt(n.x).selfMultiply(r.y).selfSubtract(new lt(r.x).selfMultiply(n.y)),h=o.multiply(l).selfSubtract(u.multiply(s)),c=a.multiply(s).selfSubtract(i.multiply(l)),f=i.multiply(u).selfSubtract(a.multiply(o)),v=h.selfDivide(f).doubleValue(),g=c.selfDivide(f).doubleValue();return A.isNaN(v)||A.isInfinite(v)||A.isNaN(g)||A.isInfinite(g)?null:new j(v,g)}},{key:"orientationIndexFilter",value:function(t,n,r){var i=null,o=(t.x-r.x)*(n.y-r.y),s=(t.y-r.y)*(n.x-r.x),a=o-s;if(o>0){if(s<=0)return e.signum(a);i=o+s}else{if(!(o<0))return e.signum(a);if(s>=0)return e.signum(a);i=-o-s}var u=e.DP_SAFE_EPSILON*i;return a>=u||-a>=u?e.signum(a):2}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}}]),e}();ht.DP_SAFE_EPSILON=1e-15;var ct=function(){function e(){t(this,e)}return n(e,[{key:"getM",value:function(t){if(this.hasM()){var e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return A.NaN}},{key:"setOrdinate",value:function(t,e,n){}},{key:"getZ",value:function(t){return this.hasZ()?this.getOrdinate(t,2):A.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(t,e){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(t){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(t){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(t){}},{key:"copy",value:function(){}},{key:"getY",value:function(t){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[w]}}]),e}();ct.X=0,ct.Y=1,ct.Z=2,ct.M=3;var ft=function(){function e(){t(this,e)}return n(e,null,[{key:"index",value:function(t,e,n){return ht.orientationIndex(t,e,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var t=arguments[0],n=t.length-1;if(n<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=n;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do{(a-=1)<0&&(a=n)}while(t[a].equals2D(r)&&a!==i);var u=i;do{u=(u+1)%n}while(t[u].equals2D(r)&&u!==i);var l=t[a],h=t[u];if(l.equals2D(r)||h.equals2D(r)||l.equals2D(h))return!1;var c=e.index(l,r,h);return 0===c?l.x>h.x:c>0}if(ot(arguments[0],ct)){var f=arguments[0],v=f.size()-1;if(v<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var g=f.getCoordinate(0),d=0,p=1;p<=v;p++){var y=f.getCoordinate(p);y.y>g.y&&(g=y,d=p)}var m=null,x=d;do{(x-=1)<0&&(x=v),m=f.getCoordinate(x)}while(m.equals2D(g)&&x!==d);var E=null,k=d;do{k=(k+1)%v,E=f.getCoordinate(k)}while(E.equals2D(g)&&k!==d);if(m.equals2D(g)||E.equals2D(g)||m.equals2D(E))return!1;var w=e.index(m,g,E);return 0===w?m.x>E.x:w>0}}}]),e}();ft.CLOCKWISE=-1,ft.RIGHT=ft.CLOCKWISE,ft.COUNTERCLOCKWISE=1,ft.LEFT=ft.COUNTERCLOCKWISE,ft.COLLINEAR=0,ft.STRAIGHT=ft.COLLINEAR;var vt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value: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}},{key:"findRightmostEdgeAtVertex",value:function(){var t=this._minDe.getEdge().getCoordinates();G.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=ft.index(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===ft.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===ft.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value: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=tt.LEFT;return n[e].y<n[e+1].y&&(r=tt.RIGHT),r}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value: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])}},{key:"findRightmostEdgeAtNode",value: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)}},{key:"findEdge",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}G.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)===tt.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),e}(),gt=function(e){r(o,e);var i=c(o);function o(e,n){var r;return t(this,o),(r=i.call(this,n?e+" [ "+n+" ]":e)).pt=n?new j(n):void 0,r.name=Object.keys({TopologyException:o})[0],r}return n(o,[{key:"getCoordinate",value:function(){return this.pt}}]),o}(F),dt=function(){function e(){t(this,e),this.array=[]}return n(e,[{key:"addLast",value:function(t){this.array.push(t)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return 0===this.array.length}}]),e}(),pt=function(e,i){r(s,e);var o=c(s);function s(e){var n;return t(this,s),(n=o.call(this)).array=[],e instanceof H&&n.addAll(e),n}return n(s,[{key:"interfaces_",get:function(){return[rt,H]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.array.push(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"set",value:function(t,e){var n=this.array[t];return this.array[t]=e,n}},{key:"iterator",value:function(){return new yt(this)}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new nt;return this.array[t]}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"sort",value:function(t){t?this.array.sort(function(e,n){return t.compare(e,n)}):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(t){for(var e=0,n=this.array.length;e<n;e++)if(this.array[e]===t)return!!this.array.splice(e,1);return!1}},{key:i,value:function(){return this.array.values()}}]),s}(rt,Symbol.iterator),yt=function(){function e(n){t(this,e),this.arrayList=n,this.position=0}return n(e,[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new W;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(t){return this.arrayList.set(this.position-1,t)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}]),e}(),mt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"clearVisitedEdges",value:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value: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 gt("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)}}},{key:"computeDepth",value:function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(tt.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)}},{key:"create",value:function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(tt.RIGHT)>=1&&e.getDepth(tt.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}},{key:"computeDepths",value:function(t){var e=new Q,n=new dt,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))}}}}},{key:"compareTo",value:function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(null===this._env){for(var t=new U,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}},{key:"addReachable",value:function(t){var e=new it;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}}},{key:"copySymDepths",value:function(t){var e=t.getSym();e.setDepth(tt.LEFT,t.getDepth(tt.RIGHT)),e.setDepth(tt.RIGHT,t.getDepth(tt.LEFT))}},{key:"add",value: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)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new pt,this._nodes=new pt,this._rightMostCoord=null,this._env=null,this._finder=new vt}}]),e}(),_t=function(){function e(){t(this,e)}return n(e,null,[{key:"intersection",value:function(t,e,n,r){var i=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,l=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,c=n.y>r.y?n.y:r.y,f=((i>u?i:u)+(s<h?s:h))/2,v=((o>l?o:l)+(a<c?a:c))/2,g=t.x-f,d=t.y-v,p=e.x-f,y=e.y-v,m=n.x-f,_=n.y-v,x=r.x-f,E=r.y-v,k=d-y,w=p-g,b=g*y-p*d,I=_-E,N=x-m,S=m*E-x*_,M=k*N-I*w,L=(w*S-N*b)/M,P=(I*b-k*S)/M;return A.isNaN(L)||A.isInfinite(L)||A.isNaN(P)||A.isInfinite(P)?null:new j(L+f,P+v)}}]),e}(),xt=function(){function e(){t(this,e)}return n(e,null,[{key:"arraycopy",value:function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++}},{key:"getProperty",value:function(t){return{"line.separator":"\\n"}[t]}}]),e}(),Et=function(){function e(){t(this,e)}return n(e,null,[{key:"log10",value:function(t){var n=Math.log(t);return A.isInfinite(n)||A.isNaN(n)?n:n/e.LOG_10}},{key:"min",value:function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i}},{key:"clamp",value: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}}},{key:"wrap",value:function(t,e){return t<0?e- -t%e:t%e}},{key:"max",value:function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}}},{key:"average",value:function(t,e){return(t+e)/2}}]),e}();Et.LOG_10=Math.log(10);var kt=function(){function e(){t(this,e)}return n(e,null,[{key:"segmentToSegment",value:function(t,n,r,i){if(t.equals(n))return e.pointToSegment(t,r,i);if(r.equals(i))return e.pointToSegment(i,t,n);var o=!1;if(U.intersects(t,n,r,i)){var s=(n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(0===s)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=((t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y))/s,l=a/s;(l<0||l>1||u<0||u>1)&&(o=!0)}}else o=!0;return o?Et.min(e.pointToSegment(t,r,i),e.pointToSegment(n,r,i),e.pointToSegment(r,t,n),e.pointToSegment(i,t,n)):0}},{key:"pointToSegment",value:function(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;if(i<=0)return t.distance(e);if(i>=1)return t.distance(n);var o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(o)*Math.sqrt(r)}},{key:"pointToLinePerpendicular",value: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)}},{key:"pointToSegmentString",value:function(t,n){if(0===n.length)throw new _("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i<n.length-1;i++){var o=e.pointToSegment(t,n[i],n[i+1]);o<r&&(r=o)}return r}}]),e}(),wt=function(){function e(){t(this,e)}return n(e,[{key:"create",value:function(){if(1===arguments.length)arguments[0]instanceof Array||ot(arguments[0],ct);else if(2===arguments.length);else if(3===arguments.length){var t=arguments[0],e=arguments[1];return this.create(t,e)}}}]),e}(),bt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),It=function(){function e(){t(this,e)}return n(e,null,[{key:"ofLine",value:function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new j;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,l=a-i,h=u-o;n+=Math.sqrt(l*l+h*h),i=a,o=u}return n}}]),e}(),Nt=function e(){t(this,e)},St=function(){function e(){t(this,e)}return n(e,null,[{key:"copyCoord",value: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))}},{key:"isRing",value:function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,ct.X)===t.getOrdinate(e-1,ct.X)&&t.getOrdinate(0,ct.Y)===t.getOrdinate(e-1,ct.Y)}},{key:"scroll",value:function(){if(2===arguments.length){if(ot(arguments[0],ct)&&Number.isInteger(arguments[1])){var t=arguments[0],n=arguments[1];e.scroll(t,n,e.isRing(t))}else if(ot(arguments[0],ct)&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1],o=e.indexOf(i,r);if(o<=0)return null;e.scroll(r,o)}}else if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2];if(a<=0)return null;for(var l=s.copy(),h=u?s.size()-1:s.size(),c=0;c<h;c++)for(var f=0;f<s.getDimension();f++)s.setOrdinate(c,f,l.getOrdinate((a+c)%h,f));if(u)for(var v=0;v<s.getDimension();v++)s.setOrdinate(h,v,s.getOrdinate(0,v))}}},{key:"isEqual",value: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)||A.isNaN(s)&&A.isNaN(a)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(1===arguments.length){var t=arguments[0];return e.minCoordinateIndex(t,0,t.size()-1)}if(3===arguments.length){for(var n=arguments[0],r=arguments[2],i=-1,o=null,s=arguments[1];s<=r;s++){var a=n.getCoordinate(s);(null===o||o.compareTo(a)>0)&&(o=a,i=s)}return i}}},{key:"extend",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();if(e.copy(n,0,i,0,o),o>0)for(var s=o;s<r;s++)e.copy(n,o-1,i,s,1);return i}},{key:"reverse",value:function(t){for(var n=t.size()-1,r=Math.trunc(n/2),i=0;i<=r;i++)e.swap(t,i,n-i)}},{key:"swap",value: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)}}},{key:"copy",value:function(t,n,r,i,o){for(var s=0;s<o;s++)e.copyCoord(t,n+s,r,i+s)}},{key:"ensureValidRing",value:function(t,n){var r=n.size();return 0===r?n:r<=3?e.createClosedRing(t,n,4):n.getOrdinate(0,ct.X)===n.getOrdinate(r-1,ct.X)&&n.getOrdinate(0,ct.Y)===n.getOrdinate(r-1,ct.Y)?n:e.createClosedRing(t,n,r+1)}},{key:"indexOf",value:function(t,e){for(var n=0;n<e.size();n++)if(t.x===e.getOrdinate(n,ct.X)&&t.y===e.getOrdinate(n,ct.Y))return n;return-1}},{key:"createClosedRing",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();e.copy(n,0,i,0,o);for(var s=o;s<r;s++)e.copy(n,0,i,s,1);return i}},{key:"minCoordinate",value:function(t){for(var e=null,n=0;n<t.size();n++){var r=t.getCoordinate(n);(null===e||e.compareTo(r)>0)&&(e=r)}return e}}]),e}(),Mt=function(){function e(){t(this,e)}return n(e,null,[{key:"toDimensionSymbol",value:function(t){switch(t){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L;case e.A:return e.SYM_A}throw new _("Unknown dimension value: "+t)}},{key:"toDimensionValue",value:function(t){switch(ut.toUpperCase(t)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L;case e.SYM_A:return e.A}throw new _("Unknown dimension symbol: "+t)}}]),e}();Mt.P=0,Mt.L=1,Mt.A=2,Mt.FALSE=-1,Mt.TRUE=-2,Mt.DONTCARE=-3,Mt.SYM_FALSE="F",Mt.SYM_TRUE="T",Mt.SYM_DONTCARE="*",Mt.SYM_P="0",Mt.SYM_L="1",Mt.SYM_A="2";var Lt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),Pt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t,e){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),e}(),Ct=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new U:this._points.expandEnvelope(new U)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new s(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._points.size()!==n._points.size())return!1;for(var r=0;r<this._points.size();r++)if(!this.equal(this._points.getCoordinate(r),n._points.getCoordinate(r),e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value: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))){if(this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0){var n=this._points.copy();St.reverse(n),this._points=n}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Mt.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var t=this._points.copy();return St.reverse(t),this.getFactory().createLineString(t)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return V.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return It.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value: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)}}},{key:"apply",value:function(){if(ot(arguments[0],bt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(ot(arguments[0],Pt)){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(ot(arguments[0],Lt)||ot(arguments[0],x))&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){throw new J}},{key:"isEquivalentClass",value:function(t){return t instanceof s}},{key:"getCoordinateN",value:function(t){return this._points.getCoordinate(t)}},{key:"getGeometryType",value:function(){return V.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return 0===this._points.size()}},{key:"init",value:function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t}},{key:"isCoordinate",value:function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))}},{key:"interfaces_",get:function(){return[Nt]}}],[{key:"constructor_",value:function(){if(this._points=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];V.constructor_.call(this,e),this.init(t)}}}]),s}(V),Tt=function e(){t(this,e)},Ot=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new U;var t=new U;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new s(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return V.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value: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)}}},{key:"apply",value:function(){if(ot(arguments[0],bt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(ot(arguments[0],Pt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(ot(arguments[0],Lt)||ot(arguments[0],x))&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return V.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return 0===this._coordinates.size()}},{key:"init",value:function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),G.isTrue(t.size()<=1),this._coordinates=t}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[Tt]}}],[{key:"constructor_",value:function(){this._coordinates=null;var t=arguments[0],e=arguments[1];V.constructor_.call(this,e),this.init(t)}}]),s}(V),Rt=function(){function e(){t(this,e)}return n(e,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var t=arguments[0];return Math.abs(e.ofRingSigned(t))}if(ot(arguments[0],ct)){var n=arguments[0];return Math.abs(e.ofRingSigned(n))}}},{key:"ofRingSigned",value: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(ot(arguments[0],ct)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new j,l=new j,h=new j;s.getCoordinate(0,l),s.getCoordinate(1,h);var c=l.x;h.x-=c;for(var f=0,v=1;v<a-1;v++)u.y=l.y,l.x=h.x,l.y=h.y,s.getCoordinate(v+1,h),h.x-=c,f+=l.x*(u.y-h.y);return f/2}}}]),e}(),At=function(){function e(){t(this,e)}return n(e,null,[{key:"sort",value:function(){var t=arguments,e=arguments[0];if(1===arguments.length)e.sort(function(t,e){return t.compareTo(e)});else if(2===arguments.length)e.sort(function(e,n){return t[1].compare(e,n)});else if(3===arguments.length){var n=e.slice(arguments[1],arguments[2]);n.sort();var r=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));e.splice(0,e.length);var i,o=p(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;e.push(s)}}catch(t){o.e(t)}finally{o.f()}}else if(4===arguments.length){var a=e.slice(arguments[1],arguments[2]);a.sort(function(e,n){return t[3].compare(e,n)});var u=e.slice(0,arguments[1]).concat(a,e.slice(arguments[2],e.length));e.splice(0,e.length);var l,h=p(u);try{for(h.s();!(l=h.n()).done;){var c=l.value;e.push(c)}}catch(t){h.e(t)}finally{h.f()}}}},{key:"asList",value:function(t){var e,n=new pt,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n.add(i)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"copyOf",value:function(t,e){return t.slice(0,e)}}]),e}(),Dt=function e(){t(this,e)},Ft=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value: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}},{key:"getArea",value:function(){var t=0;t+=Rt.ofRing(this._shell.getCoordinateSequence());for(var e=0;e<this._holes.length;e++)t-=Rt.ofRing(this._holes[e].getCoordinateSequence());return t}},{key:"copyInternal",value:function(){for(var t=this._shell.copy(),e=new Array(this._holes.length).fill(null),n=0;n<this._holes.length;n++)e[n]=this._holes[n].copy();return new s(t,e,this._factory)}},{key:"isRectangle",value: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),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}return!0}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t,r=this._shell,o=n._shell;if(!r.equalsExact(o,e))return!1;if(this._holes.length!==n._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(n._holes[a],e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){if(0===arguments.length){this._shell=this.normalized(this._shell,!0);for(var t=0;t<this._holes.length;t++)this._holes[t]=this.normalized(this._holes[t],!1);At.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=e.getCoordinateSequence(),i=St.minCoordinateIndex(r,0,r.size()-2);St.scroll(r,i,!0),ft.isCCW(r)===n&&St.reverse(r)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var t=this.getExteriorRing().reverse(),e=new Array(this.getNumInteriorRing()).fill(null),n=0;n<e.length;n++)e[n]=this.getInteriorRingN(n).reverse();return this.getFactory().createPolygon(t,e)}},{key:"getTypeCode",value:function(){return V.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t}},{key:"getNumPoints",value:function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(t,e){var n=t.copy();return this.normalize(n,e),n}},{key:"compareToSameClass",value: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[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),h=0;h<u&&h<l;){var c=this.getInteriorRingN(h),f=i.getInteriorRingN(h),v=c.compareToSameClass(f,r);if(0!==v)return v;h++}return h<u?1:h<l?-1:0}}},{key:"apply",value:function(){if(ot(arguments[0],bt)){var t=arguments[0];this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(ot(arguments[0],Pt)){var n=arguments[0];if(this._shell.apply(n),!n.isDone())for(var r=0;r<this._holes.length&&(this._holes[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(ot(arguments[0],Lt))arguments[0].filter(this);else if(ot(arguments[0],x)){var i=arguments[0];i.filter(this),this._shell.apply(i);for(var o=0;o<this._holes.length;o++)this._holes[o].apply(i)}}},{key:"getBoundary",value: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)}},{key:"getGeometryType",value:function(){return V.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(t){return this._holes[t]}},{key:"interfaces_",get:function(){return[Dt]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(V.constructor_.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),V.hasNullElements(e))throw new _("holes must not contain null elements");if(t.isEmpty()&&V.hasNonEmptyElements(e))throw new _("shell is empty but holes are not");this._shell=t,this._holes=e}}]),s}(V),qt=function(e){r(i,e);var n=c(i);function i(){return t(this,i),n.apply(this,arguments)}return i}(K),Gt=function(e){r(o,e);var i=c(o);function o(e){var n;return t(this,o),(n=i.call(this)).array=[],e instanceof H&&n.addAll(e),n}return n(o,[{key:"contains",value:function(t){var e,n=p(this.array);try{for(n.s();!(e=n.n()).done;)if(0===e.value.compareTo(t))return!0}catch(t){n.e(t)}finally{n.f()}return!1}},{key:"add",value: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);return this.array.push(t),!0}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"remove",value:function(){throw new J}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new Yt(this.array)}}]),o}(qt),Yt=function(){function e(n){t(this,e),this.array=n,this.position=0}return n(e,[{key:"next",value:function(){if(this.position===this.array.length)throw new W;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new J}}]),e}(),Bt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){for(var t=new U,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t}},{key:"getGeometryN",value:function(t){return this._geometries[t]}},{key:"getCoordinates",value: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}},{key:"getArea",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t}},{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._geometries.length!==n._geometries.length)return!1;for(var r=0;r<this._geometries.length;r++)if(!this._geometries[r].equalsExact(n._geometries[r],e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();At.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t}},{key:"reverseInternal",value:function(){for(var t=this._geometries.length,e=new pt(t),n=0;n<t;n++)e.add(this._geometries[n].reverse());return this.getFactory().buildGeometry(e)}},{key:"getTypeCode",value:function(){return V.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t}},{key:"getLength",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t}},{key:"getNumPoints",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(1===arguments.length){var t=arguments[0],e=new Gt(At.asList(this._geometries)),n=new Gt(At.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=i.getGeometryN(a),h=u.compareToSameClass(l,r);if(0!==h)return h;a++}return a<o?1:a<s?-1:0}}},{key:"apply",value:function(){if(ot(arguments[0],bt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(ot(arguments[0],Pt)){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(ot(arguments[0],Lt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(ot(arguments[0],x)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}}},{key:"getBoundary",value:function(){return V.checkNotGeometryCollection(this),G.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return V.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];if(V.constructor_.call(this,e),null===t&&(t=[]),V.hasNullElements(t))throw new _("geometries must not contain null elements");this._geometries=t}}}]),s}(V),zt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(1===arguments.length&&Number.isInteger(arguments[0])){var t=arguments[0];return this._geometries[t].getCoordinate()}return f(i(s.prototype),"getCoordinate",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[Tt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),jt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){return new s(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||f(i(s.prototype),"isClosed",this).call(this)}},{key:"reverseInternal",value:function(){var t=this._points.copy();return St.reverse(t),this.getFactory().createLinearRing(t)}},{key:"getTypeCode",value:function(){return V.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!f(i(s.prototype),"isClosed",this).call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<s.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return V.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Ct.constructor_.call(this,t,e),this.validateConstruction()}}]),s}(Ct);jt.MINIMUM_VALID_SIZE=4;var Xt=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"getZ",value:function(){return j.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}],[{key:"constructor_",value:function(){if(0===arguments.length)j.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];j.constructor_.call(this,n,r,j.NULL_ORDINATE)}}}]),o}(j);Xt.X=0,Xt.Y=1,Xt.Z=-1,Xt.M=-1;var Ut=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;case o.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getZ",value:function(){return j.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y;case o.M:return this._m}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)j.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e.x,e.y),this._m=this.getM()}}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];j.constructor_.call(this,n,r,j.NULL_ORDINATE),this._m=i}}}]),o}(j);Ut.X=0,Ut.Y=1,Ut.Z=-1,Ut.M=2;var Vt=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case j.X:this.x=e;break;case j.Y:this.y=e;break;case j.Z:this.z=e;break;case j.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getOrdinate",value:function(t){switch(t){case j.X:return this.x;case j.Y:return this.y;case j.Z:return this.getZ();case j.M:return this.getM()}throw new _("Invalid ordinate index: "+t)}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)j.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e),this._m=this.getM()}}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],s=arguments[3];j.constructor_.call(this,n,r,i),this._m=s}}}]),o}(j),Zt=function(){function e(){t(this,e)}return n(e,null,[{key:"measures",value:function(t){return t instanceof Xt?0:t instanceof Ut||t instanceof Vt?1:0}},{key:"dimension",value:function(t){return t instanceof Xt?2:t instanceof Ut?3:t instanceof Vt?4:3}},{key:"create",value:function(){if(1===arguments.length){var t=arguments[0];return e.create(t,0)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return 2===n?new Xt:3===n&&0===r?new j:3===n&&1===r?new Ut:4===n&&1===r?new Vt:new j}}}]),e}(),Ht=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getCoordinate",value:function(t){return this.get(t)}},{key:"addAll",value:function(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&ot(arguments[0],H)){for(var t=arguments[1],e=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),t),e=!0;return e}return f(i(s.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var t=f(i(s.prototype),"clone",this).call(this),e=0;e<this.size();e++)t.add(e,this.get(e).clone());return t}},{key:"toCoordinateArray",value:function(){if(0===arguments.length)return this.toArray(s.coordArrayType);if(1===arguments.length){if(arguments[0])return this.toArray(s.coordArrayType);for(var t=this.size(),e=new Array(t).fill(null),n=0;n<t;n++)e[n]=this.get(t-n-1);return e}}},{key:"add",value:function(){if(1===arguments.length){var t=arguments[0];return f(i(s.prototype),"add",this).call(this,t)}if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var e=arguments[0],n=arguments[1];return this.add(e,n,!0),!0}if(arguments[0]instanceof j&&"boolean"==typeof arguments[1]){var r=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(r))return null;f(i(s.prototype),"add",this).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1];if(arguments[2])for(var h=0;h<u.length;h++)this.add(u[h],l);else for(var c=u.length-1;c>=0;c--)this.add(u[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof j){var v=arguments[0],g=arguments[1];if(!arguments[2]){var d=this.size();if(d>0){if(v>0&&this.get(v-1).equals2D(g))return null;if(v<d&&this.get(v).equals2D(g))return null}}f(i(s.prototype),"add",this).call(this,v,g)}}else if(4===arguments.length){var p=arguments[0],y=arguments[1],m=arguments[2],_=arguments[3],x=1;m>_&&(x=-1);for(var E=m;E!==_;E+=x)this.add(p[E],y);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_",value:function(){if(0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}}]),s}(pt);Ht.coordArrayType=new Array(0).fill(null);var Wt=function(){function e(){t(this,e)}return n(e,null,[{key:"isRing",value:function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}},{key:"ptNotInList",value:function(t,n){for(var r=0;r<t.length;r++){var i=t[r];if(e.indexOf(i,n)<0)return i}return null}},{key:"scroll",value:function(t,n){var r=e.indexOf(n,t);if(r<0)return null;var i=new Array(t.length).fill(null);xt.arraycopy(t,r,i,0,t.length-r),xt.arraycopy(t,0,i,t.length-r,r),xt.arraycopy(i,0,t,0,t.length)}},{key:"equals",value: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}}},{key:"intersection",value:function(t,e){for(var n=new Ht,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()}},{key:"measures",value:function(t){if(null===t||0===t.length)return 0;var e,n=0,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n=Math.max(n,Zt.measures(i))}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"hasRepeatedPoints",value:function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(t){return e.hasRepeatedPoints(t)?new Ht(t,!1).toCoordinateArray():t}},{key:"reverse",value: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}}},{key:"removeNull",value: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}},{key:"copyDeep",value: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]=t[n].copy();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]=r[i+u].copy()}},{key:"isEqualReversed",value: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}},{key:"envelope",value:function(t){for(var e=new U,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e}},{key:"toCoordinateArray",value:function(t){return t.toArray(e.coordArrayType)}},{key:"dimension",value:function(t){if(null===t||0===t.length)return 3;var e,n=0,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n=Math.max(n,Zt.dimension(i))}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"atLeastNCoordinatesOrNothing",value:function(t,e){return e.length>=t?e:[]}},{key:"indexOf",value:function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1}},{key:"increasingDirection",value: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}},{key:"compare",value: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}},{key:"minCoordinate",value:function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e}},{key:"extract",value:function(t,e,n){e=Et.clamp(e,0,t.length);var r=(n=Et.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}}]),e}(),Jt=function(){function e(){t(this,e)}return n(e,[{key:"compare",value:function(t,e){var n=t,r=e;return Wt.compare(n,r)}},{key:"interfaces_",get:function(){return[D]}}]),e}(),Kt=function(){function e(){t(this,e)}return n(e,[{key:"compare",value: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}},{key:"OLDcompare",value: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 l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0}},{key:"interfaces_",get:function(){return[D]}}]),e}();Wt.ForwardComparator=Jt,Wt.BidirectionalComparator=Kt,Wt.coordArrayType=new Array(0).fill(null);var Qt=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),$t=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(t){return this.hasM()?this._coordinates[t].getM():A.NaN}},{key:"setOrdinate",value:function(t,e,n){switch(e){case ct.X:this._coordinates[t].x=n;break;case ct.Y:this._coordinates[t].y=n;break;default:this._coordinates[t].setOrdinate(e,n)}}},{key:"getZ",value:function(t){return this.hasZ()?this._coordinates[t].getZ():A.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(t,e){switch(e){case ct.X:return this._coordinates[t].x;case ct.Y:return this._coordinates[t].y;default:return this._coordinates[t].getOrdinate(e)}}},{key:"getCoordinate",value:function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0];arguments[1].setCoordinate(this._coordinates[e])}}},{key:"getCoordinateCopy",value:function(t){var e=this.createCoordinate();return e.setCoordinate(this._coordinates[t]),e}},{key:"createCoordinate",value:function(){return Zt.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(t){return this._coordinates[t].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t}},{key:"copy",value:function(){for(var t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++){var r=this.createCoordinate();r.setCoordinate(this._coordinates[n]),t[n]=r}return new e(t,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var t=new Qt(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"()"}},{key:"getY",value:function(t){return this._coordinates[t].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[ct,b]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];e.constructor_.call(this,t,Wt.dimension(t),Wt.measures(t))}else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var r=0;r<n;r++)this._coordinates[r]=new j}else if(ot(arguments[0],ct)){var i=arguments[0];if(null===i)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._measures=i.getMeasures(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)this._coordinates[o]=i.getCoordinateCopy(o)}}else if(2===arguments.length){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];e.constructor_.call(this,s,a,Wt.measures(s))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var h=0;h<u;h++)this._coordinates[h]=Zt.create(l)}}else if(3===arguments.length)if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var c=arguments[0],f=arguments[1],v=arguments[2];this._dimension=f,this._measures=v,this._coordinates=null===c?new Array(0).fill(null):c}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var g=arguments[0],d=arguments[1],p=arguments[2];this._coordinates=new Array(g).fill(null),this._dimension=d,this._measures=p;for(var y=0;y<g;y++)this._coordinates[y]=this.createCoordinate()}}}]),e}(),te=function(){function e(){t(this,e)}return n(e,[{key:"readResolve",value:function(){return e.instance()}},{key:"create",value:function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new $t(arguments[0]);if(ot(arguments[0],ct))return new $t(arguments[0])}else{if(2===arguments.length){var t=arguments[1];return t>3&&(t=3),t<2&&(t=2),new $t(arguments[0],t)}if(3===arguments.length){var e=arguments[2],n=arguments[1]-e;return e>1&&(e=1),n>3&&(n=3),n<2&&(n=2),new $t(arguments[0],n+e,e)}}}},{key:"interfaces_",get:function(){return[wt,b]}}],[{key:"instance",value:function(){return e.instanceObject}}]),e}();te.instanceObject=new te;var ee=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new pt,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))}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[Dt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),ne=function(){function e(){t(this,e)}return n(e,[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}]),e}(),re=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).map=new Map,e}return n(o,[{key:"get",value:function(t){return this.map.get(t)||null}},{key:"put",value:function(t,e){return this.map.set(t,e),e}},{key:"values",value:function(){for(var t=new pt,e=this.map.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t}},{key:"entrySet",value:function(){var t=new Q;return this.map.entries().forEach(function(e){return t.add(e)}),t}},{key:"size",value:function(){return this.map.size()}}]),o}(ne),ie=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this._modelType===n._modelType&&this._scale===n._scale}},{key:"compareTo",value:function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return at.compare(n,r)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===e.FLOATING||this._modelType===e.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var t="UNKNOWN";return this._modelType===e.FLOATING?t="Floating":this._modelType===e.FLOATING_SINGLE?t="Floating-Single":this._modelType===e.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t}},{key:"makePrecise",value:function(){if("number"==typeof arguments[0]){var t=arguments[0];return A.isNaN(t)||this._modelType===e.FLOATING_SINGLE?t:this._modelType===e.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof j){var n=arguments[0];if(this._modelType===e.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}}},{key:"getMaximumSignificantDigits",value:function(){var t=16;return this._modelType===e.FLOATING?t=16:this._modelType===e.FLOATING_SINGLE?t=6:this._modelType===e.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t}},{key:"setScale",value:function(t){this._scale=Math.abs(t)}},{key:"interfaces_",get:function(){return[b,k]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=e.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof oe){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},{key:"mostPrecise",value:function(t,e){return t.compareTo(e)>=0?t:e}}]),e}(),oe=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"readResolve",value:function(){return e.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){this._name=null;var t=arguments[0];this._name=t,e.nameToTypeMap.put(t,this)}}]),e}();oe.nameToTypeMap=new re,ie.Type=oe,ie.FIXED=new oe("FIXED"),ie.FLOATING=new oe("FLOATING"),ie.FLOATING_SINGLE=new oe("FLOATING SINGLE"),ie.maximumPreciseValue=9007199254740992;var se=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Mt.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new J}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[Nt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"createEmpty",value:function(t){switch(t){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new _("Invalid dimension: "+t)}}},{key:"toGeometry",value:function(t){return t.isNull()?this.createPoint():t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new j(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new j(t.getMinX(),t.getMinY()),new j(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new j(t.getMinX(),t.getMinY()),new j(t.getMinX(),t.getMaxY()),new j(t.getMaxX(),t.getMaxY()),new j(t.getMaxX(),t.getMinY()),new j(t.getMinX(),t.getMinY())]),null)}},{key:"createLineString",value:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(ot(arguments[0],ct))return new Ct(arguments[0],this)}}},{key:"createMultiLineString",value:function(){return 0===arguments.length?new se(null,this):1===arguments.length?new se(arguments[0],this):void 0}},{key:"buildGeometry",value:function(t){for(var n=null,r=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getTypeCode();null===n&&(n=a),a!==n&&(r=!0),s instanceof Bt&&(i=!0)}if(null===n)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(e.toGeometryArray(t));var u=t.iterator().next();if(t.size()>1){if(u instanceof Ft)return this.createMultiPolygon(e.toPolygonArray(t));if(u instanceof Ct)return this.createMultiLineString(e.toLineStringArray(t));if(u instanceof Ot)return this.createMultiPoint(e.toPointArray(t));G.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}},{key:"createMultiPointFromCoords",value:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}},{key:"createPoint",value:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(ot(arguments[0],ct))return new Ot(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(ot(arguments[0],ct)){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 jt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Ft(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return 0===arguments.length?new Bt(null,this):1===arguments.length?new Bt(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value: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(ot(arguments[0],ct))return new jt(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return 0===arguments.length?new ee(null,this):1===arguments.length?new ee(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(0===arguments.length)return new zt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new zt(arguments[0],this);if(ot(arguments[0],ct)){var t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var r=this.getCoordinateSequenceFactory().create(1,t.getDimension(),t.getMeasures());St.copy(t,n,r,0,1),e[n]=this.createPoint(r)}return this.createMultiPoint(e)}}}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,0===arguments.length)e.constructor_.call(this,new ie,0);else if(1===arguments.length){if(ot(arguments[0],wt)){var t=arguments[0];e.constructor_.call(this,new ie,0,t)}else if(arguments[0]instanceof ie){var n=arguments[0];e.constructor_.call(this,n,0,e.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];e.constructor_.call(this,r,i,e.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this._precisionModel=o,this._coordinateSequenceFactory=a,this._SRID=s}}},{key:"toMultiPolygonArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toGeometryArray",value:function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return te.instance()}},{key:"toMultiLineStringArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toLineStringArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toMultiPointArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toLinearRingArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toPointArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toPolygonArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"createPointFromInternalCoord",value:function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)}}]),e}(),ue="XY",le="XYZ",he="XYM",ce="XYZM",fe={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},ve="EMPTY",ge=1,de=2,pe=3,ye=4,me=5,_e=6;for(var xe in fe)fe[xe].toUpperCase();var Ee=function(){function e(n){t(this,e),this.wkt=n,this.index_=-1}return n(e,[{key:"isAlpha_",value:function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}},{key:"isNumeric_",value:function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}},{key:"isWhiteSpace_",value:function(t){return" "==t||"\\t"==t||"\\r"==t||"\\n"==t}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=de;else if(","==e)t=me;else if(")"==e)t=pe;else if(this.isNumeric_(e)||"-"==e)t=ye,r=this.readNumber_();else if(this.isAlpha_(e))t=ge,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=_e}return{position:n,value:r,type:t}}},{key:"readNumber_",value:function(){var t,e=this.index_,n=!1,r=!1;do{"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}},{key:"readText_",value:function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}]),e}(),ke=function(){function e(n,r){t(this,e),this.lexer_=n,this.token_,this.layout_=ue,this.factory=r}return n(e,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(t){return this.token_.type==t}},{key:"match",value:function(t){var e=this.isTokenType(t);return e&&this.consume_(),e}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var t=ue,e=this.token_;if(this.isTokenType(ge)){var n=e.value;"Z"===n?t=le:"M"===n?t=he:"ZM"===n&&(t=ce),t!==ue&&this.consume_()}return t}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(de)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(me));if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(de)){var t=this.parsePoint_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(de)){var t=this.parsePointList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(de)){var t=this.parseLineStringTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var t;if(this.match(de)){if(t=this.token_.type==de?this.parsePointTextList_():this.parsePointList_(),this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(de)){var t=this.parseLineStringTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(de)){var t=this.parsePolygonTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var t=[],e=this.layout_.length,n=0;n<e;++n){var r=this.token_;if(!this.match(ye))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}},{key:"parsePointList_",value:function(){for(var t=[this.parsePoint_()];this.match(me);)t.push(this.parsePoint_());return t}},{key:"parsePointTextList_",value:function(){for(var t=[this.parsePointText_()];this.match(me);)t.push(this.parsePointText_());return t}},{key:"parseLineStringTextList_",value:function(){for(var t=[this.parseLineStringText_()];this.match(me);)t.push(this.parseLineStringText_());return t}},{key:"parsePolygonTextList_",value:function(){for(var t=[this.parsePolygonText_()];this.match(me);)t.push(this.parsePolygonText_());return t}},{key:"isEmptyGeometry_",value:function(){var t=this.isTokenType(ge)&&this.token_.value==ve;return t&&this.consume_(),t}},{key:"formatErrorMessage_",value:function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}},{key:"parseGeometry_",value:function(){var t=this.factory,e=function(t){return a(j,v(t))},n=function(n){var r=n.map(function(n){return t.createLinearRing(n.map(e))});return r.length>1?t.createPolygon(r[0],r.slice(1)):t.createPolygon(r[0])},r=this.token_;if(this.match(ge)){var i=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==i){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(i){case"POINT":var s=this.parsePointText_();return s?t.createPoint(a(j,v(s))):t.createPoint();case"LINESTRING":var u=this.parseLineStringText_().map(e);return t.createLineString(u);case"LINEARRING":var l=this.parseLineStringText_().map(e);return t.createLinearRing(l);case"POLYGON":var h=this.parsePolygonText_();return h&&0!==h.length?n(h):t.createPolygon();case"MULTIPOINT":var c=this.parseMultiPointText_();if(!c||0===c.length)return t.createMultiPoint();var f=c.map(e).map(function(e){return t.createPoint(e)});return t.createMultiPoint(f);case"MULTILINESTRING":var g=this.parseMultiLineStringText_().map(function(n){return t.createLineString(n.map(e))});return t.createMultiLineString(g);case"MULTIPOLYGON":var d=this.parseMultiPolygonText_();if(!d||0===d.length)return t.createMultiPolygon();var p=d.map(n);return t.createMultiPolygon(p);default:throw new Error("Invalid geometry type: "+i)}}throw new Error(this.formatErrorMessage_())}}]),e}();function we(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")}function be(t){for(var e=t.getCoordinates().map(function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e}),n=[],r=0,i=e.length;r<i;++r)n.push(e[r].join(" "));return n.join(", ")}function Ie(t){var e=[];e.push("("+be(t.getExteriorRing())+")");for(var n=0,r=t.getNumInteriorRing();n<r;++n)e.push("("+be(t.getInteriorRingN(n))+")");return e.join(", ")}var Ne={Point:we,LineString:be,LinearRing:be,Polygon:Ie,MultiPoint:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+we(t.getGeometryN(n))+")");return e.join(", ")},MultiLineString:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+be(t.getGeometryN(n))+")");return e.join(", ")},MultiPolygon:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+Ie(t.getGeometryN(n))+")");return e.join(", ")},GeometryCollection:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push(Se(t.getGeometryN(n)));return e.join(", ")}};function Se(t){var e=t.getGeometryType(),n=Ne[e];e=e.toUpperCase();var r=function(t){var e="";if(t.isEmpty())return e;var n=t.getCoordinate();return void 0===n.z||Number.isNaN(n.z)||(e+="Z"),void 0===n.m||Number.isNaN(n.m)||(e+="M"),e}(t);return r.length>0&&(e+=" "+r),t.isEmpty()?e+" "+ve:e+" ("+n(t)+")"}var Me=function(){function e(n){t(this,e),this.geometryFactory=n||new ae,this.precisionModel=this.geometryFactory.getPrecisionModel()}return n(e,[{key:"read",value:function(t){var e=new Ee(t);return new ke(e,this.geometryFactory).parse()}},{key:"write",value:function(t){return Se(t)}}]),e}(),Le=function(){function e(n){t(this,e),this.parser=new Me(n)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}],[{key:"toLineString",value:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),e}(),Pe=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getIndexAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}},{key:"getTopologySummary",value:function(){var t=new Qt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}},{key:"computeIntersection",value: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)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value: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)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"isInteriorIntersection",value: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}}},{key:"getIntersection",value:function(t){return this._intPt[t]}},{key:"isEndPoint",value:function(){return this.hasIntersection()&&!this._isProper}},{key:"hasIntersection",value:function(){return this._result!==e.NO_INTERSECTION}},{key:"getEdgeDistance",value:function(t,n){return e.computeEdgeDistance(this._intPt[n],this._inputLines[t][0],this._inputLines[t][1])}},{key:"isCollinear",value:function(){return this._result===e.COLLINEAR_INTERSECTION}},{key:"toString",value:function(){return Le.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Le.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}},{key:"getEndpoint",value:function(t,e){return this._inputLines[t][e]}},{key:"isIntersection",value:function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1}},{key:"getIntersectionAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]}}],[{key:"constructor_",value: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 j,this._intPt[1]=new j,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}},{key:"computeEdgeDistance",value: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 G.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o}},{key:"nonRobustComputeEdgeDistance",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return G.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o}}]),e}();Pe.DONT_INTERSECT=0,Pe.DO_INTERSECT=1,Pe.COLLINEAR=2,Pe.NO_INTERSECTION=0,Pe.POINT_INTERSECTION=1,Pe.COLLINEAR_INTERSECTION=2;var Ce=function(e){r(s,e);var o=c(s);function s(){return t(this,s),o.call(this)}return n(s,[{key:"isInSegmentEnvelopes",value:function(t){var e=new U(this._inputLines[0][0],this._inputLines[0][1]),n=new U(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}},{key:"computeIntersection",value:function(){if(3!==arguments.length)return f(i(s.prototype),"computeIntersection",this).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,U.intersects(e,n,t)&&0===ft.index(e,n,t)&&0===ft.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=Pe.POINT_INTERSECTION,null;this._result=Pe.NO_INTERSECTION}},{key:"intersection",value:function(t,e,n,r){var i=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(i)||(i=new j(s.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i}},{key:"checkDD",value:function(t,e,n,r,i){var o=ht.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);xt.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&xt.out.println("Distance = "+i.distance(o))}},{key:"intersectionSafe",value:function(t,e,n,r){var i=_t.intersection(t,e,n,r);return null===i&&(i=s.nearestEndpoint(t,e,n,r)),i}},{key:"computeCollinearIntersection",value:function(t,e,n,r){var i=U.intersects(t,e,n),o=U.intersects(t,e,r),s=U.intersects(n,r,t),a=U.intersects(n,r,e);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,Pe.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=t,this._intPt[1]=e,Pe.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||a?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||s?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):Pe.NO_INTERSECTION}},{key:"computeIntersect",value:function(t,e,n,r){if(this._isProper=!1,!U.intersects(t,e,n,r))return Pe.NO_INTERSECTION;var i=ft.index(t,e,n),o=ft.index(t,e,r);if(i>0&&o>0||i<0&&o<0)return Pe.NO_INTERSECTION;var s=ft.index(n,r,t),a=ft.index(n,r,e);return s>0&&a>0||s<0&&a<0?Pe.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,r):(0===i||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:0===i?this._intPt[0]=new j(n):0===o?this._intPt[0]=new j(r):0===s?this._intPt[0]=new j(t):0===a&&(this._intPt[0]=new j(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,r)),Pe.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(t,e,n,r){var i=t,o=kt.pointToSegment(t,n,r),s=kt.pointToSegment(e,n,r);return s<o&&(o=s,i=e),(s=kt.pointToSegment(n,t,e))<o&&(o=s,i=n),(s=kt.pointToSegment(r,t,e))<o&&(o=s,i=r),i}}]),s}(Pe),Te=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"countSegment",value: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=ft.index(t,e,this._p);if(i===ft.COLLINEAR)return this._isPointOnSegment=!0,null;e.y<t.y&&(i=-i),i===ft.LEFT&&this._crossingCount++}}},{key:"isPointInPolygon",value:function(){return this.getLocation()!==Z.EXTERIOR}},{key:"getLocation",value:function(){return this._isPointOnSegment?Z.BOUNDARY:this._crossingCount%2==1?Z.INTERIOR:Z.EXTERIOR}},{key:"isOnSegment",value:function(){return this._isPointOnSegment}}],[{key:"constructor_",value:function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}},{key:"locatePointInRing",value:function(){if(arguments[0]instanceof j&&ot(arguments[1],ct)){for(var t=arguments[1],n=new e(arguments[0]),r=new j,i=new j,o=1;o<t.size();o++)if(t.getCoordinate(o,r),t.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof j&&arguments[1]instanceof Array){for(var s=arguments[1],a=new e(arguments[0]),u=1;u<s.length;u++){var l=s[u],h=s[u-1];if(a.countSegment(l,h),a.isOnSegment())return a.getLocation()}return a.getLocation()}}}]),e}(),Oe=function(){function e(){t(this,e)}return n(e,null,[{key:"isOnLine",value:function(){if(arguments[0]instanceof j&&ot(arguments[1],ct)){for(var t=arguments[0],e=arguments[1],n=new Ce,r=new j,i=new j,o=e.size(),s=1;s<o;s++)if(e.getCoordinate(s-1,r),e.getCoordinate(s,i),n.computeIntersection(t,r,i),n.hasIntersection())return!0;return!1}if(arguments[0]instanceof j&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new Ce,h=1;h<u.length;h++){var c=u[h-1],f=u[h];if(l.computeIntersection(a,c,f),l.hasIntersection())return!0}return!1}}},{key:"locateInRing",value:function(t,e){return Te.locatePointInRing(t,e)}},{key:"isInRing",value:function(t,n){return e.locateInRing(t,n)!==Z.EXTERIOR}}]),e}(),Re=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setAllLocations",value:function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t}},{key:"isNull",value:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Z.NONE)return!1;return!0}},{key:"setAllLocationsIfNull",value:function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Z.NONE&&(this.location[e]=t)}},{key:"isLine",value:function(){return 1===this.location.length}},{key:"merge",value:function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[tt.ON]=this.location[tt.ON],e[tt.LEFT]=Z.NONE,e[tt.RIGHT]=Z.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===Z.NONE&&n<t.location.length&&(this.location[n]=t.location[n])}},{key:"getLocations",value:function(){return this.location}},{key:"flip",value:function(){if(this.location.length<=1)return null;var t=this.location[tt.LEFT];this.location[tt.LEFT]=this.location[tt.RIGHT],this.location[tt.RIGHT]=t}},{key:"toString",value:function(){var t=new st;return this.location.length>1&&t.append(Z.toLocationSymbol(this.location[tt.LEFT])),t.append(Z.toLocationSymbol(this.location[tt.ON])),this.location.length>1&&t.append(Z.toLocationSymbol(this.location[tt.RIGHT])),t.toString()}},{key:"setLocations",value:function(t,e,n){this.location[tt.ON]=t,this.location[tt.LEFT]=e,this.location[tt.RIGHT]=n}},{key:"get",value:function(t){return t<this.location.length?this.location[t]:Z.NONE}},{key:"isArea",value:function(){return this.location.length>1}},{key:"isAnyNull",value:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Z.NONE)return!0;return!1}},{key:"setLocation",value:function(){if(1===arguments.length){var t=arguments[0];this.setLocation(tt.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}}},{key:"init",value:function(t){this.location=new Array(t).fill(null),this.setAllLocations(Z.NONE)}},{key:"isEqualOnSide",value:function(t,e){return this.location[e]===t.location[e]}},{key:"allPositionsEqual",value:function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0}}],[{key:"constructor_",value:function(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[tt.ON]=n}else if(arguments[0]instanceof e){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[tt.ON]=o,this.location[tt.LEFT]=s,this.location[tt.RIGHT]=a}}}]),e}(),Ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getGeometryCount",value:function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t}},{key:"setAllLocations",value:function(t,e){this.elt[t].setAllLocations(e)}},{key:"isNull",value:function(t){return this.elt[t].isNull()}},{key:"setAllLocationsIfNull",value: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)}}},{key:"isLine",value:function(t){return this.elt[t].isLine()}},{key:"merge",value:function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])}},{key:"flip",value:function(){this.elt[0].flip(),this.elt[1].flip()}},{key:"getLocation",value:function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(tt.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}}},{key:"toString",value:function(){var t=new st;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()}},{key:"isArea",value: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()}}},{key:"isAnyNull",value:function(t){return this.elt[t].isAnyNull()}},{key:"setLocation",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(tt.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}}},{key:"isEqualOnSide",value:function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)}},{key:"allPositionsEqual",value:function(t,e){return this.elt[t].allPositionsEqual(e)}},{key:"toLine",value:function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))}}],[{key:"constructor_",value:function(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Re(t),this.elt[1]=new Re(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(Z.NONE),this.elt[1]=new Re(Z.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 Re(o,s,a),this.elt[1]=new Re(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new Re(Z.NONE,Z.NONE,Z.NONE),this.elt[1]=new Re(Z.NONE,Z.NONE,Z.NONE),this.elt[u].setLocations(l,h,c)}}},{key:"toLineLabel",value:function(t){for(var n=new e(Z.NONE),r=0;r<2;r++)n.setLocation(r,t.getLocation(r));return n}}]),e}(),De=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"computeRing",value: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=ft.isCCW(this._ring.getCoordinates())}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"computePoints",value:function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new gt("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new gt("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();G.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)}},{key:"getLinearRing",value:function(){return this._ring}},{key:"getCoordinate",value:function(t){return this._pts.get(t)}},{key:"computeMaxNodeDegree",value: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}},{key:"addPoints",value: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])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)}},{key:"containsPoint",value:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Oe.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0}},{key:"addHole",value:function(t){this._holes.add(t)}},{key:"isShell",value:function(){return null===this._shell}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value: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[1],n=arguments[0].getLocation(e,tt.RIGHT);if(n===Z.NONE)return null;if(this._label.getLocation(e)===Z.NONE)return this._label.setLocation(e,n),null}}},{key:"setShell",value:function(t){this._shell=t,null!==t&&t.addHole(this)}},{key:"toPolygon",value: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)}}],[{key:"constructor_",value:function(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new pt,this._pts=new pt,this._label=new Ae(Z.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new pt,this._geometryFactory=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}}}]),e}(),Fe=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"setEdgeRing",value:function(t,e){t.setMinEdgeRing(e)}},{key:"getNext",value:function(t){return t.getNextMin()}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];De.constructor_.call(this,t,e)}}]),o}(De),qe=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"buildMinimalRings",value:function(){var t=new pt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Fe(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t}},{key:"setEdgeRing",value:function(t,e){t.setEdgeRing(e)}},{key:"linkDirectedEdgesForMinimalEdgeRings",value:function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)}},{key:"getNext",value:function(t){return t.getNext()}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];De.constructor_.call(this,t,e)}}]),o}(De),Ge=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setVisited",value:function(t){this._isVisited=t}},{key:"setInResult",value:function(t){this._isInResult=t}},{key:"isCovered",value:function(){return this._isCovered}},{key:"isCoveredSet",value:function(){return this._isCoveredSet}},{key:"setLabel",value:function(t){this._label=t}},{key:"getLabel",value:function(){return this._label}},{key:"setCovered",value:function(t){this._isCovered=t,this._isCoveredSet=!0}},{key:"updateIM",value:function(t){G.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value: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}}}]),e}(),Ye=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"isIncidentEdgeInResult",value:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(t){t.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(t){}},{key:"computeMergedLocation",value:function(t,e){var n=Z.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Z.BOUNDARY&&(n=r)}return n}},{key:"setLabel",value:function(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return f(i(s.prototype),"setLabel",this).apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new Ae(t,e):this._label.setLocation(t,e)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof s){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Ae)for(var e=arguments[0],n=0;n<2;n++){var r=this.computeMergedLocation(e,n);this._label.getLocation(n)===Z.NONE&&this._label.setLocation(n,r)}}},{key:"add",value:function(t){this._edges.insert(t),t.setNode(this)}},{key:"setLabelBoundary",value:function(t){if(null===this._label)return null;var e=Z.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Z.BOUNDARY:n=Z.INTERIOR;break;case Z.INTERIOR:default:n=Z.BOUNDARY}this._label.setLocation(t,n)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new Ae(0,Z.NONE)}}]),s}(Ge),Be=function(e){r(i,e);var n=c(i);function i(){return t(this,i),n.apply(this,arguments)}return i}(ne);function ze(t){return null==t?0:t.color}function je(t){return null==t?null:t.parent}function Xe(t,e){null!==t&&(t.color=e)}function Ue(t){return null==t?null:t.left}function Ve(t){return null==t?null:t.right}var Ze=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).root_=null,e.size_=0,e}return n(o,[{key:"get",value: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}},{key:"put",value:function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,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:0,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}},{key:"fixAfterInsertion",value:function(t){var e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)je(t)===Ue(je(je(t)))?1===ze(e=Ve(je(je(t))))?(Xe(je(t),0),Xe(e,0),Xe(je(je(t)),1),t=je(je(t))):(t===Ve(je(t))&&(t=je(t),this.rotateLeft(t)),Xe(je(t),0),Xe(je(je(t)),1),this.rotateRight(je(je(t)))):1===ze(e=Ue(je(je(t))))?(Xe(je(t),0),Xe(e,0),Xe(je(je(t)),1),t=je(je(t))):(t===Ue(je(t))&&(t=je(t),this.rotateRight(t)),Xe(je(t),0),Xe(je(je(t)),1),this.rotateLeft(je(je(t))));this.root_.color=0}},{key:"values",value:function(){var t=new pt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=o.successor(e));)t.add(e.value);return t}},{key:"entrySet",value:function(){var t=new Q,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=o.successor(e));)t.add(e);return t}},{key:"rotateLeft",value: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}}},{key:"rotateRight",value: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}}},{key:"getFirstEntry",value:function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value: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!0;e=e.right}}return!1}}],[{key:"successor",value:function(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}]),o}(Be),He=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"find",value:function(t){return this.nodeMap.get(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof j){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 Ye){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}}},{key:"print",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(t){for(var e=new pt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Z.BOUNDARY&&e.add(r)}return e}},{key:"add",value:function(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_",value:function(){this.nodeMap=new Ze,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),e}(),We=function(){function e(){t(this,e)}return n(e,null,[{key:"isNorthern",value:function(t){return t===e.NE||t===e.NW}},{key:"isOpposite",value:function(t,e){return t!==e&&2==(t-e+4)%4}},{key:"commonHalfPlane",value: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}},{key:"isInHalfPlane",value:function(t,n){return n===e.SE?t===e.SE||t===e.SW:t===n||t===n+1}},{key:"quadrant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new _("Cannot compute the quadrant for point ( "+t+", "+n+" )");return t>=0?n>=0?e.NE:e.SE:n>=0?e.NW:e.SW}if(arguments[0]instanceof j&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new _("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?e.NE:e.SE:i.y>=r.y?e.NW:e.SW}}}]),e}();We.NE=0,We.NW=1,We.SW=2,We.SE=3;var Je=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareDirection",value:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:ft.index(t._p0,t._p1,this._p1)}},{key:"getDy",value:function(){return this._dy}},{key:"getCoordinate",value:function(){return this._p0}},{key:"setNode",value:function(t){this._node=t}},{key:"print",value: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)}},{key:"compareTo",value:function(t){var e=t;return this.compareDirection(e)}},{key:"getDirectedCoordinate",value:function(){return this._p1}},{key:"getDx",value:function(){return this._dx}},{key:"getLabel",value:function(){return this._label}},{key:"getEdge",value:function(){return this._edge}},{key:"getQuadrant",value:function(){return this._quadrant}},{key:"getNode",value:function(){return this._node}},{key:"toString",value: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}},{key:"computeLabel",value:function(t){}},{key:"init",value:function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=We.quadrant(this._dx,this._dy),G.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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 n=arguments[0],r=arguments[1],i=arguments[2];e.constructor_.call(this,n,r,i,null)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];e.constructor_.call(this,o),this.init(s,a),this._label=u}}}]),e}(),Ke=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getNextMin",value:function(){return this._nextMin}},{key:"getDepth",value:function(t){return this._depth[t]}},{key:"setVisited",value:function(t){this._isVisited=t}},{key:"computeDirectedLabel",value:function(){this._label=new Ae(this._edge.getLabel()),this._isForward||this._label.flip()}},{key:"getNext",value:function(){return this._next}},{key:"setDepth",value:function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new gt("assigned depths do not match",this.getCoordinate());this._depth[t]=e}},{key:"isInteriorAreaEdge",value:function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,tt.LEFT)===Z.INTERIOR&&this._label.getLocation(e,tt.RIGHT)===Z.INTERIOR||(t=!1);return t}},{key:"setNextMin",value:function(t){this._nextMin=t}},{key:"print",value:function(t){f(i(s.prototype),"print",this).call(this,t),t.print(" "+this._depth[tt.LEFT]+"/"+this._depth[tt.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")}},{key:"setMinEdgeRing",value:function(t){this._minEdgeRing=t}},{key:"isLineEdge",value:function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Z.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,Z.EXTERIOR);return t&&e&&n}},{key:"setEdgeRing",value:function(t){this._edgeRing=t}},{key:"getMinEdgeRing",value:function(){return this._minEdgeRing}},{key:"getDepthDelta",value:function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t}},{key:"setInResult",value:function(t){this._isInResult=t}},{key:"getSym",value:function(){return this._sym}},{key:"isForward",value:function(){return this._isForward}},{key:"getEdge",value:function(){return this._edge}},{key:"printEdge",value:function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)}},{key:"setSym",value:function(t){this._sym=t}},{key:"setVisitedEdge",value:function(t){this.setVisited(t),this._sym.setVisited(t)}},{key:"setEdgeDepths",value:function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===tt.LEFT&&(r=-1);var i=tt.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)}},{key:"getEdgeRing",value:function(){return this._edgeRing}},{key:"isInResult",value:function(){return this._isInResult}},{key:"setNext",value:function(t){this._next=t}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(Je.constructor_.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()}},{key:"depthFactor",value:function(t,e){return t===Z.EXTERIOR&&e===Z.INTERIOR?1:t===Z.INTERIOR&&e===Z.EXTERIOR?-1:0}}]),s}(Je),Qe=function(){function e(){t(this,e)}return n(e,[{key:"createNode",value:function(t){return new Ye(t,null)}}]),e}(),$e=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"printEdges",value: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)}}},{key:"find",value:function(t){return this._nodes.find(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof Ye){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof j){var e=arguments[0];return this._nodes.addNode(e)}}},{key:"getNodeIterator",value:function(){return this._nodes.iterator()}},{key:"linkResultDirectedEdges",value:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()}},{key:"debugPrintln",value:function(t){xt.out.println(t)}},{key:"isBoundaryNode",value:function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===Z.BOUNDARY}},{key:"linkAllDirectedEdges",value:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()}},{key:"matchInSameDirection",value:function(t,e,n,r){return!!t.equals(n)&&ft.index(t,e,r)===ft.COLLINEAR&&We.quadrant(t,e)===We.quadrant(n,r)}},{key:"getEdgeEnds",value:function(){return this._edgeEndList}},{key:"debugPrint",value:function(t){xt.out.print(t)}},{key:"getEdgeIterator",value:function(){return this._edges.iterator()}},{key:"findEdgeInSameDirection",value: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}},{key:"insertEdge",value:function(t){this._edges.add(t)}},{key:"findEdgeEnd",value:function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null}},{key:"addEdges",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ke(n,!0),i=new Ke(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}}},{key:"add",value:function(t){this._nodes.add(t),this._edgeEndList.add(t)}},{key:"getNodes",value:function(){return this._nodes.values()}},{key:"findEdge",value: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}}],[{key:"constructor_",value:function(){if(this._edges=new pt,this._nodes=null,this._edgeEndList=new pt,0===arguments.length)this._nodes=new He(new Qe);else if(1===arguments.length){var t=arguments[0];this._nodes=new He(t)}}},{key:"linkResultDirectedEdges",value:function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()}}]),e}(),tn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"sortShellsAndHoles",value:function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}}},{key:"computePolygons",value:function(t){for(var e=new pt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e}},{key:"placeFreeHoles",value:function(t,n){for(var r=n.iterator();r.hasNext();){var i=r.next();if(null===i.getShell()){var o=e.findEdgeRingContaining(i,t);if(null===o)throw new gt("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(o)}}}},{key:"buildMinimalEdgeRings",value:function(t,e,n){for(var r=new pt,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}},{key:"buildMaximalEdgeRings",value:function(t){for(var e=new pt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new qe(r,this._geometryFactory);e.add(i),i.setInResult()}}return e}},{key:"placePolygonHoles",value:function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return G.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value: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];$e.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new pt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new pt;var t=arguments[0];this._geometryFactory=t}},{key:"findEdgeRingContaining",value: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(),l=u.getLinearRing(),h=l.getEnvelopeInternal();if(!h.equals(r)&&h.contains(r)){i=Wt.ptNotInList(n.getCoordinates(),l.getCoordinates());var c=!1;Oe.isInRing(i,l.getCoordinates())&&(c=!0),c&&(null===o||s.contains(h))&&(s=(o=u).getLinearRing().getEnvelopeInternal())}}return o}}]),e}(),en=function(){function e(){t(this,e)}return n(e,[{key:"getBounds",value:function(){}}]),e}(),nn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[en,b]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}}]),e}(),rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"poll",value: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}},{key:"size",value:function(){return this._size}},{key:"reorder",value: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)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return 0===this._size}},{key:"add",value: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)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new pt,this._items.add(null)}}]),e}(),on=function(){function e(){t(this,e)}return n(e,[{key:"insert",value:function(t,e){}},{key:"remove",value:function(t,e){}},{key:"query",value:function(){}}]),e}(),sn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(t){G.isTrue(null===this._bounds),this._childBoundables.add(t)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[en,b]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new pt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}}]),e}(),an={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return an.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?At.sort(n,e):At.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},singletonList:function(t){var e=new pt;return e.add(t),e}},un=function(){function e(){t(this,e)}return n(e,null,[{key:"maxDistance",value:function(t,n,r,i,o,s,a,u){var l=e.distance(t,n,o,s);return l=Math.max(l,e.distance(t,n,a,u)),l=Math.max(l,e.distance(r,i,o,s)),Math.max(l,e.distance(r,i,a,u))}},{key:"distance",value:function(t,e,n,r){var i=n-t,o=r-e;return Math.sqrt(i*i+o*o)}},{key:"maximumDistance",value:function(t,n){var r=Math.min(t.getMinX(),n.getMinX()),i=Math.min(t.getMinY(),n.getMinY()),o=Math.max(t.getMaxX(),n.getMaxX()),s=Math.max(t.getMaxY(),n.getMaxY());return e.distance(r,i,o,s)}},{key:"minMaxDistance",value:function(t,n){var r=t.getMinX(),i=t.getMinY(),o=t.getMaxX(),s=t.getMaxY(),a=n.getMinX(),u=n.getMinY(),l=n.getMaxX(),h=n.getMaxY(),c=e.maxDistance(r,i,r,s,a,u,a,h);return c=Math.min(c,e.maxDistance(r,i,r,s,a,u,l,u)),c=Math.min(c,e.maxDistance(r,i,r,s,l,h,a,h)),c=Math.min(c,e.maxDistance(r,i,r,s,l,h,l,u)),c=Math.min(c,e.maxDistance(r,i,o,i,a,u,a,h)),c=Math.min(c,e.maxDistance(r,i,o,i,a,u,l,u)),c=Math.min(c,e.maxDistance(r,i,o,i,l,h,a,h)),c=Math.min(c,e.maxDistance(r,i,o,i,l,h,l,u)),c=Math.min(c,e.maxDistance(o,s,r,s,a,u,a,h)),c=Math.min(c,e.maxDistance(o,s,r,s,a,u,l,u)),c=Math.min(c,e.maxDistance(o,s,r,s,l,h,a,h)),c=Math.min(c,e.maxDistance(o,s,r,s,l,h,l,u)),c=Math.min(c,e.maxDistance(o,s,o,i,a,u,a,h)),c=Math.min(c,e.maxDistance(o,s,o,i,a,u,l,u)),c=Math.min(c,e.maxDistance(o,s,o,i,l,h,a,h)),Math.min(c,e.maxDistance(o,s,o,i,l,h,l,u))}}]),e}(),ln=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"maximumDistance",value:function(){return un.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}},{key:"expandToQueue",value:function(t,n){var r=e.isComposite(this._boundable1),i=e.isComposite(this._boundable2);if(r&&i)return e.area(this._boundable1)>e.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,t,n),null):(this.expand(this._boundable2,this._boundable1,!0,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,!1,t,n),null;if(i)return this.expand(this._boundable2,this._boundable1,!0,t,n),null;throw new _("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(e.isComposite(this._boundable1)||e.isComposite(this._boundable2))}},{key:"compareTo",value:function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0}},{key:"expand",value:function(t,n,r,i,o){for(var s=t.getChildBoundables().iterator();s.hasNext();){var a=s.next(),u=null;(u=r?new e(n,a,this._itemDistance):new e(a,n,this._itemDistance)).getDistance()<o&&i.add(u)}}},{key:"getBoundable",value:function(t){return 0===t?this._boundable1:this._boundable2}},{key:"getDistance",value:function(){return this._distance}},{key:"distance",value:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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()}},{key:"area",value:function(t){return t.getBounds().getArea()}},{key:"isComposite",value:function(t){return t instanceof sn}}]),e}(),hn=function(){function e(){t(this,e)}return n(e,[{key:"visitItem",value:function(t){}}]),e}(),cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"queryInternal",value:function(){if(ot(arguments[2],hn)&&arguments[0]instanceof Object&&arguments[1]instanceof sn)for(var t=arguments[0],e=arguments[2],n=arguments[1].getChildBoundables(),r=0;r<n.size();r++){var i=n.get(r);this.getIntersectsOp().intersects(i.getBounds(),t)&&(i instanceof sn?this.queryInternal(t,i,e):i instanceof nn?e.visitItem(i.getItem()):G.shouldNeverReachHere())}else if(ot(arguments[2],rt)&&arguments[0]instanceof Object&&arguments[1]instanceof sn)for(var o=arguments[0],s=arguments[2],a=arguments[1].getChildBoundables(),u=0;u<a.size();u++){var l=a.get(u);this.getIntersectsOp().intersects(l.getBounds(),o)&&(l instanceof sn?this.queryInternal(o,l,s):l instanceof nn?s.add(l.getItem()):G.shouldNeverReachHere())}}},{key:"getNodeCapacity",value:function(){return this._nodeCapacity}},{key:"lastNode",value:function(t){return t.get(t.size()-1)}},{key:"size",value: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 sn?t+=this.size(n):n instanceof nn&&(t+=1)}return t}}},{key:"removeItem",value:function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof nn&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)}},{key:"itemsTree",value:function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new pt:t}if(1===arguments.length){for(var e=arguments[0],n=new pt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof sn){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof nn?n.add(i.getItem()):G.shouldNeverReachHere()}return n.size()<=0?null:n}}},{key:"insert",value:function(t,e){G.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new nn(t,e))}},{key:"boundablesAtLevel",value:function(){if(1===arguments.length){var t=arguments[0],e=new pt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(G.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 sn?this.boundablesAtLevel(n,s,i):(G.isTrue(s instanceof nn),-1===n&&i.add(s))}return null}}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new pt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(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.queryInternal(n,this._root,r)}}},{key:"build",value: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}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value: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 sn&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}}},{key:"createHigherLevels",value:function(t,e){G.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}},{key:"depth",value: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 sn){var r=this.depth(n);r>t&&(t=r)}}return t+1}}},{key:"createParentBoundables",value:function(t,e){G.isTrue(!t.isEmpty());var n=new pt;n.add(this.createNode(e));var r=new pt(t);an.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}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new pt,this._nodeCapacity=null,0===arguments.length)e.constructor_.call(this,e.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];G.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}},{key:"compareDoubles",value:function(t,e){return t>e?1:t<e?-1:0}}]),e}();cn.IntersectsOp=function(){},cn.DEFAULT_NODE_CAPACITY=10;var fn=function(){function e(){t(this,e)}return n(e,[{key:"distance",value:function(t,e){}}]),e}(),vn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"createParentBoundablesFromVerticalSlices",value:function(t,e){G.isTrue(t.length>0);for(var n=new pt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n}},{key:"nearestNeighbourK",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.nearestNeighbourK(t,A.POSITIVE_INFINITY,e)}if(3===arguments.length){var n=arguments[0],r=arguments[2],i=arguments[1],o=new rn;o.add(n);for(var a=new rn;!o.isEmpty()&&i>=0;){var u=o.poll(),l=u.getDistance();if(l>=i)break;u.isLeaves()?a.size()<r?a.add(u):(a.peek().getDistance()>l&&(a.poll(),a.add(u)),i=a.peek().getDistance()):u.expandToQueue(o,i)}return s.getItems(a)}}},{key:"createNode",value:function(t){return new gn(t)}},{key:"size",value:function(){return 0===arguments.length?f(i(s.prototype),"size",this).call(this):f(i(s.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof U))return f(i(s.prototype),"insert",this).apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;f(i(s.prototype),"insert",this).call(this,t,e)}},{key:"getIntersectsOp",value:function(){return s.intersectsOp}},{key:"verticalSlices",value: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 pt;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];return f(i(s.prototype),"query",this).call(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];f(i(s.prototype),"query",this).call(this,e,n)}}},{key:"getComparator",value:function(){return s.yComparator}},{key:"createParentBoundablesFromVerticalSlice",value:function(t,e){return f(i(s.prototype),"createParentBoundables",this).call(this,t,e)}},{key:"remove",value:function(){if(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof U){var t=arguments[0],e=arguments[1];return f(i(s.prototype),"remove",this).call(this,t,e)}return f(i(s.prototype),"remove",this).apply(this,arguments)}},{key:"depth",value:function(){return 0===arguments.length?f(i(s.prototype),"depth",this).call(this):f(i(s.prototype),"depth",this).apply(this,arguments)}},{key:"createParentBoundables",value:function(t,e){G.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),r=new pt(t);an.sort(r,s.xComparator);var i=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(i,e)}},{key:"nearestNeighbour",value:function(){if(1===arguments.length){if(ot(arguments[0],fn)){var t=arguments[0];if(this.isEmpty())return null;var e=new ln(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof ln){var n=arguments[0],r=A.POSITIVE_INFINITY,i=null,o=new rn;for(o.add(n);!o.isEmpty()&&r>0;){var s=o.poll(),a=s.getDistance();if(a>=r)break;s.isLeaves()?(r=a,i=s):s.expandToQueue(o,r)}return null===i?null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var h=new ln(this.getRoot(),u.getRoot(),l);return this.nearestNeighbour(h)}if(3===arguments.length){var c=arguments[2],f=new nn(arguments[0],arguments[1]),v=new ln(this.getRoot(),f,c);return this.nearestNeighbour(v)[0]}if(4===arguments.length){var g=arguments[2],d=arguments[3],p=new nn(arguments[0],arguments[1]),y=new ln(this.getRoot(),p,g);return this.nearestNeighbourK(y,d)}}}},{key:"isWithinDistance",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=A.POSITIVE_INFINITY,r=new rn;for(r.add(t);!r.isEmpty();){var i=r.poll(),o=i.getDistance();if(o>e)return!1;if(i.maximumDistance()<=e)return!0;if(i.isLeaves()){if((n=o)<=e)return!0}else i.expandToQueue(r,n)}return!1}if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=new ln(this.getRoot(),s.getRoot(),a);return this.isWithinDistance(l,u)}}},{key:"interfaces_",get:function(){return[on,b]}}],[{key:"constructor_",value:function(){if(0===arguments.length)s.constructor_.call(this,s.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];cn.constructor_.call(this,t)}}},{key:"centreX",value:function(t){return s.avg(t.getMinX(),t.getMaxX())}},{key:"avg",value:function(t,e){return(t+e)/2}},{key:"getItems",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;!t.isEmpty();){var r=t.poll();e[n]=r.getBoundable(0).getItem(),n++}return e}},{key:"centreY",value:function(t){return s.avg(t.getMinY(),t.getMaxY())}}]),s}(cn),gn=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"computeBounds",value:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new U(n.getBounds()):t.expandToInclude(n.getBounds())}return t}}],[{key:"constructor_",value:function(){var t=arguments[0];sn.constructor_.call(this,t)}}]),o}(sn);vn.STRtreeNode=gn,vn.xComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[D]}},{key:"compare",value:function(t,e){return cn.compareDoubles(vn.centreX(t.getBounds()),vn.centreX(e.getBounds()))}}]),e}()),vn.yComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[D]}},{key:"compare",value:function(t,e){return cn.compareDoubles(vn.centreY(t.getBounds()),vn.centreY(e.getBounds()))}}]),e}()),vn.intersectsOp=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(t,e){return t.intersects(e)}}]),e}()),vn.DEFAULT_NODE_CAPACITY=10;var dn=function(){function e(){t(this,e)}return n(e,null,[{key:"relativeSign",value:function(t,e){return t<e?-1:t>e?1:0}},{key:"compare",value:function(t,n,r){if(n.equals2D(r))return 0;var i=e.relativeSign(n.x,r.x),o=e.relativeSign(n.y,r.y);switch(t){case 0:return e.compareValue(i,o);case 1:return e.compareValue(o,i);case 2:return e.compareValue(o,-i);case 3:return e.compareValue(-i,o);case 4:return e.compareValue(-i,-o);case 5:return e.compareValue(-o,-i);case 6:return e.compareValue(-o,i);case 7:return e.compareValue(i,-o)}return G.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}]),e}(),pn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?dn.compare(this._segmentOctant,this.coord,e.coord):1:-1}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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 j(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),e}(),yn=function(){function e(){t(this,e)}return n(e,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),e}(),mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSplitCoordinates",value:function(){var t=new Ht;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()}},{key:"addCollapsedNodes",value:function(){var t=new pt;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)}}},{key:"createSplitEdgePts",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new j(t.coord),new j(e.coord)];var 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 j(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new j(e.coord)),o}},{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"findCollapsesFromExistingVertices",value:function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e);this._edge.getCoordinate(e+1);var r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(at.valueOf(e+1))}}},{key:"addEdgeCoordinates",value:function(t,e,n){var r=this.createSplitEdgePts(t,e);n.add(r,!1)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value: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}}},{key:"findCollapseIndex",value: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)}},{key:"findCollapsesFromInsertedNodes",value: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(at.valueOf(e[0])),r=i}}},{key:"getEdge",value:function(){return this._edge}},{key:"addEndpoints",value:function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)}},{key:"createSplitEdge",value:function(t,e){var n=this.createSplitEdgePts(t,e);return new kn(n,this._edge.getData())}},{key:"add",value:function(t,e){var n=new pn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(G.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)}},{key:"checkSplitEdgesCorrectness",value:function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new F("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 F("bad split edge end point at "+i)}}],[{key:"constructor_",value:function(){this._nodeMap=new Ze,this._edge=null;var t=arguments[0];this._edge=t}}]),e}(),_n=function(){function e(){t(this,e)}return n(e,null,[{key:"octant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new _("Cannot compute the octant for point ( "+t+", "+n+" )");var r=Math.abs(t),i=Math.abs(n);return t>=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}if(arguments[0]instanceof j&&arguments[1]instanceof j){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new _("Cannot compute the octant for two identical points "+o);return e.octant(a,u)}}}]),e}(),xn=function(){function e(){t(this,e)}return n(e,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(t){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(t){}},{key:"getData",value:function(){}}]),e}(),En=function(){function e(){t(this,e)}return n(e,[{key:"addIntersection",value:function(t,e){}},{key:"interfaces_",get:function(){return[xn]}}]),e}(),kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(t){return this._pts[t]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}},{key:"setData",value:function(t){this._data=t}},{key:"safeOctant",value:function(t,e){return t.equals2D(e)?0:_n.octant(t,e)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new j(arguments[0].getIntersection(r));this.addIntersection(i,n)}}},{key:"toString",value:function(){return Le.toLineString(new $t(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value: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)}},{key:"addIntersections",value:function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)}},{key:"interfaces_",get:function(){return[En]}}],[{key:"constructor_",value:function(){this._nodeList=new mn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}},{key:"getNodedSubstrings",value:function(){if(1===arguments.length){var t=arguments[0],n=new pt;return e.getNodedSubstrings(t,n),n}if(2===arguments.length)for(var r=arguments[1],i=arguments[0].iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)}}]),e}(),wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"minX",value:function(){return Math.min(this.p0.x,this.p1.x)}},{key:"orientationIndex",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=ft.index(this.p0,this.p1,t.p0),r=ft.index(this.p0,this.p1,t.p1);return n>=0&&r>=0||n<=0&&r<=0?Math.max(n,r):0}if(arguments[0]instanceof j){var i=arguments[0];return ft.index(this.p0,this.p1,i)}}},{key:"toGeometry",value:function(t){return t.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)}},{key:"intersection",value:function(t){var e=new Ce;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof j){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new j(t);var n=this.projectionFactor(t),r=new j;return r.x=this.p0.x+n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof e){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1)return null;if(o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new e(a,u)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(t){return 0===t?this.p0:this.p1}},{key:"distancePerpendicular",value:function(t){return kt.pointToLinePerpendicular(t,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return e.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value: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?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r}},{key:"closestPoints",value:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=A.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}},{key:"closestPoint",value: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}},{key:"maxX",value:function(){return Math.max(this.p0.x,this.p1.x)}},{key:"getLength",value:function(){return this.p0.distance(this.p1)}},{key:"compareTo",value:function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)}},{key:"reverse",value:function(){var t=this.p0;this.p0=this.p1,this.p1=t}},{key:"equalsTopo",value:function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)}},{key:"lineIntersection",value:function(t){return _t.intersection(this.p0,this.p1,t.p0,t.p1)}},{key:"maxY",value:function(){return Math.max(this.p0.y,this.p1.y)}},{key:"pointAlongOffset",value: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 IllegalStateException("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new j(n-u,r+a)}},{key:"setCoordinates",value: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}}},{key:"segmentFraction",value:function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||A.isNaN(e))&&(e=1),e}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),r=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),i=e*e+n*n,o=e*e-n*n,s=t.getX(),a=t.getY();return new j((-o*s-2*e*n*a-2*e*r)/i,(o*a-2*e*n*s-2*n*r)/i)}},{key:"distance",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return kt.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof j){var n=arguments[0];return kt.pointToSegment(n,this.p0,this.p1)}}},{key:"pointAlong",value:function(t){var e=new j;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}},{key:"hashCode",value:function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=A.doubleToLongBits(this.p1.x);return n^=31*A.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)}},{key:"interfaces_",get:function(){return[k,b]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,0===arguments.length)e.constructor_.call(this,new j,new j);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.p0,t.p1)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.p0=n,this.p1=r}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];e.constructor_.call(this,new j(i,o),new j(s,a))}}},{key:"midPoint",value:function(t,e){return new j((t.x+e.x)/2,(t.y+e.y)/2)}}]),e}(),bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"overlap",value:function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new wn,this._overlapSeg2=new wn}}]),e}(),In=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLineSegment",value:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}},{key:"computeSelect",value:function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(n-e==1)return r.select(this,e),null;if(!t.intersects(i,o))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)}},{key:"getCoordinates",value: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}},{key:"computeOverlaps",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.computeOverlaps(this._start,this._end,t,t._start,t._end,e)}else if(6===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=arguments[5];if(r-n==1&&s-o==1)return a.overlap(this,n,i,o),null;if(!this.overlaps(n,r,i,o,s))return null;var u=Math.trunc((n+r)/2),l=Math.trunc((o+s)/2);n<u&&(o<l&&this.computeOverlaps(n,u,i,o,l,a),l<s&&this.computeOverlaps(n,u,i,l,s,a)),u<r&&(o<l&&this.computeOverlaps(u,r,i,o,l,a),l<s&&this.computeOverlaps(u,r,i,l,s,a))}}},{key:"setId",value:function(t){this._id=t}},{key:"select",value:function(t,e){this.computeSelect(t,this._start,this._end,e)}},{key:"getEnvelope",value:function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new U(t,e)}return this._env}},{key:"overlaps",value:function(t,e,n,r,i){return U.intersects(this._pts[t],this._pts[e],n._pts[r],n._pts[i])}},{key:"getEndIndex",value:function(){return this._end}},{key:"getStartIndex",value:function(){return this._start}},{key:"getContext",value:function(){return this._context}},{key:"getId",value:function(){return this._id}}],[{key:"constructor_",value: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}}]),e}(),Nn=function(){function e(){t(this,e)}return n(e,null,[{key:"findChainEnd",value: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=We.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||We.quadrant(t[i-1],t[i])===r);)i++;return i-1}},{key:"getChains",value:function(){if(1===arguments.length){var t=arguments[0];return e.getChains(t,null)}if(2===arguments.length){var n=arguments[0],r=arguments[1],i=new pt,o=0;do{var s=e.findChainEnd(n,o),a=new In(n,o,s,r);i.add(a),o=s}while(o<n.length-1);return i}}}]),e}(),Sn=function(){function e(){t(this,e)}return n(e,[{key:"computeNodes",value:function(t){}},{key:"getNodedSubstrings",value:function(){}}]),e}(),Mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setSegmentIntersector",value:function(t){this._segInt=t}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value:function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}}]),e}(),Ln=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getMonotoneChains",value:function(){return this._monoChains}},{key:"getNodedSubstrings",value:function(){return kn.getNodedSubstrings(this._nodedSegStrings)}},{key:"getIndex",value:function(){return this._index}},{key:"add",value:function(t){for(var e=Nn.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)}}},{key:"computeNodes",value:function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()}},{key:"intersectChains",value:function(){for(var t=new Pn(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}}}],[{key:"constructor_",value:function(){if(this._monoChains=new pt,this._index=new vn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];Mn.constructor_.call(this,t)}}}]),o}(Mn),Pn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"overlap",value:function(){if(4!==arguments.length)return f(i(s.prototype),"overlap",this).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),o=e.getContext();this._si.processIntersections(r,t,o,n)}}],[{key:"constructor_",value:function(){this._si=null;var t=arguments[0];this._si=t}}]),s}(bn);Ln.SegmentOverlapAction=Pn;var Cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isDeletable",value: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)}},{key:"deleteShallowConcavities",value:function(){for(var t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),i=!1;r<this._inputLine.length;){var o=!1;this.isDeletable(t,n,r,this._distanceTol)&&(this._isDeleted[n]=e.DELETE,o=!0,i=!0),t=o?r:n,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n)}return i}},{key:"isShallowConcavity",value:function(t,e,n,r){return ft.index(t,e,n)===this._angleOrientation&&kt.pointToSegment(e,t,n)<r}},{key:"isShallowSampled",value:function(t,n,r,i,o){var s=Math.trunc((i-r)/e.NUM_PTS_TO_CHECK);s<=0&&(s=1);for(var a=r;a<i;a+=s)if(!this.isShallow(t,n,this._inputLine[a],o))return!1;return!0}},{key:"isConcave",value:function(t,e,n){return ft.index(t,e,n)===this._angleOrientation}},{key:"simplify",value:function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=ft.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()}},{key:"findNextNonDeletedIndex",value:function(t){for(var n=t+1;n<this._inputLine.length&&this._isDeleted[n]===e.DELETE;)n++;return n}},{key:"isShallow",value:function(t,e,n,r){return kt.pointToSegment(e,t,n)<r}},{key:"collapseLine",value:function(){for(var t=new Ht,n=0;n<this._inputLine.length;n++)this._isDeleted[n]!==e.DELETE&&t.add(this._inputLine[n]);return t.toCoordinateArray()}}],[{key:"constructor_",value:function(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ft.COUNTERCLOCKWISE;var t=arguments[0];this._inputLine=t}},{key:"simplify",value:function(t,n){return new e(t).simplify(n)}}]),e}();Cn.INIT=0,Cn.DELETE=1,Cn.KEEP=1,Cn.NUM_PTS_TO_CHECK=10;var Tn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._ptList.toArray(e.COORDINATE_ARRAY_TYPE)}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"addPt",value:function(t){var e=new j(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)}},{key:"reverse",value:function(){}},{key:"addPts",value: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])}},{key:"isRedundant",value:function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance}},{key:"toString",value:function(){return(new ae).createLineString(this.getCoordinates()).toString()}},{key:"closeRing",value:function(){if(this._ptList.size()<1)return null;var t=new j(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)}},{key:"setMinimumVertexDistance",value:function(t){this._minimimVertexDistance=t}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new pt}}]),e}();Tn.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);var On=function(){function e(){t(this,e)}return n(e,null,[{key:"toDegrees",value:function(t){return 180*t/Math.PI}},{key:"normalize",value:function(t){for(;t>Math.PI;)t-=e.PI_TIMES_2;for(;t<=-Math.PI;)t+=e.PI_TIMES_2;return t}},{key:"angle",value: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)}}},{key:"isAcute",value: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}},{key:"isObtuse",value: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}},{key:"interiorAngle",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return Math.abs(o-i)}},{key:"normalizePositive",value:function(t){if(t<0){for(;t<0;)t+=e.PI_TIMES_2;t>=e.PI_TIMES_2&&(t=0)}else{for(;t>=e.PI_TIMES_2;)t-=e.PI_TIMES_2;t<0&&(t=0)}return t}},{key:"angleBetween",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return e.diff(i,o)}},{key:"diff",value:function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(t){return t*Math.PI/180}},{key:"getTurn",value:function(t,n){var r=Math.sin(n-t);return r>0?e.COUNTERCLOCKWISE:r<0?e.CLOCKWISE:e.NONE}},{key:"angleBetweenOriented",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r)-i;return o<=-Math.PI?o+e.PI_TIMES_2:o>Math.PI?o-e.PI_TIMES_2:o}}]),e}();On.PI_TIMES_2=2*Math.PI,On.PI_OVER_2=Math.PI/2,On.PI_OVER_4=Math.PI/4,On.COUNTERCLOCKWISE=ft.COUNTERCLOCKWISE,On.CLOCKWISE=ft.CLOCKWISE,On.NONE=ft.COLLINEAR;var Rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addNextSegment",value: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=ft.index(this._s0,this._s1,this._s2),r=n===ft.CLOCKWISE&&this._side===tt.LEFT||n===ft.COUNTERCLOCKWISE&&this._side===tt.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}},{key:"addLineEndCap",value:function(t,e){var n=new wn(t,e),r=new wn;this.computeOffsetSegment(n,tt.LEFT,this._distance,r);var i=new wn;this.computeOffsetSegment(n,tt.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 y.CAP_ROUND:this._segList.addPt(r.p1),this.addDirectedFillet(e,a+Math.PI/2,a-Math.PI/2,ft.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case y.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case y.CAP_SQUARE:var u=new j;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new j(r.p1.x+u.x,r.p1.y+u.y),h=new j(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(h)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(t,e,n,r){var i=_t.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==i&&(r<=0?1:i.distance(t)/Math.abs(r))<=this._bufParams.getMitreLimit())return this._segList.addPt(i),null;this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(t,n){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*e.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===y.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===y.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(n&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))}},{key:"createSquare",value:function(t){this._segList.addPt(new j(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new j(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new j(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new j(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()}},{key:"addSegments",value:function(t,e){this._segList.addPts(t,e)}},{key:"addFirstSegment",value:function(){this._segList.addPt(this._offset1.p0)}},{key:"addCornerFillet",value: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,l=n.y-t.y,h=Math.atan2(l,u);r===ft.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,a,h,r,i),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value: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)}},{key:"addLimitedMitreJoin",value: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),l=r*n,h=n-l*Math.abs(Math.sin(s)),c=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),v=new j(c,f),g=new wn(i,v),d=g.pointAlongOffset(1,h),p=g.pointAlongOffset(1,-h);this._side===tt.LEFT?(this._segList.addPt(d),this._segList.addPt(p)):(this._segList.addPt(p),this._segList.addPt(d))}},{key:"addDirectedFillet",value:function(t,e,n,r,i){var o=r===ft.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,l=new j,h=0;h<a;h++){var c=e+o*h*u;l.x=t.x+i*Math.cos(c),l.y=t.y+i*Math.sin(c),this._segList.addPt(l)}}},{key:"computeOffsetSegment",value:function(t,e,n,r){var i=e===tt.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,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u}},{key:"addInsideTurn",value:function(t,n){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*e.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new j((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(r);var i=new j((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(t){var e=new j(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}},{key:"init",value:function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Tn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*e.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===y.JOIN_BEVEL||this._bufParams.getJoinStyle()===y.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ft.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){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 wn,this._seg1=new wn,this._offset0=new wn,this._offset1=new wn,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new Ce,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===y.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}}]),e}();Rn.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Rn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Rn.MAX_CLOSING_SEG_LEN_FACTOR=80;var An=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getOffsetCurve",value: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}},{key:"computeSingleSidedBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],tt.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);e===tt.RIGHT&&(r=-r);var i=Cn.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()}},{key:"computeLineBufferCurve",value:function(t,e){var n=this.simplifyTolerance(this._distance),r=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],tt.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],tt.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()}},{key:"computePointCurve",value:function(t,e){switch(this._bufParams.getEndCapStyle()){case y.CAP_ROUND:e.createCircle(t);break;case y.CAP_SQUARE:e.createSquare(t)}}},{key:"getLineCurve",value:function(t,e){if(this._distance=e,this.isLineOffsetEmpty(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()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(t){return t*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return e.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,n,i),i.getCoordinates()}},{key:"computeOffsetCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],tt.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(t){return new Rn(this._precisionModel,this._bufParams,t)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}},{key:"copyCoordinates",value:function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new j(t[n]);return e}}]),e}(),Dn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"findStabbedSegments",value:function(){if(1===arguments.length){for(var t=arguments[0],e=new pt,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(ot(arguments[2],rt)&&arguments[0]instanceof j&&arguments[1]instanceof Ke){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+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||ft.index(this._seg.p0,this._seg.p1,o)===ft.RIGHT)){var h=s.getDepth(tt.LEFT);this._seg.p0.equals(u[l])||(h=s.getDepth(tt.RIGHT));var c=new Fn(this._seg,h);a.add(c)}}else if(ot(arguments[2],rt)&&arguments[0]instanceof j&&ot(arguments[1],rt))for(var f=arguments[0],v=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(f,d,v)}}},{key:"getDepth",value:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:an.min(e)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new wn;var t=arguments[0];this._subgraphs=t}}]),e}(),Fn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value: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)}},{key:"compareX",value:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new wn(t),this._leftDepth=e}}]),e}();Dn.DepthSegment=Fn;var qn=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){m.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),o}(m),Gn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getY",value:function(){var t=this.y/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new qn;return t}},{key:"getX",value:function(){var t=this.x/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new qn;return t}},{key:"getCoordinate",value:function(){var t=new j;return t.x=this.getX(),t.y=this.getY(),t}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){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 j&&arguments[1]instanceof j){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],l=arguments[1],h=arguments[2];this.x=u,this.y=l,this.w=h}else if(4===arguments.length){var c=arguments[0],f=arguments[1],v=arguments[2],g=arguments[3],d=c.y-f.y,p=f.x-c.x,y=c.x*f.y-f.x*c.y,m=v.y-g.y,_=g.x-v.x,x=v.x*g.y-g.x*v.y;this.x=p*x-_*y,this.y=m*y-d*x,this.w=d*_-m*p}}}]),e}(),Yn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"area",value:function(){return e.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return e.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(t){if(null===t)throw new _("Supplied point is null.");return e.interpolateZ(t,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return e.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return e.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return e.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return e.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return e.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return e.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}},{key:"area",value:function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)}},{key:"signedArea",value:function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2}},{key:"det",value:function(t,e,n,r){return t*r-e*n}},{key:"interpolateZ",value:function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,h=s*l-a*u,c=t.x-i,f=t.y-o,v=(l*c-a*f)/h,g=(-u*c+s*f)/h;return e.getZ()+v*(n.getZ()-e.getZ())+g*(r.getZ()-e.getZ())}},{key:"longestSideLength",value: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}},{key:"circumcentreDD",value:function(t,e,n){var r=lt.valueOf(t.x).subtract(n.x),i=lt.valueOf(t.y).subtract(n.y),o=lt.valueOf(e.x).subtract(n.x),s=lt.valueOf(e.y).subtract(n.y),a=lt.determinant(r,i,o,s).multiply(2),u=r.sqr().add(i.sqr()),l=o.sqr().add(s.sqr()),h=lt.determinant(i,u,s,l),c=lt.determinant(r,u,o,l),f=lt.valueOf(n.x).subtract(h.divide(a)).doubleValue(),v=lt.valueOf(n.y).add(c.divide(a)).doubleValue();return new j(f,v)}},{key:"isAcute",value:function(t,e,n){return!!On.isAcute(t,e,n)&&!!On.isAcute(e,n,t)&&!!On.isAcute(n,t,e)}},{key:"circumcentre",value:function(t,n,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=n.x-i,l=n.y-o,h=2*e.det(s,a,u,l),c=e.det(a,s*s+a*a,l,u*u+l*l),f=e.det(s,s*s+a*a,u,u*u+l*l);return new j(i-c/h,o+f/h)}},{key:"perpendicularBisector",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Gn(t.x+n/2,t.y+r/2,1),o=new Gn(t.x-r+n/2,t.y+n+r/2,1);return new Gn(i,o)}},{key:"angleBisector",value: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 j(t.x+i*o,t.y+i*s)}},{key:"area3D",value:function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.getZ()-t.getZ(),s=n.x-t.x,a=n.y-t.y,u=n.getZ()-t.getZ(),l=i*u-o*a,h=o*s-r*u,c=r*a-i*s,f=l*l+h*h+c*c;return Math.sqrt(f)/2}},{key:"centroid",value:function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new j(r,i)}},{key:"inCentre",value: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 j(a,u)}}]),e}(),Bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addRingSide",value:function(t,e,n,r,i){if(0===e&&t.length<jt.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=jt.MINIMUM_VALID_SIZE&&ft.isCCW(t)&&(o=i,s=r,n=tt.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)}},{key:"addRingBothSides",value:function(t,e){this.addRingSide(t,e,tt.LEFT,Z.EXTERIOR,Z.INTERIOR),this.addRingSide(t,e,tt.RIGHT,Z.INTERIOR,Z.EXTERIOR)}},{key:"addPoint",value:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Z.EXTERIOR,Z.INTERIOR)}},{key:"addPolygon",value:function(t){var e=this._distance,n=tt.LEFT;this._distance<0&&(e=-this._distance,n=tt.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.addRingSide(i,e,n,Z.EXTERIOR,Z.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.addRingSide(a,e,tt.opposite(n),Z.INTERIOR,Z.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(t,e){var n=new Yn(t[0],t[1],t[2]),r=n.inCentre();return kt.pointToSegment(r,n.p0,n.p1)<Math.abs(e)}},{key:"addLineString",value:function(t){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;var e=Wt.removeRepeatedPoints(t.getCoordinates());if(Wt.isRing(e)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(e,this._distance);else{var n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Z.EXTERIOR,Z.INTERIOR)}}},{key:"addCurve",value:function(t,e,n){if(null===t||t.length<2)return null;var r=new kn(t,new Ae(0,Z.BOUNDARY,e,n));this._curveList.add(r)}},{key:"getCurves",value:function(){return this.add(this._inputGeom),this._curveList}},{key:"add",value:function(t){if(t.isEmpty())return null;if(t instanceof Ft)this.addPolygon(t);else if(t instanceof Ct)this.addLineString(t);else if(t instanceof Ot)this.addPoint(t);else if(t instanceof zt)this.addCollection(t);else if(t instanceof se)this.addCollection(t);else if(t instanceof ee)this.addCollection(t);else{if(!(t instanceof Bt))throw new J(t.getGeometryType());this.addCollection(t)}}},{key:"isErodedCompletely",value: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}},{key:"addCollection",value:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}}}],[{key:"constructor_",value:function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new pt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}}]),e}(),zn=function(){function e(){t(this,e)}return n(e,[{key:"locate",value:function(t){}}]),e}(),jn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"next",value:function(){if(this._atStart)return this._atStart=!1,e.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 W;var t=this._parent.getGeometryN(this._index++);return t instanceof Bt?(this._subcollectionIterator=new e(t),this._subcollectionIterator.next()):t}},{key:"remove",value:function(){throw new J(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[yn]}}],[{key:"constructor_",value: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()}},{key:"isAtomic",value:function(t){return!(t instanceof Bt)}}]),e}(),Xn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"locate",value:function(t){return e.locate(t,this._geom)}},{key:"interfaces_",get:function(){return[zn]}}],[{key:"constructor_",value:function(){this._geom=null;var t=arguments[0];this._geom=t}},{key:"locatePointInPolygon",value:function(t,n){if(n.isEmpty())return Z.EXTERIOR;var r=n.getExteriorRing(),i=e.locatePointInRing(t,r);if(i!==Z.INTERIOR)return i;for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o),a=e.locatePointInRing(t,s);if(a===Z.BOUNDARY)return Z.BOUNDARY;if(a===Z.INTERIOR)return Z.EXTERIOR}return Z.INTERIOR}},{key:"locatePointInRing",value:function(t,e){return e.getEnvelopeInternal().intersects(t)?Oe.locateInRing(t,e.getCoordinates()):Z.EXTERIOR}},{key:"containsPointInPolygon",value:function(t,n){return Z.EXTERIOR!==e.locatePointInPolygon(t,n)}},{key:"locateInGeometry",value:function(t,n){if(n instanceof Ft)return e.locatePointInPolygon(t,n);if(n instanceof Bt)for(var r=new jn(n);r.hasNext();){var i=r.next();if(i!==n){var o=e.locateInGeometry(t,i);if(o!==Z.EXTERIOR)return o}}return Z.EXTERIOR}},{key:"isContained",value:function(t,n){return Z.EXTERIOR!==e.locate(t,n)}},{key:"locate",value:function(t,n){return n.isEmpty()?Z.EXTERIOR:n.getEnvelopeInternal().intersects(t)?e.locateInGeometry(t,n):Z.EXTERIOR}}]),e}(),Un=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getNextCW",value: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)}},{key:"propagateSideLabels",value:function(t){for(var e=Z.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,tt.LEFT)!==Z.NONE&&(e=r.getLocation(t,tt.LEFT))}if(e===Z.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,tt.ON)===Z.NONE&&a.setLocation(t,tt.ON,i),a.isArea(t)){var u=a.getLocation(t,tt.LEFT),l=a.getLocation(t,tt.RIGHT);if(l!==Z.NONE){if(l!==i)throw new gt("side location conflict",s.getCoordinate());u===Z.NONE&&G.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else G.isTrue(a.getLocation(t,tt.LEFT)===Z.NONE,"found single null side"),a.setLocation(t,tt.RIGHT,i),a.setLocation(t,tt.LEFT,i)}}}},{key:"getCoordinate",value:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}},{key:"print",value:function(t){xt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"isAreaLabelsConsistent",value:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,tt.LEFT);G.isTrue(r!==Z.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();G.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,tt.LEFT),u=s.getLocation(t,tt.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0}},{key:"findIndex",value:function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1}},{key:"iterator",value:function(){return this.getEdges().iterator()}},{key:"getEdges",value:function(){return null===this._edgeList&&(this._edgeList=new pt(this._edgeMap.values())),this._edgeList}},{key:"getLocation",value:function(t,e,n){return this._ptInAreaLocation[t]===Z.NONE&&(this._ptInAreaLocation[t]=Xn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]}},{key:"toString",value:function(){var t=new st;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()}},{key:"computeEdgeEndLabels",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)}},{key:"computeLabelling",value: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)===Z.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 l=Z.NONE;if(e[u])l=Z.EXTERIOR;else{var h=s.getCoordinate();l=this.getLocation(u,h,t)}a.setAllLocationsIfNull(u,l)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(t,e){this._edgeMap.put(t,e),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new Ze,this._edgeList=null,this._ptInAreaLocation=[Z.NONE,Z.NONE]}}]),e}(),Vn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"linkResultDirectedEdges",value: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 gt("no outgoing dirEdge found",this.getCoordinate());G.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}}},{key:"insert",value:function(t){var e=t;this.insertEdgeEnd(e,e)}},{key:"getRightmostEdge",value: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 We.isNorthern(i)&&We.isNorthern(o)?n:We.isNorthern(i)||We.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(G.shouldNeverReachHere("found two horizontal edges incident on node"),null):r}},{key:"print",value:function(t){xt.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()}}},{key:"getResultAreaEdges",value:function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new pt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList}},{key:"updateLabelling",value: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))}}},{key:"linkAllDirectedEdges",value: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)}},{key:"computeDepths",value:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(tt.LEFT),r=t.getDepth(tt.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new gt("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(tt.RIGHT,s),s=u.getDepth(tt.LEFT)}return s}}},{key:"mergeSymLabels",value:function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value: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&&(G.isTrue(null!==e,"found null for first outgoing dirEdge"),G.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))}},{key:"getOutgoingDegree",value: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}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var t=Z.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Z.INTERIOR;break}if(r.isInResult()){t=Z.EXTERIOR;break}}}if(t===Z.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===Z.INTERIOR):(s.isInResult()&&(i=Z.EXTERIOR),a.isInResult()&&(i=Z.INTERIOR))}}},{key:"computeLabelling",value:function(t){f(i(s.prototype),"computeLabelling",this).call(this,t),this._label=new Ae(Z.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),r=0;r<2;r++){var o=n.getLocation(r);o!==Z.INTERIOR&&o!==Z.BOUNDARY||this._label.setLocation(r,Z.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),s}(Un),Zn=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.call(this)}return n(o,[{key:"createNode",value:function(t){return new Ye(t,new Vn)}}]),o}(Qe),Hn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value:function(t){var n=t;return e.compareOriented(this._pts,this._orientation,n._pts,n._orientation)}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)}},{key:"orientation",value:function(t){return 1===Wt.increasingDirection(t)}},{key:"compareOriented",value: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,l=r?0:n.length-1;;){var h=t[u].compareTo(n[l]);if(0!==h)return h;var c=(u+=i)===s,f=(l+=o)===a;if(c&&!f)return-1;if(!c&&f)return 1;if(c&&f)return 0}}}]),e}(),Wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value: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(") ")}},{key:"addAll",value:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}},{key:"findEdgeIndex",value:function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(t){return this._edges.get(t)}},{key:"findEqualEdge",value:function(t){var e=new Hn(t.getCoordinates());return this._ocaMap.get(e)}},{key:"add",value:function(t){this._edges.add(t);var e=new Hn(t.getCoordinates());this._ocaMap.put(e,t)}}],[{key:"constructor_",value:function(){this._edges=new pt,this._ocaMap=new Ze}}]),e}(),Jn=function(){function e(){t(this,e)}return n(e,[{key:"processIntersections",value:function(t,e,n,r){}},{key:"isDone",value:function(){}}]),e}(),Kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isTrivialIntersection",value:function(t,n,r,i){if(t===r&&1===this._li.getIntersectionNum()){if(e.isAdjacentSegments(n,i))return!0;if(t.isClosed()){var o=t.size()-1;if(0===n&&i===o||0===i&&n===o)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value: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)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[Jn]}}],[{key:"constructor_",value: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}},{key:"isAdjacentSegments",value:function(t,e){return 1===Math.abs(t-e)}}]),e}(),Qn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)}},{key:"compareTo",value:function(t){var e=t;return this.compare(e.segmentIndex,e.dist)}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new j(t),this.segmentIndex=e,this.dist=n}}]),e}(),$n=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value: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}}},{key:"addEndpoints",value:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}},{key:"createSplitEdge",value: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 j(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 or(o,new Ae(this.edge._label))}},{key:"add",value:function(t,e,n){var r=new Qn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)}},{key:"isIntersection",value:function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new Ze,this.edge=null;var t=arguments[0];this.edge=t}}]),e}(),tr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"isCoveredBy",value:function(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}},{key:"set",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),r=e%3;this._matrix[n][r]=Mt.toDimensionValue(t.charAt(e))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._matrix[i][o]=s}}},{key:"isContains",value:function(){return e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"setAtLeast",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),r=e%3;this.setAtLeast(n,r,Mt.toDimensionValue(t.charAt(e)))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._matrix[i][o]<s&&(this._matrix[i][o]=s)}}},{key:"setAtLeastIfValid",value:function(t,e,n){t>=0&&e>=0&&this.setAtLeast(t,e,n)}},{key:"isWithin",value:function(){return e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}},{key:"isTouches",value:function(t,n){return t>n?this.isTouches(n,t):(t===Mt.A&&n===Mt.A||t===Mt.L&&n===Mt.L||t===Mt.L&&n===Mt.A||t===Mt.P&&n===Mt.A||t===Mt.P&&n===Mt.L)&&this._matrix[Z.INTERIOR][Z.INTERIOR]===Mt.FALSE&&(e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))}},{key:"isOverlaps",value:function(t,n){return t===Mt.P&&n===Mt.P||t===Mt.A&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]):t===Mt.L&&n===Mt.L&&1===this._matrix[Z.INTERIOR][Z.INTERIOR]&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR])}},{key:"isEquals",value:function(t,n){return t===n&&e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"toString",value:function(){for(var t=new Qt("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,Mt.toDimensionSymbol(this._matrix[e][n]));return t.toString()}},{key:"setAll",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t}},{key:"get",value:function(t,e){return this._matrix[t][e]}},{key:"transpose",value:function(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}},{key:"matches",value:function(t){if(9!==t.length)throw new _("Should be length 9: "+t);for(var n=0;n<3;n++)for(var r=0;r<3;r++)if(!e.matches(this._matrix[n][r],t.charAt(3*n+r)))return!1;return!0}},{key:"add",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))}},{key:"isDisjoint",value:function(){return this._matrix[Z.INTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.INTERIOR][Z.BOUNDARY]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.BOUNDARY]===Mt.FALSE}},{key:"isCrosses",value:function(t,n){return t===Mt.P&&n===Mt.L||t===Mt.P&&n===Mt.A||t===Mt.L&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR]):t===Mt.L&&n===Mt.P||t===Mt.A&&n===Mt.P||t===Mt.A&&n===Mt.L?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]):t===Mt.L&&n===Mt.L&&0===this._matrix[Z.INTERIOR][Z.INTERIOR]}},{key:"interfaces_",get:function(){return[w]}}],[{key:"constructor_",value:function(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(Mt.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];e.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof e){var n=arguments[0];e.constructor_.call(this),this._matrix[Z.INTERIOR][Z.INTERIOR]=n._matrix[Z.INTERIOR][Z.INTERIOR],this._matrix[Z.INTERIOR][Z.BOUNDARY]=n._matrix[Z.INTERIOR][Z.BOUNDARY],this._matrix[Z.INTERIOR][Z.EXTERIOR]=n._matrix[Z.INTERIOR][Z.EXTERIOR],this._matrix[Z.BOUNDARY][Z.INTERIOR]=n._matrix[Z.BOUNDARY][Z.INTERIOR],this._matrix[Z.BOUNDARY][Z.BOUNDARY]=n._matrix[Z.BOUNDARY][Z.BOUNDARY],this._matrix[Z.BOUNDARY][Z.EXTERIOR]=n._matrix[Z.BOUNDARY][Z.EXTERIOR],this._matrix[Z.EXTERIOR][Z.INTERIOR]=n._matrix[Z.EXTERIOR][Z.INTERIOR],this._matrix[Z.EXTERIOR][Z.BOUNDARY]=n._matrix[Z.EXTERIOR][Z.BOUNDARY],this._matrix[Z.EXTERIOR][Z.EXTERIOR]=n._matrix[Z.EXTERIOR][Z.EXTERIOR]}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],n=arguments[1];return n===Mt.SYM_DONTCARE||n===Mt.SYM_TRUE&&(t>=0||t===Mt.TRUE)||n===Mt.SYM_FALSE&&t===Mt.FALSE||n===Mt.SYM_P&&t===Mt.P||n===Mt.SYM_L&&t===Mt.L||n===Mt.SYM_A&&t===Mt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var r=arguments[1];return new e(arguments[0]).matches(r)}}},{key:"isTrue",value:function(t){return t>=0||t===Mt.TRUE}}]),e}(),er=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),xt.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}},{key:"ensureCapacity",value:function(t){if(t<=this._data.length)return null;var e=Math.max(t,2*this._data.length);this._data=At.copyOf(this._data,e)}},{key:"toArray",value:function(){var t=new Array(this._size).fill(null);return xt.arraycopy(this._data,0,t,0,this._size),t}},{key:"add",value:function(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,0===arguments.length)e.constructor_.call(this,10);else if(1===arguments.length){var t=arguments[0];this._data=new Array(t).fill(null)}}}]),e}(),nr=function(){function e(){t(this,e)}return n(e,[{key:"getChainStartIndices",value:function(t){var e=0,n=new er(Math.trunc(t.length/2));n.add(e);do{var r=this.findChainEnd(t,e);n.add(r),e=r}while(e<t.length-1);return n.toArray()}},{key:"findChainEnd",value:function(t,e){for(var n=We.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&We.quadrant(t[r-1],t[r])===n;)r++;return r-1}},{key:"OLDgetChainStartIndices",value:function(t){var n=0,r=new pt;r.add(n);do{var i=this.findChainEnd(t,n);r.add(i),n=i}while(n<t.length-1);return e.toIntArray(r)}}],[{key:"toIntArray",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e}}]),e}(),rr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n}},{key:"getMinX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n}},{key:"computeIntersectsForChain",value: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],l=arguments[5];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(!this.overlaps(i,o,s,a,u))return null;var h=Math.trunc((i+o)/2),c=Math.trunc((a+u)/2);i<h&&(a<c&&this.computeIntersectsForChain(i,h,s,a,c,l),c<u&&this.computeIntersectsForChain(i,h,s,c,u,l)),h<o&&(a<c&&this.computeIntersectsForChain(h,o,s,a,c,l),c<u&&this.computeIntersectsForChain(h,o,s,c,u,l))}}},{key:"overlaps",value:function(t,e,n,r,i){return U.intersects(this.pts[t],this.pts[e],n.pts[r],n.pts[i])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value: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)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new nr;this.startIndex=e.getChainStartIndices(this.pts)}}]),e}(),ir=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getDepth",value:function(t,e){return this._depth[t][e]}},{key:"setDepth",value:function(t,e,n){this._depth[t][e]=n}},{key:"isNull",value:function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var n=0;n<3;n++)if(this._depth[t][n]!==e.NULL_VALUE)return!1;return!0}if(1===arguments.length){var r=arguments[0];return this._depth[r][1]===e.NULL_VALUE}if(2===arguments.length){var i=arguments[0],o=arguments[1];return this._depth[i][o]===e.NULL_VALUE}}},{key:"normalize",value: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}}}},{key:"getDelta",value:function(t){return this._depth[t][tt.RIGHT]-this._depth[t][tt.LEFT]}},{key:"getLocation",value:function(t,e){return this._depth[t][e]<=0?Z.EXTERIOR:Z.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(1===arguments.length)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=t.getLocation(n,r);i!==Z.EXTERIOR&&i!==Z.INTERIOR||(this.isNull(n,r)?this._depth[n][r]=e.depthAtLocation(i):this._depth[n][r]+=e.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],s=arguments[1];arguments[2]===Z.INTERIOR&&this._depth[o][s]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var n=0;n<3;n++)this._depth[t][n]=e.NULL_VALUE}},{key:"depthAtLocation",value:function(t){return t===Z.EXTERIOR?0:t===Z.INTERIOR?1:e.NULL_VALUE}}]),e}();ir.NULL_VALUE=-1;var or=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new s(t,Ae.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(t){this._isIsolated=t}},{key:"setName",value:function(t){this._name=t}},{key:"equals",value:function(t){if(!(t instanceof s))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(e.pts[o])||(n=!1),this.pts[o].equals2D(e.pts[--i])||(r=!1),!n&&!r)return!1;return!0}},{key:"getCoordinate",value: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]}}},{key:"print",value: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)}},{key:"computeIM",value:function(t){s.updateIM(this._label,t)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}},{key:"getMonotoneChainEdge",value:function(){return null===this._mce&&(this._mce=new rr(this)),this._mce}},{key:"getEnvelope",value:function(){if(null===this._env){this._env=new U;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env}},{key:"addIntersection",value:function(t,e,n,r){var i=new j(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)}},{key:"toString",value:function(){var t=new Qt;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()}},{key:"isPointwiseEqual",value: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}},{key:"setDepthDelta",value:function(t){this._depthDelta=t}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ir,this._depthDelta=0,1===arguments.length){var t=arguments[0];s.constructor_.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this._label=n}}},{key:"updateIM",value:function(){if(!(2===arguments.length&&arguments[1]instanceof tr&&arguments[0]instanceof Ae))return f(i(s),"updateIM",this).apply(this,arguments);var t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,tt.ON),t.getLocation(1,tt.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,tt.LEFT),t.getLocation(1,tt.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,tt.RIGHT),t.getLocation(1,tt.RIGHT),2))}}]),s}(Ge),sr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setWorkingPrecisionModel",value:function(t){this._workingPrecisionModel=t}},{key:"insertUniqueEdge",value:function(t){var n=this._edgeList.findEqualEdge(t);if(null!==n){var r=n.getLabel(),i=t.getLabel();n.isPointwiseEqual(t)||(i=new Ae(t.getLabel())).flip(),r.merge(i);var o=e.depthDelta(i),s=n.getDepthDelta()+o;n.setDepthDelta(s)}else this._edgeList.add(t),t.setDepthDelta(e.depthDelta(t.getLabel()))}},{key:"buildSubgraphs",value:function(t,e){for(var n=new pt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Dn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}}},{key:"createSubgraphs",value:function(t){for(var e=new pt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new mt;i.create(r),e.add(i)}}return an.sort(e,an.reverseOrder()),e}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new Ln,n=new Ce;return n.setPrecisionModel(t),e.setSegmentIntersector(new Kn(n)),e}},{key:"buffer",value:function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new An(n,this._bufParams),i=new Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new $e(new Zn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new tn(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)}},{key:"computeNodedEdges",value: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 or(i.getCoordinates(),new Ae(s));this.insertUniqueEdge(a)}}}},{key:"setNoder",value:function(t){this._workingNoder=t}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Wn;var t=arguments[0];this._bufParams=t}},{key:"depthDelta",value:function(t){var e=t.getLocation(0,tt.LEFT),n=t.getLocation(0,tt.RIGHT);return e===Z.INTERIOR&&n===Z.EXTERIOR?1:e===Z.EXTERIOR&&n===Z.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(t){for(var e=new ae,n=new pt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)}}]),e}(),ar=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"rescale",value:function(){if(ot(arguments[0],H))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])&&xt.out.println(n)}}},{key:"scale",value:function(){if(ot(arguments[0],H)){for(var t=arguments[0],e=new pt(t.size()),n=t.iterator();n.hasNext();){var r=n.next();e.add(new kn(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 j(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].getZ());return Wt.removeRepeatedPoints(o)}}},{key:"isIntegerPrecision",value:function(){return 1===this._scaleFactor}},{key:"getNodedSubstrings",value:function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t}},{key:"computeNodes",value:function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],n=arguments[1];e.constructor_.call(this,t,n,0,0)}else if(4===arguments.length){var r=arguments[0],i=arguments[1];this._noder=r,this._scaleFactor=i,this._isScaled=!this.isIntegerPrecision()}}}]),e}(),ur=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"checkEndPtVertexIntersections",value: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 F("found endpt/interior pt intersection at index "+o+" :pt "+n)}},{key:"checkInteriorIntersections",value: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 l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var h=arguments[0],c=arguments[1],f=arguments[2],v=arguments[3];if(h===f&&c===v)return null;var g=h.getCoordinates()[c],d=h.getCoordinates()[c+1],p=f.getCoordinates()[v],y=f.getCoordinates()[v+1];if(this._li.computeIntersection(g,d,p,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,p,y)))throw new F("found non-noded intersection at "+g+"-"+d+" and "+p+"-"+y)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value: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])}},{key:"hasInteriorIntersection",value: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}},{key:"checkCollapse",value:function(t,n,r){if(t.equals(r))throw new F("found non-noded collapse at "+e.fact.createLineString([t,n,r]))}}],[{key:"constructor_",value:function(){this._li=new Ce,this._segStrings=null;var t=arguments[0];this._segStrings=t}}]),e}();ur.fact=new ae;var lr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"intersectsScaled",value: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 G.isTrue(!(s&&a),"Found bad envelope test"),a}},{key:"initCorners",value:function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new j(this._maxx,this._maxy),this._corner[1]=new j(this._minx,this._maxy),this._corner[2]=new j(this._minx,this._miny),this._corner[3]=new j(this._maxx,this._miny)}},{key:"intersects",value: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))}},{key:"scale",value:function(t){return Math.round(t*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}},{key:"getSafeEnvelope",value:function(){if(null===this._safeEnv){var t=e.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new U(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}},{key:"intersectsPixelClosure",value: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()))))}},{key:"intersectsToleranceSquare",value: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)))))}},{key:"addSnappedNode",value:function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_",value: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 _("Scale factor must be non-zero");1!==e&&(this._pt=new j(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new j,this._p1Scaled=new j),this.initCorners(this._pt)}}]),e}();lr.SAFE_ENV_EXPANSION_FACTOR=.75;var hr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"select",value:function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}],[{key:"constructor_",value:function(){this.selectedSegment=new wn}}]),e}(),cr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"snap",value:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=r.getSafeEnvelope(),a=new fr(r,i,o);return this._index.query(s,new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[hn]}},{key:"visitItem",value:function(t){t.select(s,a)}}]),e}())),a.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var t=arguments[0];this._index=t}}]),e}(),fr=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof In))return f(i(s.prototype),"select",this).apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}}]),s}(hr);cr.HotPixelSnapAction=fr;var vr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"processIntersections",value: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)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[Jn]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new pt}}]),e}(),gr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"checkCorrectness",value:function(t){var e=kn.getNodedSubstrings(t),n=new ur(e);try{n.checkValid()}catch(t){if(!(t instanceof m))throw t;t.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return kn.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)}},{key:"findInteriorIntersections",value:function(t,e){var n=new vr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(ot(arguments[0],H))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof kn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new lr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}}},{key:"computeNodes",value:function(t){this._nodedSegStrings=t,this._noder=new Ln,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)}},{key:"computeIntersectionSnaps",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new lr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value: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 Ce,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}}]),e}(),dr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"bufferFixedPrecision",value:function(t){var e=new ar(new gr(new ie(1)),t.getScale()),n=new sr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(0===arguments.length){for(var t=e.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof gt))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=e.precisionScaleFactor(this._argGeom,this._distance,n),i=new ie(r);this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ie.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(t){this._bufParams.setQuadrantSegments(t)}},{key:"bufferOriginalPrecision",value:function(){try{var t=new sr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof F))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new y,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}}},{key:"bufferOp",value:function(){if(2===arguments.length){var t=arguments[1];return new e(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof V&&"number"==typeof arguments[1]){var n=arguments[1],r=arguments[2],i=new e(arguments[0]);return i.setQuadrantSegments(r),i.getResultGeometry(n)}if(arguments[2]instanceof y&&arguments[0]instanceof V&&"number"==typeof arguments[1]){var o=arguments[1];return new e(arguments[0],arguments[2]).getResultGeometry(o)}}else if(4===arguments.length){var s=arguments[1],a=arguments[2],u=arguments[3],l=new e(arguments[0]);return l.setQuadrantSegments(a),l.setEndCapStyle(u),l.getResultGeometry(s)}}},{key:"precisionScaleFactor",value:function(t,e,n){var r=t.getEnvelopeInternal(),i=Et.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)}}]),e}();dr.CAP_ROUND=y.CAP_ROUND,dr.CAP_BUTT=y.CAP_FLAT,dr.CAP_FLAT=y.CAP_FLAT,dr.CAP_SQUARE=y.CAP_SQUARE,dr.MAX_PRECISION_DIGITS=12;var pr=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],yr=function(){function e(n){t(this,e),this.geometryFactory=n||new ae}return n(e,[{key:"read",value:function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==pr.indexOf(n)?mr[n].call(this,e.coordinates):"GeometryCollection"===n?mr[n].call(this,e.geometries):mr[n].call(this,e)}},{key:"write",value:function(t){var e=t.getGeometryType();if(!_r[e])throw new Error("Geometry is not supported");return _r[e].call(this,t)}}]),e}(),mr={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!mr[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=mr.bbox.call(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.call(this,t.bbox)),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(a(j,v(r)))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new j(t[0],t[1]),new j(t[2],t[1]),new j(t[2],t[3]),new j(t[0],t[3]),new j(t[0],t[1])])},Point:function(t){var e=a(j,v(t));return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(mr.Point.call(this,t[n]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=mr.coordinates.call(this,t);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(mr.LineString.call(this,t[n]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=mr.coordinates.call(this,t[0]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=mr.coordinates.call(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(mr.Polygon.call(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)}},_r={coordinate:function(t){var e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e},Point:function(t){return{type:"Point",coordinates:_r.coordinate.call(this,t.getCoordinate())}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=_r.Point.call(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(_r.coordinate.call(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=_r.LineString.call(this,r);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=_r.LineString.call(this,t._shell);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=_r.LineString.call(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=_r.Polygon.call(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(_r[i].call(this,r))}return{type:"GeometryCollection",geometries:e}}};return{BufferOp:dr,GeoJSONReader:function(){function e(n){t(this,e),this.parser=new yr(n||new ae)}return n(e,[{key:"read",value:function(t){return this.parser.read(t)}}]),e}(),GeoJSONWriter:function(){function e(){t(this,e),this.parser=new yr(this.geometryFactory)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}]),e}()}}()}(vr)),vr.exports),dr=Jn(gr),pr=function(){return s(function t(){i(this,t),this._partials=new Float64Array(32),this._n=0},[{key:"add",value:function(t){for(var e=this._partials,n=0,r=0;r<this._n&&r<32;r++){var i=e[r],o=t+i,s=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}},{key:"valueOf",value:function(){var t,e,n,r=this._partials,i=this._n,o=0;if(i>0){for(o=r[--i];i>0&&(t=o,!(n=(e=r[--i])-((o=t+e)-t))););i>0&&(n<0&&r[i-1]<0||n>0&&r[i-1]>0)&&(e=2*n)==(t=o+e)-o&&(o=t)}return o}}])}(),yr=g().m(mr);function mr(t){var e,n,r,i;return g().w(function(o){for(;;)switch(o.p=o.n){case 0:e=a(t),o.p=1,e.s();case 2:if((n=e.n()).done){o.n=4;break}return r=n.value,o.d(p(r),3);case 3:o.n=2;break;case 4:o.n=6;break;case 5:o.p=5,i=o.v,e.e(i);case 6:return o.p=6,e.f(),o.f(6);case 7:return o.a(2)}},yr,null,[[1,5,6,7]])}function _r(t){return Array.from(mr(t))}var xr=1e-6,Er=Math.PI,kr=Er/2,wr=Er/4,br=2*Er,Ir=180/Er,Nr=Er/180,Sr=Math.abs,Mr=Math.atan,Lr=Math.atan2,Pr=Math.cos,Cr=Math.sin,Tr=Math.sign||function(t){return t>0?1:t<0?-1:0},Or=Math.sqrt;function Rr(t){return t>1?0:t<-1?Er:Math.acos(t)}function Ar(t){return t>1?kr:t<-1?-kr:Math.asin(t)}function Dr(){}function Fr(t,e){t&&Gr.hasOwnProperty(t.type)&&Gr[t.type](t,e)}var qr={Feature:function(t,e){Fr(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Fr(n[r].geometry,e)}},Gr={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){Yr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yr(n[r],e,0)},Polygon:function(t,e){Br(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Br(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Fr(n[r],e)}};function Yr(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 Br(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yr(t[n],e,1);e.polygonEnd()}function zr(t){return[Lr(t[1],t[0]),Ar(t[2])]}function jr(t){var e=t[0],n=t[1],r=Pr(n);return[r*Pr(e),r*Cr(e),Cr(n)]}function Xr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ur(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 Vr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Zr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hr(t){var e=Or(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Wr(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 Jr(t,e){return[Sr(t)>Er?t+Math.round(-t/br)*br:t,e]}function Kr(t){return function(e,n){return[(e+=t)>Er?e-br:e<-Er?e+br:e,n]}}function Qr(t){var e=Kr(t);return e.invert=Kr(-t),e}function $r(t,e){var n=Pr(t),r=Cr(t),i=Pr(e),o=Cr(e);function s(t,e){var s=Pr(e),a=Pr(t)*s,u=Cr(t)*s,l=Cr(e),h=l*n+a*r;return[Lr(u*i-h*o,a*n-l*r),Ar(h*i+u*o)]}return s.invert=function(t,e){var s=Pr(e),a=Pr(t)*s,u=Cr(t)*s,l=Cr(e),h=l*i-u*o;return[Lr(u*i+l*o,a*n+h*r),Ar(h*n-a*r)]},s}function ti(t,e){(e=jr(e))[0]-=t,Hr(e);var n=Rr(-e[1]);return((-e[2]<0?-n:n)+br-xr)%br}function ei(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Dr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ni(t,e){return Sr(t[0]-e[0])<xr&&Sr(t[1]-e[1])<xr}function ri(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ii(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(ni(r,s)){if(!r[2]&&!s[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}s[0]+=2e-6}a.push(n=new ri(r,t,null,!0)),u.push(n.o=new ri(r,null,n,!1)),a.push(n=new ri(s,t,null,!1)),u.push(n.o=new ri(s,null,n,!0))}}),a.length){for(u.sort(e),oi(a),oi(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,h,c=a[0];;){for(var f=c,v=!0;f.v;)if((f=f.n)===c)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(v)for(o=0,s=l.length;o<s;++o)i.point((h=l[o])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(v)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,v=!v}while(!f.v);i.lineEnd()}}}function oi(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 si(t){return Sr(t[0])<=Er?t[0]:Tr(t[0])*((Sr(t[0])+Er)%br-Er)}function ai(t,e,n,r){return function(i){var o,s,a,u=e(i),l=ei(),h=e(l),c=!1,f={point:v,lineStart:d,lineEnd:p,polygonStart:function(){f.point=y,f.lineStart=m,f.lineEnd=_,s=[],o=[]},polygonEnd:function(){f.point=v,f.lineStart=d,f.lineEnd=p,s=_r(s);var t=function(t,e){var n=si(e),r=e[1],i=Cr(r),o=[Cr(n),-Pr(n),0],s=0,a=0,u=new pr;1===i?r=kr+xr:-1===i&&(r=-kr-xr);for(var l=0,h=t.length;l<h;++l)if(f=(c=t[l]).length)for(var c,f,v=c[f-1],g=si(v),d=v[1]/2+wr,p=Cr(d),y=Pr(d),m=0;m<f;++m,g=x,p=k,y=w,v=_){var _=c[m],x=si(_),E=_[1]/2+wr,k=Cr(E),w=Pr(E),b=x-g,I=b>=0?1:-1,N=I*b,S=N>Er,M=p*k;if(u.add(Lr(M*I*Cr(N),y*w+M*Pr(N))),s+=S?b+I*br:b,S^g>=n^x>=n){var L=Ur(jr(v),jr(_));Hr(L);var P=Ur(o,L);Hr(P);var C=(S^b>=0?-1:1)*Ar(P[2]);(r>C||r===C&&(L[0]||L[1]))&&(a+=S^b>=0?1:-1)}}return(s<-1e-6||s<xr&&u<-1e-12)^1&a}(o,r);s.length?(c||(i.polygonStart(),c=!0),ii(s,li,t,n,i)):t&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function v(e,n){t(e,n)&&i.point(e,n)}function g(t,e){u.point(t,e)}function d(){f.point=g,u.lineStart()}function p(){f.point=v,u.lineEnd()}function y(t,e){a.push([t,e]),h.point(t,e)}function m(){h.lineStart(),a=[]}function _(){y(a[0][0],a[0][1]),h.lineEnd();var t,e,n,r,u=h.clean(),f=l.result(),v=f.length;if(a.pop(),o.push(a),a=null,v)if(1&u){if((e=(n=f[0]).length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else v>1&&2&u&&f.push(f.pop().concat(f.shift())),s.push(f.filter(ui))}return f}}function ui(t){return t.length>1}function li(t,e){return((t=t.x)[0]<0?t[1]-kr-xr:kr-t[1])-((e=e.x)[0]<0?e[1]-kr-xr:kr-e[1])}Jr.invert=Jr;var hi=ai(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Er:-Er,u=Sr(o-n);Sr(u-Er)<xr?(t.point(n,r=(r+s)/2>0?kr:-kr),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Er&&(Sr(n-i)<xr&&(n-=i*xr),Sr(o-a)<xr&&(o-=a*xr),r=function(t,e,n,r){var i,o,s=Cr(t-n);return Sr(s)>xr?Mr((Cr(e)*(o=Pr(r))*Cr(n)-Cr(r)*(i=Pr(e))*Cr(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*kr,r.point(-Er,i),r.point(0,i),r.point(Er,i),r.point(Er,0),r.point(Er,-i),r.point(0,-i),r.point(-Er,-i),r.point(-Er,0),r.point(-Er,i);else if(Sr(t[0]-e[0])>xr){var o=t[0]<e[0]?Er:-Er;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Er,-kr]);function ci(t){var e=Pr(t),n=6*Nr,r=e>0,i=Sr(e)>xr;function o(t,n){return Pr(t)*Pr(n)>e}function s(t,n,r){var i=[1,0,0],o=Ur(jr(t),jr(n)),s=Xr(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=e*s/u,h=-e*a/u,c=Ur(i,o),f=Zr(i,l);Vr(f,Zr(o,h));var v=c,g=Xr(f,v),d=Xr(v,v),p=g*g-d*(Xr(f,f)-1);if(!(p<0)){var y=Or(p),m=Zr(v,(-g-y)/d);if(Vr(m,f),m=zr(m),!r)return m;var _,x=t[0],E=n[0],k=t[1],w=n[1];E<x&&(_=x,x=E,E=_);var b=E-x,I=Sr(b-Er)<xr;if(!I&&w<k&&(_=k,k=w,w=_),I||b<xr?I?k+w>0^m[1]<(Sr(m[0]-x)<xr?k:w):k<=m[1]&&m[1]<=w:b>Er^(x<=m[0]&&m[0]<=E)){var N=Zr(v,(-g+y)/d);return Vr(N,f),[m,zr(N)]}}}function a(e,n){var i=r?t:Er-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return ai(o,function(t){var e,n,u,l,h;return{lineStart:function(){l=u=!1,h=1},point:function(c,f){var v,g=[c,f],d=o(c,f),p=r?d?0:a(c,f):d?a(c+(c<0?Er:-Er),f):0;if(!e&&(l=u=d)&&t.lineStart(),d!==u&&(!(v=s(e,g))||ni(e,v)||ni(g,v))&&(g[2]=1),d!==u)h=0,d?(t.lineStart(),v=s(g,e),t.point(v[0],v[1])):(v=s(e,g),t.point(v[0],v[1],2),t.lineEnd()),e=v;else if(i&&e&&r^d){var y;p&n||!(y=s(g,e,!0))||(h=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!d||e&&ni(e,g)||t.point(g[0],g[1]),e=g,u=d,n=p},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(l&&u)<<1}}},function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Pr(e),a=Cr(e),u=r*n;null==i?(i=e+r*br,o=e-u/2):(i=ti(s,i),o=ti(s,o),(r>0?i<o:i>o)&&(i+=r*br));for(var l,h=i;r>0?h>o:h<o;h-=u)l=zr([s,-a*Pr(h),-a*Cr(h)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)},r?[0,-t]:[-Er,t-Er])}var fi=1e9,vi=-fi;function gi(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var h=0,c=0;if(null==i||(h=s(i,a))!==(c=s(o,a))||u(i,o)<0^a>0)do{l.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==c);else l.point(o[0],o[1])}function s(r,i){return Sr(r[0]-t)<xr?i>0?0:3:Sr(r[0]-n)<xr?i>0?2:1:Sr(r[1]-e)<xr?i>0?1:0:i>0?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,l,h,c,f,v,g,d,p,y,m,_=s,x=ei(),E={point:k,lineStart:function(){E.point=w,l&&l.push(h=[]);y=!0,p=!1,g=d=NaN},lineEnd:function(){u&&(w(c,f),v&&p&&x.rejoin(),u.push(x.result()));E.point=k,p&&_.lineEnd()},polygonStart:function(){_=x,u=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,h=a.length,c=a[0],f=c[0],v=c[1];u<h;++u)o=f,s=v,f=(c=a[u])[0],v=c[1],s<=r?v>r&&(f-o)*(r-s)>(v-s)*(t-o)&&++e:v<=r&&(f-o)*(r-s)<(v-s)*(t-o)&&--e;return e}(),n=m&&e,i=(u=_r(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ii(u,a,e,o,s),s.polygonEnd());_=s,u=l=h=null}};function k(t,e){i(t,e)&&_.point(t,e)}function w(o,s){var a=i(o,s);if(l&&h.push([o,s]),y)c=o,f=s,v=a,y=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&p)_.point(o,s);else{var u=[g=Math.max(vi,Math.min(fi,g)),d=Math.max(vi,Math.min(fi,d))],x=[o=Math.max(vi,Math.min(fi,o)),s=Math.max(vi,Math.min(fi,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,h=1,c=e[0]-a,f=e[1]-u;if(s=n-a,c||!(s>0)){if(s/=c,c<0){if(s<l)return;s<h&&(h=s)}else if(c>0){if(s>h)return;s>l&&(l=s)}if(s=i-a,c||!(s<0)){if(s/=c,c<0){if(s>h)return;s>l&&(l=s)}else if(c>0){if(s<l)return;s<h&&(h=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<h&&(h=s)}else if(f>0){if(s>h)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>h)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<h&&(h=s)}return l>0&&(t[0]=a+l*c,t[1]=u+l*f),h<1&&(e[0]=a+h*c,e[1]=u+h*f),!0}}}}}(u,x,t,e,n,r)?a&&(_.lineStart(),_.point(o,s),m=!1):(p||(_.lineStart(),_.point(u[0],u[1])),_.point(x[0],x[1]),a||_.lineEnd(),m=!1)}g=o,d=s,p=a}return E}}var di=function(t){return t},pi=1/0,yi=pi,mi=-pi,_i=mi,xi={point:function(t,e){t<pi&&(pi=t);t>mi&&(mi=t);e<yi&&(yi=e);e>_i&&(_i=e)},lineStart:Dr,lineEnd:Dr,polygonStart:Dr,polygonEnd:Dr,result:function(){var t=[[pi,yi],[mi,_i]];return mi=_i=-(yi=pi=1/0),t}};function Ei(t){return function(e){var n=new ki;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ki(){}function wi(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&qr.hasOwnProperty(t.type)?qr[t.type](t,e):Fr(t,e)}(n,t.stream(xi)),e(xi.result()),null!=r&&t.clipExtent(r),t}function bi(t,e,n){return wi(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),s=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([s,a])},n)}ki.prototype={constructor:ki,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 Ii=Pr(30*Nr);function Ni(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,h,c,f,v,g,d,p){var y=l-r,m=h-i,_=y*y+m*m;if(_>4*e&&d--){var x=s+f,E=a+v,k=u+g,w=Or(x*x+E*E+k*k),b=Ar(k/=w),I=Sr(Sr(k)-1)<xr||Sr(o-c)<xr?(o+c)/2:Lr(E,x),N=t(I,b),S=N[0],M=N[1],L=S-r,P=M-i,C=m*L-y*P;(C*C/_>e||Sr((y*L+m*P)/_-.5)>.3||s*f+a*v+u*g<Ii)&&(n(r,i,o,s,a,u,S,M,I,x/=w,E/=w,k,d,p),p.point(S,M),n(S,M,I,x,E,k,l,h,c,f,v,g,d,p))}}return function(e){var r,i,o,s,a,u,l,h,c,f,v,g,d={point:p,lineStart:y,lineEnd:_,polygonStart:function(){e.polygonStart(),d.lineStart=x},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function p(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){h=NaN,d.point=m,e.lineStart()}function m(r,i){var o=jr([r,i]),s=t(r,i);n(h,c,l,f,v,g,h=s[0],c=s[1],l=r,f=o[0],v=o[1],g=o[2],16,e),e.point(h,c)}function _(){d.point=p,e.lineEnd()}function x(){y(),d.point=E,d.lineEnd=k}function E(t,e){m(r=t,e),i=h,o=c,s=f,a=v,u=g,d.point=m}function k(){n(h,c,l,f,v,g,i,o,r,s,a,u,16,e),d.lineEnd=_,_()}return d}}(t,e):function(t){return Ei({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Si=Ei({point:function(t,e){this.stream.point(t*Nr,e*Nr)}});function Mi(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,s){return[e+t*(o*=r),n-t*(s*=i)]}return o.invert=function(o,s){return[(o-e)/t*r,(n-s)/t*i]},o}(t,e,n,r,i);var s=Pr(o),a=Cr(o),u=s*t,l=a*t,h=s/t,c=a/t,f=(a*n-s*e)/t,v=(a*e+s*n)/t;function g(t,o){return[u*(t*=r)-l*(o*=i)+e,n-l*t-u*o]}return g.invert=function(t,e){return[r*(h*t-c*e+f),i*(v-c*t-h*e)]},g}function Li(t){return function(t){var e,n,r,i,o,s,a,u,l,h,c=150,f=480,v=250,g=0,d=0,p=0,y=0,m=0,_=0,x=1,E=1,k=null,w=hi,b=null,I=di,N=.5;function S(t){return u(t[0]*Nr,t[1]*Nr)}function M(t){return(t=u.invert(t[0],t[1]))&&[t[0]*Ir,t[1]*Ir]}function L(){var t=Mi(c,0,0,x,E,_).apply(null,e(g,d)),r=Mi(c,f-t[0],v-t[1],x,E,_);return n=function(t,e,n){return(t%=br)?e||n?Wr(Qr(t),$r(e,n)):Qr(t):e||n?$r(e,n):Jr}(p,y,m),a=Wr(e,r),u=Wr(n,a),s=Ni(a,N),P()}function P(){return l=h=null,S}return S.stream=function(t){return l&&h===t?l:l=Si(function(t){return Ei({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(w(s(I(h=t)))))},S.preclip=function(t){return arguments.length?(w=t,k=void 0,P()):w},S.postclip=function(t){return arguments.length?(I=t,b=r=i=o=null,P()):I},S.clipAngle=function(t){return arguments.length?(w=+t?ci(k=t*Nr):(k=null,hi),P()):k*Ir},S.clipExtent=function(t){return arguments.length?(I=null==t?(b=r=i=o=null,di):gi(b=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==b?null:[[b,r],[i,o]]},S.scale=function(t){return arguments.length?(c=+t,L()):c},S.translate=function(t){return arguments.length?(f=+t[0],v=+t[1],L()):[f,v]},S.center=function(t){return arguments.length?(g=t[0]%360*Nr,d=t[1]%360*Nr,L()):[g*Ir,d*Ir]},S.rotate=function(t){return arguments.length?(p=t[0]%360*Nr,y=t[1]%360*Nr,m=t.length>2?t[2]%360*Nr:0,L()):[p*Ir,y*Ir,m*Ir]},S.angle=function(t){return arguments.length?(_=t%360*Nr,L()):_*Ir},S.reflectX=function(t){return arguments.length?(x=t?-1:1,L()):x<0},S.reflectY=function(t){return arguments.length?(E=t?-1:1,L()):E<0},S.precision=function(t){return arguments.length?(s=Ni(a,N=t*t),P()):Or(N)},S.fitExtent=function(t,e){return bi(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return bi(t,[[0,0],e],n)}(S,t,e)},S.fitWidth=function(t,e){return function(t,e,n){return wi(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,s=-i*n[0][1];t.scale(150*i).translate([o,s])},n)}(S,t,e)},S.fitHeight=function(t,e){return function(t,e,n){return wi(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],s=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,s])},n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,L()}}(function(){return t})()}var Pi=function(t){return function(e,n){var r=Pr(e),i=Pr(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Cr(e),o*Cr(n)]}}(function(t){return(t=Rr(t))&&t/Cr(t)});function Ci(){return Li(Pi).scale(79.4188).clipAngle(179.999)}Pi.invert=function(t){return function(e,n){var r=Or(e*e+n*n),i=t(r),o=Cr(i),s=Pr(i);return[Lr(e*o,r*s),Ar(r&&n*o/r)]}}(function(t){return t});var Ti=dr.BufferOp,Oi=dr.GeoJSONReader,Ri=dr.GeoJSONWriter;function Ai(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return kt(t,function(t){var i=Ai(t,e,n,r);i&&s.push(i)}),R(s)}var a=function(t){var e=cr(t).geometry.coordinates,n=[-e[0],-e[1]];return Ci().rotate(n).scale(w)}(o),u={type:o.type,coordinates:Fi(o.coordinates,a)},l=(new Oi).read(u),h=Y(B(e,n),"meters"),c=Ti.bufferOp(l,h,r);if(!Di((c=(new Ri).write(c)).coordinates))return N({type:c.type,coordinates:qi(c.coordinates,a)},i)}function Di(t){return Array.isArray(t[0])?Di(t[0]):isNaN(t[0])}function Fi(t,e){return"object"!==E(t[0])?e(t):t.map(function(t){return Fi(t,e)})}function qi(t,e){return"object"!==E(t[0])?e.invert(t):t.map(function(t){return qi(t,e)})}function Gi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return kt(t,function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!W(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+o);(a=Number(a))>0&&dt(t,function(t){n+=t[0]*a,r+=t[1]*a,i+=a})}),M([n/i,r/i],e.properties,e)}function Yi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return dt(t,function(t){n+=t[0],r+=t[1],i++},!0),M([n/i,r/i],e.properties)}function Bi(t,e,n,r,i){var o=r.tolerance||.001,s=0,a=0,u=0,l=0;if(_t(n,function(e){var n,r=null==(n=e.properties)?void 0:n.weight,i=null==r?1:r;if(!W(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*ft(e,t);0===o&&(o=1);var h=i/o;s+=e.geometry.coordinates[0]*h,a+=e.geometry.coordinates[1]*h,u+=h}}),l<1)throw new Error("no features to measure");var h=s/u,c=a/u;return 1===l||0===i||Math.abs(h-e[0])<o&&Math.abs(c-e[1])<o?M([h,c],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([h,c]),Bi([h,c],t,n,r,i-1))}var zi,ji,Xi,Ui,Vi,Zi={exports:{}},Hi=Kn(de),Wi=Kn(we),Ji={exports:{}};function Ki(){if(Vi)return Ji.exports;Vi=1;var t=(ji||(ji=1,zi=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,u=0,l=a-1;u<a;l=u++){var h=e[n+2*u+0],c=e[n+2*u+1],f=e[n+2*l+0],v=e[n+2*l+1];c>o!=v>o&&i<(f-h)*(o-c)/(v-c)+h&&(s=!s)}return s}),zi),e=(Ui||(Ui=1,Xi=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,u=0,l=a-1;u<a;l=u++){var h=e[u+n][0],c=e[u+n][1],f=e[l+n][0],v=e[l+n][1];c>o!=v>o&&i<(f-h)*(o-c)/(v-c)+h&&(s=!s)}return s}),Xi);return Ji.exports=function(n,r,i,o){return r.length>0&&Array.isArray(r[0])?e(n,r,i,o):t(n,r,i,o)},Ji.exports.nested=e,Ji.exports.flat=t,Ji.exports}var Qi,$i,to={exports:{}};function eo(){return Qi||(Qi=1,function(t,e){!function(t){var e=134217729,n=33306690738754706e-32;function r(t,e,n,r,i){var o,s,a,u,l=e[0],h=r[0],c=0,f=0;h>l==h>-l?(o=l,l=e[++c]):(o=h,h=r[++f]);var v=0;if(c<t&&f<n)for(h>l==h>-l?(a=o-((s=l+o)-l),l=e[++c]):(a=o-((s=h+o)-h),h=r[++f]),o=s,0!==a&&(i[v++]=a);c<t&&f<n;)h>l==h>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c]):(a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f]),o=s,0!==a&&(i[v++]=a);for(;c<t;)a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c],o=s,0!==a&&(i[v++]=a);for(;f<n;)a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f],o=s,0!==a&&(i[v++]=a);return 0===o&&0!==v||(i[v++]=o),v}function i(t){return new Float64Array(t)}var o=33306690738754716e-32,s=22204460492503146e-32,a=11093356479670487e-47,u=i(4),l=i(8),h=i(12),c=i(16),f=i(4);t.orient2d=function(t,i,v,g,d,p){var y=(i-p)*(v-d),m=(t-d)*(g-p),_=y-m;if(0===y||0===m||y>0!=m>0)return _;var x=Math.abs(y+m);return Math.abs(_)>=o*x?_:-function(t,i,o,v,g,d,p){var y,m,_,x,E,k,w,b,I,N,S,M,L,P,C,T,O,R,A=t-g,D=o-g,F=i-d,q=v-d;E=(C=(b=A-(w=(k=e*A)-(k-A)))*(N=q-(I=(k=e*q)-(k-q)))-((P=A*q)-w*I-b*I-w*N))-(S=C-(O=(b=F-(w=(k=e*F)-(k-F)))*(N=D-(I=(k=e*D)-(k-D)))-((T=F*D)-w*I-b*I-w*N))),u[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),u[1]=L-(S+E)+(E-T),E=(R=M+S)-M,u[2]=M-(R-E)+(S-E),u[3]=R;var G=function(t,e){for(var n=e[0],r=1;r<t;r++)n+=e[r];return n}(4,u),Y=s*p;if(G>=Y||-G>=Y)return G;if(y=t-(A+(E=t-A))+(E-g),_=o-(D+(E=o-D))+(E-g),m=i-(F+(E=i-F))+(E-d),x=v-(q+(E=v-q))+(E-d),0===y&&0===m&&0===_&&0===x)return G;if(Y=a*p+n*Math.abs(G),(G+=A*x+q*y-(F*_+D*m))>=Y||-G>=Y)return G;E=(C=(b=y-(w=(k=e*y)-(k-y)))*(N=q-(I=(k=e*q)-(k-q)))-((P=y*q)-w*I-b*I-w*N))-(S=C-(O=(b=m-(w=(k=e*m)-(k-m)))*(N=D-(I=(k=e*D)-(k-D)))-((T=m*D)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var B=r(4,u,4,f,l);E=(C=(b=A-(w=(k=e*A)-(k-A)))*(N=x-(I=(k=e*x)-(k-x)))-((P=A*x)-w*I-b*I-w*N))-(S=C-(O=(b=F-(w=(k=e*F)-(k-F)))*(N=_-(I=(k=e*_)-(k-_)))-((T=F*_)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var z=r(B,l,4,f,h);E=(C=(b=y-(w=(k=e*y)-(k-y)))*(N=x-(I=(k=e*x)-(k-x)))-((P=y*x)-w*I-b*I-w*N))-(S=C-(O=(b=m-(w=(k=e*m)-(k-m)))*(N=_-(I=(k=e*_)-(k-_)))-((T=m*_)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var j=r(z,h,4,f,c);return c[j-1]}(t,i,v,g,d,p,x)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,to.exports)),to.exports}var no=function(){if($i)return Zi.exports;$i=1;var t=Hi,e=Wi,n=Ki(),r=eo().orient2d;function i(e,r,i){r=Math.max(0,void 0===r?2:r),i=i||0;var s=function(t){for(var e=t[0],r=t[0],i=t[0],o=t[0],s=0;s<t.length;s++){var a=t[s];a[0]<e[0]&&(e=a),a[0]>i[0]&&(i=a),a[1]<r[1]&&(r=a),a[1]>o[1]&&(o=a)}var u=[e,r,i,o],l=u.slice();for(s=0;s<t.length;s++)n(t[s],u)||l.push(t[s]);return function(t){t.sort(y);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&h(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&h(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(e),a=new t(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(e);for(var u,l=[],c=0;c<s.length;c++){var d=s[c];a.remove(d),u=v(d,u),l.push(u)}var p=new t(16);for(c=0;c<l.length;c++)p.insert(f(l[c]));for(var m=r*r,_=i*i;l.length;){var x=l.shift(),E=x.p,k=x.next.p,w=g(E,k);if(!(w<_)){var b=w/m;(d=o(a,x.prev.p,E,k,x.next.next.p,b,p))&&Math.min(g(d,E),g(d,k))<=b&&(l.push(x),l.push(v(d,x)),a.remove(d),p.remove(x),p.insert(f(x)),p.insert(f(x.next)))}}x=u;var I=[];do{I.push(x.p),x=x.next}while(x!==u);return I.push(x.p),I}function o(t,n,r,i,o,u,h){for(var c=new e([],s),f=t.data;f;){for(var v=0;v<f.children.length;v++){var g=f.children[v],p=f.leaf?d(g,r,i):a(r,i,g);p>u||c.push({node:g,dist:p})}for(;c.length&&!c.peek().node.children;){var y=c.pop(),m=y.node,_=d(m,n,r),x=d(m,i,o);if(y.dist<_&&y.dist<x&&l(r,m,h)&&l(i,m,h))return m}(f=c.pop())&&(f=f.node)}return null}function s(t,e){return t.dist-e.dist}function a(t,e,n){if(u(t,n)||u(e,n))return 0;var r=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=p(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=p(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function u(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function l(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u<a.length;u++)if(c(a[u].p,a[u].next.p,t,e))return!1;return!0}function h(t,e,n){return r(t[0],t[1],e[0],e[1],n[0],n[1])}function c(t,e,n,r){return t!==r&&e!==n&&h(t,e,n)>0!=h(t,e,r)>0&&h(n,r,t)>0!=h(n,r,e)>0}function f(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function v(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function g(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function p(t,e,n,r,i,o,s,a){var u,l,h,c,f=n-t,v=r-e,g=s-i,d=a-o,p=t-i,y=e-o,m=f*f+v*v,_=f*g+v*d,x=g*g+d*d,E=f*p+v*y,k=g*p+d*y,w=m*x-_*_,b=w,I=w;0===w?(l=0,b=1,c=k,I=x):(c=m*k-_*E,(l=_*k-x*E)<0?(l=0,c=k,I=x):l>b&&(l=b,c=k+_,I=x)),c<0?(c=0,-E<0?l=0:-E>m?l=b:(l=-E,b=m)):c>I&&(c=I,-E+_<0?l=0:-E+_>m?l=b:(l=-E+_,b=m));var N=(1-(h=0===c?0:c/I))*i+h*s-((1-(u=0===l?0:l/b))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return N*N+S*S}function y(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}return e.default&&(e=e.default),Zi.exports=i,Zi.exports.default=i,Zi.exports}(),ro=Jn(no);function io(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.concavity=e.concavity||1/0;var n=[];if(dt(t,function(t){n.push([t[0],t[1]])}),!n.length)return null;var r=ro(n,e.concavity);return r.length>3?P([r],e.properties):null}function oo(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s=0;s<r;s++)o.push(ct(t,e,-360*s/r,n).geometry.coordinates);return o.push(o[0]),P([o],i)}function so(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return ao(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return ao(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return lo(t);default:throw new Error("unknown GeoJSON type")}}function ao(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=uo(t.properties),null==t.geometry?e.geometry=null:e.geometry=lo(t.geometry),e}function uo(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"===E(r)?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map(function(t){return t}):e[n]=uo(r):e[n]=r}),e):e}function lo(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return lo(t)}),e):(e.coordinates=ho(t.coordinates),e)}function ho(t){var e=t;return"object"!==E(e[0])?e.slice():e.map(function(t){return ho(t)})}function co(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("filter is required");var n=[];return _t(t,function(t){po(t.properties,e)&&n.push(t)}),R(n)}function fo(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("property is required");for(var r=go(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],l=0;l<a.length;l++)u.push(t.features[a[l]]);n(R(u),s,o)}}function vo(t,e,n,r){var i=r;return fo(t,e,function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)}),i}function go(t,e){var n={};return _t(t,function(t,r){var i=t.properties||{};if(Object.prototype.hasOwnProperty.call(i,String(e))){var o=i[e];Object.prototype.hasOwnProperty.call(n,o)?n[o].push(r):n[o]=[r]}}),n}function po(t,e){if(void 0===t)return!1;var n=E(e);if("number"===n||"string"===n)return Object.prototype.hasOwnProperty.call(t,e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!po(t,e[r]))return!1;return!0}return yo(t,e)}function yo(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function mo(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}var _o,xo,Eo,ko,wo,bo,Io=Object.freeze({__proto__:null,applyFilter:po,clusterEach:fo,clusterReduce:vo,createBins:go,filterProperties:mo,getCluster:co,propertiesContainsFilter:yo});function No(){return xo||(xo=1,_o={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i},mandist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i},dist:function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}}),_o}var So=function(){if(bo)return wo;bo=1;var t=No(),e=function(){if(ko)return Eo;ko=1;var t=No(),e=t.eudist,n=t.dist;return Eo={kmrand:function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},kmpp:function(t,r){var i=t[0].length?e:n,o=[],s=t.length,a=t[0].length>0,u=t[Math.floor(Math.random()*s)];for(a&&u.join("_"),o.push(u);o.length<r;){for(var l=[],h=o.length,c=0,f=[],v=0;v<s;v++){for(var g=1/0,d=0;d<h;d++){var p=i(t[v],o[d]);p<=g&&(g=p)}l[v]=g}for(var y=0;y<s;y++)c+=l[y];for(var m=0;m<s;m++)f[m]={i:m,v:t[m],pr:l[m]/c,cs:0};f.sort(function(t,e){return t.pr-e.pr}),f[0].cs=f[0].pr;for(var _=1;_<s;_++)f[_].cs=f[_-1].cs+f[_].pr;for(var x=Math.random(),E=0;E<s-1&&f[E++].cs<x;);o.push(f[E-1].v)}return o}},Eo}(),n=t.eudist;t.mandist,t.dist;var r=e.kmrand,i=e.kmpp;function o(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}return wo=function(t,e,s,a){var u=[],l=[],h=[],c=[],f=!1,v=a||1e4,g=t.length,d=t[0].length,p=d>0,y=[];if(s)u="kmrand"==s?r(t,e):"kmpp"==s?i(t,e):s;else for(var m={};u.length<e;){var _=Math.floor(Math.random()*g);m[_]||(m[_]=!0,u.push(t[_]))}do{o(e,0,y);for(var x=0;x<g;x++){for(var E=1/0,k=0,w=0;w<e;w++){(c=p?n(t[x],u[w]):Math.abs(t[x]-u[w]))<=E&&(E=c,k=w)}h[x]=k,y[k]++}for(var b=[],I=(l=[],0);I<e;I++)b[I]=p?o(d,0,b[I]):0,l[I]=u[I];if(p){for(var N=0;N<e;N++)u[N]=[];for(var S=0;S<g;S++)for(var M=b[h[S]],L=t[S],P=0;P<d;P++)M[P]+=L[P];f=!0;for(var C=0;C<e;C++){for(var T=u[C],O=b[C],R=l[C],A=y[C],D=0;D<d;D++)T[D]=O[D]/A||0;if(f)for(var F=0;F<d;F++)if(R[F]!=T[F]){f=!1;break}}}else{for(var q=0;q<g;q++){b[h[q]]+=t[q]}for(var G=0;G<e;G++)u[G]=b[G]/y[G]||0;f=!0;for(var Y=0;Y<e;Y++)if(l[Y]!=u[Y]){f=!1;break}}f=f||--v<=0}while(!f);return{it:1e4-v,k:e,idxs:h,centroids:u}},wo}(),Mo=Jn(So);function Lo(t,e){var n=!1;return R(function(t){if(t.length<3)return[];t.sort(Co);var e,n,r,i,o,s,a=t.length-1,u=t[a].x,l=t[0].x,h=t[a].y,c=h,f=1e-12;for(;a--;)t[a].y<h&&(h=t[a].y),t[a].y>c&&(c=t[a].y);var v,g=l-u,d=c-h,p=g>d?g:d,y=.5*(l+u),m=.5*(c+h),_=[new Po({__sentinel:!0,x:y-20*p,y:m-p},{__sentinel:!0,x:y,y:m+20*p},{__sentinel:!0,x:y+20*p,y:m-p})],x=[],E=[];a=t.length;for(;a--;){for(E.length=0,v=_.length;v--;)(g=t[a].x-_[v].x)>0&&g*g>_[v].r?(x.push(_[v]),_.splice(v,1)):g*g+(d=t[a].y-_[v].y)*d>_[v].r||(E.push(_[v].a,_[v].b,_[v].b,_[v].c,_[v].c,_[v].a),_.splice(v,1));for(To(E),v=E.length;v;)n=E[--v],e=E[--v],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>f&&_.push(new Po(e,n,r))}Array.prototype.push.apply(x,_),a=x.length;for(;a--;)(x[a].a.__sentinel||x[a].b.__sentinel||x[a].c.__sentinel)&&x.splice(a,1);return x}(t.features.map(function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r})).map(function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},P([[e,r,i,e]],o)}))}var Po=s(function t(e,n,r){i(this,t),this.a=e,this.b=n,this.c=r;var o,s,a=n.x-e.x,u=n.y-e.y,l=r.x-e.x,h=r.y-e.y,c=a*(e.x+n.x)+u*(e.y+n.y),f=l*(e.x+r.x)+h*(e.y+r.y),v=2*(a*(r.y-n.y)-u*(r.x-n.x));this.x=(h*c-u*f)/v,this.y=(a*f-l*c)/v,o=this.x-e.x,s=this.y-e.y,this.r=o*o+s*s});function Co(t,e){return e.x-t.x}function To(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function Oo(t){return t}function Ro(t,e){var n=function(t){if(null==t)return Oo;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,h=new Array(l);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u<l;)h[u]=t[u],++u;return h}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,s=i.length;o<s;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,s)}function o(t){return n(t)}function s(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function a(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function u(t){return t.map(a)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=s(e.arcs);break;case"MultiLineString":n=e.arcs.map(s);break;case"Polygon":n=u(e.arcs);break;case"MultiPolygon":n=e.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(e)}function Ao(t,e){var n={},r={},i={},o=[],s=-1;function a(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}return e.forEach(function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++s],e[s]=n,e[r]=i)}),e.forEach(function(e){var n,o,s=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),a=s[0],u=s[1];if(n=i[a])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=a,o=i[a]){delete i[o.end];var h=o===n?n:o.concat(n);r[h.start=o.start]=i[h.end=n.end]=h}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=a]=i[n.end=u]=n}),a(i,r),a(r,i),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o}function Do(t){return Ro(t,Fo.apply(this,arguments))}function Fo(t,e){var n={},r=[],i=[];function o(t){t.forEach(function(e){e.forEach(function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)})}),r.push(t)}function s(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(Ro(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}}),r.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,i.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),r.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:i.map(function(e){var r,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].length<2&&i.push(t)})})}),(r=(i=Ao(t,i)).length)>1)for(var o,a,u=1,l=s(i[0]);u<r;++u)(o=s(i[u]))>l&&(a=i[0],i[0]=i[u],i[u]=a,l=o);return i}).filter(function(t){return t.length>0})}}var qo=Object.prototype.hasOwnProperty;function Go(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,l=0;l<t;++l)s[l]=i;return{set:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l]=o;if(++c>=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o},maybeSet:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o},get:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)break;h=s[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var r=s[e];r!=i&&t.push(r)}return t}}}function Yo(t,e){return t[0]===e[0]&&t[1]===e[1]}var Bo=new ArrayBuffer(16),zo=new Float64Array(Bo),jo=new Uint32Array(Bo);function Xo(t){zo[0]=t[0],zo[1]=t[1];var e=jo[0]^jo[1];return 2147483647&(e=e<<5^e>>7^jo[2]^jo[3])}function Uo(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=function(){for(var t=Go(1.4*o.length,E,k,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n<r;++n)e[n]=t.maybeSet(n,n);return e}(),l=new Int32Array(o.length),h=new Int32Array(o.length),c=new Int32Array(o.length),f=new Int8Array(o.length),v=0;for(e=0,n=o.length;e<n;++e)l[e]=h[e]=c[e]=-1;for(e=0,n=s.length;e<n;++e){var g=s[e],d=g[0],p=g[1];for(r=u[d],i=u[++d],++v,f[r]=1;++d<=p;)x(e,r,r=i,i=u[d]);++v,f[i]=1}for(e=0,n=o.length;e<n;++e)l[e]=-1;for(e=0,n=a.length;e<n;++e){var y=a[e],m=y[0]+1,_=y[1];for(x(e,u[_-1],r=u[m-1],i=u[m]);++m<=_;)x(e,r,r=i,i=u[m])}function x(t,e,n,r){if(l[n]!==t){l[n]=t;var i=h[n];if(i>=0){var o=c[n];i===e&&o===r||i===r&&o===e||(++v,f[n]=1)}else h[n]=e,c[n]=r}}function E(t){return Xo(o[t])}function k(t,e){return Yo(o[t],o[e])}l=h=c=null;var w,b=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=i;return{add:function(r){for(var a=e(r)&s,u=o[a],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*v,Xo,Yo);for(e=0,n=o.length;e<n;++e)f[w=u[e]]&&b.add(o[w]);return b}function Vo(t,e,n,r){Zo(t,e,n),Zo(t,e,e+r),Zo(t,e+r,n)}function Zo(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function Ho(t){return null==t?{type:null}:("FeatureCollection"===t.type?Wo:"Feature"===t.type?Jo:Ko)(t)}function Wo(t){var e={type:"GeometryCollection",geometries:t.features.map(Jo)};return null!=t.bbox&&(e.bbox=t.bbox),e}function Jo(t){var e,n=Ko(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function Ko(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(Ko)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function Qo(t,e){var n=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;function o(t){null!=t&&qo.call(s,t.type)&&s[t.type](t)}var s={GeometryCollection:function(t){t.geometries.forEach(o)},Point:function(t){a(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(a)},LineString:function(t){u(t.arcs)},MultiLineString:function(t){t.arcs.forEach(u)},Polygon:function(t){t.arcs.forEach(u)},MultiPolygon:function(t){t.arcs.forEach(l)}};function a(t){var o=t[0],s=t[1];o<e&&(e=o),o>r&&(r=o),s<n&&(n=s),s>i&&(i=s)}function u(t){t.forEach(a)}function l(t){t.forEach(u)}for(var h in t)o(t[h]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Ho(t[e]);return n}(t)),r=function(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=s.length+a.length;for(delete t.lines,delete t.rings,r=0,i=s.length;r<i;++r)for(e=s[r];e=e.next;)++u;for(r=0,i=a.length;r<i;++r)for(n=a[r];n=n.next;)++u;var l=Go(2*u*1.4,Xo,Yo),h=t.arcs=[];for(r=0,i=s.length;r<i;++r){e=s[r];do{c(e)}while(e=e.next)}for(r=0,i=a.length;r<i;++r)if((n=a[r]).next)do{c(n)}while(n=n.next);else f(n);function c(t){var e,n,r,i,s,a,u,c;if(r=l.get(e=o[t[0]]))for(u=0,c=r.length;u<c;++u)if(v(i=r[u],t))return t[0]=i[0],void(t[1]=i[1]);if(s=l.get(n=o[t[1]]))for(u=0,c=s.length;u<c;++u)if(g(a=s[u],t))return t[1]=a[0],void(t[0]=a[1]);r?r.push(t):l.set(e,[t]),s?s.push(t):l.set(n,[t]),h.push(t)}function f(t){var e,n,r,i,s;if(n=l.get(o[t[0]]))for(i=0,s=n.length;i<s;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(p(r,t))return t[0]=r[1],void(t[1]=r[0])}if(n=l.get(e=o[t[0]+y(t)]))for(i=0,s=n.length;i<s;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(p(r,t))return t[0]=r[1],void(t[1]=r[0])}n?n.push(t):l.set(e,[t]),h.push(t)}function v(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!==r-e[1])return!1;for(;n<=i;++n,++r)if(!Yo(o[n],o[r]))return!1;return!0}function g(t,e){var n=t[0],r=e[0],i=t[1],s=e[1];if(n-i!==r-s)return!1;for(;n<=i;++n,--s)if(!Yo(o[n],o[s]))return!1;return!0}function d(t,e){var n=t[0],r=e[0],i=t[1]-n;if(i!==e[1]-r)return!1;for(var s=y(t),a=y(e),u=0;u<i;++u)if(!Yo(o[n+(u+s)%i],o[r+(u+a)%i]))return!1;return!0}function p(t,e){var n=t[0],r=e[0],i=t[1],s=e[1],a=i-n;if(a!==s-r)return!1;for(var u=y(t),l=a-y(e),h=0;h<a;++h)if(!Yo(o[n+(h+u)%a],o[s-(h+l)%a]))return!1;return!0}function y(t){for(var e=t[0],n=t[1],r=e,i=r,s=o[r];++r<n;){var a=o[r];(a[0]<s[0]||a[0]===s[0]&&a[1]<s[1])&&(i=r,s=a)}return i-e}return t}(function(t){var e,n,r,i=Uo(t),o=t.coordinates,s=t.lines,a=t.rings;for(n=0,r=s.length;n<r;++n)for(var u=s[n],l=u[0],h=u[1];++l<h;)i.has(o[l])&&(e={0:l,1:u[1]},u[1]=l,u=u.next=e);for(n=0,r=a.length;n<r;++n)for(var c=a[n],f=c[0],v=f,g=c[1],d=i.has(o[f]);++v<g;)i.has(o[v])&&(d?(e={0:v,1:c[1]},c[1]=v,c=c.next=e):(Vo(o,f,g,g-v),o[g]=o[f],d=!0,v=f));return t}(function(t){var e=-1,n=[],r=[],i=[];function o(t){t&&qo.call(s,t.type)&&s[t.type](t)}var s={GeometryCollection:function(t){t.geometries.forEach(o)},LineString:function(t){t.arcs=a(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(a)},Polygon:function(t){t.arcs=t.arcs.map(u)},MultiPolygon:function(t){t.arcs=t.arcs.map(l)}};function a(t){for(var r=0,o=t.length;r<o;++r)i[++e]=t[r];var s={0:e-o+1,1:e};return n.push(s),s}function u(t){for(var n=0,o=t.length;n<o;++n)i[++e]=t[n];var s={0:e-o+1,1:e};return r.push(s),s}function l(t){return t.map(u)}for(var h in t)o(t[h]);return{type:"Topology",coordinates:i,lines:n,rings:r,objects:t}}(t))),i=r.coordinates,o=Go(1.4*r.arcs.length,$o,ts);function s(t){t&&qo.call(a,t.type)&&a[t.type](t)}t=r.objects,r.bbox=n,r.arcs=r.arcs.map(function(t,e){return o.set(t,e),i.slice(t[0],t[1]+1)}),delete r.coordinates,i=null;var a={GeometryCollection:function(t){t.geometries.forEach(s)},LineString:function(t){t.arcs=u(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(u)},Polygon:function(t){t.arcs=t.arcs.map(u)},MultiPolygon:function(t){t.arcs=t.arcs.map(l)}};function u(t){var e=[];do{var n=o.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function l(t){return t.map(u)}for(var h in t)s(t[h]);return r}function $o(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function ts(t,e){var n,r=t[0],i=t[1],o=e[0],s=e[1];return i<r&&(n=r,r=i,i=n),s<o&&(n=o,o=s,s=n),r===o&&i===s}function es(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=so(t));var r=[],i=Lt(t,function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=ns(r[0]),s=ns(r[r.length-1]),a=ns(i[0]),u=ns(i[i.length-1]);if(o===u)n=i.concat(r.slice(1));else if(a===s)n=r.concat(i.slice(1));else if(o===a)n=r.slice(1).reverse().concat(i);else{if(s!==u)return null;n=r.concat(i.reverse().slice(1))}return T(n)}(t,e);return n||(r.push(t),e)});return i&&r.push(i),r.length?1===r.length?r[0]:A(r.map(function(t){return t.coordinates})):null}function ns(t){return t[0].toString()+","+t[1].toString()}function rs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=so(t));var r=function(t){var e={};bt(t,function(t){e[t.geometry.type]=!0});var n=Object.keys(e);if(1===n.length)return n[0];return null}(t);if(!r)throw new Error("geojson must be homogenous");var i=t;switch(r){case"LineString":return es(i,e);case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=so(t));var n=[];bt(t,function(t){n.push(t.geometry)});var r=Qo({geoms:q(n).geometry});return Do(r,r.objects.geoms.geometries)}(i,e);default:throw new Error(r+" is not supported")}}var is=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,os=Math.ceil,ss=Math.floor,as="[BigNumber Error] ",us=as+"Number primitive has more than 15 significant digits: ",ls=1e14,hs=14,cs=9007199254740991,fs=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],vs=1e7,gs=1e9;function ds(t){var e=0|t;return t>0||t===e?e:e-1}function ps(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=hs-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function ys(t,e){var n,r,i=t.c,o=e.c,s=t.s,a=e.s,u=t.e,l=e.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=u==l,!i||!o)return r?0:!i^n?1:-1;if(!r)return u>l^n?1:-1;for(a=(u=i.length)<(l=o.length)?u:l,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return u==l?0:u>l^n?1:-1}function ms(t,e,n,r){if(t<e||t>n||t!==ss(t))throw Error(as+(r||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _s(t){var e=t.c.length-1;return ds(t.e/hs)==e&&t.c[e]%2!=0}function xs(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Es(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}var ks=function t(e){var n,r,i,o,s,a,u,l,h,c,f=S.prototype={constructor:S,toString:null,valueOf:null},v=new S(1),g=20,d=4,p=-7,y=21,m=-1e7,_=1e7,x=!1,k=1,w=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function S(t,e){var n,o,s,a,u,l,h,c,f=this;if(!(f instanceof S))return new S(t,e);if(null==e){if(t&&!0===t._isBigNumber)return f.s=t.s,void(!t.c||t.e>_?f.c=f.e=null:t.e<m?f.c=[f.e=0]:(f.e=t.e,f.c=t.c.slice()));if((l="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(a=0,u=t;u>=10;u/=10,a++);return void(a>_?f.c=f.e=null:(f.e=a,f.c=[t]))}c=String(t)}else{if(!is.test(c=String(t)))return i(f,c,l);f.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}(a=c.indexOf("."))>-1&&(c=c.replace(".","")),(u=c.search(/e/i))>0?(a<0&&(a=u),a+=+c.slice(u+1),c=c.substring(0,u)):a<0&&(a=c.length)}else{if(ms(e,2,I.length,"Base"),10==e&&N)return C(f=new S(t),g+f.e+1,d);if(c=String(t),l="number"==typeof t){if(0*t!=0)return i(f,c,l,e);if(f.s=1/t<0?(c=c.slice(1),-1):1,S.DEBUG&&c.replace(/^0\\.0*|\\./,"").length>15)throw Error(us+t)}else f.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1;for(n=I.slice(0,e),a=u=0,h=c.length;u<h;u++)if(n.indexOf(o=c.charAt(u))<0){if("."==o){if(u>a){a=h;continue}}else if(!s&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){s=!0,u=-1,a=0;continue}return i(f,String(t),l,e)}l=!1,(a=(c=r(c,e,10,f.s)).indexOf("."))>-1?c=c.replace(".",""):a=c.length}for(u=0;48===c.charCodeAt(u);u++);for(h=c.length;48===c.charCodeAt(--h););if(c=c.slice(u,++h)){if(h-=u,l&&S.DEBUG&&h>15&&(t>cs||t!==ss(t)))throw Error(us+f.s*t);if((a=a-u-1)>_)f.c=f.e=null;else if(a<m)f.c=[f.e=0];else{if(f.e=a,f.c=[],u=(a+1)%hs,a<0&&(u+=hs),u<h){for(u&&f.c.push(+c.slice(0,u)),h-=hs;u<h;)f.c.push(+c.slice(u,u+=hs));u=hs-(c=c.slice(u)).length}else u-=h;for(;u--;c+="0");f.c.push(+c)}}else f.c=[f.e=0]}function M(t,e,n,r){var i,o,s,a,u;if(null==n?n=d:ms(n,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)u=ps(t.c),u=1==r||2==r&&(s<=p||s>=y)?xs(u,s):Es(u,s,"0");else if(o=(t=C(new S(t),e,n)).e,a=(u=ps(t.c)).length,1==r||2==r&&(e<=o||o<=p)){for(;a<e;u+="0",a++);u=xs(u,o)}else if(e-=s,u=Es(u,o,"0"),o+1>a){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-a)>0)for(o+1==a&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function L(t,e){for(var n,r,i=1,o=new S(t[0]);i<t.length;i++)(!(r=new S(t[i])).s||(n=ys(o,r))===e||0===n&&o.s===e)&&(o=r);return o}function P(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*hs-1)>_?t.c=t.e=null:n<m?t.c=[t.e=0]:(t.e=n,t.c=e),t}function C(t,e,n,r){var i,o,s,a,u,l,h,c=t.c,f=fs;if(c){t:{for(i=1,a=c[0];a>=10;a/=10,i++);if((o=e-i)<0)o+=hs,s=e,u=c[l=0],h=ss(u/f[i-s-1]%10);else if((l=os((o+1)/hs))>=c.length){if(!r)break t;for(;c.length<=l;c.push(0));u=h=0,i=1,s=(o%=hs)-hs+1}else{for(u=a=c[l],i=1;a>=10;a/=10,i++);h=(s=(o%=hs)-hs+i)<0?0:ss(u/f[i-s-1]%10)}if(r=r||e<0||null!=c[l+1]||(s<0?u:u%f[i-s-1]),r=n<4?(h||r)&&(0==n||n==(t.s<0?3:2)):h>5||5==h&&(4==n||r||6==n&&(o>0?s>0?u/f[i-s]:0:c[l-1])%10&1||n==(t.s<0?8:7)),e<1||!c[0])return c.length=0,r?(e-=t.e+1,c[0]=f[(hs-e%hs)%hs],t.e=-e||0):c[0]=t.e=0,t;if(0==o?(c.length=l,a=1,l--):(c.length=l+1,a=f[hs-o],c[l]=s>0?ss(u/f[i-s]%f[s])*a:0),r)for(;;){if(0==l){for(o=1,s=c[0];s>=10;s/=10,o++);for(s=c[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,c[0]==ls&&(c[0]=1));break}if(c[l]+=a,c[l]!=ls)break;c[l--]=0,a=1}for(o=c.length;0===c[--o];c.pop());}t.e>_?t.c=t.e=null:t.e<m&&(t.c=[t.e=0])}return t}function T(t){var e,n=t.e;return null===n?t.toString():(e=ps(t.c),e=n<=p||n>=y?xs(e,n):Es(e,n,"0"),t.s<0?"-"+e:e)}return S.clone=t,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(t){var e,n;if(null!=t){if("object"!=E(t))throw Error(as+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(ms(n=t[e],0,gs,e),g=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(ms(n=t[e],0,8,e),d=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(ms(n[0],-gs,0,e),ms(n[1],0,gs,e),p=n[0],y=n[1]):(ms(n,-gs,gs,e),p=-(y=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)ms(n[0],-gs,-1,e),ms(n[1],1,gs,e),m=n[0],_=n[1];else{if(ms(n,-gs,gs,e),!n)throw Error(as+e+" cannot be zero: "+n);m=-(_=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(as+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw x=!n,Error(as+"crypto unavailable");x=n}else x=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(ms(n=t[e],0,9,e),k=n),t.hasOwnProperty(e="POW_PRECISION")&&(ms(n=t[e],0,gs,e),w=n),t.hasOwnProperty(e="FORMAT")){if("object"!=E(n=t[e]))throw Error(as+e+" not an object: "+n);b=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(as+e+" invalid: "+n);N="0123456789"==n.slice(0,10),I=n}}return{DECIMAL_PLACES:g,ROUNDING_MODE:d,EXPONENTIAL_AT:[p,y],RANGE:[m,_],CRYPTO:x,MODULO_MODE:k,POW_PRECISION:w,FORMAT:b,ALPHABET:I}},S.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!S.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-gs&&i<=gs&&i===ss(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%hs)<1&&(e+=hs),String(r[0]).length==e){for(e=0;e<r.length;e++)if((n=r[e])<0||n>=ls||n!==ss(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(as+"Invalid BigNumber: "+t)},S.maximum=S.max=function(){return L(arguments,-1)},S.minimum=S.min=function(){return L(arguments,1)},S.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return ss(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,n,r,i,o,a=0,u=[],l=new S(v);if(null==t?t=g:ms(t,0,gs),i=os(t/hs),x)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*e[a]+(e[a+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[a]=n[0],e[a+1]=n[1]):(u.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw x=!1,Error(as+"crypto unavailable");for(e=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&e[a])+1099511627776*e[a+1]+4294967296*e[a+2]+16777216*e[a+3]+(e[a+4]<<16)+(e[a+5]<<8)+e[a+6])>=9e15?crypto.randomBytes(7).copy(e,a):(u.push(o%1e14),a+=7);a=i/7}if(!x)for(;a<i;)(o=s())<9e15&&(u[a++]=o%1e14);for(i=u[--a],t%=hs,i&&t&&(o=fs[hs-t],u[a]=ss(i/o)*o);0===u[a];u.pop(),a--);if(a<0)u=[r=0];else{for(r=-1;0===u[0];u.splice(0,1),r-=hs);for(a=1,o=u[0];o>=10;o/=10,a++);a<hs&&(r-=hs-a)}return l.e=r,l.c=u,l}),S.sum=function(){for(var t=1,e=arguments,n=new S(e[0]);t<e.length;)n=n.plus(e[t++]);return n},r=function(){var t="0123456789";function e(t,e,n,r){for(var i,o,s=[0],a=0,u=t.length;a<u;){for(o=s.length;o--;s[o]*=e);for(s[0]+=r.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,i,o,s,a){var u,l,h,c,f,v,p,y,m=r.indexOf("."),_=g,x=d;for(m>=0&&(c=w,w=0,r=r.replace(".",""),v=(y=new S(i)).pow(r.length-m),w=c,y.c=e(Es(ps(v.c),v.e,"0"),10,o,t),y.e=y.c.length),h=c=(p=e(r,i,o,a?(u=I,t):(u=t,I))).length;0==p[--c];p.pop());if(!p[0])return u.charAt(0);if(m<0?--h:(v.c=p,v.e=h,v.s=s,p=(v=n(v,y,_,x,o)).c,f=v.r,h=v.e),m=p[l=h+_+1],c=o/2,f=f||l<0||null!=p[l+1],f=x<4?(null!=m||f)&&(0==x||x==(v.s<0?3:2)):m>c||m==c&&(4==x||f||6==x&&1&p[l-1]||x==(v.s<0?8:7)),l<1||!p[0])r=f?Es(u.charAt(1),-_,u.charAt(0)):u.charAt(0);else{if(p.length=l,f)for(--o;++p[--l]>o;)p[l]=0,l||(++h,p=[1].concat(p));for(c=p.length;!p[--c];);for(m=0,r="";m<=c;r+=u.charAt(p[m++]));r=Es(r,h,u.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,s,a=0,u=t.length,l=e%vs,h=e/vs|0;for(t=t.slice();u--;)a=((i=l*(o=t[u]%vs)+(r=h*o+(s=t[u]/vs|0)*l)%vs*vs+a)/n|0)+(r/vs|0)+h*s,t[u]=i%n;return a&&(t=[a].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(r,i,o,s,a){var u,l,h,c,f,v,g,d,p,y,m,_,x,E,k,w,b,I=r.s==i.s?1:-1,N=r.c,M=i.c;if(!(N&&N[0]&&M&&M[0]))return new S(r.s&&i.s&&(N?!M||N[0]!=M[0]:M)?N&&0==N[0]||!M?0*I:I/0:NaN);for(p=(d=new S(I)).c=[],I=o+(l=r.e-i.e)+1,a||(a=ls,l=ds(r.e/hs)-ds(i.e/hs),I=I/hs|0),h=0;M[h]==(N[h]||0);h++);if(M[h]>(N[h]||0)&&l--,I<0)p.push(1),c=!0;else{for(E=N.length,w=M.length,h=0,I+=2,(f=ss(a/(M[0]+1)))>1&&(M=t(M,f,a),N=t(N,f,a),w=M.length,E=N.length),x=w,m=(y=N.slice(0,w)).length;m<w;y[m++]=0);b=M.slice(),b=[0].concat(b),k=M[0],M[1]>=a/2&&k++;do{if(f=0,(u=e(M,y,w,m))<0){if(_=y[0],w!=m&&(_=_*a+(y[1]||0)),(f=ss(_/k))>1)for(f>=a&&(f=a-1),g=(v=t(M,f,a)).length,m=y.length;1==e(v,y,g,m);)f--,n(v,w<g?b:M,g,a),g=v.length,u=1;else 0==f&&(u=f=1),g=(v=M.slice()).length;if(g<m&&(v=[0].concat(v)),n(y,v,m,a),m=y.length,-1==u)for(;e(M,y,w,m)<1;)f++,n(y,w<m?b:M,m,a),m=y.length}else 0===u&&(f++,y=[0]);p[h++]=f,y[0]?y[m++]=N[x]||0:(y=[N[x]],m=1)}while((x++<E||null!=y[0])&&I--);c=null!=y[0],p[0]||p.splice(0,1)}if(a==ls){for(h=1,I=p[0];I>=10;I/=10,h++);C(d,o+(d.e=h+l*hs-1)+1,s,c)}else d.e=l,d.r=+c;return d}}(),a=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,u=/^([^.]+)\\.$/,l=/^\\.([^.]+)$/,h=/^-?(Infinity|NaN)$/,c=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,i=function(t,e,n,r){var i,o=n?e:e.replace(c,"");if(h.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(a,function(t,e,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?t:e}),r&&(i=r,o=o.replace(u,"$1").replace(l,"0.$1")),e!=o))return new S(o,i);if(S.DEBUG)throw Error(as+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},f.absoluteValue=f.abs=function(){var t=new S(this);return t.s<0&&(t.s=1),t},f.comparedTo=function(t,e){return ys(this,new S(t,e))},f.decimalPlaces=f.dp=function(t,e){var n,r,i,o=this;if(null!=t)return ms(t,0,gs),null==e?e=d:ms(e,0,8),C(new S(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-ds(this.e/hs))*hs,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(t,e){return n(this,new S(t,e),g,d)},f.dividedToIntegerBy=f.idiv=function(t,e){return n(this,new S(t,e),0,1)},f.exponentiatedBy=f.pow=function(t,e){var n,r,i,o,s,a,u,l,h=this;if((t=new S(t)).c&&!t.isInteger())throw Error(as+"Exponent not an integer: "+T(t));if(null!=e&&(e=new S(e)),s=t.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!t.c||!t.c[0])return l=new S(Math.pow(+T(h),s?t.s*(2-_s(t)):+T(t))),e?l.mod(e):l;if(a=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new S(NaN);(r=!a&&h.isInteger()&&e.isInteger())&&(h=h.mod(e))}else{if(t.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||s&&h.c[1]>=24e7:h.c[0]<8e13||s&&h.c[0]<=9999975e7)))return o=h.s<0&&_s(t)?-0:0,h.e>-1&&(o=1/o),new S(a?1/o:o);w&&(o=os(w/hs+2))}for(s?(n=new S(.5),a&&(t.s=1),u=_s(t)):u=(i=Math.abs(+T(t)))%2,l=new S(v);;){if(u){if(!(l=l.times(h)).c)break;o?l.c.length>o&&(l.c.length=o):r&&(l=l.mod(e))}if(i){if(0===(i=ss(i/2)))break;u=i%2}else if(C(t=t.times(n),t.e+1,1),t.e>14)u=_s(t);else{if(0===(i=+T(t)))break;u=i%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):r&&(h=h.mod(e))}return r?l:(a&&(l=v.div(l)),e?l.mod(e):o?C(l,w,d,void 0):l)},f.integerValue=function(t){var e=new S(this);return null==t?t=d:ms(t,0,8),C(e,e.e+1,t)},f.isEqualTo=f.eq=function(t,e){return 0===ys(this,new S(t,e))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(t,e){return ys(this,new S(t,e))>0},f.isGreaterThanOrEqualTo=f.gte=function(t,e){return 1===(e=ys(this,new S(t,e)))||0===e},f.isInteger=function(){return!!this.c&&ds(this.e/hs)>this.c.length-2},f.isLessThan=f.lt=function(t,e){return ys(this,new S(t,e))<0},f.isLessThanOrEqualTo=f.lte=function(t,e){return-1===(e=ys(this,new S(t,e)))||0===e},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(t,e){var n,r,i,o,s=this,a=s.s;if(e=(t=new S(t,e)).s,!a||!e)return new S(NaN);if(a!=e)return t.s=-e,s.plus(t);var u=s.e/hs,l=t.e/hs,h=s.c,c=t.c;if(!u||!l){if(!h||!c)return h?(t.s=-e,t):new S(c?s:NaN);if(!h[0]||!c[0])return c[0]?(t.s=-e,t):new S(h[0]?s:3==d?-0:0)}if(u=ds(u),l=ds(l),h=h.slice(),a=u-l){for((o=a<0)?(a=-a,i=h):(l=u,i=c),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(r=(o=(a=h.length)<(e=c.length))?a:e,a=e=0;e<r;e++)if(h[e]!=c[e]){o=h[e]<c[e];break}if(o&&(i=h,h=c,c=i,t.s=-t.s),(e=(r=c.length)-(n=h.length))>0)for(;e--;h[n++]=0);for(e=ls-1;r>a;){if(h[--r]<c[r]){for(n=r;n&&!h[--n];h[n]=e);--h[n],h[r]+=ls}h[r]-=c[r]}for(;0==h[0];h.splice(0,1),--l);return h[0]?P(t,h,l):(t.s=3==d?-1:1,t.c=[t.e=0],t)},f.modulo=f.mod=function(t,e){var r,i,o=this;return t=new S(t,e),!o.c||!t.s||t.c&&!t.c[0]?new S(NaN):!t.c||o.c&&!o.c[0]?new S(o):(9==k?(i=t.s,t.s=1,r=n(o,t,0,3),t.s=i,r.s*=i):r=n(o,t,0,k),(t=o.minus(r.times(t))).c[0]||1!=k||(t.s=o.s),t)},f.multipliedBy=f.times=function(t,e){var n,r,i,o,s,a,u,l,h,c,f,v,g,d,p,y=this,m=y.c,_=(t=new S(t,e)).c;if(!(m&&_&&m[0]&&_[0]))return!y.s||!t.s||m&&!m[0]&&!_||_&&!_[0]&&!m?t.c=t.e=t.s=null:(t.s*=y.s,m&&_?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=ds(y.e/hs)+ds(t.e/hs),t.s*=y.s,(u=m.length)<(c=_.length)&&(g=m,m=_,_=g,i=u,u=c,c=i),i=u+c,g=[];i--;g.push(0));for(d=ls,p=vs,i=c;--i>=0;){for(n=0,f=_[i]%p,v=_[i]/p|0,o=i+(s=u);o>i;)n=((l=f*(l=m[--s]%p)+(a=v*l+(h=m[s]/p|0)*f)%p*p+g[o]+n)/d|0)+(a/p|0)+v*h,g[o--]=l%d;g[o]=n}return n?++r:g.splice(0,1),P(t,g,r)},f.negated=function(){var t=new S(this);return t.s=-t.s||null,t},f.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new S(t,e)).s,!i||!e)return new S(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/hs,s=t.e/hs,a=r.c,u=t.c;if(!o||!s){if(!a||!u)return new S(i/0);if(!a[0]||!u[0])return u[0]?t:new S(a[0]?r:0*i)}if(o=ds(o),s=ds(s),a=a.slice(),i=o-s){for(i>0?(s=o,n=u):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(e=u.length)<0&&(n=u,u=a,a=n,e=i),i=0;e;)i=(a[--e]=a[e]+u[e]+i)/ls|0,a[e]=ls===a[e]?0:a[e]%ls;return i&&(a=[i].concat(a),++s),P(t,a,s)},f.precision=f.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return ms(t,1,gs),null==e?e=d:ms(e,0,8),C(new S(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*hs+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},f.shiftedBy=function(t){return ms(t,-9007199254740991,cs),this.times("1e"+t)},f.squareRoot=f.sqrt=function(){var t,e,r,i,o,s=this,a=s.c,u=s.s,l=s.e,h=g+4,c=new S("0.5");if(1!==u||!a||!a[0])return new S(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+T(s)))||u==1/0?(((e=ps(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(+e),l=ds((l+1)/2)-(l<0||l%2),r=new S(e=u==1/0?"5e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new S(u+""),r.c[0])for((u=(l=r.e)+h)<3&&(u=0);;)if(o=r,r=c.times(o.plus(n(s,o,h,1))),ps(o.c).slice(0,u)===(e=ps(r.c)).slice(0,u)){if(r.e<l&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(C(r,r.e+g+2,1),t=!r.times(r).eq(s));break}if(!i&&(C(o,o.e+g+2,0),o.times(o).eq(s))){r=o;break}h+=4,u+=4,i=1}return C(r,r.e+g+1,d,t)},f.toExponential=function(t,e){return null!=t&&(ms(t,0,gs),t++),M(this,t,e,1)},f.toFixed=function(t,e){return null!=t&&(ms(t,0,gs),t=t+this.e+1),M(this,t,e)},f.toFormat=function(t,e,n){var r,i=this;if(null==n)null!=t&&e&&"object"==E(e)?(n=e,e=null):t&&"object"==E(t)?(n=t,t=e=null):n=b;else if("object"!=E(n))throw Error(as+"Argument not an object: "+n);if(r=i.toFixed(t,e),i.c){var o,s=r.split("."),a=+n.groupSize,u=+n.secondaryGroupSize,l=n.groupSeparator||"",h=s[0],c=s[1],f=i.s<0,v=f?h.slice(1):h,g=v.length;if(u&&(o=a,a=u,u=o,g-=o),a>0&&g>0){for(o=g%a||a,h=v.substr(0,o);o<g;o+=a)h+=l+v.substr(o,a);u>0&&(h+=l+v.slice(o)),f&&(h="-"+h)}r=c?h+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?c.replace(new RegExp("\\\\d{"+u+"}\\\\B","g"),"$&"+(n.fractionGroupSeparator||"")):c):h}return(n.prefix||"")+r+(n.suffix||"")},f.toFraction=function(t){var e,r,i,o,s,a,u,l,h,c,f,g,p=this,y=p.c;if(null!=t&&(!(u=new S(t)).isInteger()&&(u.c||1!==u.s)||u.lt(v)))throw Error(as+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+T(u));if(!y)return new S(p);for(e=new S(v),h=r=new S(v),i=l=new S(v),g=ps(y),s=e.e=g.length-p.e-1,e.c[0]=fs[(a=s%hs)<0?hs+a:a],t=!t||u.comparedTo(e)>0?s>0?e:h:u,a=_,_=1/0,u=new S(g),l.c[0]=0;c=n(u,e,0,1),1!=(o=r.plus(c.times(i))).comparedTo(t);)r=i,i=o,h=l.plus(c.times(o=h)),l=o,e=u.minus(c.times(o=e)),u=o;return o=n(t.minus(r),i,0,1),l=l.plus(o.times(h)),r=r.plus(o.times(i)),l.s=h.s=p.s,f=n(h,i,s*=2,d).minus(p).abs().comparedTo(n(l,r,s,d).minus(p).abs())<1?[h,i]:[l,r],_=a,f},f.toNumber=function(){return+T(this)},f.toPrecision=function(t,e){return null!=t&&ms(t,1,gs),M(this,t,e,2)},f.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=p||o>=y?xs(ps(n.c),o):Es(ps(n.c),o,"0"):10===t&&N?e=Es(ps((n=C(new S(n),g+o+1,d)).c),n.e,"0"):(ms(t,2,I.length,"Base"),e=r(Es(ps(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},f.valueOf=f.toJSON=function(){return T(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&S.set(e),S}(),ws=function(t){function e(t){return i(this,e),r(this,e,[t])}return h(e,t),s(e)}(s(function t(e){i(this,t),u(this,"key",void 0),u(this,"left",null),u(this,"right",null),this.key=e})),bs=function(){return s(function t(){i(this,t),u(this,"size",0),u(this,"modificationCount",0),u(this,"splayCount",0)},[{key:"splay",value:function(t){var e=this.root;if(null==e)return this.compare(t,t),-1;for(var n,r=null,i=null,o=null,s=null,a=e,u=this.compare;;)if((n=u(a.key,t))>0){var l=a.left;if(null==l)break;if((n=u(l.key,t))>0&&(a.left=l.right,l.right=a,null==(l=(a=l).left)))break;null==r?i=a:r.left=a,r=a,a=l}else{if(!(n<0))break;var h=a.right;if(null==h)break;if((n=u(h.key,t))<0&&(a.right=h.left,h.left=a,null==(h=(a=h).right)))break;null==o?s=a:o.right=a,o=a,a=h}return null!=o&&(o.right=a.left,a.left=s),null!=r&&(r.left=a.right,a.right=i),this.root!==a&&(this.root=a,this.splayCount++),n}},{key:"splayMin",value:function(t){for(var e=t,n=e.left;null!=n;){var r=n;e.left=r.right,r.right=e,n=(e=r).left}return e}},{key:"splayMax",value:function(t){for(var e=t,n=e.right;null!=n;){var r=n;e.right=r.left,r.left=e,n=(e=r).right}return e}},{key:"_delete",value:function(t){if(null==this.root)return null;if(0!=this.splay(t))return null;var e=this.root,n=e,r=e.left;if(this.size--,null==r)this.root=e.right;else{var i=e.right;(e=this.splayMax(r)).right=i,this.root=e}return this.modificationCount++,n}},{key:"addNewRoot",value:function(t,e){this.size++,this.modificationCount++;var n=this.root;null!=n?(e<0?(t.left=n,t.right=n.right,n.right=null):(t.right=n,t.left=n.left,n.left=null),this.root=t):this.root=t}},{key:"_first",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMin(t),this.root)}},{key:"_last",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMax(t),this.root)}},{key:"clear",value:function(){this.root=null,this.size=0,this.modificationCount++}},{key:"has",value:function(t){return this.validKey(t)&&0==this.splay(t)}},{key:"defaultCompare",value:function(){return function(t,e){return t<e?-1:t>e?1:0}}},{key:"wrap",value:function(){var t=this;return{getRoot:function(){return t.root},setRoot:function(e){t.root=e},getSize:function(){return t.size},getModificationCount:function(){return t.modificationCount},getSplayCount:function(){return t.splayCount},setSplayCount:function(e){t.splayCount=e},splay:function(e){return t.splay(e)},has:function(e){return t.has(e)}}}}])}(),Is=function(t){function e(t,n){var o;return i(this,e),u(o=r(this,e),"root",null),u(o,"compare",void 0),u(o,"validKey",void 0),u(o,Symbol.toStringTag,"[object Set]"),o.compare=null!=t?t:o.defaultCompare(),o.validKey=null!=n?n:function(t){return null!=t&&null!=t},o}return h(e,t),s(e,[{key:"delete",value:function(t){return!!this.validKey(t)&&null!=this._delete(t)}},{key:"deleteAll",value:function(t){var e,n=a(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.delete(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"forEach",value:function(t){for(var e,n=this[Symbol.iterator]();!(e=n.next()).done;)t(e.value,e.value,this)}},{key:"add",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new ws(t),e),this}},{key:"addAndReturn",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new ws(t),e),this.root.key}},{key:"addAll",value:function(t){var e,n=a(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"isEmpty",value:function(){return null==this.root}},{key:"isNotEmpty",value:function(){return null!=this.root}},{key:"single",value:function(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}},{key:"first",value:function(){if(0==this.size)throw"Bad state: No element";return this._first().key}},{key:"last",value:function(){if(0==this.size)throw"Bad state: No element";return this._last().key}},{key:"lastBefore",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)<0)return this.root.key;var e=this.root.left;if(null==e)return null;for(var n=e.right;null!=n;)n=(e=n).right;return e.key}},{key:"firstAfter",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)>0)return this.root.key;var e=this.root.right;if(null==e)return null;for(var n=e.left;null!=n;)n=(e=n).left;return e.key}},{key:"retainAll",value:function(t){var n,r=new e(this.compare,this.validKey),i=this.modificationCount,o=a(t);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(s)&&0==this.splay(s)&&r.add(this.root.key)}}catch(t){o.e(t)}finally{o.f()}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}},{key:"lookup",value:function(t){return this.validKey(t)?0!=this.splay(t)?null:this.root.key:null}},{key:"intersection",value:function(t){var n,r=new e(this.compare,this.validKey),i=a(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)&&r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"difference",value:function(t){var n,r=new e(this.compare,this.validKey),i=a(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)||r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"union",value:function(t){var e=this.clone();return e.addAll(t),e}},{key:"clone",value:function(){var t=new e(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}},{key:"copyNode",value:function(t){if(null==t)return null;var e=new ws(t.key);return function t(e,n){var r,i;do{if(r=e.left,i=e.right,null!=r){var o=new ws(r.key);n.left=o,t(r,o)}if(null!=i){var s=new ws(i.key);n.right=s,e=i,n=s}}while(null!=i)}(t,e),e}},{key:"toSet",value:function(){return this.clone()}},{key:"entries",value:function(){return new Ms(this.wrap())}},{key:"keys",value:function(){return this[Symbol.iterator]()}},{key:"values",value:function(){return this[Symbol.iterator]()}},{key:Symbol.iterator,value:function(){return new Ss(this.wrap())}}])}(bs),Ns=function(){return s(function t(e){i(this,t),u(this,"tree",void 0),u(this,"path",new Array),u(this,"modificationCount",null),u(this,"splayCount",void 0),this.tree=e,this.splayCount=e.getSplayCount()},[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}},{key:"current",value:function(){if(!this.path.length)return null;var t=this.path[this.path.length-1];return this.getValue(t)}},{key:"rebuildPath",value:function(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}},{key:"findLeftMostDescendent",value:function(t){for(;null!=t;)this.path.push(t),t=t.left}},{key:"moveNext",value:function(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();for(var t=this.tree.getRoot();null!=t;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);var e=this.path[this.path.length-1],n=e.right;if(null!=n){for(;null!=n;)this.path.push(n),n=n.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}}])}(),Ss=function(t){function e(){return i(this,e),r(this,e,arguments)}return h(e,t),s(e,[{key:"getValue",value:function(t){return t.key}}])}(Ns),Ms=function(t){function e(){return i(this,e),r(this,e,arguments)}return h(e,t),s(e,[{key:"getValue",value:function(t){return[t.key,t.key]}}])}(Ns),Ls=function(t){return function(){return t}},Ps=function(t){var e=t?function(e,n){return n.minus(e).abs().isLessThanOrEqualTo(t)}:Ls(!1);return function(t,n){return e(t,n)?0:t.comparedTo(n)}};function Cs(t){var e=t?function(e,n,r,i,o){return e.exponentiatedBy(2).isLessThanOrEqualTo(i.minus(n).exponentiatedBy(2).plus(o.minus(r).exponentiatedBy(2)).times(t))}:Ls(!1);return function(t,n,r){var i=t.x,o=t.y,s=r.x,a=r.y,u=o.minus(a).times(n.x.minus(s)).minus(i.minus(s).times(n.y.minus(a)));return e(u,i,o,s,a)?0:u.comparedTo(0)}}var Ts=function(t){return t},Os=function(t){if(t){var e=new Is(Ps(t)),n=new Is(Ps(t)),r=function(t,e){return e.addAndReturn(t)},i=function(t){return{x:r(t.x,e),y:r(t.y,n)}};return i({x:new ks(0),y:new ks(0)}),i}return Ts},Rs=function(t){return{set:function(t){As=Rs(t)},reset:function(){return Rs(t)},compare:Ps(t),snap:Os(t),orient:Cs(t)}},As=Rs(),Ds=function(t,e){return t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y)},Fs=function(t,e){if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;var n=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,r=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y}}},qs=function(t,e){return t.x.times(e.y).minus(t.y.times(e.x))},Gs=function(t,e){return t.x.times(e.x).plus(t.y.times(e.y))},Ys=function(t){return Gs(t,t).sqrt()},Bs=function(t,e,n){var r={x:e.x.minus(t.x),y:e.y.minus(t.y)},i={x:n.x.minus(t.x),y:n.y.minus(t.y)};return Gs(i,r).div(Ys(i)).div(Ys(r))},zs=function(t,e,n){return e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(n.minus(t.y))),y:n}},js=function(t,e,n){return e.x.isZero()?null:{x:n,y:t.y.plus(e.y.div(e.x).times(n.minus(t.x)))}},Xs=function(){function t(e,n){i(this,t),u(this,"point",void 0),u(this,"isLeft",void 0),u(this,"segment",void 0),u(this,"otherSE",void 0),u(this,"consumedBy",void 0),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return s(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&(n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,n=new Map,r=function(r){var i,o,s,a,u,l=r.otherSE;n.set(r,{sine:(i=e.point,o=t.point,s=l.point,a={x:o.x.minus(i.x),y:o.y.minus(i.y)},u={x:s.x.minus(i.x),y:s.y.minus(i.y)},qs(u,a).div(Ys(u)).div(Ys(a))),cosine:Bs(e.point,t.point,l.point)})};return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,s=i.cosine,a=n.get(e),u=a.sine,l=a.cosine;return o.isGreaterThanOrEqualTo(0)&&u.isGreaterThanOrEqualTo(0)?s.isLessThan(l)?1:s.isGreaterThan(l)?-1:0:o.isLessThan(0)&&u.isLessThan(0)?s.isLessThan(l)?-1:s.isGreaterThan(l)?1:0:u.isLessThan(o)?-1:u.isGreaterThan(o)?1:0}}}],[{key:"compare",value:function(e,n){var r=t.comparePoints(e.point,n.point);return 0!==r?r:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Qs.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(t,e){return t.x.isLessThan(e.x)?-1:t.x.isGreaterThan(e.x)?1:t.y.isLessThan(e.y)?-1:t.y.isGreaterThan(e.y)?1:0}}])}(),Us=function(){function t(e){i(this,t),u(this,"events",void 0),u(this,"poly",void 0),u(this,"_isExteriorRing",void 0),u(this,"_enclosingRing",void 0),this.events=e;for(var n=0,r=e.length;n<r;n++)e[n].segment.ringOut=this;this.poly=null}return s(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==As.orient(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var s=e[0],a=e[1];0===As.orient(s,t,a)&&e.shift(),e.push(e[0]);for(var u=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],f=l;f!=h;f+=u)c.push([e[f].x.toNumber(),e[f].y.toNumber()]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];Xs.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;var s,a;if(o.ringOut!==i.ringOut)return(null===(s=o.ringOut)||void 0===s?void 0:s.enclosingRing())!==i.ringOut?i.ringOut:null===(a=i.ringOut)||void 0===a?void 0:a.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}],[{key:"factory",value:function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,u=o.rightSE,l=[a],h=a.point,c=[];s=a,a=u,l.push(a),a.point!==h;)for(;;){var f=a.getAvailableLinkedEvents();if(0===f.length){var v=l[0].point,g=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(v.x,", ").concat(v.y,"]. Last matching segment found ends at [").concat(g.x,", ").concat(g.y,"]."))}if(1===f.length){u=f[0].otherSE;break}for(var d=null,p=0,y=c.length;p<y;p++)if(c[p].point===a.point){d=p;break}if(null===d){c.push({index:l.length,point:a.point});var m=a.getLeftmostComparator(s);u=f.sort(m)[0].otherSE;break}var _=c.splice(d)[0],x=l.splice(_.index);x.unshift(x[0].otherSE),n.push(new t(x.reverse()))}n.push(new t(l))}}return n}}])}(),Vs=function(){return s(function t(e){i(this,t),u(this,"exteriorRing",void 0),u(this,"interiorRings",void 0),this.exteriorRing=e,e.poly=this,this.interiorRings=[]},[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=this.exteriorRing.getGeom();if(null===t)return null;for(var e=[t],n=0,r=this.interiorRings.length;n<r;n++){var i=this.interiorRings[n].getGeom();null!==i&&e.push(i)}return e}}])}(),Zs=function(){return s(function t(e){i(this,t),u(this,"rings",void 0),u(this,"polys",void 0),this.rings=e,this.polys=this._composePolys(e)},[{key:"getGeom",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}},{key:"_composePolys",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new Vs(i));else{var o,s=i.enclosingRing();null!=s&&s.poly||e.push(new Vs(s)),null==s||null===(o=s.poly)||void 0===o||o.addInterior(i)}}return e}}])}(),Hs=function(){return s(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qs.compare;i(this,t),u(this,"queue",void 0),u(this,"tree",void 0),u(this,"segments",void 0),this.queue=e,this.tree=new Is(n),this.segments=[]},[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.delete(t.otherSE):this.tree.delete(e),n;t.isLeft&&this.tree.add(e);var r=e,i=e;do{r=this.tree.lastBefore(r)}while(null!=r&&null!=r.consumedBy);do{i=this.tree.firstAfter(i)}while(null!=i&&null!=i.consumedBy);if(t.isLeft){var o=null;if(r){var s=r.getIntersection(e);if(null!==s&&(e.isAnEndpoint(s)||(o=s),!r.isAnEndpoint(s)))for(var a=this._splitSafely(r,s),u=0,l=a.length;u<l;u++)n.push(a[u])}var h=null;if(i){var c=i.getIntersection(e);if(null!==c&&(e.isAnEndpoint(c)||(h=c),!i.isAnEndpoint(c)))for(var f=this._splitSafely(i,c),v=0,g=f.length;v<g;v++)n.push(f[v])}if(null!==o||null!==h){var d=null;if(null===o)d=h;else if(null===h)d=o;else{d=Xs.comparePoints(o,h)<=0?o:h}this.queue.delete(e.rightSE),n.push(e.rightSE);for(var p=e.split(d),y=0,m=p.length;y<m;y++)n.push(p[y])}n.length>0?(this.tree.delete(e),n.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&i){var _=r.getIntersection(i);if(null!==_){if(!r.isAnEndpoint(_))for(var x=this._splitSafely(r,_),E=0,k=x.length;E<k;E++)n.push(x[E]);if(!i.isAnEndpoint(_))for(var w=this._splitSafely(i,_),b=0,I=w.length;b<I;b++)n.push(w[b])}}this.tree.delete(e)}return n}},{key:"_splitSafely",value:function(t,e){this.tree.delete(t);var n=t.rightSE;this.queue.delete(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}])}(),Ws=new(function(){return s(function t(){i(this,t),u(this,"type",void 0),u(this,"numMultiPolys",void 0)},[{key:"run",value:function(t,e,n){Ws.type=t;for(var r=[new ea(e,!0)],i=0,o=n.length;i<o;i++)r.push(new ea(n[i],!1));if(Ws.numMultiPolys=r.length,"difference"===Ws.type)for(var s=r[0],a=1;a<r.length;)null!==Fs(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===Ws.type)for(var u=0,l=r.length;u<l;u++)for(var h=r[u],c=u+1,f=r.length;c<f;c++)if(null===Fs(h.bbox,r[c].bbox))return[];for(var v=new Is(Xs.compare),g=0,d=r.length;g<d;g++)for(var p=r[g].getSweepEvents(),y=0,m=p.length;y<m;y++)v.add(p[y]);var _=new Hs(v),x=null;for(0!=v.size&&(x=v.first(),v.delete(x));x;){for(var E=_.process(x),k=0,w=E.length;k<w;k++){var b=E[k];void 0===b.consumedBy&&v.add(b)}0!=v.size?(x=v.first(),v.delete(x)):x=null}As.reset();var I=Us.factory(_.segments);return new Zs(I).getGeom()}}])}()),Js=Ws,Ks=0,Qs=function(){function t(e,n,r,o){i(this,t),u(this,"id",void 0),u(this,"leftSE",void 0),u(this,"rightSE",void 0),u(this,"rings",void 0),u(this,"windings",void 0),u(this,"ringOut",void 0),u(this,"consumedBy",void 0),u(this,"prev",void 0),u(this,"_prevInResult",void 0),u(this,"_beforeState",void 0),u(this,"_afterState",void 0),u(this,"_isInResult",void 0),this.id=++Ks,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=o}return s(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(e)?t:e},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(e)?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}},{key:"isAnEndpoint",value:function(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}},{key:"comparePoint",value:function(t){return As.orient(this.leftSE.point,t,this.rightSE.point)}},{key:"getIntersection",value:function(t){var e=this.bbox(),n=t.bbox(),r=Fs(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=Ds(e,s)&&0===this.comparePoint(s),l=Ds(n,i)&&0===t.comparePoint(i),h=Ds(e,a)&&0===this.comparePoint(a),c=Ds(n,o)&&0===t.comparePoint(o);if(l&&u)return c&&!h?o:!c&&h?a:null;if(l)return h&&i.x.eq(a.x)&&i.y.eq(a.y)?null:i;if(u)return c&&o.x.eq(s.x)&&o.y.eq(s.y)?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var f=function(t,e,n,r){if(e.x.isZero())return js(n,r,t.x);if(r.x.isZero())return js(t,e,n.x);if(e.y.isZero())return zs(n,r,t.y);if(r.y.isZero())return zs(t,e,n.y);var i=qs(e,r);if(i.isZero())return null;var o={x:n.x.minus(t.x),y:n.y.minus(t.y)},s=qs(o,e).div(i),a=qs(o,r).div(i),u=t.x.plus(a.times(e.x)),l=n.x.plus(s.times(r.x)),h=t.y.plus(a.times(e.y)),c=n.y.plus(s.times(r.y));return{x:u.plus(l).div(2),y:h.plus(c).div(2)}}(i,this.vector(),s,t.vector());return null===f?null:Ds(r,f)?As.snap(f):null}},{key:"split",value:function(e){var n=[],r=void 0!==e.events,i=new Xs(e,!0),o=new Xs(e,!1),s=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var a=new t(i,s,this.rings.slice(),this.windings.slice());return Xs.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Xs.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var n=this,r=e;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=t.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,u=r.rings.length;a<u;a++){var l=r.rings[a],h=r.windings[a],c=n.rings.indexOf(l);-1===c?(n.rings.push(l),n.windings.push(h)):n.windings[c]+=h}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var s=this.rings[i],a=this.windings[i],u=e.indexOf(s);-1===u?(e.push(s),n.push(a)):n[u]+=a}for(var l=[],h=[],c=0,f=e.length;c<f;c++)if(0!==n[c]){var v=e[c],g=v.poly;if(-1===h.indexOf(g))if(v.isExterior)l.push(g);else{-1===h.indexOf(g)&&h.push(g);var d=l.indexOf(v.poly);-1!==d&&l.splice(d,1)}}for(var p=0,y=l.length;p<y;p++){var m=l[p].multiPoly;-1===r.indexOf(m)&&r.push(m)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Js.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===Js.numMultiPolys&&i<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e)}return this._isInResult}}],[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o.isLessThan(n))return 1;if(i.isLessThan(r))return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n.isLessThan(r)){if(a.isLessThan(s)&&a.isLessThan(u))return 1;if(a.isGreaterThan(s)&&a.isGreaterThan(u))return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(n.isGreaterThan(r)){if(s.isLessThan(a)&&s.isLessThan(l))return-1;if(s.isGreaterThan(a)&&s.isGreaterThan(l))return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var v=t.comparePoint(e.rightSE.point);return v<0?1:v>0?-1:1}if(s.isLessThan(a))return-1;if(s.isGreaterThan(a))return 1;if(i.isLessThan(o)){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(i.isGreaterThan(o)){var d=t.comparePoint(e.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(!i.eq(o)){var p=u.minus(s),y=i.minus(n),m=l.minus(a),_=o.minus(r);if(p.isGreaterThan(y)&&m.isLessThan(_))return 1;if(p.isLessThan(y)&&m.isGreaterThan(_))return-1}return i.isGreaterThan(o)?1:i.isLessThan(o)||u.isLessThan(l)?-1:u.isGreaterThan(l)?1:t.id<e.id?-1:t.id>e.id?1:0}},{key:"fromRing",value:function(e,n,r){var i,o,s,a=Xs.comparePoints(e,n);if(a<0)i=e,o=n,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,s=-1}return new t(new Xs(i,!0),new Xs(o,!1),[r],[s])}}])}(),$s=function(){return s(function t(e,n,r){if(i(this,t),u(this,"poly",void 0),u(this,"isExterior",void 0),u(this,"segments",void 0),u(this,"bbox",void 0),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=As.snap({x:new ks(e[0][0]),y:new ks(e[0][1])});this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=e.length;a<l;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var h=As.snap({x:new ks(e[a][0]),y:new ks(e[a][1])});h.x.eq(s.x)&&h.y.eq(s.y)||(this.segments.push(Qs.fromRing(s,h,this)),h.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=h.x),h.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=h.y),h.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=h.x),h.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=h.y),s=h)}o.x.eq(s.x)&&o.y.eq(s.y)||this.segments.push(Qs.fromRing(s,o,this))},[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}])}(),ta=function(){return s(function t(e,n){if(i(this,t),u(this,"multiPoly",void 0),u(this,"exteriorRing",void 0),u(this,"interiorRings",void 0),u(this,"bbox",void 0),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $s(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,o=e.length;r<o;r++){var s=new $s(e[r],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n},[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}])}(),ea=function(){return s(function t(e,n){if(i(this,t),u(this,"isSubject",void 0),u(this,"polys",void 0),u(this,"bbox",void 0),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(t){}this.polys=[],this.bbox={ll:{x:new ks(Number.POSITIVE_INFINITY),y:new ks(Number.POSITIVE_INFINITY)},ur:{x:new ks(Number.NEGATIVE_INFINITY),y:new ks(Number.NEGATIVE_INFINITY)}};for(var r=0,o=e.length;r<o;r++){var s=new ta(e[r],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n},[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}])}(),na=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("union",t,n)},ra=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("intersection",t,n)},ia=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("difference",t,n)},oa=As.set,sa=Object.freeze({__proto__:null,difference:ia,intersection:ra,setPrecision:oa,union:na,xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("xor",t,n)}});function aa(t){if(!t)throw new Error("geojson is required");var e=[];return bt(t,function(t){e.push(t)}),R(e)}function ua(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=et(t),i=et(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)}function la(t,e){var n,r,i=(e=e||{}).threshold||1e4,o=e.p||2,s=null!=(n=e.binary)&&n,a=e.alpha||-1,u=null!=(r=e.standardization)&&r,l=[];_t(t,function(t){l.push(Yi(t))});for(var h=[],c=0;c<l.length;c++)h[c]=[];for(var f=0;f<l.length;f++)for(var v=f;v<l.length;v++){f===v&&(h[f][v]=0);var g=ua(l[f],l[v],o);h[f][v]=g,h[v][f]=g}for(var d=0;d<l.length;d++)for(var p=0;p<l.length;p++){var y=h[d][p];0!==y&&(h[d][p]=s?y<=i?1:0:y<=i?Math.pow(y,a):0)}if(u)for(var m=0;m<l.length;m++)for(var _=h[m].reduce(function(t,e){return t+e},0),x=0;x<l.length;x++)h[m][x]=h[m][x]/_;return h}function ha(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=et(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var o=function(t,e,n){var r=n=void 0===n?w:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+l*l*a*a)*r}(r,i);return Z(o,"meters",n.units)}function ca(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e<0,o=Z(Math.abs(e),r.units,"meters");i&&(o=-Math.abs(o));var s=et(t),a=function(t,e,n,r){r=void 0===r?w:Number(r);var i=e/r,o=t[0]*Math.PI/180,s=V(t[1]),a=V(n),u=i*Math.cos(a),l=s+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),c=Math.abs(h)>1e-11?u/h:Math.cos(s),f=i*Math.sin(a)/c;return[(180*(o+f)/Math.PI+540)%360-180,180*l/Math.PI]}(s,o,n);return a[0]+=a[0]-s[0]>180?-360:s[0]-a[0]>180?360:0,M(a,r.properties)}function fa(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");if(0===e)return t;var o=null!=r?r:Yi(t);return!1!==i&&void 0!==i||(t=so(t)),dt(t,function(t){var n=vt(o,t)+e,r=ha(o,t),i=nt(ca(o,r,n));t[0]=i[0],t[1]=i[1]}),K(t),t}function va(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",s=r.angle||0,a=r.pivot||t,u=r.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!J(r))throw new Error("options must be an object");if(!W(i))throw new Error("steps must be a number");if(!W(s))throw new Error("angle must be a number");var l=et(fa(M(et(t)),s,{pivot:a}));s=-90+s,i=Math.ceil(i/4);for(var h=[],c=[],f=e,v=n,g=v,d=(f-v)/(Math.PI/2),p=(f+v)*Math.PI/4,y=i,m=0,_=0,x=0;x<i;x++)_+=m,m=0===d?p/y/g:(-(d*_+g)+Math.sqrt(Math.pow(d*_+g,2)-.5*d*4*(-p/y)))/(.5*d*2),0!=_&&h.push(_);c.push(0);for(var E=0;E<h.length;E++)c.push(h[E]);c.push(Math.PI/2);for(var k=0;k<h.length;k++)c.push(Math.PI-h[h.length-k-1]);c.push(Math.PI);for(var w=0;w<h.length;w++)c.push(Math.PI+h[w]);c.push(3*Math.PI/2);for(var b=0;b<h.length;b++)c.push(2*Math.PI-h[h.length-b-1]);c.push(0);for(var I=[],N=0,S=c;N<S.length;N++){var L=S[N],C=Math.atan2(v*Math.sin(L),f*Math.cos(L)),T=Math.sqrt(Math.pow(f,2)*Math.pow(v,2)/(Math.pow(f*Math.sin(C),2)+Math.pow(v*Math.cos(C),2)));I.push(ct(l,T,s+U(C),{units:o}).geometry.coordinates)}return P([I],u)}function ga(t){return jt(qt(t))}function da(t){var e=[];return"FeatureCollection"===t.type?_t(t,function(t){dt(t,function(n){e.push(M(n,t.properties))})}):"Feature"===t.type?dt(t,function(n){e.push(M(n,t.properties))}):dt(t,function(t){e.push(M(t))}),R(e)}function pa(t){for(var e=Math.pow(10,6),n=[],r=0;r<t.length;r++){var i=t[r];void 0!==i&&(n[r]=Math.round((i+Number.EPSILON)*e)/e)}return n}var ya=Math.PI/180,ma=180/Math.PI,_a=function(){function t(e,n){i(this,t),u(this,"lon",void 0),u(this,"lat",void 0),u(this,"x",void 0),u(this,"y",void 0),this.lon=e,this.lat=n,this.x=ya*e,this.y=ya*n}return s(t,[{key:"view",value:function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)}},{key:"antipode",value:function(){var e=-1*this.lat;return new t(this.lon<0?180+this.lon:-1*(180-this.lon),e)}}])}(),xa=function(){return s(function t(e){i(this,t),u(this,"properties",{}),u(this,"geometries",[]),e&&(this.properties=e)},[{key:"json",value:function(){if(0===this.geometries.length)return{type:"Feature",geometry:{type:"LineString",coordinates:null},properties:this.properties};if(1===this.geometries.length){var t=this.geometries[0];return t?{type:"Feature",geometry:{type:"LineString",coordinates:t.coords},properties:this.properties}:{type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:this.properties}}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:this.geometries.filter(function(t){return void 0!==t}).map(function(t){return t.coords})},properties:this.properties}}},{key:"wkt",value:function(){if(0===this.geometries.length)return"";var t,e=[],n=a(this.geometries);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r&&0!==r.coords.length){var i=r.coords.filter(function(t){return void 0!==t}).map(function(t){var e,n,r=null!==(e=t[0])&&void 0!==e?e:0,i=null!==(n=t[1])&&void 0!==n?n:0;return"".concat(r," ").concat(i)});0===i.length?e.push("LINESTRING EMPTY"):e.push("LINESTRING(".concat(i.join(","),")"))}else e.push("LINESTRING EMPTY")}}catch(t){n.e(t)}finally{n.f()}return e.join("; ")}}])}(),Ea=function(){return s(function t(){i(this,t),u(this,"coords",[]),u(this,"length",0)},[{key:"move_to",value:function(t){this.length++,this.coords.push(t)}}])}(),ka=function(){return s(function t(e,n,r){if(i(this,t),u(this,"start",void 0),u(this,"end",void 0),u(this,"properties",void 0),u(this,"g",void 0),!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!n||void 0===n.x||void 0===n.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new _a(e.x,e.y),this.end=new _a(n.x,n.y),this.properties=r||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,a=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(a)),this.g===Math.PI)throw new Error("it appears "+this.start.view()+" and "+this.end.view()+" are \'antipodal\', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+n)},[{key:"interpolate",value:function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=ma*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[ma*Math.atan2(i,r),s]}},{key:"Arc",value:function(t,e){var n,r=[];if(!t||t<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var i=1/(t-1),o=0;o<t;++o){var s=i*o,a=this.interpolate(s);r.push(a)}for(var u=!1,l=0,h=null!==(n=null==e?void 0:e.offset)&&void 0!==n?n:10,c=180-h,f=-180+h,v=360-h,g=1;g<r.length;++g){var d,p,y,m,_=null!==(d=null===(p=r[g-1])||void 0===p?void 0:p[0])&&void 0!==d?d:0,x=null!==(y=null===(m=r[g])||void 0===m?void 0:m[0])&&void 0!==y?y:0,E=Math.abs(x-_);E>v&&(x>c&&_<f||_>c&&x<f)?u=!0:E>l&&(l=E)}var k=[];if(u&&l<h){var w=[];k.push(w);for(var b=0;b<r.length;++b){var I,N,S,M,L=parseFloat((null!==(I=null===(N=r[b])||void 0===N?void 0:N[0])&&void 0!==I?I:0).toString());if(b>0&&Math.abs(L-(null!==(S=null===(M=r[b-1])||void 0===M?void 0:M[0])&&void 0!==S?S:0))>v){var P,C,T,O,R,A,D,F,q,G,Y,B,z,j,X,U,V,Z,H=parseFloat((null!==(P=null===(C=r[b-1])||void 0===C?void 0:C[0])&&void 0!==P?P:0).toString()),W=parseFloat((null!==(T=null===(O=r[b-1])||void 0===O?void 0:O[1])&&void 0!==T?T:0).toString()),J=parseFloat((null!==(R=null===(A=r[b])||void 0===A?void 0:A[0])&&void 0!==R?R:0).toString()),K=parseFloat((null!==(D=null===(F=r[b])||void 0===F?void 0:F[1])&&void 0!==D?D:0).toString());if(H>-180&&H<f&&180===J&&b+1<r.length&&(null!==(q=null===(G=r[b-1])||void 0===G?void 0:G[0])&&void 0!==q?q:0)>-180&&(null!==(Y=null===(B=r[b-1])||void 0===B?void 0:B[0])&&void 0!==Y?Y:0)<f){var Q,$,tt,et,nt,rt;w.push([-180,null!==(Q=null===($=r[b])||void 0===$?void 0:$[1])&&void 0!==Q?Q:0]),b++,w.push([null!==(tt=null===(et=r[b])||void 0===et?void 0:et[0])&&void 0!==tt?tt:0,null!==(nt=null===(rt=r[b])||void 0===rt?void 0:rt[1])&&void 0!==nt?nt:0]);continue}if(H>c&&H<180&&-180===J&&b+1<r.length&&(null!==(z=null===(j=r[b-1])||void 0===j?void 0:j[0])&&void 0!==z?z:0)>c&&(null!==(X=null===(U=r[b-1])||void 0===U?void 0:U[0])&&void 0!==X?X:0)<180){var it,ot,st,at,ut,lt;w.push([180,null!==(it=null===(ot=r[b])||void 0===ot?void 0:ot[1])&&void 0!==it?it:0]),b++,w.push([null!==(st=null===(at=r[b])||void 0===at?void 0:at[0])&&void 0!==st?st:0,null!==(ut=null===(lt=r[b])||void 0===lt?void 0:lt[1])&&void 0!==ut?ut:0]);continue}if(H<=180&&J>=180&&H<J){var ht,ct,ft,vt,gt=(180-H)/(J-H),dt=gt*K+(1-gt)*W;w.push([(null!==(ht=null===(ct=r[b-1])||void 0===ct?void 0:ct[0])&&void 0!==ht?ht:0)>c?180:-180,dt]),(w=[]).push([(null!==(ft=null===(vt=r[b-1])||void 0===vt?void 0:vt[0])&&void 0!==ft?ft:0)>c?-180:180,dt]),k.push(w)}else w=[],k.push(w);w.push([L,null!==(V=null===(Z=r[b])||void 0===Z?void 0:Z[1])&&void 0!==V?V:0])}else{var pt,yt,mt,_t;w.push([null!==(pt=null===(yt=r[b])||void 0===yt?void 0:yt[0])&&void 0!==pt?pt:0,null!==(mt=null===(_t=r[b])||void 0===_t?void 0:_t[1])&&void 0!==mt?mt:0])}}}else{var xt=[];k.push(xt);for(var Et=0;Et<r.length;++Et){var kt,wt,bt,It;xt.push([null!==(kt=null===(wt=r[Et])||void 0===wt?void 0:wt[0])&&void 0!==kt?kt:0,null!==(bt=null===(It=r[Et])||void 0===It?void 0:It[1])&&void 0!==bt?bt:0])}}for(var Nt=new xa(this.properties),St=0;St<k.length;++St){var Mt=new Ea;Nt.geometries.push(Mt);var Lt=k[St];if(Lt)for(var Pt=0;Pt<Lt.length;++Pt){var Ct=Lt[Pt];Ct&&Mt.move_to(pa([Ct[0],Ct[1]]))}}return Nt}}])}();function wa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(kt(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must specify at least 2 geometries");var r=ra.apply(sa,[n[0]].concat(_(n.slice(1))));return 0===r.length?null:1===r.length?P(r[0],e.properties):F(r,e.properties)}function ba(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=JSON.stringify(n.properties||{}),i=m(t,4),o=i[0],s=i[1],a=i[2],u=i[3],l=(s+u)/2,h=(o+a)/2,c=2*e/ft([o,l],[a,l],n)*(a-o),f=2*e/ft([h,s],[h,u],n)*(u-s),v=c/2,g=2*v,d=Math.sqrt(3)/2*f,p=a-o,y=u-s,_=3/4*g,x=d,E=(p-g)/(g-v/2),k=Math.floor(E),w=(k*_-v/2-p)/2-v/2+_/2,b=Math.floor((y-d)/d),I=(y-b*d)/2,N=b*d-y>d/2;N&&(I-=d/4);for(var S=[],M=[],L=0;L<6;L++){var P=2*Math.PI/6*L;S.push(Math.cos(P)),M.push(Math.sin(P))}for(var C=[],T=0;T<=k;T++)for(var O=0;O<=b;O++){var A=T%2==1;if((0!==O||!A)&&(0!==O||!N)){var D=T*_+o-w,F=O*x+s+I;if(A&&(F-=d/2),!0===n.triangles)Na([D,F],c/2,f/2,JSON.parse(r),S,M).forEach(function(t){n.mask?wa(R([n.mask,t]))&&C.push(t):C.push(t)});else{var q=Ia([D,F],c/2,f/2,JSON.parse(r),S,M);n.mask?wa(R([n.mask,q]))&&C.push(q):C.push(q)}}}return R(C)}function Ia(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),P([s],r)}function Na(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(P([u],r))}return s}function Sa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],s=t[2],a=t[3],u=e/ft([i,o],[s,o],n)*(s-i),l=e/ft([i,o],[i,a],n)*(a-o),h=s-i,c=a-o,f=Math.floor(h/u),v=(c-Math.floor(c/l)*l)/2,g=i+(h-f*u)/2;g<=s;){for(var d=o+v;d<=a;){var p=M([g,d],n.properties);n.mask?hr(p,n.mask)&&r.push(p):r.push(p),d+=l}g+=u}return R(r)}function Ma(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o=t[0],s=t[1],a=t[2],u=t[3],l=a-o,h=Z(e,r.units,"degrees"),c=u-s,f=Z(n,r.units,"degrees"),v=Math.floor(Math.abs(l)/h),g=Math.floor(Math.abs(c)/f),d=(c-g*f)/2,p=o+(l-v*h)/2,y=0;y<v;y++){for(var m=s+d,_=0;_<g;_++){var x=P([[[p,m],[p,m+f],[p+h,m+f],[p+h,m],[p,m]]],r.properties);r.mask?Wn(r.mask,x)&&i.push(x):i.push(x),m+=f}p+=h}return R(i)}function La(t,e){return Ma(t,e,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function Pa(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=e/ft([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/ft([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var u=0,l=t[1];l<=t[3];){var h=null,c=null;s%2==0&&u%2==0?(h=P([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)):s%2==0&&u%2==1?(h=P([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties)):u%2==0&&s%2==1?(h=P([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties),c=P([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties)):u%2==1&&s%2==1&&(h=P([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)),n.mask?(wa(R([n.mask,h]))&&r.push(h),wa(R([n.mask,c]))&&r.push(c)):(r.push(h),r.push(c)),l+=o,u++}s++,a+=i}return R(r)}var Ca=Object.defineProperty,Ta=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Aa=function(t,e,n){return e in t?Ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Da=function(t,e){for(var n in e||(e={}))Oa.call(e,n)&&Aa(t,n,e[n]);if(Ta){var r,i=a(Ta(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Ra.call(e,n)&&Aa(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Fa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e))throw new Error("options is invalid");var n=e.zProperty,r=void 0===n?"elevation":n,i=e.flip,o=void 0!==i&&i,s=e.flags,a=void 0!==s&&s;st(t,"Point","input must contain Points");for(var u=function(t,e){var n={};_t(t,function(t){var e=nt(t)[1];n[e]||(n[e]=[]),n[e].push(t)});for(var r=[],i=0,o=Object.values(n);i<o.length;i++){var s=o[i];r.push(s.sort(function(t,e){return nt(t)[0]-nt(e)[0]}))}return r.sort(e?function(t,e){return nt(t[0])[1]-nt(e[0])[1]}:function(t,e){return nt(e[0])[1]-nt(t[0])[1]}),r}(t,o),l=[],h=0;h<u.length;h++){for(var c=u[h],f=[],v=0;v<c.length;v++){var g=c[v];null==g.properties&&(g.properties={}),g.properties[r]?f.push(g.properties[r]):f.push(0),!0===a&&(g.properties.matrixPosition=[h,v])}l.push(f)}return l}function qa(t,e){for(var n=[],r=t[0].length,i=t.length,o=0;o<i-1;o++)for(var s=0;s<r-1;s++){var a=t[o+1][s+1],u=t[o][s+1],l=t[o][s],h=t[o+1][s];switch((h>=e?8:0)|(a>=e?4:0)|(u>=e?2:0)|(l>=e?1:0)){case 0:case 15:continue;case 1:n.push([[s+c(l,u),o],[s,o+c(l,h)]]);break;case 2:n.push([[s+1,o+c(u,a)],[s+c(l,u),o]]);break;case 3:n.push([[s+1,o+c(u,a)],[s,o+c(l,h)]]);break;case 4:n.push([[s+c(h,a),o+1],[s+1,o+c(u,a)]]);break;case 5:(h+a+u+l)/4>=e?n.push([[s+c(h,a),o+1],[s,o+c(l,h)]],[[s+c(l,u),o],[s+1,o+c(u,a)]]):n.push([[s+c(h,a),o+1],[s+1,o+c(u,a)]],[[s+c(l,u),o],[s,o+c(l,h)]]);break;case 6:n.push([[s+c(h,a),o+1],[s+c(l,u),o]]);break;case 7:n.push([[s+c(h,a),o+1],[s,o+c(l,h)]]);break;case 8:n.push([[s,o+c(l,h)],[s+c(h,a),o+1]]);break;case 9:n.push([[s+c(l,u),o],[s+c(h,a),o+1]]);break;case 10:(h+a+u+l)/4>=e?n.push([[s,o+c(l,h)],[s+c(l,u),o]],[[s+1,o+c(u,a)],[s+c(h,a),o+1]]):n.push([[s,o+c(l,h)],[s+c(h,a),o+1]],[[s+1,o+c(u,a)],[s+c(l,u),o]]);break;case 11:n.push([[s+1,o+c(u,a)],[s+c(h,a),o+1]]);break;case 12:n.push([[s,o+c(l,h)],[s+1,o+c(u,a)]]);break;case 13:n.push([[s+c(l,u),o],[s+1,o+c(u,a)]]);break;case 14:n.push([[s,o+c(l,h)],[s+c(l,u),o]])}}return n;function c(t,n){if(t===n)return.5;var r=(e-t)/(n-t);return r>1?1:r<0?0:r}}function Ga(t,e){for(var n=e.length,r=e[0].length,i=[],o=[];t.length>0;){var s=_(t.shift());i.push(s);var u=void 0;do{u=!1;for(var l=0;l<t.length;l++){var h=t[l];if(h[0][0]===s[s.length-1][0]&&h[0][1]===s[s.length-1][1]){u=!0,s.push(h[1]),t.splice(l,1);break}if(h[1][0]===s[0][0]&&h[1][1]===s[0][1]){u=!0,s.unshift(h[0]),t.splice(l,1);break}}}while(u)}for(var c=function(){var t=i[0];if(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1])return o.push(t),i.shift(),1;var e,s,u=t[t.length-1];if(0===u[0]&&0!==u[1])e=Xa(i,function(t){return 0===t[0][0]&&t[0][1]<u[1]},function(t,e){return e[0][1]-t[0][1]}),s=[0,0];else if(0===u[1]&&u[0]!==r-1)e=Xa(i,function(t){return 0===t[0][1]&&t[0][0]>u[0]},function(t,e){return t[0][0]-e[0][0]}),s=[r-1,0];else if(u[0]===r-1&&u[1]!==n-1)e=Xa(i,function(t){return t[0][0]===r-1&&t[0][1]>u[1]},function(t,e){return t[0][1]-e[0][1]}),s=[r-1,n-1];else{if(u[1]!==n-1||0===u[0])throw new Error("Contour not closed but is not along an edge");e=Xa(i,function(t){return t[0][1]===n-1&&t[0][0]<u[0]},function(t,e){return e[0][0]-t[0][0]}),s=[0,n-1]}if(-1===e)t.push(s);else if(0===e)t.push([t[0][0],t[0][1]]),o.push(t),i.shift();else{var l=i[e];i.splice(e,1);var h,c=a(l);try{for(c.s();!(h=c.n()).done;){var f=h.value;t.push(f)}}catch(t){c.e(t)}finally{c.f()}}};i.length>0;)c();for(var f=0;f<o.length;f++)o[f].length<4&&(o.splice(f,1),f--);return o}function Ya(t){var e=t.map(function(t){return{ring:t,area:Ot(P([t]))}});return e.sort(function(t,e){return e.area-t.area}),e.map(function(t){return t.ring})}function Ba(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!ja(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;var o=P([e[r].lrCoordinates]);t:for(var s=r+1;s<e.length;s++)if(!e[s].grouped){var a=P([e[s].lrCoordinates]);if(za(a,o)){for(var u=1;u<i.length;u++)if(za(a,P([i[u]])))continue t;i.push(e[s].lrCoordinates),e[s].grouped=!0}}n.push(i)}return n}function za(t,e){for(var n=da(t),r=0;r<n.features.length;r++)if(!Zt(n.features[r],e))return!1;return!0}function ja(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}function Xa(t,e,n){for(var r=-1,i=0;i<t.length;i++)e(t[i])&&(-1===r||n(t[r],t[i])>0)&&(r=i);return r}var Ua=Object.defineProperty,Va=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Wa=function(t,e,n){return e in t?Ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ja=function(t,e){for(var n in e||(e={}))Za.call(e,n)&&Wa(t,n,e[n]);if(Va){var r,i=a(Va(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Ha.call(e,n)&&Wa(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Ka(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e))throw new Error("options is invalid");var n=e.zProperty,r=void 0===n?"elevation":n,i=e.flip,o=void 0!==i&&i,s=e.flags,a=void 0!==s&&s;st(t,"Point","input must contain Points");for(var u=function(t,e){var n={};_t(t,function(t){var e=nt(t)[1];n[e]||(n[e]=[]),n[e].push(t)});for(var r=[],i=0,o=Object.values(n);i<o.length;i++){var s=o[i];r.push(s.sort(function(t,e){return nt(t)[0]-nt(e)[0]}))}return r.sort(e?function(t,e){return nt(t[0])[1]-nt(e[0])[1]}:function(t,e){return nt(e[0])[1]-nt(t[0])[1]}),r}(t,o),l=[],h=0;h<u.length;h++){for(var c=u[h],f=[],v=0;v<c.length;v++){var g=c[v];null==g.properties&&(g.properties={}),g.properties[r]?f.push(g.properties[r]):f.push(0),!0===a&&(g.properties.matrixPosition=[h,v])}l.push(f)}return l}function Qa(t,e){for(var n=[],r=t.length,i=t[0].length,o=0;o<r-1;o++)for(var s=0;s<i-1;s++){var a=t[o+1][s+1],u=t[o][s+1],l=t[o][s],h=t[o+1][s];switch((h>=e?8:0)|(a>=e?4:0)|(u>=e?2:0)|(l>=e?1:0)){case 0:case 15:continue;case 1:n.push([[s+p(l,u),o],[s,o+p(l,h)]]);break;case 2:n.push([[s+1,o+p(u,a)],[s+p(l,u),o]]);break;case 3:n.push([[s+1,o+p(u,a)],[s,o+p(l,h)]]);break;case 4:n.push([[s+p(h,a),o+1],[s+1,o+p(u,a)]]);break;case 5:(h+a+u+l)/4>=e?n.push([[s+p(h,a),o+1],[s,o+p(l,h)]],[[s+p(l,u),o],[s+1,o+p(u,a)]]):n.push([[s+p(h,a),o+1],[s+1,o+p(u,a)]],[[s+p(l,u),o],[s,o+p(l,h)]]);break;case 6:n.push([[s+p(h,a),o+1],[s+p(l,u),o]]);break;case 7:n.push([[s+p(h,a),o+1],[s,o+p(l,h)]]);break;case 8:n.push([[s,o+p(l,h)],[s+p(h,a),o+1]]);break;case 9:n.push([[s+p(l,u),o],[s+p(h,a),o+1]]);break;case 10:(h+a+u+l)/4>=e?n.push([[s,o+p(l,h)],[s+p(l,u),o]],[[s+1,o+p(u,a)],[s+p(h,a),o+1]]):n.push([[s,o+p(l,h)],[s+p(h,a),o+1]],[[s+1,o+p(u,a)],[s+p(l,u),o]]);break;case 11:n.push([[s+1,o+p(u,a)],[s+p(h,a),o+1]]);break;case 12:n.push([[s,o+p(l,h)],[s+1,o+p(u,a)]]);break;case 13:n.push([[s+p(l,u),o],[s+1,o+p(u,a)]]);break;case 14:n.push([[s,o+p(l,h)],[s+p(l,u),o]])}}for(var c=[];n.length>0;){var f=_(n.shift());c.push(f);var v=void 0;do{v=!1;for(var g=0;g<n.length;g++){var d=n[g];if(d[0][0]===f[f.length-1][0]&&d[0][1]===f[f.length-1][1]){v=!0,f.push(d[1]),n.splice(g,1);break}if(d[1][0]===f[0][0]&&d[1][1]===f[0][1]){v=!0,f.unshift(d[0]),n.splice(g,1);break}}}while(v)}return c;function p(t,n){if(t===n)return.5;var r=(e-t)/(n-t);return r>1?1:r<0?0:r}}function $a(t,e,n,r,i,o,s,a){var u,l,h,c,f={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==f.x&&null!==f.y&&f:(c=(n-t)*(l=e-o)-(r-e)*(h=t-i),l=((s-i)*l-(a-o)*h)/u,h=c/u,f.x=t+l*(n-t),f.y=e+l*(r-e),l>=0&&l<=1&&(f.onLine1=!0),h>=0&&h<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function tu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return St(t,function(t,n){var r=n.geometry.coordinates;return t+ft(r[0],r[1],e)},0)}function eu(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.steps||64,s=nu(n),a=nu(r),u=Array.isArray(t)||"Feature"!==t.type?{}:t.properties;if(s===a)return T(oo(t,e,i).geometry.coordinates[0],u);for(var l=s,h=s<a?a:a+360,c=[],f=(h-l)/o,v=0;v<=o;v++){var g=v===o?h:l+v*f;c.push(ct(t,e,g,i).geometry.coordinates)}return T(c,u)}function nu(t){var e=t%360;return e<0&&(e+=360),e}function ru(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!J(r))throw new Error("options is invalid");var i,o=r.units,s=void 0===o?"kilometers":o,a=[];if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}for(var u,l,h,c=i.length,f=0,v=0;v<i.length&&!(e>=f&&v===i.length-1);v++){if(f>e&&0===a.length){var g=e-f;if(!g)return a.push(i[v]),T(a);l=ht(i[v],i[v-1])-180,h=ct(i[v],g,l,{units:s}),a.push(h.geometry.coordinates)}if(f>=n)return(u=n-f)?(l=ht(i[v],i[v-1])-180,h=ct(i[v],u,l,{units:s}),a.push(h.geometry.coordinates),T(a)):(a.push(i[v]),T(a));if(f>=e&&a.push(i[v]),v===i.length-1)return T(a);f+=ft(i[v],i[v+1],{units:s})}if(f<e&&i.length===c)throw new Error("Start position is beyond line");var d=i[i.length-1];return T([d,d])}function iu(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function ou(t,e){return t[0]*e[1]-e[0]*t[1]}function su(t,e){return!function(t,e){return 0===ou(iu(t),iu(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=iu(t),s=e[0],a=iu(e),u=ou(o,a),l=function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(ou((r=i,[(n=s)[0]-r[0],n[1]-r[1]]),a)/u,o));return l}(t,e)}function au(t,e,n){var r=[],i=z(e,n),o=nt(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=(l=t,h=o[e+1],c=i,f=Math.sqrt((l[0]-h[0])*(l[0]-h[0])+(l[1]-h[1])*(l[1]-h[1])),v=l[0]+c*(h[1]-l[1])/f,g=h[0]+c*(h[1]-l[1])/f,d=l[1]+c*(l[0]-h[0])/f,p=h[1]+c*(l[0]-h[0])/f,[[v,d],[g,p]]);if(r.push(n),e>0){var a=r[e-1],u=su(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}var l,h,c,f,v,g,d,p}),T(s,"Feature"===t.type?t.properties:{})}function uu(t,e){var n="Feature"===t.type?t.geometry:t;e.properties.segmentIndex>=n.coordinates.length-1&&(e.properties.segmentIndex=n.coordinates.length-2)}function lu(t,e,n,r){e=e||("Feature"===t.type?t.properties:{});var i=at(t),o=i.coordinates,s=i.type;if(!o.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(o=hu(o)),P([o],e);case"MultiLineString":var a=[],u=0;return o.forEach(function(t){if(n&&(t=hu(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(qt(T(t)));e>u?(a.unshift(t),u=e):a.push(t)}else a.push(t)}),P(a,e);default:throw new Error("geometry type "+s+" is not supported")}}function hu(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function cu(t){return F(t)}function fu(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return t&&(e="Feature"===t.type?t.geometry.coordinates:t.coordinates),P(e)}function vu(t){var e,n=0,r=a(t);try{for(r.s();!(e=r.n()).done;){n+=e.value}}catch(t){r.e(t)}finally{r.f()}return n/t.length}var gu=Object.defineProperty,du=Object.defineProperties,pu=Object.getOwnPropertyDescriptors,yu=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,xu=function(t,e,n){return e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Eu=function(t,e){for(var n in e||(e={}))mu.call(e,n)&&xu(t,n,e[n]);if(yu){var r,i=a(yu(e));try{for(i.s();!(r=i.n()).done;){n=r.value;_u.call(e,n)&&xu(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},ku=function(t,e){return du(t,pu(e))};function wu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r=1/0,i=0;_t(e,function(e,o){var s=ft(t,e,n);s<r&&(i=o,r=s)});var o=so(e.features[i]);return ku(Eu({},o),{properties:ku(Eu({},o.properties),{featureIndex:i,distanceToPoint:r})})}function bu(t,e){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=null!=(n=i.method)?n:"geodesic",s=null!=(r=i.units)?r:"kilometers";if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=M(t):"Point"===t.type?t=N(t):ot(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=T(e):"LineString"===e.type?e=N(e):ot(e,"LineString","line");var a=1/0,u=t.geometry.coordinates;return Nt(e,function(t){if(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],r=function(t,e,n,r){if("geodesic"===r.method){return $e(T([e,n]).geometry,t,{units:"degrees"}).properties.pointDistance}var i=[n[0]-e[0],n[1]-e[1]],o=[t[0]-e[0],t[1]-e[1]],s=Iu(o,i);if(s<=0)return ha(t,e,{units:"degrees"});var a=Iu(i,i);if(a<=s)return ha(t,n,{units:"degrees"});var u=s/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return ha(t,l,{units:"degrees"})}(u,e,n,{method:o});r<a&&(a=r)}}),Z(a,"degrees",s)}function Iu(t,e){return t[0]*e[0]+t[1]*e[1]}var Nu=Object.defineProperty,Su=Object.getOwnPropertySymbols,Mu=Object.prototype.hasOwnProperty,Lu=Object.prototype.propertyIsEnumerable,Pu=function(t,e,n){return e in t?Nu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Cu=function(t,e){for(var n in e||(e={}))Mu.call(e,n)&&Pu(t,n,e[n]);if(Su){var r,i=a(Su(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Lu.call(e,n)&&Pu(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Tu(t,e,n,r,i,o){return Math.sqrt((i-n)*(i-n)+(o-r)*(o-r))===Math.sqrt((t-n)*(t-n)+(e-r)*(e-r))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}function Ou(t,e){var n=[];return _t(t,function(t){var r=!1;if("Point"===t.geometry.type)kt(e,function(e){Zt(t,e)&&(r=!0)}),r&&n.push(t);else{if("MultiPoint"!==t.geometry.type)throw new Error("Input geometry must be a Point or MultiPoint");var i=[];kt(e,function(e){dt(t,function(t){Zt(t,e)&&(r=!0,i.push(t))})}),r&&n.push(D(i,t.properties))}}),R(n)}function Ru(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return function(t){return(t>0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function Au(t,e){return e.geometry.coordinates[0].every(function(e){return Zt(M(e),t)})}var Du=function(){return s(function t(e,n){i(this,t),this.id=e,this.coordinates=n,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1},[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Ru(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}])}(),Fu=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return s(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}},{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { ".concat(this.from.id," -> ").concat(this.to.id," }")}},{key:"toLineString",value:function(){return T([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return Ru(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}])}(),qu=function(){return s(function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0},[{key:"push",value:function(t){this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"length",get:function(){return this.edges.length}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Ru(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0}},{key:"toMultiPoint",value:function(){return D(this.edges.map(function(t){return t.from.coordinates}))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=P([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=ga(this.toPolygon())}},{key:"inside",value:function(t){return Zt(t,this.toPolygon())}}],[{key:"findEdgeRingContaining",value:function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,u,l,h,c,f=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,u=(o=f).geometry.coordinates[0].map(function(t){return t[0]}),l=o.geometry.coordinates[0].map(function(t){return t[1]}),h=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,u)!==Math.max.apply(null,h)||Math.max.apply(null,l)!==Math.max.apply(null,c)||Math.min.apply(null,u)!==Math.min.apply(null,h)||Math.min.apply(null,l)!==Math.min.apply(null,c))&&Au(f,i)){var v,g,d=a(t.map(function(t){return t.from.coordinates}));try{var p=function(){var t=g.value;e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(v=t)};for(d.s();!(g=d.n()).done;)p()}catch(t){d.e(t)}finally{d.f()}v&&e.inside(M(v))&&(r&&!Au(n,f)||(r=e))}}),r}}])}();var Gu=function(){function t(){i(this,t),this.nodes=new Map,this.nodeId=0,this.edges=new Map}return s(t,[{key:"getNode",value:function(t){var e,n=null==(e=this.nodes.get(t[0]))?void 0:e.get(t[1]);if(null==n){var r=new Du(this.nodeId++,t),i=this.nodes.get(t[0]);return null==i&&(i=new Map,this.nodes.set(t[0],i)),i.set(t[1],r),r}return n}},{key:"addEdge",value:function(t,e){var n;if(!(null==(n=this.edges.get(t))?void 0:n.has(e))){var r=new Fu(t,e),i=r.getSymetric(),o=this.edges.get(t);null==o&&(o=new Map,this.edges.set(t,o)),o.set(e,r);var s=this.edges.get(e);null==s&&(s=new Map,this.edges.set(e,s)),s.set(t,i)}}},{key:"deleteDangles",value:function(){var t=this;this._forEachNode(function(e){return t._removeIfDangle(e)})}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this._forEachEdge(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})}},{key:"_computeNextCWEdges",value:function(t){var e=this;null==t?this._forEachNode(function(t){return e._computeNextCWEdges(t)}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this._forEachEdge(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this._forEachEdge(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this._forEachEdge(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new qu;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e,n=this;t.getOuterEdges().forEach(function(t){return n.removeEdge(t)}),t.innerEdges.forEach(function(t){return n.removeEdge(t)}),null==(e=this.nodes.get(t.coordinates[0]))||e.delete(t.coordinates[1])}},{key:"removeEdge",value:function(t){var e;null==(e=this.edges.get(t.from))||e.delete(t.to),t.deleteEdge()}},{key:"_forEachNode",value:function(t){var e,n=a(this.nodes.values());try{for(n.s();!(e=n.n()).done;){var r,i=a(e.value.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}}},{key:"_forEachEdge",value:function(t){var e,n=a(this.edges.values());try{for(n.s();!(e=n.n()).done;){var r,i=a(e.value.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}}}],[{key:"fromGeoJson",value:function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type \'".concat(t.type,"\'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature"))}(e);var n=new t;return bt(e,function(t){ot(t,"LineString","Graph::fromGeoJson"),pt(t,function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e})}),n}}])}();function Yu(t,e){var n,r;dt(t,function(t,i,o,s,a){if(r!==a)e.push([]);else{var u=n[0],l=n[1],h=t[0],c=t[1];e[a].push([.75*u+.25*h,.75*l+.25*c]),e[a].push([.25*u+.75*h,.25*l+.75*c])}n=t,r=a},!1),e.forEach(function(t){t.push(t[0])})}function Bu(t,e){var n,r,i;dt(t,function(t,o,s,a,u){if(r!==a)e.push([[]]);else if(i!==u)e[a].push([]);else{var l=n[0],h=n[1],c=t[0],f=t[1];e[a][u].push([.75*l+.25*c,.75*h+.25*f]),e[a][u].push([.25*l+.75*c,.25*h+.75*f])}n=t,r=a,i=u},!1),e.forEach(function(t){t.forEach(function(t){t.push(t[0])})})}function zu(t,e,n,r,i){for(var o=0;o<t.length;o++){var s=t[o],a=t[o+1];o===t.length-1&&(a=t[0]);var u=Uu(s,a,e);n<=0&&u>0?Xu(e,s,r)||(r=s):n>0&&u<=0&&(ju(e,s,i)||(i=s)),n=u}return[r,i]}function ju(t,e,n){return Uu(t,e,n)>0}function Xu(t,e,n){return Uu(t,e,n)<0}function Uu(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function Vu(t){return Hu(t,"mercator",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Zu(t){return Hu(t,"wgs84",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Hu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&W(t[0])?t="mercator"===e?Wu(t):Ju(t):(!0!==r&&(t=so(t)),dt(t,function(t){var n="mercator"===e?Wu(t):Ju(t);t[0]=n[0],t[1]=n[1]})),t}function Wu(t){var e=Math.PI/180,n=6378137,r=20037508.342789244,i=Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]),o=[n*i*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return o[0]>r&&(o[0]=r),o[0]<-r&&(o[0]=-r),o[1]>r&&(o[1]=r),o[1]<-r&&(o[1]=-r),o}function Ju(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var Ku=Object.freeze({__proto__:null,toMercator:Vu,toWgs84:Zu});var Qu={20:1.07275,15:1.13795,10:1.22385,5:1.3581,2:1.51743,1:1.62762};function $u(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function tl(t){var e=[];return function t(n){return 0===n||1===n?1:e[n]>0?e[n]:e[n]=t(n-1)*n}(t)}function el(t){return rl(t),nl(t)}function nl(t){return Array.isArray(t)?ul(t):t&&t.bbox?ul(t.bbox):[360*al(),180*al()]}function rl(t){null!=t&&(Array.isArray(t)?Q(t):null!=t.bbox&&Q(t.bbox))}function il(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rl(e.bbox),null==t&&(t=1);for(var n=[],r=0;r<t;r++)n.push(M(nl(e.bbox)));return R(n)}function ol(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rl(e.bbox),null==t&&(t=1),void 0!==e.bbox&&null!==e.bbox||(e.bbox=[-180,-90,180,90]),W(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),W(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);var n=Math.abs(e.bbox[0]-e.bbox[2]),r=Math.abs(e.bbox[1]-e.bbox[3]),i=Math.min(n/2,r/2);if(e.max_radial_length>i)throw new Error("max_radial_length is greater than the radius of the bbox");for(var o=[e.bbox[0]+e.max_radial_length,e.bbox[1]+e.max_radial_length,e.bbox[2]-e.max_radial_length,e.bbox[3]-e.max_radial_length],s=[],a=function(){var t,n=[],r=_(Array(e.num_vertices+1)).map(Math.random);r.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),r.forEach(function(t){t=2*t*Math.PI/r[r.length-1];var i=Math.random();n.push([i*(e.max_radial_length||10)*Math.sin(t),i*(e.max_radial_length||10)*Math.cos(t)])}),n[n.length-1]=n[0],n=n.reverse().map((t=nl(o),function(e){return[e[0]+t[0],e[1]+t[1]]})),s.push(P([n]))},u=0;u<t;u++)a();return R(s)}function sl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.bbox;rl(n);var r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!W(r)||void 0===r||r<2)&&(r=10),W(i)&&void 0!==i||(i=1e-4),W(o)&&void 0!==o||(o=Math.PI/8);for(var s=[],a=0;a<t;a++){for(var u=[nl(n)],l=0;l<r-1;l++){var h=(0===l?2*Math.random()*Math.PI:Math.tan((u[l][1]-u[l-1][1])/(u[l][0]-u[l-1][0])))+(Math.random()-.5)*o*2,c=Math.random()*i;u.push([u[l][0]+c*Math.cos(h),u[l][1]+c*Math.sin(h)])}s.push(T(u))}return R(s)}function al(){return Math.random()-.5}function ul(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}var ll=Object.freeze({__proto__:null,randomLineString:sl,randomPoint:il,randomPolygon:ol,randomPosition:el});function hl(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return kt(t,function(t){hl(t,e)}),t;case"LineString":return cl(nt(t),e),t;case"Polygon":return fl(nt(t),e),t;case"MultiLineString":return nt(t).forEach(function(t){cl(t,e)}),t;case"MultiPolygon":return nt(t).forEach(function(t){fl(t,e)}),t;case"Point":case"MultiPoint":return t}}function cl(t,e){Ut(t)===e&&t.reverse()}function fl(t,e){Ut(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)Ut(t[n])===e&&t[n].reverse()}function vl(t){var e=t%360;return e<0&&(e+=360),e}function gl(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.origin||"centroid",i=n.mutate||!1;if(!t)throw new Error("geojson required");if("number"!=typeof e||e<=0)throw new Error("invalid factor");var o=Array.isArray(r)||"object"===E(r);return!0!==i&&(t=so(t)),"FeatureCollection"!==t.type||o?dl(t,e,r):(_t(t,function(n,i){t.features[i]=dl(n,e,r)}),1!==e&&delete t.bbox,t)}function dl(t,e,n){var r="Point"===ut(t),i=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"===E(e))return et(e);var n=t.bbox?t.bbox:qt(t,{recompute:!0}),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return M([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return M([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return M([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return M([o,s]);case"center":return cr(t);case void 0:case null:case"centroid":return Yi(t);default:throw new Error("invalid origin")}}(t,n);return 1===e||r||(dt(t,function(t){var n=ha(i,t),r=vt(i,t),o=nt(ca(i,n*e,r));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),K(t)),t}function pl(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var yl={search:function(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.cleanDirty(),i=i||{};var o=yl.heuristics.manhattan,s=null!=(r=i.closest)&&r,a=new xl(function(t){return t.f}),u=e;for(e.h=o(e,n),a.push(e);a.size()>0;){var l=a.pop();if(l===n)return pl(l);l.closed=!0;for(var h=t.neighbors(l),c=0,f=h.length;c<f;++c){var v=h[c];if(!v.closed&&!v.isWall()){var g=l.g+v.getCost(l),d=v.visited;(!d||g<v.g)&&(v.visited=!0,v.parent=l,v.h=v.h||o(v,n),v.g=g,v.f=v.g+v.h,t.markDirty(v),s&&(v.h<u.h||v.h===u.h&&v.g<u.g)&&(u=v),d?a.rescoreElement(v):a.push(v))}}}return s?pl(u):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=void 0}},ml=function(){return s(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.nodes=[],this.grid=[],this.dirtyNodes=[],this.diagonal=!!n.diagonal;for(var r=0;r<e.length;r++){this.grid[r]=[];for(var o=0,s=e[r];o<s.length;o++){var a=new _l(r,o,s[o]);this.grid[r][o]=a,this.nodes.push(a)}}this.init()},[{key:"init",value:function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)yl.cleanNode(this.nodes[t])}},{key:"cleanDirty",value:function(){for(var t=0;t<this.dirtyNodes.length;t++)yl.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]}},{key:"markDirty",value:function(t){this.dirtyNodes.push(t)}},{key:"neighbors",value:function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e}},{key:"toString",value:function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\\n")}}])}(),_l=function(){return s(function t(e,n,r){i(this,t),this.visited=!1,this.h=0,this.g=0,this.f=0,this.closed=!1,this.x=e,this.y=n,this.weight=r},[{key:"toString",value:function(){return"["+this.x+" "+this.y+"]"}},{key:"getCost",value:function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight}},{key:"isWall",value:function(){return 0===this.weight}}])}(),xl=function(){return s(function t(e){i(this,t),this.content=[],this.scoreFunction=e},[{key:"push",value:function(t){this.content.push(t),this.sinkDown(this.content.length-1)}},{key:"pop",value:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t}},{key:"remove",value:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))}},{key:"size",value:function(){return this.content.length}},{key:"rescoreElement",value:function(t){this.sinkDown(this.content.indexOf(t))}},{key:"sinkDown",value:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}}},{key:"bubbleUp",value:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}}])}();function El(t,e){for(var n=0;n<e.features.length;n++)if(Zt(t,e.features[n]))return!0;return!1}function kl(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function wl(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function bl(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=wl(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&bl(t,e,o,r,i),i.push(t[o]),n-o>1&&bl(t,o,n,r,i))}function Il(t,e){var n=t.length-1,r=[t[0]];return bl(t,0,n,e,r),r.push(t[n]),r}function Nl(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;o<s;o++)kl(n=t[o],r)>e&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),t=Il(t,r)}function Sl(t,e,n){return t.map(function(t){if(t.length<4)throw new Error("invalid polygon");for(var r=e,i=Nl(t,r,n);!Ml(i)&&r>=Number.EPSILON;)i=Nl(t,r-=.01*r,n);return Ml(i)?(i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i):t})}function Ml(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}function Ll(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}var Pl,Cl={exports:{}};var Tl=function(){if(Pl)return Cl.exports;function t(t,n,i){i=i||2;var o,s,a,h,c,v,g,d=n&&n.length,p=d?n[0]*i:t.length,y=e(t,0,p,i,!0),m=[];if(!y||y.next===y.prev)return m;if(d&&(y=function(t,n,r,i){var o,s,a,h=[];for(o=0,s=n.length;o<s;o++)(a=e(t,n[o]*i,o<s-1?n[o+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),h.push(f(a));for(h.sort(u),o=0;o<h.length;o++)r=l(h[o],r);return r}(t,n,y,i)),t.length>80*i){o=a=t[0],s=h=t[1];for(var _=i;_<p;_+=i)(c=t[_])<o&&(o=c),(v=t[_+1])<s&&(s=v),c>a&&(a=c),v>h&&(h=v);g=0!==(g=Math.max(a-o,h-s))?32767/g:0}return r(y,m,i,o,s,g,0),m}function e(t,e,n,r,i){var o,s;if(i===I(t,e,n,r)>0)for(o=e;o<n;o+=r)s=k(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=k(o,t[o],t[o+1],s);return s&&p(s,s.next)&&(w(s),s=s.next),s}function n(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!p(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(w(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function r(t,e,u,l,h,f,v){if(t){!v&&f&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=c(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<l&&(a++,r=r.nextZ);e++);for(u=l;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(s>1)}(i)}(t,l,h,f);for(var g,d,p=t;t.prev!==t.next;)if(g=t.prev,d=t.next,f?o(t,l,h,f):i(t))e.push(g.i/u|0),e.push(t.i/u|0),e.push(d.i/u|0),w(t),t=d.next,p=d.next;else if((t=d)===p){v?1===v?r(t=s(n(t),e,u),e,u,l,h,f,2):2===v&&a(t,e,u,l,h,f):r(n(t),e,u,l,h,f,1);break}}}function i(t){var e=t.prev,n=t,r=t.next;if(d(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=i<o?i<s?i:s:o<s?o:s,c=a<u?a<l?a:l:u<l?u:l,f=i>o?i>s?i:s:o>s?o:s,g=a>u?a>l?a:l:u>l?u:l,p=r.next;p!==e;){if(p.x>=h&&p.x<=f&&p.y>=c&&p.y<=g&&v(i,a,o,u,s,l,p.x,p.y)&&d(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function o(t,e,n,r){var i=t.prev,o=t,s=t.next;if(d(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,f=o.y,g=s.y,p=a<u?a<l?a:l:u<l?u:l,y=h<f?h<g?h:g:f<g?f:g,m=a>u?a>l?a:l:u>l?u:l,_=h>f?h>g?h:g:f>g?f:g,x=c(p,y,e,n,r),E=c(m,_,e,n,r),k=t.prevZ,w=t.nextZ;k&&k.z>=x&&w&&w.z<=E;){if(k.x>=p&&k.x<=m&&k.y>=y&&k.y<=_&&k!==i&&k!==s&&v(a,h,u,f,l,g,k.x,k.y)&&d(k.prev,k,k.next)>=0)return!1;if(k=k.prevZ,w.x>=p&&w.x<=m&&w.y>=y&&w.y<=_&&w!==i&&w!==s&&v(a,h,u,f,l,g,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;k&&k.z>=x;){if(k.x>=p&&k.x<=m&&k.y>=y&&k.y<=_&&k!==i&&k!==s&&v(a,h,u,f,l,g,k.x,k.y)&&d(k.prev,k,k.next)>=0)return!1;k=k.prevZ}for(;w&&w.z<=E;){if(w.x>=p&&w.x<=m&&w.y>=y&&w.y<=_&&w!==i&&w!==s&&v(a,h,u,f,l,g,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,s=i.next.next;!p(o,s)&&y(o,i,i.next,s)&&x(o,s)&&x(s,o)&&(e.push(o.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),w(i),w(i.next),i=t=s),i=i.next}while(i!==t);return n(i)}function a(t,e,i,o,s,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var h=E(u,l);return u=n(u,u.next),h=n(h,h.next),r(u,e,i,o,s,a,0),void r(h,e,i,o,s,a,0)}l=l.next}u=u.next}while(u!==t)}function u(t,e){return t.x-e.x}function l(t,e){var r=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,c=n.x,f=n.y,g=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&v(o<f?i:s,o,c,f,o<f?s:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),x(r,t)&&(u<g||u===g&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,g=u)),r=r.next}while(r!==l);return n}(t,e);if(!r)return e;var i=E(r,t);return n(i,i.next),n(r,r.next)}function h(t,e){return d(t.prev,t,e.prev)<0&&d(e.next,t,t.next)<0}function c(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&y(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(x(t,e)&&x(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(d(t.prev,t,e.prev)||d(t,e.prev,e))||p(t,e)&&d(t.prev,t,t.next)>0&&d(e.prev,e,e.next)>0)}function d(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,n,r){var i=_(d(t,e,n)),o=_(d(t,e,r)),s=_(d(n,r,t)),a=_(d(n,r,e));return i!==o&&s!==a||(!(0!==i||!m(t,n,e))||(!(0!==o||!m(t,r,e))||(!(0!==s||!m(n,t,r))||!(0!==a||!m(n,e,r)))))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _(t){return t>0?1:t<0?-1:0}function x(t,e){return d(t.prev,t,t.next)<0?d(t,e,t.next)>=0&&d(t,t.prev,e)>=0:d(t,e,t.prev)<0||d(t,t.next,e)<0}function E(t,e){var n=new b(t.i,t.x,t.y),r=new b(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function k(t,e,n,r){var i=new b(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}return Pl=1,Cl.exports=t,Cl.exports.default=t,t.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(I(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(I(t,l,h,n))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*n,v=r[a+1]*n,g=r[a+2]*n;c+=Math.abs((t[f]-t[g])*(t[v+1]-t[f+1])-(t[f]-t[v])*(t[g+1]-t[f+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},t.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},Cl.exports}(),Ol=Jn(Tl);function Rl(t){var e=function(t){for(var e=3,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Ol(e.vertices,e.holes,3),r=[],i=[];n.forEach(function(t,r){var o=n[r];void 0!==e.vertices[3*o+2]?i.push([e.vertices[3*o],e.vertices[3*o+1],e.vertices[3*o+2]]):i.push([e.vertices[3*o],e.vertices[3*o+1]])});for(var o=0;o<i.length;o+=3){var s=i.slice(o,o+3);s.push(i[o]),r.push(P([s]))}return r}function Al(t,e){if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");for(var n=t.geometry.coordinates,r=[],i={},o=[],s=0;s<n.length;s++)for(var a=0;a<n[s].length-1;a++)o.push(f(s,a));var u=new te;u.load(o);for(var l=0;l<n.length;l++)for(var h=0;h<n[l].length-1;h++){u.search(f(l,h)).forEach(function(t){var e=t.ring,n=t.edge;c(l,h,e,n)})}return r;function c(t,o,s,a){var u,l,h=n[t][o],c=n[t][o+1],f=n[s][a],v=n[s][a+1],g=function(t,e,n,r){if(Dl(t,n)||Dl(t,r)||Dl(e,n)||Dl(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],l=n[1],h=r[0],c=r[1],f=(i-s)*(l-c)-(o-a)*(u-h);if(0===f)return null;var v=((i*a-o*s)*(u-h)-(i-s)*(u*c-l*h))/f,g=((i*a-o*s)*(l-c)-(o-a)*(u*c-l*h))/f;return[v,g]}(h,c,f,v);if(null!==g&&(u=c[0]!==h[0]?(g[0]-h[0])/(c[0]-h[0]):(g[1]-h[1])/(c[1]-h[1]),l=v[0]!==f[0]?(g[0]-f[0])/(v[0]-f[0]):(g[1]-f[1])/(v[1]-f[1]),!(u>=1||u<=0||l>=1||l<=0))){var d=g,p=!i[d.toString()];p&&(i[d.toString()]=!0),e&&r.push(e(g,t,o,h,c,u,s,a,f,v,l,p))}}function f(t,e){var r,i,o,s,a=n[t][e],u=n[t][e+1];return a[0]<u[0]?(r=a[0],i=u[0]):(r=u[0],i=a[0]),a[1]<u[1]?(o=a[1],s=u[1]):(o=u[1],s=a[1]),{minX:r,minY:o,maxX:i,maxY:s,ring:t,edge:e}}}function Dl(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!Dl(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function Fl(t){if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var e=t.geometry.coordinates.length,n=[],r=0;r<e;r++){var i=t.geometry.coordinates[r];zl(i[0],i[i.length-1])||i.push(i[0]);for(var o=0;o<i.length-1;o++)n.push(i[o])}if(!function(t){for(var e={},n=1,r=0,i=t.length;r<i;++r){if(Object.prototype.hasOwnProperty.call(e,t[r].toString())){n=0;break}e[t[r].toString()]=1}return n}(n))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var s=n.length,a=Al(t,function(t,e,n,r,i,o,s,a,u,l,h,c){return[t,e,n,r,i,o,s,a,u,l,h,c]}),u=a.length;if(0==u){var l=[];for(r=0;r<e;r++)l.push(P([t.geometry.coordinates[r]],{parent:-1,winding:Bl(t.geometry.coordinates[r])}));var h=R(l);return Y(h),B(h),h}var c=[],f=[];for(r=0;r<e;r++){c.push([]);for(o=0;o<t.geometry.coordinates[r].length-1;o++)c[r].push([new ql(t.geometry.coordinates[r][jl(o+1,t.geometry.coordinates[r].length-1)],1,[r,o],[r,jl(o+1,t.geometry.coordinates[r].length-1)],void 0)]),f.push(new Gl(t.geometry.coordinates[r][o],[r,jl(o-1,t.geometry.coordinates[r].length-1)],[r,o],void 0,void 0,!1,!0))}for(r=0;r<u;r++)c[a[r][1]][a[r][2]].push(new ql(a[r][0],a[r][5],[a[r][1],a[r][2]],[a[r][6],a[r][7]],void 0)),a[r][11]&&f.push(new Gl(a[r][0],[a[r][1],a[r][2]],[a[r][6],a[r][7]],void 0,void 0,!0,!0));var v=f.length;for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)c[r][o].sort(function(t,e){return t.param<e.param?-1:1});var g=[];for(r=0;r<v;r++)g.push({minX:f[r].coord[0],minY:f[r].coord[1],maxX:f[r].coord[0],maxY:f[r].coord[1],index:r});var d=new te;d.load(g);for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)for(var p=0;p<c[r][o].length;p++){var y=void 0;y=p==c[r][o].length-1?c[r][jl(o+1,t.geometry.coordinates[r].length-1)][0].coord:c[r][o][p+1].coord;var m=d.search({minX:y[0],minY:y[1],maxX:y[0],maxY:y[1]})[0];c[r][o][p].nxtIsectAlongEdgeIn=m.index}for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)for(p=0;p<c[r][o].length;p++){var _=c[r][o][p].coord,x=(m=d.search({minX:_[0],minY:_[1],maxX:_[0],maxY:_[1]})[0]).index;x<s?f[x].nxtIsectAlongRingAndEdge2=c[r][o][p].nxtIsectAlongEdgeIn:zl(f[x].ringAndEdge1,c[r][o][p].ringAndEdgeIn)?f[x].nxtIsectAlongRingAndEdge1=c[r][o][p].nxtIsectAlongEdgeIn:f[x].nxtIsectAlongRingAndEdge2=c[r][o][p].nxtIsectAlongEdgeIn}var E=[];for(r=0,o=0;o<e;o++){var k=r;for(p=0;p<t.geometry.coordinates[o].length-1;p++)f[r].coord[0]<f[k].coord[0]&&(k=r),r++;var w=f[k].nxtIsectAlongRingAndEdge2;for(p=0;p<f.length;p++)if(f[p].nxtIsectAlongRingAndEdge1==k||f[p].nxtIsectAlongRingAndEdge2==k){var b=p;break}var I=Yl([f[b].coord,f[k].coord,f[w].coord],!0)?1:-1;E.push({isect:k,parent:-1,winding:I})}E.sort(function(t,e){return f[t.isect].coord>f[e.isect].coord?-1:1});for(l=[];E.length>0;){var N=E.pop(),S=N.isect,M=N.parent,L=N.winding,C=l.length,T=[f[S].coord],O=S;if(f[S].ringAndEdge1Walkable)var A=f[S].ringAndEdge1,D=f[S].nxtIsectAlongRingAndEdge1;else A=f[S].ringAndEdge2,D=f[S].nxtIsectAlongRingAndEdge2;for(;!zl(f[S].coord,f[D].coord);){T.push(f[D].coord);var F=void 0;for(r=0;r<E.length;r++)if(E[r].isect==D){F=r;break}if(null!=F&&E.splice(F,1),zl(A,f[D].ringAndEdge1)){if(A=f[D].ringAndEdge2,f[D].ringAndEdge2Walkable=!1,f[D].ringAndEdge1Walkable){var q={isect:D};Yl([f[O].coord,f[D].coord,f[f[D].nxtIsectAlongRingAndEdge2].coord],1==L)?(q.parent=M,q.winding=-L):(q.parent=C,q.winding=L),E.push(q)}O=D,D=f[D].nxtIsectAlongRingAndEdge2}else{if(A=f[D].ringAndEdge1,f[D].ringAndEdge1Walkable=!1,f[D].ringAndEdge2Walkable){q={isect:D};Yl([f[O].coord,f[D].coord,f[f[D].nxtIsectAlongRingAndEdge1].coord],1==L)?(q.parent=M,q.winding=-L):(q.parent=C,q.winding=L),E.push(q)}O=D,D=f[D].nxtIsectAlongRingAndEdge1}}T.push(f[D].coord),l.push(P([T],{index:C,parent:M,winding:L,netWinding:void 0}))}var G=R(l);function Y(t){for(var e=[],n=0;n<t.features.length;n++)-1==t.features[n].properties.parent&&e.push(n);if(e.length>1)for(n=0;n<e.length;n++){for(var r=-1,i=1/0,o=0;o<t.features.length;o++)e[n]!=o&&Zt(t.features[e[n]].geometry.coordinates[0][0],t.features[o],{ignoreBoundary:!0})&&Ot(t.features[o])<i&&(r=o);t.features[e[n]].properties.parent=r}}function B(t){for(var e=0;e<t.features.length;e++)if(-1==t.features[e].properties.parent){var n=t.features[e].properties.winding;t.features[e].properties.netWinding=n,z(t,e,n)}}function z(t,e,n){for(var r=0;r<t.features.length;r++)if(t.features[r].properties.parent==e){var i=n+t.features[r].properties.winding;t.features[r].properties.netWinding=i,z(t,r,i)}}return Y(G),B(G),G}var ql=s(function t(e,n,r,o,s){i(this,t),this.coord=e,this.param=n,this.ringAndEdgeIn=r,this.ringAndEdgeOut=o,this.nxtIsectAlongEdgeIn=s}),Gl=s(function t(e,n,r,o,s,a,u){i(this,t),this.coord=e,this.ringAndEdge1=n,this.ringAndEdge2=r,this.nxtIsectAlongRingAndEdge1=o,this.nxtIsectAlongRingAndEdge2=s,this.ringAndEdge1Walkable=a,this.ringAndEdge2Walkable=u});function Yl(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function Bl(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(Yl([t[jl(e-1,t.length-1)],t[e],t[jl(e+1,t.length-1)]],!0))var r=1;else r=-1;return r}function zl(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!zl(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function jl(t,e){return(t%e+e)%e}function Xl(t){return function(){return t}}function Ul(t){return t[0]}function Vl(t){return t[1]}function Zl(){this._=null}function Hl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Wl(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Jl(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Kl(t){for(;t.L;)t=t.L;return t}function Ql(t,e,n,r){var i=[null,null],o=kh.push(i)-1;return i.left=t,i.right=e,n&&th(i,t,e,n),r&&th(i,e,t,r),xh[t.index].halfedges.push(o),xh[e.index].halfedges.push(o),i}function $l(t,e,n){var r=[e,n];return r.left=t,r}function th(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function eh(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],h=0,c=1,f=a[0]-u,v=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<h)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>h&&(h=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>h&&(h=o)}else if(f>0){if(o<h)return;o<c&&(c=o)}if(o=n-l,v||!(o>0)){if(o/=v,v<0){if(o<h)return;o<c&&(c=o)}else if(v>0){if(o>c)return;o>h&&(h=o)}if(o=i-l,v||!(o<0)){if(o/=v,v<0){if(o>c)return;o>h&&(h=o)}else if(v>0){if(o<h)return;o<c&&(c=o)}return!(h>0||c<1)||(h>0&&(t[0]=[u+h*f,l+h*v]),c<1&&(t[1]=[u+c*f,l+c*v]),!0)}}}}}function nh(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,h=t.right,c=l[0],f=l[1],v=h[0],g=h[1],d=(c+v)/2,p=(f+g)/2;if(g===f){if(d<e||d>=r)return;if(c>v){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]<n)return}else u=[d,i];o=[d,n]}}else if(a=p-(s=(c-v)/(g-f))*d,s<-1||s>1)if(c>v){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<g){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function rh(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function ih(t,e){return e[+(e.left!==t.site)]}function oh(t,e){return e[+(e.left===t.site)]}Zl.prototype={constructor:Zl,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Kl(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Wl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Jl(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Jl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Wl(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Kl(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Wl(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Jl(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Wl(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Jl(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Wl(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Jl(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var sh,ah=[];function uh(){Hl(this),this.x=this.y=this.arc=this.site=this.cy=null}function lh(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,h=o[0]-s,c=o[1]-a,f=2*(u*c-l*h);if(!(f>=-1e-12)){var v=u*u+l*l,g=h*h+c*c,d=(c*v-l*g)/f,p=(u*g-h*v)/f,y=ah.pop()||new uh;y.arc=t,y.site=i,y.x=d+s,y.y=(y.cy=p+a)+Math.sqrt(d*d+p*p),t.circle=y;for(var m=null,_=Eh._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Eh.insert(m,y),m||(sh=y)}}}}function hh(t){var e=t.circle;e&&(e.P||(sh=e.N),Eh.remove(e),ah.push(e),Hl(e),t.circle=null)}var ch=[];function fh(){Hl(this),this.edge=this.site=this.circle=null}function vh(t){var e=ch.pop()||new fh;return e.site=t,e}function gh(t){hh(t),_h.remove(t),ch.push(t),Hl(t)}function dh(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];gh(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<wh&&Math.abs(r-u.circle.cy)<wh;)o=u.P,a.unshift(u),gh(u),u=o;a.unshift(u),hh(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<wh&&Math.abs(r-l.circle.cy)<wh;)s=l.N,a.push(l),gh(l),l=s;a.push(l),hh(l);var h,c=a.length;for(h=1;h<c;++h)l=a[h],u=a[h-1],th(l.edge,u.site,l.site,i);u=a[0],(l=a[c-1]).edge=Ql(u.site,l.site,null,i),lh(u),lh(l)}function ph(t){for(var e,n,r,i,o=t[0],s=t[1],a=_h._;a;)if((r=yh(a,s)-o)>wh)a=a.L;else{if(!((i=o-mh(a,s))>wh)){r>-wh?(e=a.P,n=a):i>-wh?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){xh[t.index]={site:t,halfedges:[]}}(t);var u=vh(t);if(_h.insert(e,u),e||n){if(e===n)return hh(e),n=vh(e.site),_h.insert(u,n),u.edge=n.edge=Ql(e.site,u.site),lh(e),void lh(n);if(n){hh(e),hh(n);var l=e.site,h=l[0],c=l[1],f=t[0]-h,v=t[1]-c,g=n.site,d=g[0]-h,p=g[1]-c,y=2*(f*p-v*d),m=f*f+v*v,_=d*d+p*p,x=[(p*m-v*_)/y+h,(f*_-d*m)/y+c];th(n.edge,l,g,x),u.edge=Ql(l,t,null,x),n.edge=Ql(t,g,null,x),lh(e),lh(n)}else u.edge=Ql(e.site,u.site)}}function yh(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var h=a-r,c=1/o-1/l,f=h/l;return c?(-f+Math.sqrt(f*f-2*c*(h*h/(-2*l)-u+l/2+i-o/2)))/c+r:(r+a)/2}function mh(t,e){var n=t.N;if(n)return yh(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var _h,xh,Eh,kh,wh=1e-6;function bh(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Ih(t,e){return e[1]-t[1]||e[0]-t[0]}function Nh(t,e){var n,r,i,o=t.sort(Ih).pop();for(kh=[],xh=new Array(t.length),_h=new Zl,Eh=new Zl;;)if(i=sh,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(ph(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;dh(i.arc)}if(function(){for(var t,e,n,r,i=0,o=xh.length;i<o;++i)if((t=xh[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=rh(t,kh[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=kh.length;o--;)nh(i=kh[o],t,e,n,r)&&eh(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>wh||Math.abs(i[0][1]-i[1][1])>wh)||delete kh[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,h,c,f,v,g,d,p=xh.length,y=!0;for(i=0;i<p;++i)if(o=xh[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)kh[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)g=(v=oh(o,kh[u[a]]))[0],d=v[1],c=(h=ih(o,kh[u[++a%l]]))[0],f=h[1],(Math.abs(g-c)>wh||Math.abs(d-f)>wh)&&(u.splice(a,0,kh.push($l(s,v,Math.abs(g-t)<wh&&r-d>wh?[t,Math.abs(c-t)<wh?f:r]:Math.abs(d-r)<wh&&n-g>wh?[Math.abs(f-r)<wh?c:n,r]:Math.abs(g-n)<wh&&d-e>wh?[n,Math.abs(c-n)<wh?f:e]:Math.abs(d-e)<wh&&g-t>wh?[Math.abs(f-e)<wh?c:t,e]:null))-1),++l);l&&(y=!1)}if(y){var m,_,x,E=1/0;for(i=0,y=null;i<p;++i)(o=xh[i])&&(x=(m=(s=o.site)[0]-t)*m+(_=s[1]-e)*_)<E&&(E=x,y=o);if(y){var k=[t,e],w=[t,r],b=[n,r],I=[n,e];y.halfedges.push(kh.push($l(s=y.site,k,w))-1,kh.push($l(s,w,b))-1,kh.push($l(s,b,I))-1,kh.push($l(s,I,k))-1)}}for(i=0;i<p;++i)(o=xh[i])&&(o.halfedges.length||delete xh[i])}(s,a,u,l)}this.edges=kh,this.cells=xh,_h=Eh=kh=xh=null}function Sh(t,e){return e?St(t,function(t,e){return t+function(t){var e=m(t[0],2),n=e[0],r=e[1],i=m(t[1],2),o=i[0]-n,s=i[1]-r;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}(e.geometry.coordinates)},0):tu(t,{units:"meters"})}function Mh(t){var e=90-t;return e>180&&(e-=360),e}function Lh(t,e){var n=t[0],r=t[t.length-1];if(e){var i=m(n,2),o=i[0],s=i[1],a=m(r,2),u=a[0]-o,l=a[1]-s,h=Math.sqrt(Math.pow(u,2)+Math.pow(l,2));return h<1e-9?[NaN,NaN]:[l/h,u/h]}var c=Mh(ht(n,r))*Math.PI/180;return[Math.sin(c),Math.cos(c)]}function Ph(t,e,n,r){if(r){var i=m(t,2),o=i[0],s=i[1],a=e*Math.PI/180,u=Math.sin(a),l=Math.cos(a);return[[o-n/2*l,s-n/2*u],[o+n/2*l,s+n/2*u]]}var h=ct(M(t),n/2,e,{units:"meters"});return[et(ct(M(t),-n/2,e,{units:"meters"})),et(h)]}Nh.prototype={constructor:Nh,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return ih(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],h=l.left===a?l.right:l.left;++u<o;)s=h,h=(l=e[i[u]]).left===a?l.right:l.left,s&&h&&r<s.index&&r<h.index&&bh(a,s,h)<0&&t.push([a.data,s.data,h.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],h=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],c=u*u+l*l;c<h&&(h=c,s=a.index)}})}while(null!==s);return o._found=r,null==n||h<=n*n?i.site:null}},t.along=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=at(t).coordinates,i=0,o=0;o<r.length&&!(e>=i&&o===r.length-1);o++){if(i>=e){var s=e-i;if(s){var a=ht(r[o],r[o-1])-180;return ct(r[o],s,a,n)}return M(r[o])}i+=ft(r[o],r[o+1],n)}return M(r[r.length-1])},t.angle=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!J(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s=n,a=j(!0!==r.mercator?ht(o,i):vt(o,i)),u=j(!0!==r.mercator?ht(o,s):vt(o,s));u<a&&(u+=360);var l=u-a;return!0===r.explementary?360-l:l},t.applyFilter=po,t.area=Ot,t.areaFactors=I,t.azimuthToBearing=X,t.bbox=qt,t.bboxClip=function(t,e){var n=at(t),r=n.type,i="Feature"===t.type?t.properties:{},o=n.coordinates;switch(r){case"LineString":case"MultiLineString":var s=[];return"LineString"===r&&(o=[o]),o.forEach(function(t){!function(t,e,n){var r,i,o,s,a,u=t.length,l=Bt(t[0],e),h=[];for(n||(n=[]),r=1;r<u;r++){for(s=t[r-1],i=o=Bt(a=t[r],e);;){if(!(l|i)){h.push(s),i!==o?(h.push(a),r<u-1&&(n.push(h),h=[])):r===u-1&&h.push(a);break}if(l&i)break;l?l=Bt(s=Yt(s,a,l,e),e):i=Bt(a=Yt(s,a,i,e),e)}l=o}h.length&&n.push(h)}(t,e,s)}),1===s.length?T(s[0],i):A(s,i);case"Polygon":return P(zt(o,e),i);case"MultiPolygon":return F(o.map(function(t){return zt(t,e)}),i);default:throw new Error("geometry "+r+" not supported")}},t.bboxPolygon=jt,t.bearing=ht,t.bearingToAzimuth=j,t.bezierSpline=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.resolution||1e4,r=e.sharpness||.85,i=[],o=at(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),s=new Xt({duration:n,points:o,sharpness:r}),a=function(t){var e=s.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u<s.duration;u+=10)a(u);return a(s.duration),T(i,e.properties)},t.booleanClockwise=Ut,t.booleanConcave=function(t){var e=at(t).coordinates;if(e[0].length<=4)return!1;for(var n=!1,r=e[0].length-1,i=0;i<r;i++){var o=e[0][(i+2)%r][0]-e[0][(i+1)%r][0],s=e[0][(i+2)%r][1]-e[0][(i+1)%r][1],a=e[0][i][0]-e[0][(i+1)%r][0],u=o*(e[0][i][1]-e[0][(i+1)%r][1])-s*a;if(0===i)n=u>0;else if(n!==u>0)return!0}return!1},t.booleanContains=fn,t.booleanCrosses=Yn,t.booleanDisjoint=Un,t.booleanEqual=Gn,t.booleanIntersects=Wn,t.booleanOverlap=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(Cn(t,e,{precision:6}))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],h=r.coordinates[u];if(l[0]===h[0]&&l[1]===h[1])return!0}return!1;case"LineString":case"MultiLineString":Nt(t,function(t){Nt(e,function(e){tr(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Nt(t,function(t){Nt(e,function(e){je(t,e).features.length&&s++})})}return s>0},t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==rr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==rr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=xe(Dn(t)).features,r=xe(Dn(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!nr(o,r[i].geometry.coordinates))return!1}return!0},t.booleanPointInPolygon=Zt,t.booleanPointOnLine=Ht,t.booleanTouches=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"Point":switch(o){case"LineString":return ir(n,r);case"MultiLineString":for(var s=!1,a=0;a<r.coordinates.length;a++)ir(n,{coordinates:r.coordinates[a]})&&(s=!0);return s;case"Polygon":for(var u=0;u<r.coordinates.length;u++)if(Ht(n,{type:"LineString",coordinates:r.coordinates[u]}))return!0;return!1;case"MultiPolygon":for(u=0;u<r.coordinates.length;u++)for(a=0;a<r.coordinates[u].length;a++)if(Ht(n,{type:"LineString",coordinates:r.coordinates[u][a]}))return!0;return!1;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"LineString":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||ir({coordinates:n.coordinates[u]},r)&&(s=!0),Ht({type:"Point",coordinates:n.coordinates[u]},r,{ignoreEndVertices:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||ir({coordinates:n.coordinates[u]},{coordinates:r.coordinates[a]})&&(s=!0),Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a]},{ignoreEndVertices:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a][0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},{type:"Polygon",coordinates:r.coordinates[a]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return ir(r,n);case"MultiPoint":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||ir({coordinates:r.coordinates[u]},n)&&(s=!0),Ht({type:"Point",coordinates:r.coordinates[u]},n,{ignoreEndVertices:!0}))return!1;return s;case"LineString":var l=!1;if(ir({coordinates:n.coordinates[0]},r)&&(l=!0),ir({coordinates:n.coordinates[n.coordinates.length-1]},r)&&(l=!0),!1===l)return!1;for(u=0;u<n.coordinates.length;u++)if(Ht({type:"Point",coordinates:n.coordinates[u]},r,{ignoreEndVertices:!0}))return!1;return l;case"MultiLineString":for(l=!1,u=0;u<r.coordinates.length;u++){ir({coordinates:n.coordinates[0]},{coordinates:r.coordinates[u]})&&(l=!0),ir({coordinates:n.coordinates[n.coordinates.length-1]},{coordinates:r.coordinates[u]})&&(l=!0);for(a=0;a<n.coordinates[u].length;a++)if(Ht({type:"Point",coordinates:n.coordinates[a]},{type:"LineString",coordinates:r.coordinates[u]},{ignoreEndVertices:!0}))return!1}return l;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates.length;u++){for(a=0;a<r.coordinates.length;a++)s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a][0]})&&(s=!0);if(Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1}return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiLineString":switch(o){case"Point":for(u=0;u<n.coordinates.length;u++)if(ir(r,{coordinates:n.coordinates[u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||ir({coordinates:r.coordinates[a]},{coordinates:n.coordinates[a]})&&(s=!0),Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[a]},{ignoreEndVertices:!0}))return!1;return s;case"LineString":for(l=!1,u=0;u<n.coordinates.length;u++){ir({coordinates:n.coordinates[u][0]},r)&&(l=!0),ir({coordinates:n.coordinates[u][n.coordinates[u].length-1]},r)&&(l=!0);for(a=0;a<r.coordinates.length;a++)if(Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[u]},{ignoreEndVertices:!0}))return!1}return l;case"MultiLineString":for(l=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++){ir({coordinates:n.coordinates[u][0]},{coordinates:r.coordinates[a]})&&(l=!0),ir({coordinates:n.coordinates[u][n.coordinates[u].length-1]},{coordinates:r.coordinates[a]})&&(l=!0);for(var h=0;h<n.coordinates[u].length;h++)if(Ht({type:"Point",coordinates:n.coordinates[u][h]},{type:"LineString",coordinates:r.coordinates[a]},{ignoreEndVertices:!0}))return!1}return l;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<n.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[u][a]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u][a]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<r.coordinates[0].length;u++)for(a=0;a<n.coordinates.length;a++)for(h=0;h<n.coordinates[a].length;h++)if(s||Ht({type:"Point",coordinates:n.coordinates[a][h]},{type:"LineString",coordinates:r.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[a][h]},{type:"Polygon",coordinates:[r.coordinates[0][u]]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":for(u=0;u<n.coordinates.length;u++)if(Ht(r,{type:"LineString",coordinates:n.coordinates[u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:r.coordinates[u]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u]},n,{ignoreBoundary:!0}))return!1;return s;case"LineString":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:r.coordinates[u]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u]},n,{ignoreBoundary:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<r.coordinates.length;u++)for(a=0;a<r.coordinates[u].length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[u][a]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u][a]},n,{ignoreBoundary:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<r.coordinates[0].length;u++)for(a=0;a<n.coordinates[0].length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][a]},{type:"LineString",coordinates:r.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][a]},{type:"Polygon",coordinates:r.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":switch(o){case"Point":for(u=0;u<n.coordinates[0].length;u++)if(Ht(r,{type:"LineString",coordinates:n.coordinates[0][u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a]},{type:"Polygon",coordinates:n.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;case"LineString":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a]},{type:"Polygon",coordinates:n.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)for(h=0;h<r.coordinates[a].length;h++)if(s||Ht({type:"Point",coordinates:r.coordinates[a][h]},{type:"LineString",coordinates:n.coordinates[u][0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a][h]},{type:"Polygon",coordinates:[n.coordinates[u][0]]},{ignoreBoundary:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<n.coordinates[0][u].length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u][a]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u][a]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates[0].length;a++)for(h=0;h<n.coordinates[0].length;h++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u][h]},{type:"LineString",coordinates:r.coordinates[0][a]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u][h]},{type:"Polygon",coordinates:r.coordinates[0][a]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},t.booleanValid=function t(e){if(!e.type)return!1;var n=at(e),r=n.type,i=n.coordinates;switch(r){case"Point":return i.length>1;case"MultiPoint":for(var o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"LineString":if(i.length<2)return!1;for(o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"MultiLineString":if(i.length<1)return!1;for(o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"Polygon":for(o=0;o<n.coordinates.length;o++){if(i[o].length<4)return!1;if(!ar(i[o]))return!1;if(ur(i[o]))return!1;if(o>0&&je(P([i[0]]),P([i[o]])).features.length>1)return!1}return!0;case"MultiPolygon":for(o=0;o<n.coordinates.length;o++)for(var s=n.coordinates[o],a=0;a<s.length;a++){if(s[a].length<4)return!1;if(!ar(s[a]))return!1;if(ur(s[a]))return!1;if(0===a&&!lr(s,n.coordinates,o))return!1;if(a>0&&je(P([s[0]]),P([s[a]])).features.length>1)return!1}return!0;case"GeometryCollection":return!!n.geometries&&(Array.isArray(n.geometries)&&n.geometries.length>0&&n.geometries.every(function(e){return sr.has(e.type)&&t(e)}));default:return!1}},t.booleanWithin=hr,t.buffer=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!==E(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");var o=[];switch(t.type){case"GeometryCollection":return kt(t,function(t){var n=Ai(t,e,r,i);n&&o.push(n)}),R(o);case"FeatureCollection":return _t(t,function(t){var n=Ai(t,e,r,i);n&&_t(n,function(t){t&&o.push(t)})}),R(o)}return Ai(t,e,r,i)},t.center=cr,t.centerMean=Gi,t.centerMedian=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!W(n))throw new Error("counter must be a number");var r=e.weight,i=Gi(t,{weight:e.weight}),o=R([]);_t(t,function(t){var e;o.features.push(Yi(t,{properties:{weight:null==(e=t.properties)?void 0:e[r]}}))});var s={tolerance:e.tolerance,medianCandidates:[]};return Bi(i.geometry.coordinates,[0,0],o,s,n)},t.centerOfMass=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(ut(e)){case"Point":return M(et(e),n.properties);case"Polygon":var r=[];dt(e,function(t){r.push(t)});var i,o,s,a,u,l,h,c,f=Yi(e,{properties:n.properties}),v=f.geometry.coordinates,g=0,d=0,p=0,y=r.map(function(t){return[t[0]-v[0],t[1]-v[1]]});for(i=0;i<r.length-1;i++)a=(o=y[i])[0],l=o[1],u=(s=y[i+1])[0],p+=c=a*(h=s[1])-u*l,g+=(a+u)*c,d+=(l+h)*c;if(0===p)return f;var m=1/(6*(.5*p));return M([v[0]+m*g,v[1]+m*d],n.properties);default:var _=io(e);return _?t(_,{properties:n.properties}):Yi(e,{properties:n.properties})}},t.centroid=Yi,t.circle=oo,t.cleanCoords=Dn,t.clone=so,t.cloneProperties=uo,t.clusterEach=fo,t.clusterReduce=vo,t.clusters=Io,t.clustersDbscan=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!0!==n.mutate&&(t=so(t));var r=n.minPoints||3,i=z(e,n.units),o=new te(t.features.length),s=t.features.map(function(t){return!1}),a=t.features.map(function(t){return!1}),u=t.features.map(function(t){return!1}),l=t.features.map(function(t){return-1});o.load(t.features.map(function(t,e){var n=m(t.geometry.coordinates,2),r=n[0],i=n[1];return{minX:r,minY:i,maxX:r,maxY:i,index:e}}));var h=function(r){var s=t.features[r],a=m(s.geometry.coordinates,2),u=a[0],l=a[1],h=Math.max(l-i,-90),c=Math.min(l+i,90),f=h<0&&c>0?i:Math.abs(h)<Math.abs(c)?i/Math.cos(V(c)):i/Math.cos(V(h)),v=Math.max(u-f,-360),g=Math.min(u+f,360),d={minX:v,minY:h,maxX:g,maxY:c};return o.search(d).filter(function(r){var i=r.index,o=t.features[i];return ft(s,o,{units:n.units})<=e})},c=0;return t.features.forEach(function(t,e){if(!s[e]){var n=h(e);if(n.length>=r){var i=c;c++,s[e]=!0,function(t,e){for(var n=0;n<e.length;n++){var i=e[n].index;if(!s[i]){s[i]=!0;var o=h(i);o.length>=r&&e.push.apply(e,_(o))}a[i]||(a[i]=!0,l[i]=t)}}(i,n)}else u[e]=!0}}),t.features.forEach(function(e,n){var r=t.features[n];r.properties||(r.properties={}),l[n]>=0?(r.properties.dbscan=u[n]?"edge":"core",r.properties.cluster=l[n]):r.properties.dbscan="noise"}),t},t.clustersKmeans=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=so(t));var r=Et(t),i=r.slice(0,e.numberOfClusters),o=Mo(r,e.numberOfClusters,i),s={};return o.centroids.forEach(function(t,e){s[e]=t}),_t(t,function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=s[n]}),t},t.collect=function(t,e,n,r){var i=new te(6),o=e.features.map(function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null==(e=t.properties)?void 0:e[n]}});return i.load(o),t.features.forEach(function(t){t.properties||(t.properties={});var e=qt(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach(function(e){Zt([e.minX,e.minY],t)&&o.push(e.property)}),t.properties[r]=o}),t},t.collectionOf=st,t.combine=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return _t(t,function(t){var n,r,i,o;switch(null==(o=t.geometry)?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,_(t.geometry.coordinates)),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,_(t.geometry.coordinates)),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,_(t.geometry.coordinates)),e.MultiPolygon.properties.push(t.properties)}}),R(Object.keys(e).filter(function(t){return e[t].coordinates.length}).sort().map(function(t){return N({type:t,coordinates:e[t].coordinates},{collectedProperties:e[t].properties})}))},t.concave=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxEdge||1/0,r=function(t){var e=[],n={};return _t(t,function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}}),R(e)}(t),i=Lo(r);if(i.features=i.features.filter(function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=ft(r,i,e),a=ft(i,o,e),u=ft(r,o,e);return s<=n&&a<=n&&u<=n}),i.features.length<1)return null;var o=rs(i);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),N(o)},t.containsNumber=rt,t.convertArea=H,t.convertLength=Z,t.convex=io,t.coordAll=Et,t.coordEach=dt,t.coordReduce=pt,t.createBins=go,t.degreesToRadians=V,t.destination=ct,t.difference=function(t){var e=[];if(kt(t,function(t){e.push(t.coordinates)}),e.length<2)throw new Error("Must have at least two features");var n=t.features[0].properties||{},r=ia.apply(sa,[e[0]].concat(_(e.slice(1))));return 0===r.length?null:1===r.length?P(r[0],n):F(r,n)},t.directionalMean=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!!n.planar,i=null!=(e=n.segment)&&e,o=0,s=0,a=0,u=0,l=[];i?Nt(t,function(t){var e=m(Lh(t.geometry.coordinates,r),2),n=e[0],i=e[1],h=Sh(t,r);isNaN(n)||isNaN(i)||(o+=n,s+=i,a+=1,u+=h,l.push(Yi(t)))}):_t(t,function(t){if("LineString"!==t.geometry.type)throw new Error("shold to support MultiLineString?");var e=m(Lh(t.geometry.coordinates,r),2),n=e[0],i=e[1],h=Sh(t,r);isNaN(n)||isNaN(i)||(o+=n,s+=i,a+=1,u+=h,l.push(Yi(t)))});var h=function(t,e){var n=0;n=Math.abs(e)<1e-9?90:180*Math.atan2(t,e)/Math.PI;t>=0?e<0&&(n+=180):e<0&&(n-=180);return n}(o,s),c=Mh(h),f=function(t,e,n){if(0===n)throw new Error("the size of the features set must be greater than 0");return 1-Math.sqrt(Math.pow(t,2)+Math.pow(e,2))/n}(o,s,a),v=u/a,g=m(et(Yi(R(l))),2),d=g[0],p=g[1];return T(Ph([d,p],r?h:c,v,r),{averageLength:v,averageX:d,averageY:p,bearingAngle:c,cartesianAngle:h,circularVariance:f,countOfLines:a})},t.dissolve=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;st(t,"Polygon","dissolve");var r=[];if(!n)return aa(F(na.apply(null,t.features.map(function(t){return t.geometry.coordinates}))));var i={};_t(t,function(t){t.properties&&(Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t))});for(var o=Object.keys(i),s=0;s<o.length;s++){var a=F(na.apply(null,i[o[s]].map(function(t){return t.geometry.coordinates})));a&&a.properties&&(a.properties[n]=o[s],r.push(a))}return aa(R(r))},t.distance=ft,t.distanceWeight=la,t.earthRadius=w,t.ellipse=va,t.envelope=ga,t.explode=da,t.factors=b,t.feature=N,t.featureCollection=R,t.featureEach=_t,t.featureOf=ot,t.featureReduce=xt,t.filterProperties=mo,t.findPoint=Ct,t.findSegment=Pt,t.flatten=aa,t.flattenEach=bt,t.flattenReduce=It,t.flip=function(t,e){var n;if(!J(e=e||{}))throw new Error("options is invalid");var r=null!=(n=e.mutate)&&n;if(!t)throw new Error("geojson is required");return!1!==r&&void 0!==r||(t=so(t)),dt(t,function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e}),t},t.geojsonRbush=me,t.geojsonType=it,t.geomEach=kt,t.geomReduce=wt,t.geometry=S,t.geometryCollection=q,t.getCluster=co,t.getCoord=et,t.getCoords=nt,t.getGeom=at,t.getType=ut,t.greatCircle=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==E(n))throw new Error("options is invalid");var r=n.properties,i=void 0===r?{}:r,o=n.npoints,s=void 0===o?100:o,a=n.offset,u=void 0===a?10:a,l=et(t),h=et(e);return l[0]===h[0]&&l[1]===h[1]?T(Array(s).fill([l[0],l[1]]),i):new ka({x:l[0],y:l[1]},{x:h[0],y:h[1]},i||{}).Arc(s,{offset:u}).json()},t.helpers=tt,t.hexGrid=ba,t.interpolate=function(t,e,n){var r,i,o,s;if("object"!==E(n=n||{}))throw new Error("options is invalid");if(!t)throw new Error("points is required");if(st(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");var a,u=null!=(r=n.gridType)?r:"square",l=null!=(i=n.property)?i:"elevation",h=null!=(o=n.weight)?o:1,c=null!=(s=n.bbox)?s:qt(t);if(void 0!==h&&"number"!=typeof h)throw new Error("weight must be a number");switch(Q(c),u){case"point":case"points":a=Sa(c,e,n);break;case"square":case"squares":a=La(c,e,n);break;case"hex":case"hexes":a=ba(c,e,n);break;case"triangle":case"triangles":a=Pa(c,e,n);break;default:throw new Error("invalid gridType")}var f=[];return _t(a,function(e){var r=0,i=0;_t(t,function(t){var o,s,a=ft("point"===u?e:Yi(e),t,n);if(void 0!==l&&(s=null==(o=t.properties)?void 0:o[l]),void 0===s&&(s=t.geometry.coordinates[2]),void 0===s)throw new Error("zValue is missing");0===a&&(r=s);var c=1/Math.pow(a,h);i+=c,r+=c*s});var o=so(e);null!=o.properties||(o.properties={}),o.properties[l]=r/i,f.push(o)}),R(f)},t.intersect=wa,t.invariant=lt,t.isNumber=W,t.isObject=J,t.isobands=function(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(st(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!J(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s=Fa(t,{zProperty:r,flip:!0}),a=s[0].length;if(s.length<2||a<2)throw new Error("Matrix of points must be at least 2x2");for(var l=1;l<s.length;l++)if(s[l].length!==a)throw new Error("Matrix of points is not uniform in the x dimension");var h=function(t,e,n){for(var r,i=[],o=1;o<e.length;o++){1===o&&(r=qa(t,+e[0]));var s=+e[o],a=+e[o-1],l=qa(t,s),h=l.map(function(t){return t.map(function(t){return[t[0],t[1]]}).reverse()}),c=Ba(Ya(Ga(r.concat(h),t)));if(0===c.length&&t[0][0]<s&&t[0][0]>=a){var f=t[0].length,v=t.length;c.push([[[0,0],[f-1,0],[f-1,v-1],[0,v-1],[0,0]]])}i.push(u({groupedRings:c},n,a+"-"+s)),r=l}return i}(s,e,r);h=function(t,e,n){var r=qt(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,h=i/u,c=o/l;return t.map(function(t){return t.groupedRings=t.groupedRings.map(function(t){return t.map(function(t){return t.map(function(t){return[t[0]*h+s,t[1]*c+a]})})}),t})}(h,s,t);var c=h.map(function(t,e){if(o[e]&&!J(o[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Da(Da({},i),o[e]);return n[r]=t[r],F(t.groupedRings,n)});return R(c)},t.isolines=function(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(st(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!J(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=Ka(t,{zProperty:r,flip:!0}),a=s[0].length;if(s.length<2||a<2)throw new Error("Matrix of points must be at least 2x2");for(var u=1;u<s.length;u++)if(s[u].length!==a)throw new Error("Matrix of points is not uniform in the x dimension");var l=function(t,e,n){var r=qt(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,h=i/u,c=o/l,f=function(t){t[0]=t[0]*h+s,t[1]=t[1]*c+a};return t.forEach(function(t){dt(t,f)}),t}(function(t,e,n,r,i){for(var o=[],s=0;s<e.length;s++){var a=+e[s],u=Ja(Ja({},r),i[s]);u[n]=a;var l=A(Qa(t,a),u);o.push(l)}return o}(s,e,r,i,o),s,t);return R(l)},t.kinks=function(t){var e,n,r={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type){var i;e=(i=[]).concat.apply(i,_(n.coordinates))}else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var i=n;i<e.length-1;i++){if(t===e){if(1===Math.abs(n-i))continue;if(0===n&&i===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var o=$a(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[i][0],e[i][1],e[i+1][0],e[i+1][1]);o&&r.features.push(M([o[0],o[1]]))}})}),r},t.length=tu,t.lengthToDegrees=z,t.lengthToRadians=B,t.lineArc=eu,t.lineChunk=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n))throw new Error("options is invalid");var r=n.units,i=void 0===r?"kilometers":r,o=n.reverse,s=void 0!==o&&o;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var a=[];return bt(t,function(t){s&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,r){var i=tu(t,{units:n});if(i<=e)return r(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++){r(ru(t,e*s,e*(s+1),{units:n}))}}(t,e,i,function(t){a.push(t)})}),R(a)},t.lineEach=Mt,t.lineIntersect=je,t.lineOffset=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r=n.units,i=void 0===r?"kilometers":r;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var o=ut(t),s="Feature"===t.type?t.properties:{};switch(o){case"LineString":return au(t,e,i);case"MultiLineString":var a=[];return bt(t,function(t){a.push(au(t,e,i).geometry.coordinates)}),A(a,s);default:throw new Error("geometry "+o+" is not supported")}},t.lineOverlap=tr,t.lineReduce=Lt,t.lineSegment=xe,t.lineSlice=function(t,e,n){var r=nt(n);if("LineString"!==ut(n))throw new Error("line must be a LineString");var i=$e(n,t),o=$e(n,e);uu(n,i),uu(n,o);for(var s=i.properties.segmentIndex<=o.properties.segmentIndex?[i,o]:[o,i],a=[s[0].geometry.coordinates],u=s[0].properties.segmentIndex+1;u<s[1].properties.segmentIndex+1;u++)a.push(r[u]);return a.push(s[1].geometry.coordinates),T(a,"Feature"===n.type?n.properties:{})},t.lineSliceAlong=ru,t.lineSplit=an,t.lineString=T,t.lineStrings=O,t.lineToPolygon=function(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.properties,s=null==(e=i.autoComplete)||e,a=null==(n=i.orderCoords)||n;if(null!=(r=i.mutate)&&r||(t=so(t)),"FeatureCollection"===t.type){var u=[];return t.features.forEach(function(t){u.push(nt(lu(t,{},s,a)))}),F(u,o)}return lu(t,o,s,a)},t.mask=function(t,e,n){var r,i=null!=(r=null==n?void 0:n.mutate)&&r,o=e;e&&!1===i&&(o=so(e));var s,a=fu(o);return("FeatureCollection"===t.type?cu(2===(s=t).features.length?na(s.features[0].geometry.coordinates,s.features[1].geometry.coordinates):na.apply(sa,s.features.map(function(t){return t.geometry.coordinates}))):"Feature"===t.type?cu(na(t.geometry.coordinates)):cu(na(t.coordinates))).geometry.coordinates.forEach(function(t){a.geometry.coordinates.push(t[0])}),a},t.meta=Tt,t.midpoint=function(t,e){return ct(t,ft(t,e)/2,ht(t,e))},t.moranIndex=function(t,e){var n,r,i=e.inputField,o=e.threshold||1e5,s=e.p||2,u=null!=(n=e.binary)&&n,l=la(t,{alpha:e.alpha||-1,binary:u,p:s,standardization:null==(r=e.standardization)||r,threshold:o}),h=[];_t(t,function(t){var e=t.properties||{};h.push(e[i])});for(var c=vu(h),f=function(t){var e,n=vu(t),r=0,i=a(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r+=Math.pow(o-n,2)}}catch(t){i.e(t)}finally{i.f()}return r/t.length}(h),v=0,g=0,d=0,p=0,y=l.length,m=0;m<y;m++){for(var _=0,x=0;x<y;x++)v+=l[m][x]*(h[m]-c)*(h[x]-c),g+=l[m][x],d+=Math.pow(l[m][x]+l[x][m],2),_+=l[m][x]+l[x][m];p+=Math.pow(_,2)}var E=v/g/f,k=-1/(y-1),w=(y*y*(d*=.5)-y*p+g*g*3)/((y-1)*(y+1)*(g*g))-k*k,b=Math.sqrt(w);return{expectedMoranIndex:k,moranIndex:E,stdNorm:b,zNorm:(E-k)/b}},t.multiLineString=A,t.multiPoint=D,t.multiPolygon=F,t.nearestNeighborAnalysis=function(t,e){var n=(e=e||{}).studyArea||jt(qt(t)),r=e.properties||{},i=e.units||"kilometers",o=[];_t(t,function(t){o.push(Yi(t))});var s=o.length,a=o.map(function(t,e){return ft(t,wu(t,R(o.filter(function(t,n){return n!==e}))).geometry.coordinates,{units:i})}).reduce(function(t,e){return t+e},0)/s,u=s/H(Ot(n),"meters",i),l=1/(2*Math.sqrt(u)),h=.26136/Math.sqrt(s*u);return r.nearestNeighborAnalysis={units:i,arealUnits:i+"²",observedMeanDistance:a,expectedMeanDistance:l,nearestNeighborIndex:a/l,numberOfPoints:s,zScore:(a-l)/h},n.properties=r,n},t.nearestPoint=wu,t.nearestPointOnLine=$e,t.nearestPointToLine=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.units,i=n.properties||{},o=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return kt(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t;default:throw new Error("points must be a Point Collection")}}(t);if(!o.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==ut(e))throw new Error("line must be a LineString");var s=1/0,a=null;return _t(o,function(t){var n=bu(t,e,{units:r});n<s&&(s=n,a=t)}),a&&(a.properties=Cu(Cu(Cu({},{dist:s}),a.properties),i)),a},t.planepoint=function(t,e){var n=et(t),r=at(e).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var i="Feature"===e.type&&e.properties||{},o=i.a,s=i.b,a=i.c,u=n[0],l=n[1],h=r[0][0],c=r[0][1],f=void 0!==o?o:r[0][2],v=r[1][0],g=r[1][1],d=void 0!==s?s:r[1][2],p=r[2][0],y=r[2][1],m=void 0!==a?a:r[2][2];return(m*(u-h)*(l-g)+f*(u-v)*(l-y)+d*(u-p)*(l-c)-d*(u-h)*(l-y)-m*(u-v)*(l-c)-f*(u-p)*(l-g))/((u-h)*(l-g)+(u-v)*(l-y)+(u-p)*(l-c)-(u-h)*(l-y)-(u-v)*(l-c)-(u-p)*(l-g))},t.point=M,t.pointGrid=Sa,t.pointOnFeature=function(t){for(var e=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?R([N(t)]):R([t]);return t}(t),n=cr(e),r=!1,i=0;!r&&i<e.features.length;){var o=e.features[i].geometry,s=!1;if("Point"===o.type)n.geometry.coordinates[0]===o.coordinates[0]&&n.geometry.coordinates[1]===o.coordinates[1]&&(r=!0);else if("MultiPoint"===o.type)for(var a=!1,u=0;!a&&u<o.coordinates.length;)n.geometry.coordinates[0]===o.coordinates[u][0]&&n.geometry.coordinates[1]===o.coordinates[u][1]&&(r=!0,a=!0),u++;else if("LineString"===o.type)for(var l=0;!s&&l<o.coordinates.length-1;)Tu(n.geometry.coordinates[0],n.geometry.coordinates[1],o.coordinates[l][0],o.coordinates[l][1],o.coordinates[l+1][0],o.coordinates[l+1][1])&&(s=!0,r=!0),l++;else if("MultiLineString"===o.type)for(var h=0;h<o.coordinates.length;){s=!1;for(var c=0,f=o.coordinates[h];!s&&c<f.length-1;)Tu(n.geometry.coordinates[0],n.geometry.coordinates[1],f[c][0],f[c][1],f[c+1][0],f[c+1][1])&&(s=!0,r=!0),c++;h++}else"Polygon"!==o.type&&"MultiPolygon"!==o.type||Zt(n,o)&&(r=!0);i++}if(r)return n;for(var v=R([]),g=0;g<e.features.length;g++)v.features=v.features.concat(da(e.features[g]).features);return M(wu(n,v).geometry.coordinates)},t.pointToLineDistance=bu,t.pointToPolygonDistance=function t(r,i){var o,s,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null!=(o=a.method)?o:"geodesic",l=null!=(s=a.units)?s:"kilometers";if(!r)throw new Error("point is required");if(!i)throw new Error("polygon or multi-polygon is required");var h,c=at(i);if("MultiPolygon"===c.type){var g=c.coordinates.map(function(e){return t(r,P(e),{method:u,units:l})});return Math.min.apply(Math,_(g.map(Math.abs)))*(Zt(r,i)?-1:1)}if(c.coordinates.length>1){var d=c.coordinates.map(function(e){return t(r,P([e]),{method:u,units:l})}),p=n(h=d)||f(h)||k(h)||v(),y=p[0],m=e(p).slice(1);if(y>=0)return y;var x=Math.min.apply(Math,_(m));return x<0?Math.abs(x):Math.max(-1*x,y)}var E=wn(c),w=1/0;return bt(E,function(t){w=Math.min(w,bu(r,t,{method:u,units:l}))}),Zt(r,c)?-w:w},t.points=L,t.pointsWithinPolygon=Ou,t.polygon=P,t.polygonSmooth=function(t,e){(e=e||{}).iterations=e.iterations||1;var n=e.iterations,r=[];if(!t)throw new Error("inputPolys is required");return kt(t,function(t,e,i){if("Polygon"===t.type){for(var o=[[]],s=0;s<n;s++){var a=[],u=t;s>0&&(u=P(o).geometry),Yu(u,a),o=a.slice(0)}r.push(P(o,i))}else{if("MultiPolygon"!==t.type)throw new Error("geometry is invalid, must be Polygon or MultiPolygon");for(var l=[[[]]],h=0;h<n;h++){var c=[],f=t;h>0&&(f=F(l).geometry),Bu(f,c),l=c.slice(0)}r.push(F(l,i))}}),R(r)},t.polygonTangents=function(t,e){var n,r=nt(t),i=nt(e),o=[],s=[],a=qt(e),u=0,l=null;switch(r[0]>a[0]&&r[0]<a[2]&&r[1]>a[1]&&r[1]<a[3]&&(u=(l=wu(t,da(e))).properties.featureIndex),ut(e)){case"Polygon":o=i[0][u],s=i[0][0],null!==l&&l.geometry.coordinates[1]<r[1]&&(s=i[0][u]),n=Uu(i[0][0],i[0][i[0].length-1],r);var h=m(zu(i[0],r,n,o,s),2);o=h[0],s=h[1];break;case"MultiPolygon":for(var c=0,f=0,v=0,g=0;g<i[0].length;g++){c=g;for(var d=!1,p=0;p<i[0][g].length;p++){if(f=p,v===u){d=!0;break}v++}if(d)break}o=i[0][c][f],s=i[0][c][f],n=Uu(i[0][0][0],i[0][0][i[0][0].length-1],r),i.forEach(function(t){var e=m(zu(t[0],r,n,o,s),2);o=e[0],s=e[1]})}return R([M(o),M(s)])},t.polygonToLine=wn,t.polygonize=function(t){var e=Gu.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):r.push(t)}),n.forEach(function(t){qu.findEdgeRingContaining(t,r)&&r.push(t)}),R(r.map(function(t){return t.toPolygon()}))},t.polygons=C,t.projection=Ku,t.propEach=yt,t.propReduce=mt,t.propertiesContainsFilter=yo,t.quadratAnalysis=function(t,e){for(var n=(e=e||{}).studyBbox||qt(t),r=e.confidenceLevel||20,i=t.features,o=i.length,s=Ot(jt(n)),u=La(n,Math.sqrt(s/o*2),{units:"meters"}).features,l={},h=0;h<u.length;h++)l[h]={box:qt(u[h]),cnt:0};var c,f=0,v=a(i);try{for(v.s();!(c=v.n()).done;)for(var g=c.value,d=0,p=Object.keys(l);d<p.length;d++){var y=p[d],m=l[y].box;if($u(et(g),m)){l[y].cnt+=1,f+=1;break}}}catch(t){v.e(t)}finally{v.f()}for(var _=0,x=0,E=Object.keys(l);x<E.length;x++){var k=l[E[x]].cnt;k>_&&(_=k)}for(var w=[],b=Object.keys(l).length,I=f/b,N=0,S=0;S<_+1;S++)N+=Math.exp(-I)*Math.pow(I,S)/tl(S),w.push(N);for(var M=[],L=0,P=0;P<_+1;P++){for(var C=0,T=Object.keys(l);C<T.length;C++){l[T[C]].cnt===P&&(L+=1)}var O=L/b;M.push(O)}for(var R=0,A=0;A<_+1;A++){var D=Math.abs(w[A]-M[A]);D>R&&(R=D)}var F=Qu[r]/Math.sqrt(b),q={criticalValue:F,isRandom:!0,maxAbsoluteDifference:R,observedDistribution:M};return R>F&&(q.isRandom=!1),q},t.radiansToDegrees=U,t.radiansToLength=Y,t.random=ll,t.randomLineString=sl,t.randomPoint=il,t.randomPolygon=ol,t.randomPosition=el,t.rectangleGrid=Ma,t.removeBbox=K,t.rewind=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(r=r||{}))throw new Error("options is invalid");var i=null!=(e=r.mutate)&&e,o=null!=(n=r.reverse)&&n;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof o)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof i)throw new Error("<mutate> must be a boolean");i||"Point"===t.type||"MultiPoint"===t.type||(t=so(t));var s=[];switch(t.type){case"GeometryCollection":return kt(t,function(t){hl(t,o)}),t;case"FeatureCollection":return _t(t,function(t){_t(hl(t,o),function(t){s.push(t)})}),R(s)}return hl(t,o)},t.rhumbBearing=vt,t.rhumbDestination=ca,t.rhumbDistance=ha,t.round=G,t.sample=function(t,e){if(!t)throw new Error("fc is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");var n=R(function(t,e){var n,r,i=t.slice(0),o=t.length,s=o-e;for(;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e));return n},t.sector=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!J(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!==E(i))throw new Error("options must be an object");if(vl(n)===vl(r))return oo(t,e,i);var s=nt(t),a=eu(t,e,n,r,i),u=[[s]];return dt(a,function(t){u[0].push(t)}),u[0].push(s),P(u,o)},t.segmentEach=Nt,t.segmentReduce=St,t.shortestPath=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r=n.obstacles||R([]),i=n.resolution||100;if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(!W(i)||i<=0)throw new Error("options.resolution must be a number, greater than 0");var o=et(t),s=et(e);if(t=M(o),e=M(s),"FeatureCollection"===r.type){if(0===r.features.length)return T([o,s])}else if("Feature"===r.type&&"Polygon"===r.geometry.type)r=R([r]);else{if("Polygon"!==r.type)throw new Error("invalid obstacles");r=R([N(at(r))])}var a=r;a.features.push(t),a.features.push(e);var u=m(qt(gl(jt(qt(a)),1.15)),4),l=u[0],h=u[1],c=u[2],f=u[3];a.features.pop(),a.features.pop();for(var v,g,d=ft([l,h],[c,h],n)/i,p=(c-l)/d,y=ft([l,h],[l,f],n)/i,_=(f-h)/y,x=d%1*p/2,E=[],k=[],w=1/0,b=1/0,I=f-y%1*_/2,S=0;I>=h;){for(var L=[],P=[],C=l+x,O=0;C<=c;){var A=M([C,I]),D=El(A,r);L.push(D?0:1),P.push(C+"|"+I);var F=ft(A,t);!D&&F<w&&(w=F,v={x:O,y:S});var q=ft(A,e);!D&&q<b&&(b=q,g={x:O,y:S}),C+=p,O++}k.push(L),E.push(P),I-=_,S++}var G=new ml(k,{diagonal:!0}),Y=G.grid[v.y][v.x],B=G.grid[g.y][g.x],z=yl.search(G,Y,B),j=[o];return z.forEach(function(t){var e=E[t.x][t.y].split("|");j.push([+e[0],+e[1]])}),j.push(s),Dn(T(j))},t.simplify=function(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(i=null!=i?i:{}))throw new Error("options is invalid");var o=null!=(e=i.tolerance)?e:1,s=null!=(n=i.highQuality)&&n,a=null!=(r=i.mutate)&&r;if(!t)throw new Error("geojson is required");if(o&&o<0)throw new Error("invalid tolerance");return!0!==a&&(t=so(t)),kt(t,function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;if(Dn(t,{mutate:!0}),"GeometryCollection"!==r)switch(r){case"LineString":t.coordinates=Nl(t.coordinates,e,n);break;case"MultiLineString":t.coordinates=t.coordinates.map(function(t){return Nl(t,e,n)});break;case"Polygon":t.coordinates=Sl(t.coordinates,e,n);break;case"MultiPolygon":t.coordinates=t.coordinates.map(function(t){return Sl(t,e,n)})}}(t,o,s)}),t},t.square=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(ft(t.slice(0,2),[r,n])>=ft(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]},t.squareGrid=La,t.standardDeviationalEllipse=function(t,e){var n;if(!J(e=e||{}))throw new Error("options is invalid");var r=e.steps||64,i=e.weight,o=e.properties||{};if(!W(r))throw new Error("steps must be a number");if(!J(o))throw new Error("properties must be a number");var s=Et(t).length,a=Gi(t,{weight:i}),u=0,l=0,h=0;_t(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Ll(nt(t),nt(a));u+=Math.pow(r.x,2)*n,l+=Math.pow(r.y,2)*n,h+=r.x*r.y*n});var c=u-l,f=Math.sqrt(Math.pow(c,2)+4*Math.pow(h,2)),v=2*h,g=Math.atan((c+f)/v),d=180*g/Math.PI,p=0,y=0,m=0;_t(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Ll(nt(t),nt(a));p+=Math.pow(r.x*Math.cos(g)-r.y*Math.sin(g),2)*n,y+=Math.pow(r.x*Math.sin(g)+r.y*Math.cos(g),2)*n,m+=n});var _=Math.sqrt(2*p/m),x=Math.sqrt(2*y/m),E=va(a,_,x,{units:"degrees",angle:d,steps:r,properties:o}),k=Ou(t,R([E])),w={meanCenterCoordinates:nt(a),semiMajorAxis:_,semiMinorAxis:x,numberOfFeatures:s,angle:d,percentageWithinEllipse:100*Et(k).length/s};return E.properties=null!=(n=E.properties)?n:{},E.properties.standardDeviationalEllipse=w,E},t.tag=function(t,e,n,r){return t=so(t),e=so(e),_t(t,function(t){t.properties||(t.properties={}),_t(e,function(e){t.properties&&e.properties&&void 0===t.properties[r]&&Zt(t,e)&&(t.properties[r]=e.properties[n])})}),t},t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=Rl(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(Rl(t))}),e},t.tin=Lo,t.toMercator=Vu,t.toWgs84=Zu,t.transformRotate=fa,t.transformScale=gl,t.transformTranslate=function(t,e,n,r){if(!J(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==s&&void 0!==s||(t=so(t)),dt(t,function(t){var r=nt(ca(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}),K(t),t},t.triangleGrid=Pa,t.truncate=_e,t.union=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(kt(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must have at least 2 geometries");var r=na.apply(sa,[n[0]].concat(_(n.slice(1))));return 0===r.length?null:1===r.length?P(r[0],e.properties):F(r,e.properties)},t.unkinkPolygon=function(t){var e=[];return bt(t,function(t){"Polygon"===t.geometry.type&&_t(Fl(t),function(n){e.push(P(n.geometry.coordinates,t.properties))})}),R(e)},t.validateBBox=Q,t.validateId=$,t.voronoi=function(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return st(t,"Point","points"),R(function(){var t=Ul,e=Vl,n=null;function r(r){return new Nh(r.map(function(n,i){var o=[Math.round(t(n,i,r)/wh)*wh,Math.round(e(n,i,r)/wh)*wh];return o.index=i,o.data=n,o}),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:Xl(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:Xl(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(function(e,n){return Object.assign(function(t){return(t=t.slice()).push(t[0]),P([t])}(e),{properties:uo(t.features[n].properties)})}))}});\n\n;!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(A.h3={})}(this,function(A){var e=function(A){var e,r=void 0!==(A=A||{})?A:{},i={};for(e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);var n,a,t,f,o=[],l=!1;n="object"==typeof window,a="function"==typeof importScripts,t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,l=t&&!n&&!a,f=!n&&!l&&!a;var u,c,s,b,d,g="";l?(g="undefined"!=typeof __dirname?__dirname+"/":"",u=function(A,e){var r;return(r=nA(A))||(b||(b=require("fs")),d||(d=require("path")),A=d.normalize(A),r=b.readFileSync(A)),e?r:r.toString()},s=function(A){var e=u(A,!0);return e.buffer||(e=new Uint8Array(e)),m(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\\\/g,"/"),o=process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):f?("undefined"!=typeof read&&(u=function(A){var e=nA(A);return e?rA(e):read(A)}),s=function(A){var e;return(e=nA(A))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(m("object"==typeof(e=read(A,"binary"))),e)},"undefined"!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(n||a)&&(a?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),g=0!==g.indexOf("blob:")?g.substr(0,g.lastIndexOf("/")+1):"",u=function(A){try{var e=new XMLHttpRequest;return e.open("GET",A,!1),e.send(null),e.responseText}catch(e){var r=nA(A);if(r)return rA(r);throw e}},a&&(s=function(A){try{var e=new XMLHttpRequest;return e.open("GET",A,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var r=nA(A);if(r)return r;throw e}}),c=function(A,e,r){var i=new XMLHttpRequest;i.open("GET",A,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var n=nA(A);n?e(n.buffer):r()}},i.onerror=r,i.send(null)});var w=r.print||console.log.bind(console),k=r.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e]);i=null,r.arguments&&(o=r.arguments);var B=0,h=!1;function m(A,e){A||BA("Assertion failed: "+e)}function v(A){var e=r["_"+A];return m(e,"Cannot call unknown function "+A+", make sure it is exported"),e}var Q,E,D,C,_,y,M,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(A,e){return A?function(A,e,r){for(var i=e+r,n=e;A[n]&&!(n>=i);)++n;if(n-e>16&&A.subarray&&P)return P.decode(A.subarray(e,n));for(var a="";e<n;){var t=A[e++];if(128&t){var f=63&A[e++];if(192!=(224&t)){var o=63&A[e++];if((t=224==(240&t)?(15&t)<<12|f<<6|o:(7&t)<<18|f<<12|o<<6|63&A[e++])<65536)a+=String.fromCharCode(t);else{var l=t-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&t)<<6|f)}else a+=String.fromCharCode(t)}return a}(D,A,e):""}function p(A,e){return A%e>0&&(A+=e-A%e),A}function T(A){Q=A,r.HEAP8=E=new Int8Array(A),r.HEAP16=C=new Int16Array(A),r.HEAP32=_=new Int32Array(A),r.HEAPU8=D=new Uint8Array(A),r.HEAPU16=new Uint16Array(A),r.HEAPU32=new Uint32Array(A),r.HEAPF32=y=new Float32Array(A),r.HEAPF64=M=new Float64Array(A)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var F=r.TOTAL_MEMORY||33554432;function L(A){for(;A.length>0;){var e=A.shift();if("function"!=typeof e){var i=e.func;"number"==typeof i?void 0===e.arg?r.dynCall_v(i):r.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}F=(Q=r.buffer?r.buffer:new ArrayBuffer(F)).byteLength,T(Q),_[7096]=5271296;var G=[],U=[],z=[],x=[],V=Math.abs,S=Math.ceil,H=Math.floor,R=Math.min,Y=0,j=null,O=null;r.preloadedImages={},r.preloadedAudios={};var N,W,Z=null,J="data:application/octet-stream;base64,";function K(A){return String.prototype.startsWith?A.startsWith(J):0===A.indexOf(J)}function X(A){return A}function q(A){return A.replace(/\\b__Z[\\w\\d_]+/g,function(A){var e=X(A);return A===e?A:e+" ["+A+"]"})}function $(){var A=new Error;if(!A.stack){try{throw new Error(0)}catch(e){A=e}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function AA(){return E.length}function eA(A){try{var e=new ArrayBuffer(A);if(e.byteLength!=A)return;return new Int8Array(e).set(E),oA(e),T(e),1}catch(A){}}function rA(A){for(var e=[],r=0;r<A.length;r++){var i=A[r];i>255&&(i&=255),e.push(String.fromCharCode(i))}return e.join("")}Z="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAABgtRFT7IQlAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCUAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAABgtRFT7IQnAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCcAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAMpi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAABAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP6phvycGBZRAJbod0OgwfkCp+L8jatBmQCjl3pGrPlFAfMWm114SOkButwtqS7UjQHQwbcjXyw1A8jnLuuyA9j9KwjL0VwHhPyotk0lcs8k/Q5PvEs9rsz+SfsOQEVqdPzUAKDojLoY/WJz/kcjCcD8YFu070FRZPyoLC2BdJEM/YOXQAuiMM0HIBz1bw3sdQdV46aaHRwZByatzjDPX8EDb3Jie8HXZQCJxj6ULP8NAUaG6uRAZrUCWdmou5/mVQLb9huRPm4BAhvoCHygZaUCuX/I3SPdSQC9/bC/1qTxAfKxsYQ6pJUCuslH+N14QQMS/cv7SvPg/Ol8maYKx4j8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAKriWFiWZfg/Y2nmTbY/8z8MHSPSqmnjv6hnn18HR3c/quJYWJZl+D/jq5TzDdzyPwwdI9KqaeO/u0kC1eFSBECq4lhYlmX4P69pJmt7c/E/NnkJi6jSBsDESFlzKkr6P33ArMz7sfY/o2q2uqM08D+oZ59fB0d3PzEqCi3qrvK/kmm4ANp49D+4wS2wzhzvP9WJvyAnx+E/upcY75RVx7+95t+9y0T1P9L18g1caO0/k6CkRyVzAEBf99+e/GjxP6QMsuuLQ/U/PlP4Qr8q7j8Mb/GO2GMCwLl2K/DQIghAePiwytEp9D9UHrsuI/nqPzjMedJ+yuy/k6xgf58n/L+XoQtn22DzP2lzCnsYk+s/JhUSDI4P8z+8lFcBhgTcPxOqKRxEX/M/89MEdoPQ6j8OKQaXDob7vzWwNvblgAPAzGkxMcl88j9Nm4okPkbpP0vI89vxSgRAdac2Z6W2/T+6UFOMC3zyP/+2XEF3hug/QqhELwGKCMAwdlQerEoEQFcr/B+VnvE/hB1hfFzT5j8wdsE/Da64P0hIvnF/sOC/KH/hrXUg8T9bI5OQHaLlP+mYzla7td6/CtKG6iOm8b8FW3TV8oXwP8ORhtNuJ+c/q8JrTMz/AcC8PaUl+PUFwAXv9rkMT/A/m+sAswr15D+7hk/O3yvkP6c/yVsOHKI/qqAX9idJ8D/8hNz1KNPiP7xSXh3Ggvg/epbkiKr57T/23/LB1GLvP4GTTeNZi+M/W4TqlTheBcDupZgIdYUIQGwlcW3YZO8/tQvDXQ3H4j8Bt+sf9DkAQMdFie+nNvg/Z5Uh1wDX7j9h5X2d4KjhPxMJ1ZVT4Pa/evqB8xB//7+W183U9QLsPwzNxsC7AOA/af/LqCnK/r/lPceQ0FQDwHoY0nYIW+w/bHNSHrTg4D/DFcMAdabuv2sz5Ojhnve/FvLf01HN6z/tEDL2Hz/gP0bBv0KUhPA/pd7sEnMc4D8EGon4Lo7sP5NVbYtSON8/DAMC50odBkB+Z2J8MGYCQIhlM1gubOo/FssiPwWy4D8OIlGqRnkCQAd1vopp6f4/QS1keLLK6T9rfoBuT7LZP3KQbH5ugwjAjqVPXTmbBUBL/JxcqR3qP3oSeovuktg/Y6pRhJmqy7+0kwuU0Yjmv2wvsfFmQ+g/R98lJFqQ2T/IGb5gjLkCwK3mNff3kQbAqDznPFM86T+iiP0FfsvYP7fzKG6Mls0/h7+at2btzL8tsUTgk+LmP/YEIrTDINU/WmwKoVjA5L9aC02r6FHxvzzFCT/Qg+Y/nx0V97en0j8+1toJOm77P1kZ7h8KjfQ/GBbbqxgk5j9RGXM79G/SP+beHsWmweQ/9REi4eX0xD/V9s+kmMHkP+pb9yNs09A/c5ERjVDTAECqEr3OBCH7P14ILfMECOU/piRx4P8P0j+JYU//bfL0Pw62fw28B+w/l5YW2Ga45D9+CyKRbenOP5cH6fHy1/S/o/egk03++r91nTYRL/bjP3fHN6OJVdA/7xXQh1XLBcAB3g6tBdUIQKW2KnGYjeQ/SqIpagclyz8F9P3YgNL6v9H6NBsZ8QDAW2k5L5Qs4z/0axa1l6zLP1GE65Mu4wNAwfX+BYmWAEBBgJP90M3hP6/03qhPLdA/zqo5bJz2778/ESlPCTn1v7JkhGyvzuE/DM7sj5twwz/6xbXLavYGQH29RFRGkgNA7bOXVSJ54T9fEhTHO/TDP+8t+HMOiwDAxa0SbGTtA8Atii7y0mLgP4cecHFB3sM/uPUpyv+K7j8nktD1/WvhP2cWmi772d8/Fj7uU9kEvD8oKOESLzKmvwSdCqrHdNu/XCluGsvI3T929OW5md+uP9dP6rXcZNq/gXM+ggzL6b+eKjsPgJncP6i1e9aVu7E/2CnPNJyD1D/DnyGgSe+xvy8k7g9bp9s/nYmLvHn1sz9cFOwApH8IwGa6Mjy9cgZAJr95SiSW2z8rCkhOFvqdP3SIKmO/UwPAEy0zkN7bBsCds8Hg/13YP1zv413hVGi/FVtqixSn6L9XAPQGul3yv7SGu2BoCNk/n94bv7Maj79p13T6X9z3P45MPCW3WvI/rU/8/LRj1T9cgR6SXd+ZPymL2DstbPI/8s/pAkIz6z/fmoB+8efYPz2XyfWgYaa/6wys72AW/j8LZImhgrf3P729Zla/n9U/ySB8B3PBqL8O2nhevvbxv17+5A+n6fe/YrGIqEGB1T+wCEGbkhaxv989QHVE5wFAzd12PTu3/T9AHUPZY2DUP3SQDST0zq2/JCxAlIoj5T+Mhe1IJkrQP/cRpl8QhtU/amc4seFts79khiUSVaz3vxYfWtjPwf2/CHscxQqD0j/ctUBQ9my3v0POnFiyXv2/pjjn2Ju/AcDk45DwBhPRP/GjwlCrv7m/aT2ciwolBsAQOzHr/wUJQCzpq5UYvtI/gDCf3SlCwb+4i7S+mukEQBDA1f8mowFA2utnRN3KyT9T+9EYAVG6v9/IVZ0enrE/7NbRtdGfzr/8y8GpRz7LP3U0vTSk18e/JzHEcwiBB0AGm8Q7AJkEQNLciyt4Esk/gLou5zoQxr+RrOfM91oBwEzd36KybgTAgLou5zoQxj/S3IsreBLJv1gCch0OHO8/FD+RxSLN4j91NL00pNfHP/zLwalHPsu/nL7/By4Pyr8tSP5h7CPiv1P70RgBUbo/2utnRN3Kyb/KfllfCpUIwLkP5zj+NwdAgDCf3SlCwT8s6auVGL7Sv2aFPlaC4eC/XrS5UVH77b/xo8JQq7+5P+TjkPAGE9G/Q30/RYbn1z8FF/ISafuLv9y1QFD2bLc/CHscxQqD0r/fi+tPROX0P6vRc+19ie0/amc4seFtsz/3EaZfEIbVv77TYpahl/o/DDsu0CaC9D90kA0k9M6tP0AdQ9ljYNS/CCI0rxjZA8BgfCaLthgHwLAIQZuSFrE/YrGIqEGB1b8kvQ982+rsv4J8EWu7jPS/ySB8B3PBqD+9vWZWv5/VvwrAByWcJgBAxFujmE9a+j89l8n1oGGmP9+agH7x59i/N03cuJUt9L8X9v4GdIz6v1yBHpJd35m/rU/8/LRj1b8mz69sydf/vyu5idMqVQLAn94bv7Majz8AhrtgaAjZv+aCE66WZ/q/lA1Mgz/p/79c7+Nd4VRoP52zweD/Xdi/TJZpMTb4AkDLWZShPOb/PysKSE4W+p2/Jr95SiSW27/PkmbE7zjnP6UAiCDmMNI/nYmLvHn1s78vJO4PW6fbv5MWA2vqSrQ/V5WLwPB51b+otXvWlbuxv54qOw+Amdy/1keqzYeRBsApIEMHgZIIQHb05bmZ366/XCluGsvI3b8W44a9X9UFQEeQtDM4rwJAFj7uU9kEvL9nFpou+9nfv3Co+JcyyQhAcdkCX2KzBUCHHnBxQd7Dvy2KLvLSYuC/o6+5YTt/AcCHCNDW+8YEwF8SFMc79MO/7bOXVSJ54b9E/pfA2S3xPzD9xaBb0uQ/DM7sj5tww7+yZIRsr87hv7c4c0SEXNG/Tr79/9M+5r+v9N6oTy3Qv5uAk/3QzeG/XcI1OVQkAUAQSV9Z7Qr9P/RrFrWXrMu/W2k5L5Qs479Zo2IBM/vkv6FuipzkFvG/SqIpagcly7+ltipxmI3kv0pmis91cfc/gWQecsRh8D93xzejiVXQv3WdNhEv9uO/D7mgYy612j+PyVPNaT2jv34LIpFt6c6/l5YW2Ga45L+LUp+2A2z9P39i5xSpRfc/piRx4P8P0r9eCC3zBAjlv5n4OKmIUf2/jj/kUAwgAsDqW/cjbNPQv9X2z6SYweS/aTdljlWd8L94R8vZ8SL3v1EZczv0b9K/GBbbqxgk5r9XdfyikfEDwPILMvas0gfAnx0V97en0r88xQk/0IPmvxGErZ681fa/9kCaiOy2/b/2BCK0wyDVvy2xROCT4ua/+5EBLOXxA0B7p53+BnkAQKKI/QV+y9i/qDznPFM86b/snWGNkkgHwC+ByugkUwdAR98lJFqQ2b9sL7HxZkPovyJNGM67oek/HzNy6BqA1D96EnqL7pLYv0v8nFypHeq/axL/u1FnB0AkSEHvxn8DQGt+gG5Pstm/QS1keLLK6b/Sk/O6mtGzPxU8pLcPNty/FssiPwWy4L+IZTNYLmzqvw4szKfSouq/G+XJHY1a87+TVW2LUjjfvwQaifgujuy/3VARaoMl2L9NFodfK+/qv+0QMvYfP+C/FvLf01HN67+ETOQysd8AwH71iI/eGgXAbHNSHrTg4L96GNJ2CFvsv6BnExReeAFA5CakvxSl+j8MzcbAuwDgv5bXzdT1Auy/uVq8/8x58z+uvPMNqzTnP2HlfZ3gqOG/Z5Uh1wDX7r8PUbMSo2P7P9VfBrXlxPI/tQvDXQ3H4r9sJXFt2GTvvyDssGgO0PG/WxT/uE4N+r+Bk03jWYvjv/bf8sHUYu+/rUXN8hUe3j9m5HB1yZCzv/yE3PUo0+K/qqAX9idJ8L9mByqLMMH5v4kHC7KQowHAm+sAswr15L8F7/a5DE/wv2JLsGADFwTAKQjVGovZCMDDkYbTbifnvwVbdNXyhfC/malhH7yI7D+oevd0GWDZP1sjk5AdouW/KH/hrXUg8b8KWmrpQ0sFQAzEAF/pTgBAhB1hfFzT5r9XK/wflZ7xv18hRuqKXAjA/5rUd9v1BED/tlxBd4bov7pQU4wLfPK/4pnwn0T/sj/c277XPF3jv02biiQ+Rum/zGkxMcl88r8Yk0HhJVzjv62yUUFRjfS/89MEdoPQ6r8TqikcRF/zvxQxghHovfY/cfM1eFWE5j9pcwp7GJPrv5ehC2fbYPO/KUV2nGg0/795OhmUaqEFwFQeuy4j+eq/ePiwytEp9L8DuqWfW+8BQLytJylXHPY/PlP4Qr8q7r+kDLLri0P1vxT4ShWL+Oo/DMsWg0zlv7/S9fINXGjtv73m373LRPW/+xg/Gaxd8b94MdQEfW0AwLjBLbDOHO+/kmm4ANp49L+cShSMMbAEwKyjUgWirAdAo2q2uqM08L99wKzM+7H2v3RdlNBXFgnA8S9+ewyV/z+vaSZre3Pxv6riWFiWZfi/2J7VSZZ60j+LES81zPn3v+OrlPMN3PK/quJYWJZl+L/OZbufkEcEQLCNB/1lPOO/Y2nmTbY/87+q4lhYlmX4v7CNB/1lPOO/zmW7n5BHBEBwKD1Aa57LP/XsSsw7RbU/PMDPJGsfoD/TqningGKIPzFtCLYmb3I/qYfrJr7eWz9pQmleXRFFP0rWlJkA2i8/pCvcttgTGD9Dt8IWbjMCPyCG4GRlhOs+1JI2GhDN1D7ns8cGvXK/Pi8m8UTJxac+hNTfA2z4kT7GI8kjLyt7Pv//////HwAI//////8zEAj/////fzIgCP////9vMjAI/////2MyQAj///8/YjJQCP///zdiMmAI////M2IycAj//78zYjKACP//qzNiMpAI/3+rM2IyoAj/D6szYjKwCP8DqzNiMsAIvwOrM2Iy0AifA6szYjLgCJkDqzNiMvAI//////8/Dwj//////ysfCP////9/KS8I/////z8pPwj/////OSlPCP///z84KV8I////Dzgpbwj///8OOCl/CP//Hw44KY8I//8PDjgpnwj/fw0OOCmvCP8PDQ44Kb8I/w0NDjgpzwj/DA0OOCnfCMcMDQ44Ke8IxAwNDjgp/wgHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAgAAAAEAAAADAAAADgAAAAYAAAALAAAAAgAAAAcAAAABAAAAGAAAAAUAAAAKAAAAAQAAAAYAAAAAAAAAJgAAAAcAAAAMAAAAAwAAAAgAAAACAAAAMQAAAAkAAAAOAAAAAAAAAAUAAAAEAAAAOgAAAAgAAAANAAAABAAAAAkAAAADAAAAPwAAAAsAAAAGAAAADwAAAAoAAAAQAAAASAAAAAwAAAAHAAAAEAAAAAsAAAARAAAAUwAAAAoAAAAFAAAAEwAAAA4AAAAPAAAAYQAAAA0AAAAIAAAAEQAAAAwAAAASAAAAawAAAA4AAAAJAAAAEgAAAA0AAAATAAAAdQAAAA8AAAATAAAAEQAAABIAAAAQAAAABgAAAAIAAAADAAAABQAAAAQAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAMAAAABAAAABQAAAAQAAAAAAAAAAAAAAAcAAAAFAAAAAwAAAAQAAAABAAAAAAAAAAIAAAAAAAAAAgAAAAMAAAABAAAABQAAAAQAAAAGAAAAAAAAAAAAAAAYLURU+yH5PxgtRFT7Ifm/GC1EVPshCUAYLURU+yEJwGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjZWxsc1RvTXVsdGlQb2x5LmMAY2VsbFRvRWRnZUFyY3MAAAEDAgQABAMFAQJjYW5jZWxBcmNQYWlycwBjcmVhdGVTb3J0YWJsZUxvb3AAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAdmVjM1RvQ2VsbABjZWxsVG9DaGlsZFBvcwB2YWxpZGF0ZUNoaWxkUG9zAHJldkRpciAhPSBJTlZBTElEX0RJR0lUAGxvY2FsaWouYwBjZWxsVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAYmFzZUNlbGwgPT0gb3JpZ2luQmFzZUNlbGwALi4vaW5jbHVkZS9jb29yZGlqay5oAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAYmFzZUNlbGwgIT0gSU5WQUxJRF9CQVNFX0NFTEwAbG9jYWxJamtUb0NlbGwAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAZ3JpZFBhdGhDZWxsc0ludGVycG9sYXRlAHBvbHlmaWxsLmMAaXRlclN0ZXBQb2x5Z29uQ29tcGFjdAAwAHZlcnRleC5jAHZlcnRleFJvdGF0aW9ucwBjZWxsVG9WZXJ0ZXg=";var iA="function"==typeof atob?atob:function(A){var e,r,i,n,a,t,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="",l=0;A=A.replace(/[^A-Za-z0-9\\+\\/\\=]/g,"");do{i=f.indexOf(A.charAt(l++)),e=(15&(n=f.indexOf(A.charAt(l++))))<<4|(a=f.indexOf(A.charAt(l++)))>>2,r=(3&a)<<6|(t=f.indexOf(A.charAt(l++))),o+=String.fromCharCode(i<<2|n>>4),64!==a&&(o+=String.fromCharCode(e)),64!==t&&(o+=String.fromCharCode(r))}while(l<A.length);return o};function nA(A){if(K(A))return function(A){if("boolean"==typeof l&&l){var e;try{e=Buffer.from(A,"base64")}catch(r){e=new Buffer(A,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var r=iA(A),i=new Uint8Array(r.length),n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}catch(A){throw new Error("Converting base64 string to bytes failed.")}}(A.slice(J.length))}var aA,tA,fA=function(A,e,r){var i=new A.Int8Array(r),n=new A.Int32Array(r),a=(new A.Uint8Array(r),new A.Float32Array(r),new A.Float64Array(r)),t=0|e.o,f=0|e.p,o=A.Math.floor,l=A.Math.abs,u=A.Math.sqrt,c=A.Math.cos,s=A.Math.sin,b=A.Math.tan,d=A.Math.acos,g=A.Math.asin,w=A.Math.atan,k=A.Math.atan2,B=A.Math.ceil,h=A.Math.imul,m=A.Math.min,v=A.Math.max,Q=A.Math.clz32,E=e.a,D=e.b,C=e.c,_=e.d,y=e.e,M=e.f,P=e.g,I=e.h,p=e.i,T=28416;function F(A,e,r,i){return 0|L(A|=0,e|=0,r|=0,i|=0,0)}function L(A,e,r,i,a){var t,f=0,o=0,l=0,u=0;if(t=T,T=T+16|0,o=t,!(0|G(A|=0,e|=0,r|=0,i|=0,a|=0)))return T=t,0;do{if((0|r)>=0){if((0|r)>13780509){if(0|(f=0|ZA(15,o)))break;o=0|n[(l=o)>>2],l=0|n[l+4>>2]}else u=0|Ue(0|r,0|(f=((0|r)<0)<<31>>31),3,0),l=0|C(),f=0|pe(0|r,0|f,1,0),f=0|pe(0|(f=0|Ue(0|u,0|l,0|f,0|C())),0|C(),1,0),l=0|C(),n[o>>2]=f,n[o+4>>2]=l,o=f;if(Ze(0|i,0,o<<3|0),0|a){Ze(0|a,0,o<<2|0),f=0|U(A,e,r,i,a,o,l,0);break}(f=0|Me(o,4))?(u=0|U(A,e,r,i,f,o,l,0),ye(f),f=u):f=13}else f=2}while(0);return T=t,0|f}function G(A,e,r,i,a){e|=0,r|=0,i|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(f=T,T=T+16|0,o=f+8|0,n[(w=t=f)>>2]=A|=0,n[w+4>>2]=e,(0|r)<0)return T=f,2;if(n[(l=i)>>2]=A,n[l+4>>2]=e,(l=0!=(0|a))&&(n[a>>2]=0),0|CA(A,e))return T=f,9;n[o>>2]=0;A:do{if((0|r)>=1)if(l)for(d=1,b=0,g=0,w=1,l=A;;){if(!(b|g)){if(0|(l=0|z(l,e,4,o,t)))break A;if(0|CA(l=0|n[(e=t)>>2],e=0|n[e+4>>2])){l=9;break A}}if(0|(l=0|z(l,e,0|n[26864+(g<<2)>>2],o,t)))break A;if(l=0|n[(e=t)>>2],e=0|n[e+4>>2],n[(A=i+(d<<3)|0)>>2]=l,n[A+4>>2]=e,n[a+(d<<2)>>2]=w,u=(0|(A=b+1|0))==(0|w),s=6==(0|(c=g+1|0)),0|CA(l,e)){l=9;break A}if((0|(w=w+(s&u&1)|0))>(0|r)){l=0;break}d=d+1|0,b=u?0:A,g=u?s?0:c:g}else for(d=1,b=0,g=0,w=1,l=A;;){if(!(b|g)){if(0|(l=0|z(l,e,4,o,t)))break A;if(0|CA(l=0|n[(e=t)>>2],e=0|n[e+4>>2])){l=9;break A}}if(0|(l=0|z(l,e,0|n[26864+(g<<2)>>2],o,t)))break A;if(l=0|n[(e=t)>>2],e=0|n[e+4>>2],n[(A=i+(d<<3)|0)>>2]=l,n[A+4>>2]=e,u=(0|(A=b+1|0))==(0|w),s=6==(0|(c=g+1|0)),0|CA(l,e)){l=9;break A}if((0|(w=w+(s&u&1)|0))>(0|r)){l=0;break}d=d+1|0,b=u?0:A,g=u?s?0:c:g}else l=0}while(0);return T=f,0|l}function U(A,e,r,i,a,t,f,o){r|=0,i|=0,a|=0,o|=0;var l,u,c,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(c=T,T=T+16|0,l=c+8|0,u=c,s=0|xe(0|(A|=0),0|(e|=0),0|(t|=0),0|(f|=0)),d=0|C(),!(0==(0|(B=0|n[(k=g=i+(s<<3)|0)>>2]))&0==(0|(k=0|n[k+4>>2]))|(b=(0|B)==(0|A)&(0|k)==(0|e))))do{s=0|ze(0|(s=0|pe(0|s,0|d,1,0)),0|C(),0|t,0|f),d=0|C(),b=(0|(k=0|n[(B=g=i+(s<<3)|0)>>2]))==(0|A)&(0|(B=0|n[B+4>>2]))==(0|e)}while(!(0==(0|k)&0==(0|B)|b));if(s=a+(s<<2)|0,b&&(0|n[s>>2])<=(0|o))return T=c,0;if(n[(B=g)>>2]=A,n[B+4>>2]=e,n[s>>2]=o,(0|o)>=(0|r))return T=c,0;switch(b=o+1|0,n[l>>2]=0,0|(s=0|z(A,e,2,l,u))){case 9:w=9;break;case 0:(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b))||(w=9)}A:do{if(9==(0|w)){switch(n[l>>2]=0,0|(s=0|z(A,e,3,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,1,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,5,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,4,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,6,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}return T=c,0}}while(0);return T=c,0|s}function z(A,e,r,i,a){A|=0,e|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0,b=0,d=0;if((r|=0)>>>0>6)return 1;n[(i|=0)>>2]=u=(0|n[i>>2])%6|0;A:do{if((0|u)>0)for(l=0;;){switch(0|r){case 1:r=5;break;case 5:r=4;break;case 4:r=6;break;case 6:r=2;break;case 2:r=3;break;case 3:r=1}if((0|(l=l+1|0))==(0|u))break A}}while(0);if(o=0|Se(0|A,0|e,45),C(),(f=127&o)>>>0>121)return 5;t=0|MA(A,e),l=0|Se(0|A,0|e,52),C(),l&=15;A:do{if(l){for(;;){if(c=0|Se(0|A,0|e,0|(u=3*(15-l|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(d=0==(0|LA(l)),l=l+-1|0,b=0|He(7,0,0|u),e&=~(0|C()),A=0|He(0|n[(d?432:16)+(28*c|0)+(r<<2)>>2],0,0|u)|A&~b,e|=u=0|C(),!(r=0|n[(d?640:224)+(28*c|0)+(r<<2)>>2])){r=0;break A}if(!l){s=15;break A}}return 0|e}s=15}while(0);15==(0|s)&&(A|=0|He(0|(d=0|n[848+(28*f|0)+(r<<2)>>2]),0,45),e=0|C()|-1040385&e,r=0|n[4272+(28*f|0)+(r<<2)>>2],127==(127&d|0)&&(d=0|He(0|n[848+(28*f|0)+20>>2],0,45),e=0|C()|-1040385&e,r=0|n[4272+(28*f|0)+20>>2],A=0|IA(d|A,e),e=0|C(),n[i>>2]=1+(0|n[i>>2]))),c=0|Se(0|A,0|e,45),C(),c&=127;A:do{if(0|Y(c)){e:do{if(1==(0|MA(A,e))){if((0|f)!=(0|c)){if(0|W(c,0|n[7696+(28*f|0)>>2])){A=0|TA(A,e),u=1,e=0|C();break}_(27634,26928,533,26936)}switch(0|t){case 3:A=0|IA(A,e),e=0|C(),n[i>>2]=1+(0|n[i>>2]),u=0;break e;case 5:A=0|TA(A,e),e=0|C(),n[i>>2]=5+(0|n[i>>2]),u=0;break e;case 0:return 9;default:return 1}}else u=0}while(0);if((0|r)>0){l=0;do{A=0|PA(A,e),e=0|C(),l=l+1|0}while((0|l)!=(0|r))}if((0|f)!=(0|c)){if(!(0|j(c))){if(0!=(0|u)|5!=(0|MA(A,e)))break;n[i>>2]=1+(0|n[i>>2]);break}switch(127&o){case 8:case 118:break A}3!=(0|MA(A,e))&&(n[i>>2]=1+(0|n[i>>2]))}}else if((0|r)>0){l=0;do{A=0|IA(A,e),e=0|C(),l=l+1|0}while((0|l)!=(0|r))}}while(0);return n[i>>2]=((0|n[i>>2])+r|0)%6|0,n[(d=a)>>2]=A,n[d+4>>2]=e,0}function x(A,e,r,i){e|=0,r|=0,i|=0;var a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(t=T,T=T+16|0,g=t+8|0,n[(d=a=t)>>2]=A|=0,n[d+4>>2]=e,(0|r)<0)return T=t,2;if(!r)return n[(g=i)>>2]=A,n[g+4>>2]=e,T=t,0;n[g>>2]=0;A:do{if(0|CA(A,e))A=9;else{f=0,d=A;do{if(0|(A=0|z(d,e,4,g,a)))break A;if(f=f+1|0,0|CA(d=0|n[(e=a)>>2],e=0|n[e+4>>2])){A=9;break A}}while((0|f)<(0|r));n[(b=i)>>2]=d,n[b+4>>2]=e,b=r+-1|0,s=0,A=1;do{if(f=26864+(s<<2)|0,5==(0|s))for(l=0|n[f>>2],o=0,f=A;;){if(0|(A=0|z(0|n[(A=a)>>2],0|n[A+4>>2],l,g,a)))break A;if((0|o)!=(0|b)){if(u=0|n[(c=a)>>2],c=0|n[c+4>>2],n[(A=i+(f<<3)|0)>>2]=u,n[A+4>>2]=c,0|CA(u,c)){A=9;break A}A=f+1|0}else A=f;if((0|(o=o+1|0))>=(0|r))break;f=A}else for(c=0|n[f>>2],u=0,f=A,o=0|n[(l=a)>>2],l=0|n[l+4>>2];;){if(0|(A=0|z(o,l,c,g,a)))break A;if(o=0|n[(l=a)>>2],l=0|n[l+4>>2],n[(A=i+(f<<3)|0)>>2]=o,n[A+4>>2]=l,A=f+1|0,0|CA(o,l)){A=9;break A}if((0|(u=u+1|0))>=(0|r))break;f=A}s=s+1|0}while(s>>>0<6);A=(0|d)==(0|n[(A=a)>>2])&&(0|e)==(0|n[A+4>>2])?0:9}}while(0);return T=t,0|A}function V(A,e,r,i){A|=0,e|=0,i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0;if(a=T,T=T+16|0,o=a,!(r|=0))return n[i>>2]=A,n[i+4>>2]=e,T=a,0;do{if((0|r)>=0){if((0|r)>13780509){if(0|(t=0|ZA(15,o)))break;t=0|n[(f=o)>>2],f=0|n[f+4>>2]}else s=0|Ue(0|r,0|(t=((0|r)<0)<<31>>31),3,0),f=0|C(),t=0|pe(0|r,0|t,1,0),t=0|pe(0|(t=0|Ue(0|s,0|f,0|t,0|C())),0|C(),1,0),f=0|C(),n[(s=o)>>2]=t,n[s+4>>2]=f;if(c=0|Me(t,8)){if(!(s=0|Me(t,4))){ye(c),t=13;break}if(0|(t=0|U(A,e,r,c,s,t,f,0))){ye(c),ye(s);break}if(e=0|n[o>>2],(0|(o=0|n[o+4>>2]))>0|0==(0|o)&e>>>0>0){t=0,l=0,u=0;do{0==(0|(f=0|n[(A=c+(l<<3)|0)>>2]))&0==(0|(A=0|n[A+4>>2]))||(0|n[s+(l<<2)>>2])!=(0|r)||(n[(b=i+(t<<3)|0)>>2]=f,n[b+4>>2]=A,t=t+1|0),l=0|pe(0|l,0|u,1,0),u=0|C()}while((0|u)<(0|o)|(0|u)==(0|o)&l>>>0<e>>>0)}ye(c),ye(s),t=0}else t=13}else t=2}while(0);return T=a,0|t}function S(A,e,r,i){r|=0,i|=0;var a,t,f,o=0,l=0;for(f=T,T=T+16|0,a=f,t=f+8|0,o=(o=0==(0|CA(A|=0,e|=0)))?1:2;;){if(n[t>>2]=0,0==(0|z(A,e,o,t,a))&((0|n[(l=a)>>2])==(0|r)?(0|n[l+4>>2])==(0|i):0)){A=4;break}if((o=o+1|0)>>>0>=7){o=7,A=4;break}}return 4==(0|A)?(T=f,0|o):0}function H(A,e,r,i,t,f,o){e|=0,r|=0,i|=0,t|=0,f|=0,o|=0;var l,u,c,s,b,d,g,w,k,B,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,G=0,U=0,z=0,x=0,V=0;if(B=T,T=T+64|0,k=B+24|0,u=B,(0|(m=0|n[(A|=0)>>2]))<=0)return T=B,0;for(c=A+4|0,s=8+(g=B+48|0)|0,b=8+(w=B+32|0)|0,d=8+(l=B+8|0)|0,h=0,F=0;;){n[g>>2]=n[(p=(v=0|n[c>>2])+(F<<4)|0)>>2],n[g+4>>2]=n[p+4>>2],n[g+8>>2]=n[p+8>>2],n[g+12>>2]=n[p+12>>2],(0|F)==(m+-1|0)?(n[w>>2]=n[v>>2],n[w+4>>2]=n[v+4>>2],n[w+8>>2]=n[v+8>>2],n[w+12>>2]=n[v+12>>2]):(n[w>>2]=n[(p=v+(F+1<<4)|0)>>2],n[w+4>>2]=n[p+4>>2],n[w+8>>2]=n[p+8>>2],n[w+12>>2]=n[p+12>>2]),m=0|iA(g,w,i,k);A:do{if(m)v=0,h=m;else if(v=0|n[(m=k)>>2],(0|(m=0|n[m+4>>2]))>0|0==(0|m)&v>>>0>0){I=0,p=0;e:for(;;){if(z=1/(+(v>>>0)+4294967296*+(0|m)),V=+a[g>>3],x=+((m=0|Te(0|v,0|m,0|I,0|p))>>>0)+4294967296*+(0|C()),a[l>>3]=z*(V*x)+z*(+a[w>>3]*(U=+(I>>>0)+4294967296*+(0|p))),a[d>>3]=z*(+a[s>>3]*x)+z*(+a[b>>3]*U),0|(m=0|GA(l,i,u))){h=m;break}D=0|xe(0|(M=0|n[(P=u)>>2]),0|(P=0|n[P+4>>2]),0|e,0|r),Q=0|C(),v=0|n[(E=m=o+(D<<3)|0)>>2],E=0|n[E+4>>2];r:do{if(0==(0|v)&0==(0|E))L=m,G=16;else for(_=0,y=0;;){if((0|_)>(0|r)|(0|_)==(0|r)&y>>>0>e>>>0){h=1;break e}if((0|v)==(0|M)&(0|E)==(0|P))break r;if(D=0|ze(0|(m=0|pe(0|D,0|Q,1,0)),0|C(),0|e,0|r),Q=0|C(),y=0|pe(0|y,0|_,1,0),_=0|C(),0==(0|(v=0|n[(E=m=o+(D<<3)|0)>>2]))&0==(0|(E=0|n[E+4>>2]))){L=m,G=16;break}}}while(0);if(16!=(0|G)||(G=0,0==(0|M)&0==(0|P))||(n[(y=L)>>2]=M,n[y+4>>2]=P,n[(y=f+(n[t>>2]<<3)|0)>>2]=M,n[y+4>>2]=P,y=0|pe(0|n[(y=t)>>2],0|n[y+4>>2],1,0),M=0|C(),n[(P=t)>>2]=y,n[P+4>>2]=M),I=0|pe(0|I,0|p,1,0),p=0|C(),v=0|n[(m=k)>>2],!((0|(m=0|n[m+4>>2]))>(0|p)|(0|m)==(0|p)&v>>>0>I>>>0)){v=1;break A}}v=0}else v=1}while(0);if(F=F+1|0,!v){G=21;break}if((0|F)>=(0|(m=0|n[A>>2]))){h=0,G=21;break}}return 21==(0|G)?(T=B,0|h):0}function R(A,e){e|=0;var r,i=0,t=0,f=0,o=0,l=0,u=0,b=0,d=0,g=0;if((0|(o=0|n[(A|=0)>>2]))<=0)return t=(f=0)+(t=12.566370614359172-(t=0)),a[e>>3]=f=(o=f<0)?t:f,0;if(f=.5*+a[(r=0|n[A+4>>2])+((A=1!=(0|o)&1)<<4)>>3]+.7853981633974483,i=+s(+(l=.5*+a[r>>3]+.7853981633974483))*+s(+f),i=(t=0+(i=-2*+k(+ +s(+(t=+a[r+(A<<4)+8>>3]-+a[r+8>>3]))*i,+(+c(+l)*+c(+f)+ +c(+t)*i))))-i,1==(0|o))return f=(l=t)+(f=12.566370614359172-(f=i)),a[e>>3]=l=(o=l<0)?f:l,0;for(A=1,f=t;d=A,u=.5*+a[r+((g=(0|(A=A+1|0))%(0|o)|0)<<4)>>3]+.7853981633974483,t=+s(+(b=.5*+a[r+(d<<4)>>3]+.7853981633974483))*+s(+u),i=(t=f+(i=-2*+k(+ +s(+(l=+a[r+(g<<4)+8>>3]-+a[r+(d<<4)+8>>3]))*t,+(+c(+b)*+c(+u)+ +c(+l)*t))-i))-f-i,!((0|A)>=(0|o));)f=t;return b=t+(b=12.566370614359172-i),a[e>>3]=b=(g=t<0)?b:t,0}function Y(A){return(A|=0)>>>0>121?0|(A=0):0|(A=0|n[7696+(28*A|0)+16>>2])}function j(A){return 4==(0|(A|=0))|117==(0|A)|0}function O(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)>>2]}function N(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)+4>>2]}function W(A,e){return(0|n[7696+(28*(A|=0)|0)+20>>2])==(0|(e|=0))?0|(e=1):0|(e=(0|n[7696+(28*A|0)+24>>2])==(0|e))}function Z(A,e){return 0|n[848+(28*(A|=0)|0)+((e|=0)<<2)>>2]}function J(A,e){return(0|n[848+(28*(A|=0)|0)>>2])==(0|(e|=0))?0|(e=0):(0|n[848+(28*A|0)+4>>2])==(0|e)?0|(e=1):(0|n[848+(28*A|0)+8>>2])==(0|e)?0|(e=2):(0|n[848+(28*A|0)+12>>2])==(0|e)?0|(e=3):(0|n[848+(28*A|0)+16>>2])==(0|e)?0|(e=4):(0|n[848+(28*A|0)+20>>2])==(0|e)?0|(e=5):0|((0|n[848+(28*A|0)+24>>2])==(0|e)?6:7)}function K(A){var e,r,i;return e=(i=+a[16+(A|=0)>>3])-(r=+a[A+24>>3]),+(i<r?e+6.283185307179586:e)}function X(A){return+(+a[(A|=0)>>3]-+a[A+8>>3])}function q(A,e){var r,i,n=0;return(n=+a[(e|=0)>>3])>=+a[8+(A|=0)>>3]&&n<=+a[A>>3]?(e=(i=+a[e+8>>3])>=(n=+a[A+24>>3]),A=i<=(r=+a[A+16>>3])&1,r<n?e&&(A=1):e||(A=0),0|(e=0!=(0|A))):0|(e=0)}function $(A,e){var r,i,n,t,f,o=0,l=0,u=0,c=0;return+a[(A|=0)>>3]<+a[8+(e|=0)>>3]?0|(o=0):+a[A+8>>3]>+a[e>>3]?0|(o=0):(u=(f=+a[(o=e+16|0)>>3])<(t=+a[(i=e+24|0)>>3]),e=(c=+a[(r=A+24|0)>>3])-f<t-(l=+a[A+16>>3]),A=(n=l<c)?u|e?1:2:0,e=u?n?1:e?2:1:0,(l=+OA(l,A))<+OA(+a[i>>3],e)?0|(u=0):(c=+OA(+a[r>>3],A))>+OA(+a[o>>3],e)?0|(u=0):0|(u=1))}function AA(A,e){var r,i,n,t,f,o=0,l=0,u=0,c=0;return+a[(A|=0)>>3]<+a[(e|=0)>>3]?0|(o=0):+a[A+8>>3]>+a[e+8>>3]?0|(o=0):(u=(c=+a[(r=e+16|0)>>3])<(f=+a[(i=e+24|0)>>3]),e=(l=+a[A+24>>3])-c<f-(t=+a[(o=A+16|0)>>3]),A=(n=t<l)?u|e?1:2:0,e=u?n?1:e?2:1:0,(l=+OA(l,A))<=+OA(+a[i>>3],e)?0|(u=(c=+OA(+a[o>>3],A))>=+OA(+a[r>>3],e)):0|(u=0))}function eA(A,e){A|=0,e|=0;var r,i,t,f,o,l=0;t=T,T=T+176|0,n[(i=t)>>2]=4,a[i+8>>3]=l=+a[e>>3],a[i+16>>3]=f=+a[e+16>>3],a[i+24>>3]=l,a[i+32>>3]=l=+a[e+24>>3],a[i+40>>3]=o=+a[e+8>>3],a[i+48>>3]=l,a[i+56>>3]=o,a[i+64>>3]=f,r=96+(e=i+72|0)|0;do{n[e>>2]=0,e=e+4|0}while((0|e)<(0|r));Ne(0|A,0|i,168),T=t}function rA(A,e,r){A|=0,e|=0,r|=0;var i,f,u,c,s,b,d,g=0,w=0,k=0,h=0,v=0,Q=0,E=0;b=T,T=T+288|0,s=b+264|0,h=b+96|0,w=(g=k=b)+96|0;do{n[g>>2]=0,g=g+4|0}while((0|g)<(0|w));return 0|(e=0|SA(e,k))?(T=b,0|(Q=e)):(xA(k=0|n[(w=k)>>2],w=0|n[w+4>>2],s),VA(k,w,h),c=+NA(s,h+8|0),a[s>>3]=+a[A>>3],a[(w=s+8|0)>>3]=+a[A+16>>3],a[h>>3]=+a[A+8>>3],a[(k=h+8|0)>>3]=+a[A+24>>3],f=+NA(s,h),u=+l(+(E=+a[w>>3]-+a[k>>3])),i=+l(+(d=+a[s>>3]-+a[h>>3])),0==E|0==d||(E=+Ye(+u,+i),E=+B(+f*f/+je(+E/+je(+u,+i),3)/(c*(2.59807621135*c)*.8)),a[t>>3]=E,v=~~E>>>0,Q=+l(E)>=1?E>0?~~+m(+o(E/4294967296),4294967295)>>>0:~~+B((E-+(~~E>>>0))/4294967296)>>>0:0,2146435072==(2146435072&n[t+4>>2]|0))?e=1:(n[(e=r)>>2]=(h=0==(0|v)&0==(0|Q))?1:v,n[e+4>>2]=h?0:Q,e=0),T=b,0|(Q=e))}function iA(A,e,r,i){A|=0,e|=0,r|=0,i|=0;var f,u,c,s,b=0,d=0,g=0;s=T,T=T+288|0,u=s+264|0,c=s+96|0,f=(b=d=s)+96|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|f));return 0|(r=0|SA(r,d))?(T=s,0|(i=r)):(xA(b=0|n[(r=d)>>2],r=0|n[r+4>>2],u),VA(b,r,c),g=+NA(u,c+8|0),g=+B(+ +NA(A,e)/(2*g)),a[t>>3]=g,r=~~g>>>0,b=+l(g)>=1?g>0?~~+m(+o(g/4294967296),4294967295)>>>0:~~+B((g-+(~~g>>>0))/4294967296)>>>0:0,2146435072==(2146435072&n[t+4>>2]|0)?(T=s,0|(i=1)):(n[i>>2]=(d=0==(0|r)&0==(0|b))?1:r,n[i+4>>2]=d?0:b,T=s,0|(i=0)))}function nA(A,e,r,t){A|=0,t|=0;var f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,G=0;if(f=T,T=T+224|0,p=f,y=f+48|0,(s=(0|(r|=0))>0|0==(0|r)&(e|=0)>>>0>0)&(r>>>0>0|0==(0|r)&e>>>0>17895697))return T=f,14;if((0|r)<0)return T=f,2;if(0==(0|e)&0==(0|r))return n[t>>2]=0,n[t+4>>2]=0,T=f,0;for(o=0|hA(0|n[(o=A)>>2],0|n[o+4>>2]),u=0,c=0;;){if(!(0|vA(0|n[(G=l=A+(u<<3)|0)>>2],0|n[G+4>>2]))){o=5,F=159;break}if(G=(0|hA(0|n[(G=l)>>2],0|n[G+4>>2]))==(0|o),u=0|pe(0|u,0|c,1,0),c=0|C(),!G){o=12,F=159;break}if(!((0|c)<(0|r)|(0|c)==(0|r)&u>>>0<e>>>0)){F=8;break}}if(8==(0|F)){do{if((0|r)>0|0==(0|r)&e>>>0>1){if(!(u=0|_e(o=e<<3)))return T=f,13;for(Ne(0|u,0|A,0|o),ke(u,e,8,1),o=1,l=0;G=(0|n[(L=u+(o<<3)|0)>>2])==(0|n[(G=u+(o+-1<<3)|0)>>2])?(0|n[L+4>>2])==(0|n[G+4>>2]):0,o=0|pe(0|o,0|l,1,0),l=0|C(),!G;)if(!((0|l)<(0|r)|(0|l)==(0|r)&o>>>0<e>>>0)){F=14;break}if(14==(0|F)){ye(u);break}return ye(u),T=f,10}}while(0);if(o=0|Ue(0|e,0|r,6,0),l=0|C(),s){u=0,c=0;do{o=0|pe(0|o,0|l,0|(G=(0!=(0|CA(0|n[(G=A+(c<<3)|0)>>2],0|n[G+4>>2])))<<31>>31),((0|G)<0)<<31>>31|0),l=0|C(),c=0|pe(0|c,0|u,1,0),u=0|C()}while((0|u)<(0|r)|(0|u)==(0|r)&c>>>0<e>>>0);D=o,E=l}else D=o,E=l;if(v=0|Ue(0|D,0|E,10,0),Q=0|C(),!(L=0|_e(D<<5)))return T=f,13;if(!(G=0|Me(v,4)))return ye(L),T=f,13;A:do{if(s){for(fA(0|n[(I=A)>>2],0|n[I+4>>2],p),k=L,B=0,h=0,o=0,m=0;;){l=(s=0==(0|n[(s=p)>>2])&0==(0|n[s+4>>2]))?26990:26995,u=s?5:6,s=p+((1&s)<<3)|0,b=0|pe(0|u,0|(c=0),-1,-1),d=0|C(),g=0,w=0;do{M=0|n[4+(P=s+(g<<3)|0)>>2],n[(I=k+(g<<5)|0)>>2]=n[P>>2],n[I+4>>2]=M,i[k+(g<<5)+9>>0]=0,i[k+(g<<5)+8>>0]=0,n[k+(g<<5)+20>>2]=k,n[(I=k+(g<<5)+24|0)>>2]=1,n[I+4>>2]=0,I=0|i[l+g>>0],M=0|xe(0|(M=0|pe(0|b,0|d,0|g,0|w)),0|C(),0|u,0|c),C(),M=0|i[l+M>>0],g=0|pe(0|g,0|w,1,0),w=0|C(),P=0|i[l+((0|g)==(0|u)&(0|w)==(0|c)?0:g)>>0],n[k+((I&=255)<<5)+16>>2]=k+((255&M)<<5),n[k+(I<<5)+12>>2]=k+((255&P)<<5)}while(w>>>0<c>>>0|(0|w)==(0|c)&g>>>0<u>>>0);if(B=0|pe(0|B,0|h,1,0),h=0|C(),o=0|pe(0|u,0|c,0|o,0|m),m=0|C(),!((0|h)<(0|r)|(0|h)==(0|r)&B>>>0<e>>>0))break A;0|fA(0|n[(I=A+(B<<3)|0)>>2],0|n[I+4>>2],p)||(k=L+(o<<5)|0)}_(27634,26956,108,26975)}}while(0);if((0|E)>0|0==(0|E)&D>>>0>0){c=0,s=0;do{if(o=0|Se(0|(u=0|n[(l=L+(c<<5)|0)>>2]),0|(l=0|n[l+4>>2]),30),o=0|Se(0|(l=0|Ue(o^u|0,(0|C())^l|0,484763065,-1084733587)),0|(u=0|C()),27),l=0|xe((o=0|Se(0|(u=0|Ue(o^l|0,(0|C())^u|0,321982955,-1798288965)),0|(l=0|C()),31))^u|0,(0|C())^l|0,0|v,0|Q),u=0|C(),0|n[(o=G+(l<<2)|0)>>2])do{l=0|ze(0|(o=0|pe(0|l,0|u,1,0)),0|C(),0|v,0|Q),u=0|C(),o=G+(l<<2)|0}while(0!=(0|n[o>>2]));n[o>>2]=L+(c<<5),c=0|pe(0|c,0|s,1,0),s=0|C()}while((0|s)<(0|E)|(0|s)==(0|E)&c>>>0<D>>>0);g=0,w=0;do{if(c=L+(g<<5)|0,!(0|i[(s=L+(g<<5)+9|0)>>0])){if(0|lA(0|n[(I=c)>>2],0|n[I+4>>2],p)){F=39;break}l=0|Se(0|(b=0|n[(d=p)>>2]),0|(d=0|n[d+4>>2]),30),o=0|Se(0|(l=0|Ue(l^b|0,(0|C())^d|0,484763065,-1084733587)),0|(u=0|C()),27),l=0|xe((o=0|Se(0|(u=0|Ue(o^l|0,(0|C())^u|0,321982955,-1798288965)),0|(l=0|C()),31))^u|0,(0|C())^l|0,0|v,0|Q),u=0|C(),o=0|n[G+(l<<2)>>2];A:do{if(0|o){for(;(0|n[(I=o)>>2])!=(0|b)||(0|n[I+4>>2])!=(0|d);)if(l=0|ze(0|(o=0|pe(0|l,0|u,1,0)),0|C(),0|v,0|Q),u=0|C(),!(o=0|n[G+(l<<2)>>2]))break A;i[s>>0]=1,i[o+9>>0]=1,n[16+(0|n[(I=L+(g<<5)+12|0)>>2])>>2]=n[(l=o+16|0)>>2],n[12+(P=0|n[L+(g<<5)+16>>2])>>2]=n[(r=o+12|0)>>2],n[16+(0|n[r>>2])>>2]=P,n[12+(0|n[l>>2])>>2]=n[I>>2],l=0|aA(c),I=0|aA(o),o=(P=(0|(r=0|n[4+(o=l+24|0)>>2]))<(0|(M=0|n[4+(P=I+24|0)>>2]))|((0|r)==(0|M)?(0|n[o>>2])>>>0<(0|n[P>>2])>>>0:0))?l:I,(0|(l=P?I:l))!=(0|o)&&(M=0|pe(0|n[(P=I=l+24|0)>>2],0|n[P+4>>2],0|n[(M=o+24|0)>>2],0|n[M+4>>2]),P=0|C(),n[I>>2]=M,n[I+4>>2]=P,n[o+20>>2]=l)}}while(0)}g=0|pe(0|g,0|w,1,0),w=0|C()}while((0|w)<(0|E)|(0|w)==(0|E)&g>>>0<D>>>0);39==(0|F)&&_(27634,26956,258,27001),o=0,l=0;do{i[L+(o<<5)+8>>0]=0,o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|E)|(0|l)==(0|E)&o>>>0<D>>>0);for(b=0,u=0,s=0,d=0;;){if(o=L+(b<<5)|0,0==(0|i[L+(b<<5)+8>>0])&&0==(0|i[L+(b<<5)+9>>0])){l=0|n[(c=o)>>2],c=0|n[c+4>>2];do{i[o+8>>0]=1,I=o=0|n[o+12>>2]}while((0|n[I>>2])!=(0|l)||(0|n[I+4>>2])!=(0|c));u=0|pe(0|u,0|s,1,0),c=0|C()}else c=s;if(b=0|pe(0|b,0|d,1,0),!((0|(d=0|C()))<(0|E)|(0|d)==(0|E)&b>>>0<D>>>0))break;s=c}o=0,l=0;do{i[L+(o<<5)+8>>0]=0,o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|E)|(0|l)==(0|E)&o>>>0<D>>>0);P=u,M=c,o=1}else P=0,M=0,o=0;I=0|_e(24*P|0);A:do{if(0|I){e:do{if(o){A=0,v=0,r=0,e=0;r:for(;;){if(o=L+(A<<5)|0,0==(0|i[L+(A<<5)+8>>0])&&0==(0|i[L+(A<<5)+9>>0])){h=0|n[(m=o)>>2],m=0|n[m+4>>2],l=0,u=0;do{l=0|pe(0|l,0|u,2,0),u=0|C(),Q=o=0|n[o+12>>2]}while((0|n[Q>>2])!=(0|h)||(0|n[Q+4>>2])!=(0|m));if(!(B=0|_e(l<<4)))break;l=h,u=m,k=0,w=0,c=0,s=0;do{if(0|oA(l,u,y)){F=69;break r}if(g=((0|(d=(Q=0|n[y>>2])-1|0))<0)<<31>>31,(0|Q)>1){u=c,b=0,l=s,c=0;do{n[(Q=B+(u<<4)|0)>>2]=n[(s=y+8+(b<<4)|0)>>2],n[Q+4>>2]=n[s+4>>2],n[Q+8>>2]=n[s+8>>2],n[Q+12>>2]=n[s+12>>2],u=0|pe(0|u,0|l,1,0),l=0|C(),b=0|pe(0|b,0|c,1,0),c=0|C()}while((0|c)<(0|g)|(0|c)==(0|g)&b>>>0<d>>>0);c=u,s=l}k=0|pe(0|k,0|w,0|d,0|g),w=0|C(),i[o+8>>0]=1,l=0|n[(u=o=0|n[o+12>>2])>>2],u=0|n[u+4>>2]}while(!((0|l)==(0|h)&(0|u)==(0|m)));if(!(l=0|Pe(B,k<<4))){F=75;break}m=0|aA(o),Q=0|n[m+4>>2],n[(o=I+(24*r|0)|0)>>2]=n[m>>2],n[o+4>>2]=Q,n[(o=I+(24*r|0)+16|0)>>2]=k,n[I+(24*r|0)+20>>2]=l,n[p>>2]=n[o>>2],n[p+4>>2]=n[o+4>>2],R(p,I+(24*r|0)+8|0),l=0|pe(0|r,0|v,1,0),o=0|C()}else l=r,o=v;if(A=0|pe(0|A,0|e,1,0),!((0|(e=0|C()))<(0|E)|(0|e)==(0|E)&A>>>0<D>>>0))break e;v=o,r=l}if(69==(0|F)?_(27634,26956,351,27016):75==(0|F)&&ye(B),(0|v)>0|0==(0|v)&r>>>0>0)for(c=0,s=0,o=r,u=v;(l=0|n[I+(24*c|0)+20>>2])?(ye(l),l=v,o=r):l=u,c=0|pe(0|c,0|s,1,0),(0|(s=0|C()))<(0|l)|(0|s)==(0|l)&c>>>0<o>>>0;)u=l;ye(I);break A}}while(0);ke(I,P,24,2);e:do{if(0==(0|P)&0==(0|M)){if(0|(Q=0|_e(192))){if(n[Q+16>>2]=0,n[Q+20>>2]=0,n[(w=Q+8|0)>>2]=3,o=0|_e(48),n[(k=Q+12|0)>>2]=o,0|o){n[o>>2]=n[3860],n[o+4>>2]=n[3861],n[o+8>>2]=n[3862],n[o+12>>2]=n[3863],n[(g=o+16|0)>>2]=n[3864],n[g+4>>2]=n[3865],n[g+8>>2]=n[3866],n[g+12>>2]=n[3867],n[(g=o+32|0)>>2]=n[3868],n[g+4>>2]=n[3869],n[g+8>>2]=n[3870],n[g+12>>2]=n[3871],n[p>>2]=n[w>>2],n[p+4>>2]=n[w+4>>2],R(p,Q),n[Q+40>>2]=0,n[Q+44>>2]=0,n[(g=Q+32|0)>>2]=3,o=0|_e(48),n[(B=Q+36|0)>>2]=o;do{if(o){if(n[o>>2]=n[3872],n[o+4>>2]=n[3873],n[o+8>>2]=n[3874],n[o+12>>2]=n[3875],n[(d=o+16|0)>>2]=n[3876],n[d+4>>2]=n[3877],n[d+8>>2]=n[3878],n[d+12>>2]=n[3879],n[(d=o+32|0)>>2]=n[3880],n[d+4>>2]=n[3881],n[d+8>>2]=n[3882],n[d+12>>2]=n[3883],n[p>>2]=n[g>>2],n[p+4>>2]=n[g+4>>2],R(p,Q+24|0),n[Q+64>>2]=0,n[Q+68>>2]=0,n[(d=Q+56|0)>>2]=3,o=0|_e(48),n[(h=Q+60|0)>>2]=o,!o){c=0,s=2;break}if(n[o>>2]=n[3884],n[o+4>>2]=n[3885],n[o+8>>2]=n[3886],n[o+12>>2]=n[3887],n[(b=o+16|0)>>2]=n[3888],n[b+4>>2]=n[3889],n[b+8>>2]=n[3890],n[b+12>>2]=n[3891],n[(b=o+32|0)>>2]=n[3892],n[b+4>>2]=n[3893],n[b+8>>2]=n[3894],n[b+12>>2]=n[3895],n[p>>2]=n[d>>2],n[p+4>>2]=n[d+4>>2],R(p,Q+48|0),n[Q+88>>2]=0,n[Q+92>>2]=0,n[(b=Q+80|0)>>2]=3,o=0|_e(48),n[(m=Q+84|0)>>2]=o,!o){c=0,s=3;break}if(n[o>>2]=n[3896],n[o+4>>2]=n[3897],n[o+8>>2]=n[3898],n[o+12>>2]=n[3899],n[(s=o+16|0)>>2]=n[3900],n[s+4>>2]=n[3901],n[s+8>>2]=n[3902],n[s+12>>2]=n[3903],n[(s=o+32|0)>>2]=n[3904],n[s+4>>2]=n[3905],n[s+8>>2]=n[3906],n[s+12>>2]=n[3907],n[p>>2]=n[b>>2],n[p+4>>2]=n[b+4>>2],R(p,Q+72|0),n[Q+112>>2]=0,n[Q+116>>2]=0,n[(s=Q+104|0)>>2]=3,o=0|_e(48),n[(A=Q+108|0)>>2]=o,!o){c=0,s=4;break}if(n[o>>2]=n[3908],n[o+4>>2]=n[3909],n[o+8>>2]=n[3910],n[o+12>>2]=n[3911],n[(c=o+16|0)>>2]=n[3912],n[c+4>>2]=n[3913],n[c+8>>2]=n[3914],n[c+12>>2]=n[3915],n[(c=o+32|0)>>2]=n[3916],n[c+4>>2]=n[3917],n[c+8>>2]=n[3918],n[c+12>>2]=n[3919],n[p>>2]=n[s>>2],n[p+4>>2]=n[s+4>>2],R(p,Q+96|0),n[Q+136>>2]=0,n[Q+140>>2]=0,n[(c=Q+128|0)>>2]=3,o=0|_e(48),n[(e=Q+132|0)>>2]=o,!o){c=0,s=5;break}if(n[o>>2]=n[3920],n[o+4>>2]=n[3921],n[o+8>>2]=n[3922],n[o+12>>2]=n[3923],n[(u=o+16|0)>>2]=n[3924],n[u+4>>2]=n[3925],n[u+8>>2]=n[3926],n[u+12>>2]=n[3927],n[(u=o+32|0)>>2]=n[3928],n[u+4>>2]=n[3929],n[u+8>>2]=n[3930],n[u+12>>2]=n[3931],n[p>>2]=n[c>>2],n[p+4>>2]=n[c+4>>2],R(p,Q+120|0),n[Q+160>>2]=0,n[Q+164>>2]=0,n[(u=Q+152|0)>>2]=3,o=0|_e(48),n[(r=Q+156|0)>>2]=o,!o){c=0,s=6;break}if(n[o>>2]=n[3932],n[o+4>>2]=n[3933],n[o+8>>2]=n[3934],n[o+12>>2]=n[3935],n[(l=o+16|0)>>2]=n[3936],n[l+4>>2]=n[3937],n[l+8>>2]=n[3938],n[l+12>>2]=n[3939],n[(l=o+32|0)>>2]=n[3940],n[l+4>>2]=n[3941],n[l+8>>2]=n[3942],n[l+12>>2]=n[3943],n[p>>2]=n[u>>2],n[p+4>>2]=n[u+4>>2],R(p,Q+144|0),n[Q+184>>2]=0,n[Q+188>>2]=0,n[(l=Q+176|0)>>2]=3,o=0|_e(48),n[(v=Q+180|0)>>2]=o,!o){c=0,s=7;break}if(n[o>>2]=n[3944],n[o+4>>2]=n[3945],n[o+8>>2]=n[3946],n[o+12>>2]=n[3947],n[(y=o+16|0)>>2]=n[3948],n[y+4>>2]=n[3949],n[y+8>>2]=n[3950],n[y+12>>2]=n[3951],n[(o=o+32|0)>>2]=n[3952],n[o+4>>2]=n[3953],n[o+8>>2]=n[3954],n[o+12>>2]=n[3955],n[p>>2]=n[l>>2],n[p+4>>2]=n[l+4>>2],R(p,Q+168|0),ke(Q,8,24,3),o=0|_e(128),n[t+4>>2]=o,0|o){n[t>>2]=8,n[o>>2]=n[w>>2],n[o+4>>2]=n[w+4>>2],n[o+8>>2]=n[w+8>>2],n[o+12>>2]=n[w+12>>2],n[(F=o+16|0)>>2]=n[g>>2],n[F+4>>2]=n[g+4>>2],n[F+8>>2]=n[g+8>>2],n[F+12>>2]=n[g+12>>2],n[(F=o+32|0)>>2]=n[d>>2],n[F+4>>2]=n[d+4>>2],n[F+8>>2]=n[d+8>>2],n[F+12>>2]=n[d+12>>2],n[(F=o+48|0)>>2]=n[b>>2],n[F+4>>2]=n[b+4>>2],n[F+8>>2]=n[b+8>>2],n[F+12>>2]=n[b+12>>2],n[(F=o+64|0)>>2]=n[s>>2],n[F+4>>2]=n[s+4>>2],n[F+8>>2]=n[s+8>>2],n[F+12>>2]=n[s+12>>2],n[(F=o+80|0)>>2]=n[c>>2],n[F+4>>2]=n[c+4>>2],n[F+8>>2]=n[c+8>>2],n[F+12>>2]=n[c+12>>2],n[(F=o+96|0)>>2]=n[u>>2],n[F+4>>2]=n[u+4>>2],n[F+8>>2]=n[u+8>>2],n[F+12>>2]=n[u+12>>2],n[(F=o+112|0)>>2]=n[l>>2],n[F+4>>2]=n[l+4>>2],n[F+8>>2]=n[l+8>>2],n[F+12>>2]=n[l+12>>2],ye(Q),F=158;break e}0|(o=0|n[k>>2])&&ye(o),0|(o=0|n[B>>2])&&ye(o),0|(o=0|n[h>>2])&&ye(o),0|(o=0|n[m>>2])&&ye(o),0|(o=0|n[A>>2])&&ye(o),0|(o=0|n[e>>2])&&ye(o),0|(o=0|n[r>>2])&&ye(o),0|(o=0|n[v>>2])&&ye(o),ye(Q);break e}c=0,s=1}while(0);o=0,u=0;do{0|(l=0|n[Q+(24*o|0)+12>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while(u>>>0<c>>>0|(0|u)==(0|c)&o>>>0<s>>>0)}ye(Q),F=152}}else{if((0|M)>0|0==(0|M)&P>>>0>0){u=0,c=0,s=0,l=0,o=0,b=0;do{p=c,F=s,l=0|pe(0|l,0|o,1&((0|(c=0|n[(y=I+(24*u|0)|0)>>2]))!=(0|p)|(0|(s=0|n[y+4>>2]))!=(0|F))|0,0),o=0|C(),u=0|pe(0|u,0|b,1,0),b=0|C()}while((0|b)<(0|M)|(0|b)==(0|M)&u>>>0<P>>>0);m=l,h=o}else m=0,h=0;if(A=0|_e(24*m|0)){r:do{if((0|M)>=0){for(w=0,k=0,l=0,u=0,B=0,c=0;;){if((0|w)==(0|P)&(0|k)==(0|M)||(0|n[(p=I+(24*l|0)|0)>>2])!=(0|n[(F=I+(24*w|0)|0)>>2])||(0|n[p+4>>2])!=(0|n[F+4>>2])){if(d=I+(24*l|0)|0,g=0|pe(0|(F=0|Te(0|w,0|k,0|l,0|u)),0|(p=0|C()),-1,-1),u=0|C(),(0|p)>0|0==(0|p)&F>>>0>1){if(!(o=0|_e(g<<3)))break;s=0,b=0;do{F=s,s=0|pe(0|s,0|b,1,0),b=0|C(),p=0|n[4+(y=d+(24*s|0)+16|0)>>2],n[(F=o+(F<<3)|0)>>2]=n[y>>2],n[F+4>>2]=p}while((0|b)<(0|u)|(0|b)==(0|u)&s>>>0<g>>>0)}else o=0;F=0|n[4+(p=I+(24*l|0)+16|0)>>2],n[(u=A+(24*c|0)+8|0)>>2]=n[p>>2],n[u+4>>2]=F,n[A+(24*c|0)+16>>2]=g,n[A+(24*c|0)+20>>2]=o,a[A+(24*c|0)>>3]=+a[I+(24*l|0)+8>>3],c=0|pe(0|c,0|B,1,0),l=w,u=k,o=0|C()}else o=B;if(F=w,w=0|pe(0|w,0|k,1,0),p=k,k=0|C(),!((0|p)<(0|M)|(0|p)==(0|M)&F>>>0<P>>>0))break r;B=o}if((0|B)>0|0==(0|B)&c>>>0>0){o=0,u=0;do{0|(l=0|n[A+(24*o|0)+20>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while((0|u)<(0|B)|(0|u)==(0|B)&o>>>0<c>>>0)}ye(A),F=152;break e}}while(0);if(ke(A,m,24,3),o=0|_e(m<<4),n[(u=t+4|0)>>2]=o,o){n[t>>2]=m;do{if((0|h)>0|0==(0|h)&m>>>0>0){if(n[o>>2]=n[(t=A+8|0)>>2],n[o+4>>2]=n[t+4>>2],n[o+8>>2]=n[t+8>>2],n[o+12>>2]=n[t+12>>2],1==(0|m)&0==(0|h))break;if(n[(t=o+16|0)>>2]=n[(F=A+32|0)>>2],n[t+4>>2]=n[F+4>>2],n[t+8>>2]=n[F+8>>2],n[t+12>>2]=n[F+12>>2],!((0|h)>0|0==(0|h)&m>>>0>2))break;o=2,l=0;do{n[(t=(0|n[u>>2])+(o<<4)|0)>>2]=n[(F=A+(24*o|0)+8|0)>>2],n[t+4>>2]=n[F+4>>2],n[t+8>>2]=n[F+8>>2],n[t+12>>2]=n[F+12>>2],o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|h)|(0|l)==(0|h)&o>>>0<m>>>0)}}while(0);ye(A),F=158;break}if((0|h)>0|0==(0|h)&m>>>0>0){o=0,u=0;do{0|(l=0|n[A+(24*o|0)+20>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while((0|u)<(0|h)|(0|u)==(0|h)&o>>>0<m>>>0)}ye(A),F=152;break}F=152}}while(0);if(158==(0|F))return ye(L),ye(G),ye(I),T=f,0;if(152==(0|F)&&(0|M)>0|0==(0|M)&P>>>0>0)for(c=0,s=0,o=P,u=M;(l=0|n[I+(24*c|0)+20>>2])?(ye(l),l=M,o=P):l=u,c=0|pe(0|c,0|s,1,0),(0|(s=0|C()))<(0|l)|(0|s)==(0|l)&c>>>0<o>>>0;)u=l;return ye(I),ye(L),ye(G),T=f,13}}while(0);return ye(L),ye(G),T=f,13}return 159==(0|F)?(T=f,0|o):0}function aA(A){var e,r=0;return(0|(r=0|n[(e=20+(A|=0)|0)>>2]))==(0|A)?0|A:(r=0|aA(r),n[e>>2]=r,0|r)}function tA(A,e){var r=0;switch(r=0|Se(0|(A|=0),0|(e|=0),56),C(),7&r){case 0:case 7:return 0}return r=-2130706433&e|134217728,!0&268435456==(2013265920&e|0)?!0&16777216==(117440512&e|0)&0!=(0|CA(A,r))?0|(r=0):0|(r=0|vA(A,r)):0|(r=0)}function fA(A,e,r){r|=0;var i,a=0;return i=0==(0|CA(A|=0,e|=0)),e&=-2130706433,n[(a=r)>>2]=i?A:0,n[a+4>>2]=i?285212672|e:0,n[(a=r+8|0)>>2]=A,n[a+4>>2]=301989888|e,n[(a=r+16|0)>>2]=A,n[a+4>>2]=318767104|e,n[(a=r+24|0)>>2]=A,n[a+4>>2]=335544320|e,n[(a=r+32|0)>>2]=A,n[a+4>>2]=352321536|e,n[(r=r+40|0)>>2]=A,n[r+4>>2]=369098752|e,0}function oA(A,e,r){r|=0;var i,a,t=0,f=0;return a=T,T=T+16|0,i=a,f=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e|0)?(t=0|Se(0|(A|=0),0|e,56),C(),-1==(0|(t=0|function(A,e,r){r|=0;var i,a,t=0;if(i=T,T=T+16|0,a=i,t=0|CA(A|=0,e|=0),(r+-1|0)>>>0>5)return T=i,-1;if(1==(0|r)&(t=0!=(0|t)))return T=i,-1;do{if(!(0|de(A,e,a))){if(t){t=(5+(0|n[26416+(r<<2)>>2])-(0|n[a>>2])|0)%5|0;break}t=(6+(0|n[26448+(r<<2)>>2])-(0|n[a>>2])|0)%6|0;break}t=-1}while(0);return T=i,0|t}(A,f,7&t)))?(n[r>>2]=0,T=a,0|(f=6)):(0|zA(A,f,i)&&_(27634,27035,282,27050),e=0|Se(0|A,0|e,52),C(),e&=15,0|CA(A,f)?bA(i,e,t,2,r):kA(i,e,t,2,r),T=a,0|(f=0))):(T=a,0|(f=6))}function lA(A,e,r){A|=0,r|=0;var i,a=0,t=0,f=0;return i=T,T=T+16|0,t=i,f=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e|0)?(n[(a=i+8|0)>>2]=0,e=0|Se(0|A,0|e,56),C(),0|(e=0|z(A,f,7&e,a,t))?(T=i,0|(r=e)):7==(0|(e=0|S(a=0|n[t>>2],t=0|n[t+4>>2],A,f)))?(T=i,0|(r=11)):(A=0|He(0|e,0,56),f=-2130706433&t|0|C()|268435456,n[r>>2]=a|A,n[r+4>>2]=f,T=i,0|(r=0))):(T=i,0|(r=6))}function uA(A,e,r){A|=0,e|=0;var i,t,f=0,o=0,g=0,w=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0;n[(r|=0)>>2]=0,m=+a[A>>3],v=+a[A+8>>3],h=+a[A+16>>3],o=0,g=5,f=5,A=0;do{(w=(D=+a[15888+(24*o|0)>>3]-m)*D+(E=+a[15888+(24*o|0)+8>>3]-v)*E+(w=+a[15888+(24*o|0)+16>>3]-h)*w)<f&&(n[r>>2]=o,g=w,A=o,f=w),o=o+1|0}while(20!=(0|o));if((g=+d(+(1-.5*g)))<1e-16)h=0,w=0;else{if(I=+a[16368+(24*A|0)>>3],w=(M=+a[15888+(24*A|0)>>3])*(p=-((y=+a[15888+(24*A|0)+16>>3])+(0*M+0*(P=+a[15888+(24*A|0)+8>>3]))))+0,D=P*p+0,w*=_=(_=+u(+((p=y*p+1)*p+(w*w+D*D))))>0?1/_:0,D*=_,_*=p,E=m+M*(p=-(m*M+v*P+h*y)),E*=v=(v=+u(+((m=h+y*p)*m+(E*E+(f=v+P*p)*f))))>0?1/v:0,f*=v,f=+jA(I-+jA(+k(+((v*=m)*(P*w-M*D)+(E*(y*D-P*_)+f*(M*_-y*w))),+(_*v+(w*E+D*f))))),w=0|LA(e)?+jA(f+-.3334731722518321):f,f=2.618033988749896*+b(+g),(0|e)>0){A=0;do{f*=2.6457513110645907,A=A+1|0}while((0|A)!=(0|e))}h=+c(+w)*f,w=+s(+w)*f}e=r+4|0,n[(t=r+12|0)>>2]=0,g=1.1547005383792515*+l(+w),f=+l(+h)+.5*g,f-=+(0|(A=~~f)),g-=+(0|(o=~~g));do{if(f<.5){if(f<.3333333333333333){if(n[e>>2]=A,g<.5*(f+1)){n[r+8>>2]=o;break}n[r+8>>2]=o=o+1|0;break}if(n[r+8>>2]=o=(1&!(g<(p=1-f)))+o|0,p<=g&g<2*f){n[e>>2]=A=A+1|0;break}n[e>>2]=A;break}if(!(f<.6666666666666666)){if(n[e>>2]=A=A+1|0,g<.5*f){n[r+8>>2]=o;break}n[r+8>>2]=o=o+1|0;break}if(g<1-f){if(n[r+8>>2]=o,2*f-1<g){n[e>>2]=A;break}}else n[r+8>>2]=o=o+1|0;n[e>>2]=A=A+1|0}while(0);do{if(h<0){if(1&o){A=~~(+(0|A)-(2*(+((Q=0|Te(0|A,((0|A)<0)<<31>>31|0,0|(Q=(o+1|0)/2|0),((0|Q)<0)<<31>>31|0))>>>0)+4294967296*+(0|C()))+1)),n[e>>2]=A,Q=e;break}A=~~(+(0|A)-2*(+((Q=0|Te(0|A,((0|A)<0)<<31>>31|0,0|(Q=(0|o)/2|0),((0|Q)<0)<<31>>31|0))>>>0)+4294967296*+(0|C()))),n[e>>2]=A,Q=e;break}Q=e}while(0);i=r+8|0,e=0-o|0,w<0?(n[Q>>2]=r=A-((1|o<<1)/2|0)|0,n[i>>2]=e,o=e):r=A,A=o-r|0,e=0-r|0,(0|r)<0?(n[i>>2]=A,n[t>>2]=e,n[Q>>2]=0,B=0):(A=o,B=r,e=0),r=B-A|0,o=e-A|0,(0|A)<0?(n[Q>>2]=r,n[t>>2]=o,n[i>>2]=0,B=r,A=0):o=e,r=B-o|0,e=A-o|0,(0|o)<0?(n[Q>>2]=r,n[i>>2]=e,n[t>>2]=0,o=0):(e=A,r=B),(0|(A=(0|o)<(0|(A=(0|e)<(0|r)?e:r))?o:A))<=0||(n[Q>>2]=r-A,n[i>>2]=e-A,n[t>>2]=o-A)}function cA(A,e,r){var i,t,f,o;e|=0,r|=0,i=T,T=T+16|0,a[(t=i)>>3]=+((0|n[4+(A|=0)>>2])-(o=0|n[A+12>>2])|0)-.5*(f=+((0|n[A+8>>2])-o|0)),a[t+8>>3]=.8660254037844386*f,sA(t,0|n[A>>2],e,0,r),T=i}function sA(A,e,r,i,t){e|=0,r|=0,i|=0,t|=0;var f,o,l,b,d,g=0,B=0,h=0,m=0,v=0,Q=0,E=0;if((g=+function(A){var e,r;return+ +u(+((r=+a[(A|=0)>>3])*r+(e=+a[A+8>>3])*e))}(A|=0))<1e-16)return n[t>>2]=n[(e=15888+(24*e|0)|0)>>2],n[t+4>>2]=n[e+4>>2],n[t+8>>2]=n[e+8>>2],n[t+12>>2]=n[e+12>>2],n[t+16>>2]=n[e+16>>2],void(n[t+20>>2]=n[e+20>>2]);if(B=+k(+ +a[A+8>>3],+ +a[A>>3]),(0|r)>0){A=0;do{g*=.37796447300922725,A=A+1|0}while((0|A)!=(0|r))}h=.3333333333333333*g,i?(r=0==(0|LA(r)),g=+w(.381966011250105*(r?h:.37796447300922725*h))):(g=+w(.381966011250105*g),0|LA(r)&&(B=+jA(B+.3334731722518321))),v=+jA(+a[16368+(24*e|0)>>3]-B),m=(h=+a[15888+(24*e|0)>>3])*(E=-((b=+a[15888+(24*e|0)+16>>3])+(0*h+0*(o=+a[15888+(24*e|0)+8>>3]))))+0,B=o*E+0,m*=Q=(Q=+u(+((E=b*E+1)*E+(m*m+B*B))))>0?1/Q:0,B*=Q,Q*=E,E=+c(+v),v=+s(+v),f=(d=+c(+g))*h+(l=+s(+g))*(E*m+v*(b*B-o*Q)),g=d*o+l*(E*B+v*(h*Q-b*m)),h=+u(+((B=d*b+l*(E*Q+v*(o*m-h*B)))*B+(f*f+g*g))),a[t>>3]=f*(h=h>0?1/h:0),a[t+8>>3]=g*h,a[t+16>>3]=B*h}function bA(A,e,r,i,t){A|=0,r|=0,i|=0,t|=0;var f,o,l,u,c,s,b,d,w,B,m,v,Q,E,D,C,y,M,P,I,p,F,L,G,U,z,x,V=0,S=0,H=0,R=0,Y=0,j=0,O=0,N=0,W=0,Z=0,J=0,K=0,X=0,q=0,$=0;if(x=T,T=T+256|0,W=x+224|0,G=x,U=x+208|0,z=x+192|0,M=x+168|0,P=x+152|0,I=x+136|0,p=x+120|0,F=x+104|0,L=x+80|0,n[(V=x+240|0)>>2]=e|=0,n[W>>2]=n[A>>2],n[W+4>>2]=n[A+4>>2],n[W+8>>2]=n[A+8>>2],n[W+12>>2]=n[A+12>>2],dA(W,V,G),n[t>>2]=0,(0|(W=i+r+(5==(0|i)&1)|0))<=(0|r))T=x;else{b=U+4|0,c=U+8|0,s=U+12|0,w=z+8|0,B=r+5|0,m=16848+((d=0|n[V>>2])<<2)|0,v=M+8|0,Q=16928+(d<<2)|0,E=P+8|0,D=I+8|0,C=p+8|0,y=z+8|0,f=M+8|0,l=M+16|0,o=L+8|0,u=L+16|0,N=r,i=0,S=0,H=0,R=0;A:for(;;){n[U>>2]=n[(O=G+(((0|N)%5|0)<<4)|0)>>2],n[U+4>>2]=n[O+4>>2],n[U+8>>2]=n[O+8>>2],n[U+12>>2]=n[O+12>>2];do{}while(2==(0|gA(U,d,0,1)));if((0|N)>(0|r)&0!=(0|LA(e))){if(O=0|n[U>>2],A=0|n[b>>2],Y=0|n[c>>2],V=0|n[s>>2],a[z>>3]=+(S-R|0)-.5*(Z=+(H-R|0)),a[w>>3]=.8660254037844386*Z,j=0|n[18608+(80*O|0)+(20*(R=0|n[17008+(80*O|0)+(i<<2)>>2])|0)>>2],(0|(H=0|n[18608+(80*O|0)+(20*R|0)+16>>2]))>0){S=0,i=Y;do{i=((K=(0|(Y=i+A-((q=(0|(X=V+A|0))<0)?X:0)|0))<0)?0:Y)-((V=(0|(J=V+i-(q?X:0)-(K?Y:0)|0))<0)?J:0)|0,A=(A=(q?0:X)-(K?Y:0)-(V?J:0)|0)-((Y=(0|(V=(0|(J=V?0:J))<(0|(V=(0|i)<(0|A)?i:A))?J:V))>0)?V:0)|0,i=i-(Y?V:0)|0,V=J-(Y?V:0)|0,S=S+1|0}while((0|S)<(0|H))}else i=Y;switch(J=(0|h(q=3*(0|n[m>>2])|0,0|n[18608+(80*O|0)+(20*R|0)+4>>2]))+A|0,Y=(0|h(q,0|n[18608+(80*O|0)+(20*R|0)+8>>2]))+i|0,q=(0|h(q,0|n[18608+(80*O|0)+(20*R|0)+12>>2]))+V|0,J=((R=(0|J)<0)?0:J)-((K=(0|(Y=Y-(R?J:0)|0))<0)?Y:0)-((X=(0|(q=q+(R?0-J|0:0)+(K?0-Y|0:0)|0))<0)?q:0)|0,Y=(K?0:Y)-(X?q:0)|0,a[M>>3]=+(J-((K=(0|(X=(0|(q=X?0:q))<(0|(X=(0|Y)<(0|J)?Y:J))?q:X))>0)?X:0)-(q=q-(K?X:0)|0)|0)-.5*(Z=+(Y-(K?X:0)-q|0)),a[v>>3]=.8660254037844386*Z,a[P>>3]=3*(Z=+(0|n[Q>>2])),a[E>>3]=0,a[I>>3]=$=-1.5*Z,a[D>>3]=2.598076211353316*Z,a[p>>3]=$,a[C>>3]=-2.598076211353316*Z,0|n[17008+(80*j|0)+(O<<2)>>2]){case 1:A=I,i=P;break;case 3:A=p,i=I;break;case 2:A=P,i=p;break;default:A=12;break A}se(z,M,i,A,F),sA(F,j,d,1,L),q=0|n[t>>2],Z=+g(+ +a[u>>3]),$=+k(+ +a[o>>3],+ +a[L>>3]),a[t+8+(q<<4)>>3]=Z,a[t+8+(q<<4)+8>>3]=$,n[t>>2]=1+(0|n[t>>2])}if((0|N)<(0|B)&&(a[z>>3]=+((0|n[b>>2])-(q=0|n[s>>2])|0)-.5*(Z=+((0|n[c>>2])-q|0)),a[y>>3]=.8660254037844386*Z,sA(z,0|n[U>>2],d,1,M),q=0|n[t>>2],Z=+g(+ +a[l>>3]),$=+k(+ +a[f>>3],+ +a[M>>3]),a[t+8+(q<<4)>>3]=Z,a[t+8+(q<<4)+8>>3]=$,n[t>>2]=1+(0|n[t>>2])),(0|(N=N+1|0))>=(0|W)){A=3;break}i=0|n[U>>2],S=0|n[b>>2],H=0|n[c>>2],R=0|n[s>>2]}3!=(0|A)?12==(0|A)&&_(27073,27120,599,27130):T=x}}function dA(A,e,r){A|=0,e|=0,r|=0;var i,a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;f=T,T=T+128|0,l=f,c=20208,s=60+(u=o=f+64|0)|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));c=20272,s=(u=l)+60|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));g=(g=0==(0|LA(0|n[e>>2])))?o:l,l=0|n[(a=A+12|0)>>2],n[(t=A+4|0)>>2]=c=(o=0|n[(i=A+8|0)>>2])+((u=0|n[t>>2])<<1)|0,n[i>>2]=o=l+(o<<1)|0,n[a>>2]=u=(l<<1)+u|0,l=o-c|0,s=u-c|0,(0|c)<0&&(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,c=0,u=s),s=c-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=s,n[a>>2]=l,n[i>>2]=0,o=0):(l=u,s=c),c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(l=l-o|0,u=u-o|0,n[t>>2]=c=c-o|0,n[i>>2]=u,n[a>>2]=l),b=(u<<1)+c|0,n[t>>2]=s=l+(c<<1)|0,n[i>>2]=b,n[a>>2]=u=(l<<1)+u|0,o=b-s|0,l=u-s|0,(0|s)<0?(n[i>>2]=o,n[a>>2]=l,n[t>>2]=0,s=0,u=l):o=b,c=s-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=c,n[a>>2]=l,n[i>>2]=0,s=c,o=0):l=u,c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(n[t>>2]=c-o,n[i>>2]=u-o,n[a>>2]=l-o),0|LA(0|n[e>>2])&&(o=(3*(c=0|n[i>>2])|0)+(u=0|n[t>>2])|0,n[t>>2]=u=(l=0|n[a>>2])+(3*u|0)|0,n[i>>2]=o,n[a>>2]=c=(3*l|0)+c|0,l=o-u|0,s=c-u|0,(0|u)<0?(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,b=0):(b=u,s=c),u=b-o|0,l=s-o|0,(0|o)<0?(n[t>>2]=u,n[a>>2]=l,n[i>>2]=0,b=u,c=0):(c=o,l=s),u=b-l|0,o=c-l|0,(0|l)<0?(n[t>>2]=u,n[i>>2]=o,n[a>>2]=0,c=o,l=0):u=b,(0|(o=(0|l)<(0|(o=(0|c)<(0|u)?c:u))?l:o))>0&&(n[t>>2]=u-o,n[i>>2]=c-o,n[a>>2]=l-o),n[e>>2]=1+(0|n[e>>2])),n[r>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+4>>2],d=0|n[g+8>>2],n[(b=r+4|0)>>2]=c=(0|n[g>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+8|0)>>2]=l,o=d+o|0,n[(d=r+12|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+16>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+16>>2],d=0|n[g+20>>2],n[(b=r+20|0)>>2]=c=(0|n[g+12>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+24|0)>>2]=l,o=d+o|0,n[(d=r+28|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+32>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+28>>2],d=0|n[g+32>>2],n[(b=r+36|0)>>2]=c=(0|n[g+24>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+40|0)>>2]=l,o=d+o|0,n[(d=r+44|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+48>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+40>>2],d=0|n[g+44>>2],n[(b=r+52|0)>>2]=c=(0|n[g+36>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+56|0)>>2]=l,o=d+o|0,n[(d=r+60|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+64>>2]=n[A>>2],u=0|n[i>>2],o=0|n[a>>2],d=0|n[g+52>>2],b=0|n[g+56>>2],n[(e=r+68|0)>>2]=c=(0|n[g+48>>2])+(0|n[t>>2])|0,u=d+u|0,n[(d=r+72|0)>>2]=u,o=b+o|0,n[(b=r+76|0)>>2]=o,l=u-c|0,(0|c)<0?(o=o-c|0,n[d>>2]=l,n[b>>2]=o,n[e>>2]=0,u=0):(l=u,u=c),(0|l)<0&&(n[e>>2]=u=u-l|0,n[b>>2]=o=o-l|0,n[d>>2]=0,l=0),s=u-o|0,c=l-o|0,(0|o)<0?(n[e>>2]=s,n[d>>2]=c,n[b>>2]=0,u=s,o=0):c=l,(0|(l=(0|o)<(0|(l=(0|c)<(0|u)?c:u))?o:l))<=0?T=f:(n[e>>2]=u-l,n[d>>2]=c-l,n[b>>2]=o-l,T=f)}function gA(A,e,r,i){r|=0;var a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(b=0|n[16928+((e|=0)<<2)>>2],b=(f=0!=(0|(i|=0)))?3*b|0:b,c=0|n[(t=4+(A|=0)|0)>>2],l=0|n[(a=A+8|0)>>2],f){if((0|(o=l+c+(i=0|n[(u=A+12|0)>>2])|0))==(0|b))return 1;s=u}else i=o=0|n[(s=A+12|0)>>2],o=l+c+o|0;if((0|o)<=(0|b))return 0;do{if((0|i)>0){if(o=0|n[A>>2],(0|l)>0){o=18608+(80*o|0)+60|0,u=c;break}o=18608+(80*o|0)+40|0,r?(r=((d=(0|(r=l+(u=c-b|0)|0))<0)?0:r)-((c=(0|(l=i+l-(d?r:0)|0))<0)?l:0)-((u=(0|(i=i+u-(d?r:0)-(c?l:0)|0))<0)?i:0)|0,l=(l=(c?0:l)-(u?i:0)|0)-((c=(0|(u=(0|(i=u?0:i))<(0|(u=(0|l)<(0|r)?l:r))?i:u))>0)?u:0)|0,i=i-(c?u:0)|0,n[t>>2]=u=r-(c?u:0)+b|0,n[a>>2]=l,n[s>>2]=i):u=c}else o=18608+(80*(0|n[A>>2])|0)+20|0,u=c}while(0);if(n[A>>2]=n[o>>2],(0|(c=0|n[o+16>>2]))>0){r=0;do{(0|(A=(0|(i=(l=(0|(u=i+l-(B=(g=(0|(d=i+u|0))<0)?d:0)-(A=(k=(0|(w=l+u-B|0))<0)?w:0)|0))<0)?0:u))<(0|(A=(0|(l=(k?0:w)-(u=l?u:0)|0))<(0|(u=(g?0:d)-A-u|0))?l:u))?i:A))>0&&(u=u-A|0,l=l-A|0,i=i-A|0),r=r+1|0}while((0|r)<(0|c));n[t>>2]=u,n[a>>2]=l,n[s>>2]=i}return w=0|n[16848+(e<<2)>>2],k=0|h(w=f?3*w|0:w,0|n[o+8>>2]),B=0|h(w,0|n[o+12>>2]),u=(0|h(w,0|n[o+4>>2]))+u|0,n[t>>2]=u,n[a>>2]=l=k+l|0,n[s>>2]=i=B+i|0,o=l-u|0,(0|u)<0?(i=i-u|0,n[a>>2]=o,n[s>>2]=i,n[t>>2]=0,l=0):(o=l,l=u),(0|o)<0?(n[t>>2]=A=l-o|0,n[s>>2]=i=i-o|0,n[a>>2]=0,u=0):(A=l,u=o),l=A-i|0,o=u-i|0,(0|i)<0?(n[t>>2]=l,n[a>>2]=o,n[s>>2]=0,i=0):(o=u,l=A),(0|(u=(0|i)<(0|(u=(0|o)<(0|l)?o:l))?i:u))>0&&(o=o-u|0,i=i-u|0,n[t>>2]=l=l-u|0,n[a>>2]=o,n[s>>2]=i),f?0|(B=(o+l+i|0)==(0|b)?1:2):0|(B=2)}function wA(A,e){A|=0,e|=0;var r=0;do{r=0|gA(A,e,0,1)}while(2==(0|r));return 0|r}function kA(A,e,r,i,t){A|=0,r|=0,i|=0,t|=0;var f,o,l,u,c,s,b,d,w,B,h,m,v,Q,E,D,C,y,M,P,I,p,F,L,G,U,z,x,V=0,S=0,H=0,R=0,Y=0,j=0,O=0;if(x=T,T=T+272|0,S=x+240|0,G=x,U=x+224|0,z=x+208|0,M=x+184|0,P=x+168|0,I=x+152|0,p=x+136|0,F=x+120|0,L=x+96|0,n[(V=x+256|0)>>2]=e|=0,n[S>>2]=n[A>>2],n[S+4>>2]=n[A+4>>2],n[S+8>>2]=n[A+8>>2],n[S+12>>2]=n[A+12>>2],BA(S,V,G),n[t>>2]=0,(0|(y=i+r+(6==(0|i)&1)|0))<=(0|r))T=x;else{h=r+6|0,m=z+8|0,v=M+8|0,Q=16928+((B=0|n[V>>2])<<2)|0,E=P+8|0,D=I+8|0,C=p+8|0,d=0|n[S>>2],c=U+4|0,s=U+8|0,b=U+12|0,w=z+8|0,f=M+8|0,l=M+16|0,o=L+8|0,u=L+16|0,S=0,H=r,i=-1;A:for(;;){if(n[U>>2]=n[(A=G+((V=(0|H)%6|0)<<4)|0)>>2],n[U+4>>2]=n[A+4>>2],n[U+8>>2]=n[A+8>>2],n[U+12>>2]=n[A+12>>2],A=S,S=0|gA(U,B,0,1),(0|H)>(0|r)&0!=(0|LA(e))&&1!=(0|A)&(0|(R=0|n[U>>2]))!=(0|i)){switch(a[z>>3]=+((0|n[G+((O=(V+5|0)%6|0)<<4)+4>>2])-(A=0|n[G+(O<<4)+12>>2])|0)-.5*(Y=+((0|n[G+(O<<4)+8>>2])-A|0)),a[m>>3]=.8660254037844386*Y,a[M>>3]=+((0|n[G+(V<<4)+4>>2])-(A=0|n[G+(V<<4)+12>>2])|0)-.5*(Y=+((0|n[G+(V<<4)+8>>2])-A|0)),a[v>>3]=.8660254037844386*Y,a[P>>3]=3*(Y=+(0|n[Q>>2])),a[E>>3]=0,a[I>>3]=j=-1.5*Y,a[D>>3]=2.598076211353316*Y,a[p>>3]=j,a[C>>3]=-2.598076211353316*Y,0|n[17008+(80*d|0)+(((0|i)==(0|d)?R:i)<<2)>>2]){case 1:A=I,i=P;break;case 3:A=p,i=I;break;case 2:A=P,i=p;break;default:A=8;break A}se(z,M,i,A,F),0|be(z,F)||0|be(M,F)||(sA(F,d,B,1,L),O=0|n[t>>2],Y=+g(+ +a[u>>3]),j=+k(+ +a[o>>3],+ +a[L>>3]),a[t+8+(O<<4)>>3]=Y,a[t+8+(O<<4)+8>>3]=j,n[t>>2]=1+(0|n[t>>2]))}if((0|H)<(0|h)&&(a[z>>3]=+((0|n[c>>2])-(O=0|n[b>>2])|0)-.5*(Y=+((0|n[s>>2])-O|0)),a[w>>3]=.8660254037844386*Y,sA(z,0|n[U>>2],B,1,M),O=0|n[t>>2],Y=+g(+ +a[l>>3]),j=+k(+ +a[f>>3],+ +a[M>>3]),a[t+8+(O<<4)>>3]=Y,a[t+8+(O<<4)+8>>3]=j,n[t>>2]=1+(0|n[t>>2])),(0|(H=H+1|0))>=(0|y)){A=3;break}i=0|n[U>>2]}3!=(0|A)?8==(0|A)&&_(27157,27120,766,27202):T=x}}function BA(A,e,r){A|=0,e|=0,r|=0;var i,a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;f=T,T=T+160|0,l=f,c=20336,s=72+(u=o=f+80|0)|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));c=20416,s=(u=l)+72|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));w=(w=0==(0|LA(0|n[e>>2])))?o:l,l=0|n[(a=A+12|0)>>2],n[(t=A+4|0)>>2]=c=(o=0|n[(i=A+8|0)>>2])+((u=0|n[t>>2])<<1)|0,n[i>>2]=o=l+(o<<1)|0,n[a>>2]=u=(l<<1)+u|0,l=o-c|0,s=u-c|0,(0|c)<0&&(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,c=0,u=s),s=c-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=s,n[a>>2]=l,n[i>>2]=0,o=0):(l=u,s=c),c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(l=l-o|0,u=u-o|0,n[t>>2]=c=c-o|0,n[i>>2]=u,n[a>>2]=l),b=(u<<1)+c|0,n[t>>2]=s=l+(c<<1)|0,n[i>>2]=b,n[a>>2]=u=(l<<1)+u|0,o=b-s|0,l=u-s|0,(0|s)<0?(n[i>>2]=o,n[a>>2]=l,n[t>>2]=0,s=0,u=l):o=b,c=s-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=c,n[a>>2]=l,n[i>>2]=0,s=c,o=0):l=u,c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(n[t>>2]=c-o,n[i>>2]=u-o,n[a>>2]=l-o),0|LA(0|n[e>>2])&&(o=(3*(c=0|n[i>>2])|0)+(u=0|n[t>>2])|0,n[t>>2]=u=(l=0|n[a>>2])+(3*u|0)|0,n[i>>2]=o,n[a>>2]=c=(3*l|0)+c|0,l=o-u|0,s=c-u|0,(0|u)<0?(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,b=0):(b=u,s=c),u=b-o|0,l=s-o|0,(0|o)<0?(n[t>>2]=u,n[a>>2]=l,n[i>>2]=0,b=u,c=0):(c=o,l=s),u=b-l|0,o=c-l|0,(0|l)<0?(n[t>>2]=u,n[i>>2]=o,n[a>>2]=0,c=o,l=0):u=b,(0|(o=(0|l)<(0|(o=(0|c)<(0|u)?c:u))?l:o))>0&&(n[t>>2]=u-o,n[i>>2]=c-o,n[a>>2]=l-o),n[e>>2]=1+(0|n[e>>2])),b=0;do{n[r+(b<<4)>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],d=0|n[w+(12*b|0)+4>>2],g=0|n[w+(12*b|0)+8>>2],n[(e=r+(b<<4)+4|0)>>2]=c=(0|n[w+(12*b|0)>>2])+(0|n[t>>2])|0,l=d+l|0,n[(d=r+(b<<4)+8|0)>>2]=l,o=g+o|0,n[(g=r+(b<<4)+12|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[d>>2]=u,n[g>>2]=o,n[e>>2]=0,l=u,c=0),(0|l)<0&&(n[e>>2]=c=c-l|0,n[g>>2]=o=o-l|0,n[d>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[e>>2]=s,n[d>>2]=u,n[g>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[e>>2]=c-l,n[d>>2]=u-l,n[g>>2]=o-l),b=b+1|0}while(6!=(0|b));T=f}function hA(A,e){return e=0|Se(0|(A|=0),0|(e|=0),52),C(),15&e|0}function mA(A,e){return e=0|Se(0|(A|=0),0|(e|=0),45),C(),127&e|0}function vA(A,e){A|=0;var r=0,n=0,a=0,t=0;return!0&134217728==(-16777216&(e|=0)|0)?(n=0|Se(0|A,0|e,52),C(),n&=15,r=0|Se(0|A,0|e,45),C(),(r&=127)>>>0>121?0|(A=0):0==(613566756&(t=0|He(0|(a=0|Se(0|A,0|e,0|(t=3*(15^n)|0))),0|C(),0|t))&(0|Te(-1227133514,-1171,0|t,0|(a=0|C())))|0)&0==(4681&a&(0|C())|0)&&15==(0|n)|0==(0|(t=0|Se(0|He(0|~A,0|~e,0|(t=19+(3*n|0)|0)),0|C(),0|t)))&0==(0|C())?0|i[20496+r>>0]?0==(0|A)&0==(0|(e&=8191))?0|(t=1):(t=0|Re(0|A,0|e),C(),0!=(0|(63-t|0)%3)|0):0|(t=1):0|(t=0)):0|(A=0)}function QA(A,e,r,i){A|=0,r|=0,i|=0;var a=0,t=0,f=0,o=0;if(a=0|He(0|(e|=0),0,52),t=0|C(),r=0|He(0|r,0,45),r=0|t|C()|134225919,(0|e)<1)return i=r,n[(e=A)>>2]=t=-1,void(n[(A=A+4|0)>>2]=i);for(t=1,a=-1;o=0|He(7,0,0|(f=3*(15-t|0)|0)),r&=~(0|C()),a=a&~o|(f=0|He(0|i,0,0|f)),r=0|r|C(),(0|t)!=(0|e);)t=t+1|0;n[(f=o=A)>>2]=a,n[(o=o+4|0)>>2]=r}function EA(A,e,r,i){r|=0,i|=0;var a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),r>>>0>15)return 4;if((0|(t&=15))<(0|r))return 12;if((0|t)==(0|r))return n[i>>2]=A,n[i+4>>2]=e,0;if(a=0|He(0|r,0,52),a|=A,A=0|C()|-15728641&e,(0|t)>(0|r))do{e=0|He(7,0,3*(14-r|0)|0),r=r+1|0,a|=e,A=0|C()|A}while((0|r)<(0|t));return n[i>>2]=a,n[i+4>>2]=A,0}function DA(A,e,r,i){r|=0,i|=0;var a=0,t=0,f=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!((0|r)<16&(0|(t&=15))<=(0|r)))return 4;a=r-t|0,r=0|Se(0|A,0|e,45),C();A:do{if(0|Y(127&r)){e:do{if(0|t){for(r=1;0==((f=0|He(7,0,3*(15-r|0)|0))&A|0)&0==((0|C())&e|0);){if(!(r>>>0<t>>>0))break e;r=r+1|0}r=0|$A(7,0,a,((0|a)<0)<<31>>31),a=0|C();break A}}while(0);r=0|pe(0|(r=0|Ue(0|(r=0|$A(7,0,a,((0|a)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),r=0|pe(0|(r=0|Ge(0|r,0|C(),6,0)),0|C(),1,0),a=0|C()}else r=0|$A(7,0,a,((0|a)<0)<<31>>31),a=0|C()}while(0);return n[(f=i)>>2]=r,n[f+4>>2]=a,0}function CA(A,e){var r=0,i=0,n=0;if(n=0|Se(0|(A|=0),0|(e|=0),45),C(),!(0|Y(127&n)))return 0;n=0|Se(0|A,0|e,52),C(),n&=15;A:do{if(n)for(i=1;;){if(r=0|Se(0|A,0|e,3*(15-i|0)|0),C(),0|(r&=7))break A;if(!(i>>>0<n>>>0)){r=0;break}i=i+1|0}else r=0}while(0);return 0|0==(0|r)&1}function _A(A,e,r,i){return A|=0,e|=0,(0|(i|=0))<(0|(r|=0))?(i=A,D(0|(r=e)),0|i):(r=0|He(-1,-1,3+(3*(i-r|0)|0)|0),i=0|He(0|~r,0|~(0|C()),3*(15-i|0)|0),r=~(0|C())&e,i=~i&A,D(0|r),0|i)}function yA(A,e,r,i){r|=0,i|=0;var a=0;return a=0|Se(0|(A|=0),0|(e|=0),52),C(),(0|r)<16&(0|(a&=15))<=(0|r)?((0|a)<(0|r)&&(a=0|He(-1,-1,3+(3*(r+-1-a|0)|0)|0),a=0|He(0|~a,0|~(0|C()),3*(15-r|0)|0),e=~(0|C())&e,A&=~a),a=0|He(0|r,0,52),r=-15728641&e|0|C(),n[i>>2]=A|a,n[i+4>>2]=r,0|(i=0)):0|(i=4)}function MA(A,e){var r=0,i=0,n=0;if(n=0|Se(0|(A|=0),0|(e|=0),52),C(),!(n&=15))return 0;for(i=1;;){if(r=0|Se(0|A,0|e,3*(15-i|0)|0),C(),0|(r&=7)){i=5;break}if(!(i>>>0<n>>>0)){r=0,i=5;break}i=i+1|0}return 5==(0|i)?0|r:0}function PA(A,e){var r=0,i=0,n=0,a=0,t=0,f=0,o=0,l=0,u=0;if(u=0|Se(0|(A|=0),0|(e|=0),52),C(),!(u&=15))return u=A,D(0|(l=e)),0|u;for(l=1,r=0;;){switch(a=A&~(f=0|He(7,0,0|(i=3*(15-l|0)|0))),t=e&~(o=0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A&=7}A=(i=0|He(0|A,0,0|i))|a,e=(n=0|C())|t;A:do{if(!r)if(0==(i&f|0)&0==(n&o|0))r=0;else if(t=0|Se(0|A,0|e,52),C(),t&=15){r=1;e:for(;;){switch(o=0|Se(0|A,0|e,3*(15-r|0)|0),C(),7&o){case 1:break e;case 0:break;default:r=1;break A}if(!(r>>>0<t>>>0)){r=1;break A}r=r+1|0}for(a=1;;){switch(r=0|Se(0|A,0|e,0|(n=3*(15-a|0)|0)),C(),i=A&~(i=0|He(7,0,0|n)),e&=~(0|C()),7&r){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&r}if(A=0|He(0|A,0,0|n),A|=i,e=0|C()|e,!(a>>>0<t>>>0)){r=1;break A}a=a+1|0}}else r=1}while(0);if(!(l>>>0<u>>>0))break;l=l+1|0}return D(0|e),0|A}function IA(A,e){var r=0,i=0,n=0,a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!(t&=15))return t=A,D(0|(a=e)),0|t;for(a=1;;){switch(r=0|Se(0|A,0|e,0|(n=3*(15-a|0)|0)),C(),i=A&~(i=0|He(7,0,0|n)),e&=~(0|C()),7&r){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&r}if(A=0|He(0|A,0,0|n),A|=i,e=0|C()|e,!(a>>>0<t>>>0))break;a=a+1|0}return D(0|e),0|A}function pA(A,e){var r=0,i=0,n=0,a=0,t=0,f=0,o=0,l=0,u=0;if(u=0|Se(0|(A|=0),0|(e|=0),52),C(),!(u&=15))return u=A,D(0|(l=e)),0|u;for(l=1,r=0;;){switch(a=A&~(f=0|He(7,0,0|(i=3*(15-l|0)|0))),t=e&~(o=0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}A=(i=0|He(0|A,0,0|i))|a,e=(n=0|C())|t;A:do{if(!r)if(0==(i&f|0)&0==(n&o|0))r=0;else if(t=0|Se(0|A,0|e,52),C(),t&=15){r=1;e:for(;;){switch(o=0|Se(0|A,0|e,3*(15-r|0)|0),C(),7&o){case 1:break e;case 0:break;default:r=1;break A}if(!(r>>>0<t>>>0)){r=1;break A}r=r+1|0}for(a=1;;){switch(i=A&~(i=0|He(7,0,0|(r=3*(15-a|0)|0))),n=e&~(0|C()),A=0|Se(0|A,0|e,0|r),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(A=0|He(0|A,0,0|r),A|=i,e=0|C()|n,!(a>>>0<t>>>0)){r=1;break A}a=a+1|0}}else r=1}while(0);if(!(l>>>0<u>>>0))break;l=l+1|0}return D(0|e),0|A}function TA(A,e){var r=0,i=0,n=0,a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!(t&=15))return t=A,D(0|(a=e)),0|t;for(a=1;;){switch(r=A&~(r=0|He(7,0,0|(i=3*(15-a|0)|0))),n=e&~(0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(A=0|He(0|A,0,0|i),A|=r,e=0|C()|n,!(a>>>0<t>>>0))break;a=a+1|0}return D(0|e),0|A}function FA(A,e){A|=0;var r,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,_=0;if(r=T,T=T+16|0,v=r,He(0|(e|=0),0,52),i=134225919|C(),!e)return(0|n[A+4>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(0|n[A+8>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(0|n[A+12>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(He(0|O(A),0,45),m=0|C()|i,v=-1,D(0|m),T=r,0|v);n[v>>2]=n[A>>2],n[v+4>>2]=n[A+4>>2],n[v+8>>2]=n[A+8>>2],n[v+12>>2]=n[A+12>>2],m=v+4|0;A:do{if((0|e)>0)for(w=e,b=0|n[(k=v+8|0)>>2],d=0|n[(B=v+12|0)>>2],e=-1,s=0|n[v+4>>2];;){g=w,w=w+-1|0,A=s-d|0,a=b-d|0,1&g?(f=0|Ce(.14285714285714285*+((3*A|0)-a|0)),n[m>>2]=f,A=0|Ce(.14285714285714285*+((a<<1)+A|0)),n[k>>2]=A,n[B>>2]=0,a=A-f|0,t=0-f|0,(0|f)<0?(n[k>>2]=a,n[B>>2]=t,n[m>>2]=0,A=a,o=0):(o=f,t=0),f=o-A|0,a=t-A|0,(0|A)<0?(n[m>>2]=f,n[B>>2]=a,n[k>>2]=0,o=f,f=0):(a=t,f=A),A=o-a|0,t=f-a|0,(0|a)<0?(n[m>>2]=A,n[k>>2]=t,n[B>>2]=0,f=0):(t=f,A=o,f=a),(0|(a=(0|f)<(0|(a=(0|t)<(0|A)?t:A))?f:a))>0&&(f=f-a|0,t=t-a|0,n[m>>2]=A=A-a|0,n[k>>2]=t,n[B>>2]=f),u=(c=(0|(l=(0|(_=(l=(0|(a=(3*f|0)+A-((Q=(0|(E=t+(3*A|0)|0))<0)?E:0)-((u=(0|(c=f+(3*t|0)-(Q?E:0)|0))<0)?c:0)|0))<0)?0:a))<(0|(l=(0|(o=(u?0:c)-(l?a:0)|0))<(0|(a=(Q?0:E)-(u?c:0)-(l?a:0)|0))?o:a))?_:l))>0)?l:0,o=o-(c?l:0)|0,l=_-(c?l:0)|0,c=f):(l=0|Ce(.14285714285714285*+((A<<1)+a|0)),n[m>>2]=l,t=0|Ce(.14285714285714285*+((3*a|0)-A|0)),n[k>>2]=t,n[B>>2]=0,a=t-l|0,A=0-l|0,(0|l)<0?(n[k>>2]=a,n[B>>2]=A,n[m>>2]=0,t=a,l=0):A=0,o=l-t|0,a=A-t|0,(0|t)<0?(n[m>>2]=o,n[B>>2]=a,n[k>>2]=0,f=a,t=0):(f=A,o=l),A=o-f|0,a=t-f|0,(0|f)<0?(n[m>>2]=A,n[k>>2]=a,n[B>>2]=0,t=a,f=0):A=o,(0|(a=(0|f)<(0|(a=(0|t)<(0|A)?t:A))?f:a))>0&&(f=f-a|0,t=t-a|0,n[m>>2]=A=A-a|0,n[k>>2]=t,n[B>>2]=f),u=(c=(0|(l=(0|(Q=(l=(0|(a=(3*f|0)+t-((_=(0|(E=f+(3*A|0)|0))<0)?E:0)-((u=(0|(c=(3*t|0)+A-(_?E:0)|0))<0)?c:0)|0))<0)?0:a))<(0|(l=(0|(o=(u?0:c)-(l?a:0)|0))<(0|(a=(_?0:E)-(u?c:0)-(l?a:0)|0))?o:a))?Q:l))>0)?l:0,o=o-(c?l:0)|0,l=Q-(c?l:0)|0,c=f),l=(s=(0|(d=d-l+((f=(0|(a=s+(u-a)|0))<0)?0-a|0:0)+((o=(0|(u=b-o-(f?a:0)|0))<0)?0-u|0:0)|0))<0)?0:d,_=(o?0:u)-(s?d:0)|0,d=(d=(f?0:a)-(o?u:0)-(s?d:0)|0)-((u=(0|(s=(0|l)<(0|(s=(0|_)<(0|d)?_:d))?l:s))>0)?s:0)|0,a=e&~(a=0|He(7,0,0|(o=3*(15-g|0)|0))),f=i&~(0|C()),e=(e=(i=(0|(E=l-(u?s:0)-(E=(b=(0|d)<0)?d:0)+((Q=(0|(_=_-(u?s:0)-E|0))<0)?0-_|0:0)|0))<0)?0:E)-(_=(0|(_=(0|e)<(0|(_=(0|(i=(Q?0:_)-(E=i?E:0)|0))<(0|(E=(b?0:d)-(Q?_:0)-E|0))?i:E))?e:_))>0?_:0)|0,i=i-_|0;e:do{switch(E-_|0){case 0:switch(0|i){case 0:e=0==(0|e)?0:1==(0|e)?1:7;break e;case 1:e=0==(0|e)?2:1==(0|e)?3:7;break e;default:h=36;break e}case 1:switch(0|i){case 0:e=0==(0|e)?4:1==(0|e)?5:7;break e;case 1:if(e){h=36;break e}e=6;break e;default:h=36;break e}default:h=36}}while(0);if(36==(0|h)&&(h=0,e=7),e=0|He(0|e,0,0|o),e|=a,i=0|C()|f,(0|g)<=1)break A;b=t,d=c,s=A}else e=-1,A=0|n[m>>2]}while(0);A:do{if((0|A)<=2&&(0|n[v+8>>2])<=2&&(0|n[v+12>>2])<=2){if(e|=A=0|He(0|(a=0|O(v)),0,45),A=0|C()|-1040385&i,u=0|N(v),!(0|Y(a))){if((0|u)<=0)break;for(l=0;;){o=0|Se(0|e,0|A,52),C(),o&=15;e:do{if(o)for(f=1;;){switch(i=0|Se(0|e,0|A,0|(t=3*(15-f|0)|0)),C(),e&=~(a=0|He(7,0,0|t)),a=A&~(0|C()),7&i){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&i}if(e|=A=0|He(0|A,0,0|t),A=0|C()|a,!(f>>>0<o>>>0))break e;f=f+1|0}}while(0);if((0|(l=l+1|0))==(0|u))break A}}o=0|Se(0|e,0|A,52),C(),o&=15;e:do{if(o){i=1;r:for(;;){switch(_=0|Se(0|e,0|A,3*(15-i|0)|0),C(),7&_){case 1:break r;case 0:break;default:break e}if(!(i>>>0<o>>>0))break e;i=i+1|0}if(0|W(a,0|n[v>>2]))for(f=1;;){switch(a=e&~(a=0|He(7,0,0|(i=3*(15-f|0)|0))),t=A&~(0|C()),A=0|Se(0|e,0|A,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(e=0|He(0|A,0,0|i),e|=a,A=0|C()|t,!(f>>>0<o>>>0))break e;f=f+1|0}else for(f=1;;){switch(i=0|Se(0|e,0|A,0|(t=3*(15-f|0)|0)),C(),e&=~(a=0|He(7,0,0|t)),a=A&~(0|C()),7&i){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&i}if(e|=A=0|He(0|A,0,0|t),A=0|C()|a,!(f>>>0<o>>>0))break e;f=f+1|0}}}while(0);if((0|u)>0){i=0;do{e=0|PA(e,A),A=0|C(),i=i+1|0}while((0|i)!=(0|u))}}else e=0,A=0}while(0);return _=e,D(0|(E=A)),T=r,0|_}function LA(A){return 0|(0|(A|=0))%2}function GA(A,e,r){r|=0;var i,f,o,l,u=0,b=0,d=0,g=0,w=0;if(o=T,T=T+64|0,f=o+24|0,g=o+48|0,w=o,(e|=0)>>>0>15)return T=o,4;if(a[t>>3]=i=+a[(A|=0)>>3],2146435072==(2146435072&n[t+4>>2]|0))return T=o,3;if(a[t>>3]=u=+a[A+8>>3],2146435072==(2146435072&n[t+4>>2]|0))return T=o,3;l=(b=+c(+i))*+c(+u),b*=+s(+u),u=+s(+i),a[w>>3]=l,a[w+8>>3]=b,a[w+16>>3]=u,a[t>>3]=l;do{if(2146435072==(2146435072&n[t+4>>2]|0)||(a[t>>3]=u,A=0|n[t+4>>2],a[t>>3]=b,2146435072==(2146435072&n[t+4>>2]|0)|!0&2146435072==(2146435072&A|0)))d=2;else{if(n[f>>2]=n[w>>2],n[f+4>>2]=n[w+4>>2],n[f+8>>2]=n[w+8>>2],n[f+12>>2]=n[w+12>>2],n[f+16>>2]=n[w+16>>2],n[f+20>>2]=n[w+20>>2],uA(f,e,g),g=0|FA(g,e),w=0|C(),n[r>>2]=g,n[r+4>>2]=w,!(0==(0|g)&0==(0|w))){d=0;break}_(27634,27225,1073,27248)}}while(0);return T=o,0|d}function UA(A,e,r){var i,a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(a=4+(r|=0)|0,g=0|Se(0|(A|=0),0|(e|=0),52),C(),g&=15,d=0|Se(0|A,0|e,45),C(),t=0==(0|g),0|Y(127&d)){if(t)return 1;t=1}else{if(t)return 0;t=0==(0|n[a>>2])&&0==(0|n[r+8>>2])?0!=(0|n[r+12>>2])&1:1}for(d=r+8|0,i=r+12|0,b=1,r=0|n[a>>2],l=0|n[d>>2],o=0|n[i>>2];f=3*r|0,u=3*l|0,s=3*o|0,1&b?(n[a>>2]=c=l+f|0,n[d>>2]=o=o+u|0,n[i>>2]=f=s+r|0,r=o-c|0,l=f-c|0,(0|c)<0?(n[d>>2]=r,n[i>>2]=l,n[a>>2]=0,u=0,f=l):(r=o,u=c),l=u-r|0,o=f-r|0,(0|r)<0?(n[a>>2]=l,n[i>>2]=o,n[d>>2]=0,u=l,f=0):(o=f,f=r),r=u-o|0,l=f-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=l,n[i>>2]=0,o=0):(l=f,r=u),(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)):(c=u+r|0,n[a>>2]=u=o+f|0,n[d>>2]=c,n[i>>2]=f=s+l|0,r=c-u|0,o=f-u|0,(0|u)<0?(n[d>>2]=r,n[i>>2]=o,n[a>>2]=0,u=0,f=o):r=c,l=u-r|0,o=f-r|0,(0|r)<0?(n[a>>2]=l,n[i>>2]=o,n[d>>2]=0,u=l,f=0):(o=f,f=r),r=u-o|0,l=f-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=l,n[i>>2]=0,o=0):(l=f,r=u),(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)),f=0|Se(0|A,0|e,3*(15-b|0)|0),C(),((f&=7)-1|0)>>>0<6&&(c=0|n[22032+(12*f|0)+4>>2],s=0|n[22032+(12*f|0)+8>>2],n[a>>2]=u=(0|n[22032+(12*f|0)>>2])+r|0,n[d>>2]=l=c+l|0,n[i>>2]=r=s+o|0,o=l-u|0,f=r-u|0,(0|u)<0&&(n[d>>2]=o,n[i>>2]=f,n[a>>2]=0,u=0,r=f,l=o),f=u-l|0,o=r-l|0,(0|l)<0?(n[a>>2]=f,n[i>>2]=o,n[d>>2]=0,u=f,l=0):o=r,r=u-o|0,f=l-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=f,n[i>>2]=0,l=f,o=0):r=u,(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)),b>>>0<g>>>0;)b=b+1|0;return 0|t}function zA(A,e,r){r|=0;var i,a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(t=T,T=T+16|0,a=t,d=0|Se(0|(A|=0),0|(e|=0),45),C(),(d&=127)>>>0>121)return n[r>>2]=0,n[r+4>>2]=0,n[r+8>>2]=0,n[r+12>>2]=0,T=t,5;A:do{if(0!=(0|Y(d))&&(c=0|Se(0|A,0|e,52),C(),0!=(0|(c&=15)))){f=1;e:for(;;){switch(g=0|Se(0|A,0|e,3*(15-f|0)|0),C(),7&g){case 5:break e;case 0:break;default:b=e;break A}if(!(f>>>0<c>>>0)){b=e;break A}f=f+1|0}for(u=1,f=e;;){switch(o=A&~(o=0|He(7,0,0|(e=3*(15-u|0)|0))),l=f&~(0|C()),f=0|Se(0|A,0|f,0|e),C(),7&f){case 1:f=3;break;case 3:f=2;break;case 2:f=6;break;case 6:f=4;break;case 4:f=5;break;case 5:f=1;break;default:f&=7}if(A=0|He(0|f,0,0|e),A|=o,f=0|C()|l,!(u>>>0<c>>>0)){b=f;break A}u=u+1|0}}else b=e}while(0);if(n[r>>2]=n[(g=7696+(28*d|0)|0)>>2],n[r+4>>2]=n[g+4>>2],n[r+8>>2]=n[g+8>>2],n[r+12>>2]=n[g+12>>2],!(0|UA(A,b,r)))return T=t,0;if(n[a>>2]=n[(g=r+4|0)>>2],n[a+4>>2]=n[g+4>>2],n[a+8>>2]=n[g+8>>2],s=0|Se(0|A,0|b,52),C(),i=15&s,1&s?(f=(3*(o=0|n[(c=r+8|0)>>2])|0)+(l=0|n[g>>2])|0,n[g>>2]=l=(e=0|n[(s=r+12|0)>>2])+(3*l|0)|0,n[c>>2]=f,n[s>>2]=o=(3*e|0)+o|0,e=f-l|0,u=o-l|0,(0|l)<0&&(n[c>>2]=e,n[s>>2]=u,n[g>>2]=0,f=e,l=0,o=u),u=l-f|0,e=o-f|0,(0|f)<0?(n[g>>2]=u,n[s>>2]=e,n[c>>2]=0,f=0):(e=o,u=l),l=u-e|0,o=f-e|0,(0|e)<0?(n[g>>2]=l,n[c>>2]=o,n[s>>2]=0,e=0):(o=f,l=u),(0|(f=(0|e)<(0|(f=(0|o)<(0|l)?o:l))?e:f))>0&&(n[g>>2]=l-f,n[c>>2]=o-f,n[s>>2]=e-f),o=i+1|0):o=i,0|Y(d)){A:do{if(i)for(e=1;;){if(f=0|Se(0|A,0|b,3*(15-e|0)|0),C(),0|(f&=7))break A;if(!(e>>>0<i>>>0)){f=0;break}e=e+1|0}else f=0}while(0);f=4==(0|f)&1}else f=0;if(0|gA(r,o,f,0)){if(0|Y(d))do{}while(0!=(0|gA(r,o,0,0)));(0|o)!=(0|i)&&(e=0|Ce(.14285714285714285*+(((f=(0|n[g>>2])-(A=0|n[(c=r+12|0)>>2])|0)<<1)+(A=(0|n[(u=r+8|0)>>2])-A|0)|0)),n[g>>2]=e,f=0|Ce(.14285714285714285*+((3*A|0)-f|0)),n[u>>2]=f,n[c>>2]=0,A=f-e|0,o=0-e|0,(0|e)<0?(n[u>>2]=A,n[c>>2]=o,n[g>>2]=0,f=A,e=0):o=0,l=e-f|0,A=o-f|0,(0|f)<0?(n[g>>2]=l,n[c>>2]=A,n[u>>2]=0,e=l,f=0):A=o,l=e-A|0,o=f-A|0,(0|A)<0?(n[g>>2]=l,n[u>>2]=o,n[c>>2]=0,e=l,A=0):o=f,(0|(f=(0|A)<(0|(f=(0|o)<(0|e)?o:e))?A:f))>0&&(n[g>>2]=e-f,n[u>>2]=o-f,n[c>>2]=A-f))}else(0|o)!=(0|i)&&(n[g>>2]=n[a>>2],n[g+4>>2]=n[a+4>>2],n[g+8>>2]=n[a+8>>2]);return T=t,0}function xA(A,e,r){r|=0;var i,n,t,f=0,o=0,l=0;return t=T,T=T+48|0,n=t,(f=0|zA(A|=0,e|=0,i=t+24|0))?(T=t,0|f):(f=0|Se(0|A,0|e,52),C(),cA(i,15&f,n),l=+g(+ +a[n+16>>3]),o=+k(+ +a[n+8>>3],+ +a[n>>3]),a[r>>3]=l,a[r+8>>3]=o,T=t,0|(f=0))}function VA(A,e,r){r|=0;var i,n,a=0,t=0;if(i=T,T=T+16|0,0|(a=0|zA(A|=0,e|=0,n=i)))return T=i,0|a;a=0|Se(0|A,0|e,45),C(),a=0==(0|Y(127&a)),t=0|Se(0|A,0|e,52),C(),t&=15;A:do{if(!a){if(0|t)for(a=1;;){if(!(0==((0|He(7,0,3*(15-a|0)|0))&A|0)&0==((0|C())&e|0)))break A;if(!(a>>>0<t>>>0))break;a=a+1|0}return bA(n,t,0,5,r),T=i,0}}while(0);return kA(n,t,0,6,r),T=i,0}function SA(A,e){e|=0;var r,i=0,a=0,t=0,f=0,o=0,l=0;if((A|=0)>>>0>15)return 4;if(He(0|A,0,52),r=134225919|C(),!A){i=0,a=0;do{0|Y(a)&&(He(0|a,0,45),o=0|r|C(),n[(A=e+(i<<3)|0)>>2]=-1,n[A+4>>2]=o,i=i+1|0),a=a+1|0}while(122!=(0|a));return 0}i=0,o=0;do{if(0|Y(o)){for(He(0|o,0,45),a=1,t=-1,f=0|r|C();t&=~(l=0|He(7,0,3*(15-a|0)|0)),f&=~(0|C()),(0|a)!=(0|A);)a=a+1|0;n[(l=e+(i<<3)|0)>>2]=t,n[l+4>>2]=f,i=i+1|0}o=o+1|0}while(122!=(0|o));return 0}function HA(A,e,r,i){A|=0,i|=0;var a=0,t=0,f=0;a=0|Se(0|(e|=0),0|(r|=0),52),C(),0==(0|e)&0==(0|r)|(0|i)>15|(0|(a&=15))>(0|i)?(t=-1,e=-1,r=0,a=0):(e=0|_A(e,r,a+1|0,i),f=-15728641&(0|C()),r=0|He(0|i,0,52),t=a,e=(e=0==(0|CA(r|=e,f=0|f|C())))?-1:i,a=f),n[(f=A)>>2]=r,n[f+4>>2]=a,n[A+8>>2]=t,n[A+12>>2]=e}function RA(A,e,r,i){r|=0,i|=0;var a=0,t=0;return a=0|Se(0|(A|=0),0|(e|=0),52),C(),n[(t=i+8|0)>>2]=a&=15,0==(0|A)&0==(0|e)|(0|r)>15|(0|a)>(0|r)?(n[(r=i)>>2]=0,n[r+4>>2]=0,n[t>>2]=-1,void(n[i+12>>2]=-1)):(A=0|_A(A,e,a+1|0,r),t=-15728641&(0|C()),a=0|He(0|r,0,52),a|=A,t=0|t|C(),n[(A=i)>>2]=a,n[A+4>>2]=t,A=i+12|0,0|CA(a,t)?void(n[A>>2]=r):void(n[A>>2]=-1))}function YA(A){var e,r=0,i=0,a=0,t=0,f=0,o=0,l=0,u=0;if(!(0==(0|(r=0|n[(i=A|=0)>>2]))&0==(0|(i=0|n[i+4>>2]))||(a=0|Se(0|r,0|i,52),C(),r=0|pe(0|(l=0|He(1,0,3*(15^(a&=15))|0)),0|C(),0|r,0|i),i=0|C(),n[(l=A)>>2]=r,n[l+4>>2]=i,(0|a)<(0|(o=0|n[(l=A+8|0)>>2]))))){for(e=A+12|0,f=a;;){if((0|f)==(0|o)){a=5;break}if(u=(0|f)==(0|n[e>>2]),a=0|Se(0|r,0|i,0|(t=3*(15-f|0)|0)),C(),u&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(r=0|pe(0|r,0|i,0|(u=0|He(1,0,0|t)),0|C()),i=0|C(),n[(u=A)>>2]=r,n[u+4>>2]=i,!((0|f)>(0|o))){a=10;break}f=f+-1|0}if(5==(0|a))return n[(u=A)>>2]=0,n[u+4>>2]=0,n[l>>2]=-1,void(n[e>>2]=-1);if(7==(0|a))return o=0|pe(0|r,0|i,0|(o=0|He(1,0,0|t)),0|C()),l=0|C(),n[(u=A)>>2]=o,n[u+4>>2]=l,void(n[e>>2]=f+-1)}}function jA(A){var e;return e=(A=+A)<0?A+6.283185307179586:A,+(A>=6.283185307179586?e+-6.283185307179586:e)}function OA(A,e){switch(A=+A,0|(e|=0)){case 1:A=A<0?A+6.283185307179586:A;break;case 2:A=A>0?A+-6.283185307179586:A}return+A}function NA(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))*6371.007180918475}function WA(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20624+(A<<3)>>3],0|(e=0))}function ZA(A,e){e|=0;var r=0;return(A|=0)>>>0>15?0|(e=4):(r=0|Ue(0|(r=0|$A(7,0,A,((0|A)<0)<<31>>31)),0|C(),120,0),A=0|C(),n[e>>2]=2|r,n[e+4>>2]=A,0|(e=0))}function JA(A,e,r,a,t){r|=0,a|=0,t|=0;var f,o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0;if(f=T,T=T+16|0,o=f,d=0|Se(0|(A|=0),0|(e|=0),52),C(),d&=15,k=0|Se(0|r,0|a,52),C(),(0|d)!=(15&k|0))return T=f,12;if(s=0|Se(0|A,0|e,45),C(),s&=127,b=0|Se(0|r,0|a,45),C(),s>>>0>121|(b&=127)>>>0>121)return T=f,5;if(k=(0|s)!=(0|b)){if(7==(0|(u=0|J(s,b))))return T=f,1;7==(0|(c=0|J(b,s)))?_(27291,27315,164,27325):(h=u,l=c)}else h=0,l=0;g=0|Y(s),w=0|Y(b),n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,n[o+12>>2]=0;do{if(h){u=(0|(b=0|n[4272+(28*s|0)+(h<<2)>>2]))>0;A:do{if(w)if(u)for(s=0,c=r,u=a;;){switch(c=0|pA(c,u),u=0|C(),0|l){case 5:case 1:l=3;break;case 3:l=2;break;case 2:l=6;break;case 6:l=4;break;case 4:l=5}if((0|(s=s+1|0))==(0|b)){b=l,s=c,c=u;break A}}else b=l,s=r,c=a;else if(u)for(s=0,c=r,u=a;;){switch(c=0|TA(c,u),u=0|C(),0|l){case 1:l=3;break;case 3:l=2;break;case 2:l=6;break;case 6:l=4;break;case 4:l=5;break;case 5:l=1}if((0|(s=s+1|0))==(0|b)){b=l,s=c,c=u;break A}}else b=l,s=r,c=a}while(0);if(UA(s,c,o),k||_(27340,27315,194,27325),(u=0!=(0|g))&(l=0!=(0|w))&&_(27367,27315,195,27325),u){if(7==(0|(l=0|MA(A,e)))){l=5;break}if(0|i[21968+(7*l|0)+h>>0]){l=1;break}k=w=0|n[21136+(28*l|0)+(h<<2)>>2]}else if(l){if(7==(0|(l=0|MA(s,c)))){l=5;break}if(0|i[21968+(7*l|0)+b>>0]){l=1;break}k=0,w=0|n[21136+(28*b|0)+(l<<2)>>2]}else k=0,w=0;if((k|w|0)>=0){if((0|w)>0){b=0,c=0|n[(r=o+4|0)>>2],u=0|n[(a=o+8|0)>>2],l=0|n[(g=o+12|0)>>2];do{(0|(s=(0|(l=(m=(0|(c=l+c-(m=(e=(0|(B=u+c|0))<0)?B:0)-(s=(A=(0|(u=l+u-m|0))<0)?u:0)|0))<0)?0:c))<(0|(s=(0|(u=(A?0:u)-(c=m?c:0)|0))<(0|(c=(e?0:B)-s-c|0))?u:c))?l:s))>0&&(c=c-s|0,u=u-s|0,l=l-s|0),b=b+1|0}while((0|b)!=(0|w));n[r>>2]=c,n[a>>2]=u,n[g>>2]=l}if((h+-1|0)>>>0<6?(l=(l=0|n[22032+(12*h|0)>>2])-(u=(0|(u=(0|(m=0|n[22032+(12*h|0)+8>>2]))<(0|(u=(0|(c=0|n[22032+(12*h|0)+4>>2]))<(0|l)?c:l))?m:u))>0?u:0)|0,c=c-u|0,u=m-u|0):(l=0,c=0,u=0),d)for(;;){if(s=3*l|0,b=3*c|0,r=3*u|0,0|LA(d)?(l=(m=(0|(u=(0|(h=(u=(0|(c=l+r-((A=(0|(e=s+c|0))<0)?e:0)-((B=(0|(m=b+u-(A?e:0)|0))<0)?m:0)|0))<0)?0:c))<(0|(u=(0|(s=(B?0:m)-(u?c:0)|0))<(0|(c=(A?0:e)-(B?m:0)-(u?c:0)|0))?s:c))?h:u))>0)?u:0,s=s-(m?u:0)|0,u=h-(m?u:0)|0):(l=(m=(0|(u=(0|(h=(u=(0|(c=r+c-((e=(0|(B=s+u|0))<0)?B:0)-((l=(0|(m=b+l-(e?B:0)|0))<0)?m:0)|0))<0)?0:c))<(0|(u=(0|(s=(l?0:m)-(u?c:0)|0))<(0|(c=(e?0:B)-(l?m:0)-(u?c:0)|0))?s:c))?h:u))>0)?u:0,s=s-(m?u:0)|0,u=h-(m?u:0)|0),l=c-l|0,!((0|d)>1)){c=s;break}d=d+-1|0,c=s}if((0|k)>0){s=0;do{u=(u=(l=(0|(h=l+u-((A=(0|(e=l+c|0))<0)?e:0)-((B=(0|(m=c+u-(A?e:0)|0))<0)?m:0)|0))<0)?0:h)-((m=(0|(l=(0|u)<(0|(l=(0|(c=(B?0:m)-(l?h:0)|0))<(0|(h=(A?0:e)-(B?m:0)-(l?h:0)|0))?c:h))?u:l))>0)?l:0)|0,c=c-(m?l:0)|0,l=h-(m?l:0)|0,s=s+1|0}while((0|s)!=(0|k))}h=0|n[(d=o+8|0)>>2],m=0|n[(a=o+12|0)>>2],n[(r=o+4|0)>>2]=s=(0|n[r>>2])+l|0,n[d>>2]=c=h+c|0,n[a>>2]=l=m+u|0,u=c-s|0,(0|s)<0?(l=l-s|0,n[d>>2]=u,n[a>>2]=l,n[r>>2]=0,c=0):(u=c,c=s),(0|u)<0&&(n[r>>2]=c=c-u|0,n[a>>2]=l=l-u|0,n[d>>2]=0,u=0),b=c-l|0,s=u-l|0,(0|l)<0?(n[r>>2]=b,n[d>>2]=s,n[a>>2]=0,c=b,l=0):s=u,(0|(u=(0|l)<(0|(u=(0|s)<(0|c)?s:c))?l:u))>0?(n[r>>2]=c-u,n[d>>2]=s-u,n[a>>2]=l-u,B=77):B=77}else l=5}else if(UA(r,a,o),0!=(0|g)&0!=(0|w))if((0|b)!=(0|s)&&_(27398,27315,264,27325),7==(0|(u=0|MA(A,e)))|7==(0|(l=0|MA(r,a))))l=5;else if(0|i[21968+(7*u|0)+l>>0])l=1;else if((0|(r=0|n[21136+(28*u|0)+(l<<2)>>2]))>0){b=0,c=0|n[(d=o+4|0)>>2],u=0|n[(a=o+8|0)>>2],l=0|n[(g=o+12|0)>>2];do{(0|(s=(0|(l=(A=(0|(c=l+c-(A=(B=(0|(h=u+c|0))<0)?h:0)-(s=(e=(0|(u=l+u-A|0))<0)?u:0)|0))<0)?0:c))<(0|(s=(0|(u=(e?0:u)-(c=A?c:0)|0))<(0|(c=(B?0:h)-s-c|0))?u:c))?l:s))>0&&(c=c-s|0,u=u-s|0,l=l-s|0),b=b+1|0}while((0|b)!=(0|r));n[d>>2]=c,n[a>>2]=u,n[g>>2]=l,B=77}else B=77;else B=77}while(0);return 77==(0|B)&&(n[t>>2]=n[(l=o+4|0)>>2],n[t+4>>2]=n[l+4>>2],n[t+8>>2]=n[l+8>>2],l=0),T=f,0|l}function KA(A,e,r,i){r|=0,i|=0;var a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),t&=15,v=0|Se(0|A,0|e,45),C(),(v&=127)>>>0>121)return 5;if(k=0|Y(v),He(0|t,0,52),o=134225919|C(),n[(f=i)>>2]=-1,n[f+4>>2]=o,f=0|n[r>>2],o=0|n[r+4>>2],r=0|n[r+8>>2],!t){a=(a=(r=(0|(B=r-(B=(e=(0|f)<0)?f:0)+((k=(0|(m=o-B|0))<0)?0-m|0:0)|0))<0)?0:B)-(m=(0|(m=(0|a)<(0|(m=(0|(r=(k?0:m)-(B=r?B:0)|0))<(0|(B=(e?0:f)-(k?m:0)-B|0))?r:B))?a:m))>0?m:0)|0,r=r-m|0;A:do{switch(B-m|0){case 0:switch(0|r){case 0:if(a){a=1==(0|a)?1:7,h=11;break A}a=0;break A;case 1:if(a){a=1==(0|a)?3:7,h=11;break A}a=2;break A;default:return 1}case 1:switch(0|r){case 0:if(a){a=1==(0|a)?5:7,h=11;break A}a=4;break A;case 1:if(!a){a=6;break A}return 1;default:return 1}default:return 1}}while(0);return 11==(0|h)&&7==(0|a)?0|(i=1):127==(0|(a=0|Z(v,a)))?0|(i=1):(m=0|He(0|a,0,45),v=0|C(),v|=-1040385&n[(h=i)+4>>2],n[i>>2]=n[h>>2]|m,n[i+4>>2]=v,0|(i=0))}for(;;){if(w=t,t=t+-1|0,l=(g=f-r|0)>>>0>715827881|(d=o-r|0)>>>0>715827881,0|LA(w)){if(l){if(s=2147483647-g|0,b=-2147483648-g|0,(c=(0|g)>0)?(0|s)<(0|g):(0|b)>(0|g)){a=1,h=107;break}if(y=g<<1,c?(2147483647-y|0)<(0|g):(-2147483648-y|0)>(0|g)){a=1,h=107;break}if((0|d)>0?(2147483647-d|0)<(0|d):(-2147483648-d|0)>(0|d)){a=1,h=107;break}if(l=3*g|0,u=d<<1,(c?(0|s)<(0|u):(0|b)>(0|u))||((0|g)>-1?(-2147483648|l|0)>=(0|d):(-2147483648^l|0)<(0|d))){a=1,h=107;break}}else l=3*g|0,u=d<<1;if(s=0|Ce(.14285714285714285*+(l-d|0)),l=(u=(0|(c=0|Ce(.14285714285714285*+(u+g|0))))<(0|s))?s:c,(0|(u=u?c:s))<0){if(-2147483648==(0|u)||((0|l)>0?(2147483647-l|0)<(0|u):(-2147483648-l|0)>(0|u))){h=24;break}if((0|l)>-1?(-2147483648|l|0)>=(0|u):(-2147483648^l|0)<(0|u)){h=24;break}}b=((b=(0|s)<0)?0:s)-((E=(0|(d=c-(b?s:0)|0))<0)?d:0)-((g=(0|(Q=(b?0-s|0:0)-(E?d:0)|0))<0)?Q:0)|0,d=(E?0:d)-(g?Q:0)|0,b=b-((E=(0|(g=(0|(Q=g?0:Q))<(0|(g=(0|d)<(0|b)?d:b))?Q:g))>0)?g:0)|0,d=d-(E?g:0)|0,l=(y=(0|(c=(0|(D=(c=(0|(s=(3*(g=Q-(E?g:0)|0)|0)+b-((Q=(0|(E=(3*b|0)+d|0))<0)?E:0)-((l=(0|(y=(3*d|0)+g-(Q?E:0)|0))<0)?y:0)|0))<0)?0:s))<(0|(c=(0|(u=(l?0:y)-(c?s:0)|0))<(0|(s=(Q?0:E)-(l?y:0)-(c?s:0)|0))?u:s))?D:c))>0)?c:0,u=u-(y?c:0)|0,c=D-(y?c:0)|0}else{if(l){if((u=(0|g)>0)?(2147483647-g|0)<(0|g):(-2147483648-g|0)>(0|g)){a=1,h=107;break}if(l=g<<1,(c=(0|d)>0)?(2147483647-d|0)<(0|d):(-2147483648-d|0)>(0|d)){a=1,h=107;break}if(b=d<<1,c?(2147483647-b|0)<(0|d):(-2147483648-b|0)>(0|d)){a=1,h=107;break}if(u?(2147483647-l|0)<(0|d):(-2147483648-l|0)>(0|d)){a=1,h=107;break}if(u=3*d|0,(0|d)>-1?(-2147483648|u|0)>=(0|g):(-2147483648^u|0)<(0|g)){a=1,h=107;break}}else l=g<<1,u=3*d|0;if(s=0|Ce(.14285714285714285*+(l+d|0)),l=(u=(0|(c=0|Ce(.14285714285714285*+(u-g|0))))<(0|s))?s:c,(0|(u=u?c:s))<0){if(-2147483648==(0|u)||((0|l)>0?(2147483647-l|0)<(0|u):(-2147483648-l|0)>(0|u))){h=36;break}if((0|l)>-1?(-2147483648|l|0)>=(0|u):(-2147483648^l|0)<(0|u)){h=36;break}}b=((b=(0|s)<0)?0:s)-((D=(0|(d=c-(b?s:0)|0))<0)?d:0)-((g=(0|(y=(b?0-s|0:0)-(D?d:0)|0))<0)?y:0)|0,d=(D?0:d)-(g?y:0)|0,b=b-((D=(0|(g=(0|(y=g?0:y))<(0|(g=(0|d)<(0|b)?d:b))?y:g))>0)?g:0)|0,d=d-(D?g:0)|0,l=(Q=(0|(c=(0|(E=(c=(0|(s=(3*(g=y-(D?g:0)|0)|0)+d-((y=(0|(D=(3*b|0)+g|0))<0)?D:0)-((l=(0|(Q=(3*d|0)+b-(y?D:0)|0))<0)?Q:0)|0))<0)?0:s))<(0|(c=(0|(u=(l?0:Q)-(c?s:0)|0))<(0|(s=(y?0:D)-(l?Q:0)-(c?s:0)|0))?u:s))?E:c))>0)?c:0,u=u-(Q?c:0)|0,c=E-(Q?c:0)|0}c=(f=(0|(Q=r-c+((D=(0|(l=f+(l-s)|0))<0)?0-l|0:0)+((s=(0|(u=o-u-(D?l:0)|0))<0)?0-u|0:0)|0))<0)?0:Q,y=(s?0:u)-(f?Q:0)|0,Q=(Q=(D?0:l)-(s?u:0)-(f?Q:0)|0)-((r=(0|(f=(0|c)<(0|(f=(0|y)<(0|Q)?y:Q))?c:f))>0)?f:0)|0,s=0|n[(u=i)>>2],u=0|n[u+4>>2],l=s&~(l=0|He(7,0,0|(o=3*(15-w|0)|0))),u&=~(0|C()),r=(r=(f=(0|(D=c-(r?f:0)-(D=(s=(0|Q)<0)?Q:0)+((E=(0|(y=y-(r?f:0)-D|0))<0)?0-y|0:0)|0))<0)?0:D)-(y=(0|(y=(0|r)<(0|(y=(0|(f=(E?0:y)-(D=f?D:0)|0))<(0|(D=(s?0:Q)-(E?y:0)-D|0))?f:D))?r:y))>0?y:0)|0,f=f-y|0;A:do{switch(D-y|0){case 0:switch(0|f){case 0:r=0==(0|r)?0:1==(0|r)?1:7;break A;case 1:r=0==(0|r)?2:1==(0|r)?3:7;break A;default:h=45;break A}case 1:switch(0|f){case 0:r=0==(0|r)?4:1==(0|r)?5:7;break A;case 1:if(r){h=45;break A}r=6;break A;default:h=45;break A}default:h=45}}while(0);if(45==(0|h)&&(h=0,r=7),E=0|He(0|r,0,0|o),D=0|C()|u,n[(y=i)>>2]=E|l,n[y+4>>2]=D,(0|w)<=1){h=47;break}f=b,o=d,r=g}if(24==(0|h))_(27634,27425,416,27447);else if(36==(0|h))_(27634,27425,464,27461);else{if(47==(0|h)){if((0|b)>1|(0|d)>1|(0|g)>1)return 1;r=(r=(t=(0|(D=g-(D=(Q=(0|b)<0)?b:0)+((E=(0|(y=d-D|0))<0)?0-y|0:0)|0))<0)?0:D)-(y=(0|(y=(0|r)<(0|(y=(0|(t=(E?0:y)-(D=t?D:0)|0))<(0|(D=(Q?0:b)-(E?y:0)-D|0))?t:D))?r:y))>0?y:0)|0,t=t-y|0;A:do{switch(D-y|0){case 0:switch(0|t){case 0:t=0==(0|r)?0:1==(0|r)?1:7;break A;case 1:t=0==(0|r)?2:1==(0|r)?3:7;break A;default:h=55;break A}case 1:switch(0|t){case 0:t=0==(0|r)?4:1==(0|r)?5:7;break A;case 1:if(r){h=55;break A}t=6;break A;default:h=55;break A}default:h=55}}while(0);55==(0|h)&&(t=7),u=127==(0|(o=0|Z(v,t)))?0:0|Y(o);A:do{if(t){if(k){if(7==(0|(r=0|MA(A,e))))return 5;f=0|n[21344+(28*r|0)+(t<<2)>>2];e:do{if((0|f)>0)for(r=t,t=0;;){switch(0|r){case 1:r=5;break;case 5:r=4;break;case 4:r=6;break;case 6:r=2;break;case 2:r=3;break;case 3:r=1}if((0|(t=t+1|0))==(0|f))break e}else r=t}while(0);if(1==(0|r))return 9;127==(0|(t=0|Z(v,r)))&&_(27476,27315,415,27506),0|Y(t)?_(27521,27315,416,27506):(a=t,m=f,B=r)}else a=o,m=0,B=t;if((0|(l=0|n[4272+(28*v|0)+(B<<2)>>2]))<=-1&&_(27552,27315,423,27506),!u){if((0|m)<0)return 5;if(0|m){r=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];do{t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,r=r+1|0}while((0|r)<(0|m))}if((0|l)<=0){h=104;break}for(r=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];;)if(t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,(0|(r=r+1|0))==(0|l)){h=104;break A}}if(7==(0|(o=0|J(a,v)))&&_(27291,27315,432,27506),t=0|n[(r=i)>>2],r=0|n[r+4>>2],(0|l)>0){f=0;do{t=0|IA(t,r),r=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=r,f=f+1|0}while((0|f)!=(0|l))}if(7==(0|(r=0|MA(t,r)))&&_(27634,27315,444,27506),t=0|j(a),(0|(t=0|n[(t?21760:21552)+(28*o|0)+(r<<2)>>2]))<0&&_(27634,27315,458,27506),t){r=0,f=0|n[(o=i)>>2],o=0|n[o+4>>2];do{f=0|PA(f,o),o=0|C(),n[(y=i)>>2]=f,n[y+4>>2]=o,r=r+1|0}while((0|r)<(0|t));h=104}else h=104}else if(0!=(0|k)&0!=(0|u)){if(7==(0|(a=0|MA(A,e)))|7==(0|(r=0|MA(0|n[(r=i)>>2],0|n[r+4>>2]))))return 5;if((0|(r=0|n[21344+(28*a|0)+(r<<2)>>2]))<0)return 5;if(r){a=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];do{t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,a=a+1|0}while((0|a)<(0|r));a=o,h=104}else a=o,h=105}else a=o,h=104}while(0);return 104==(0|h)&&u&&(h=105),105==(0|h)&&1==(0|MA(0|n[(y=i)>>2],0|n[y+4>>2]))?0|(y=9):(Q=0|n[(D=i)>>2],D=-1040385&n[D+4>>2],E=0|He(0|a,0,45),D=0|D|C(),n[(y=i)>>2]=Q|E,n[y+4>>2]=D,0|(y=0))}if(107==(0|h))return 0|a}return 0}function XA(A,e,r,i,a){r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0;return t=T,T=T+32|0,u=t,0|(o=0|JA(A|=0,e|=0,A,e,l=t+12|0))?(T=t,0|(u=o)):0|(A=0|JA(A,e,r,i,u))?(T=t,0|(u=A)):(l=(l=(o=(0|(i=(0|n[l+8>>2])-(0|n[u+8>>2])+(i=(f=(0|(A=(0|n[l>>2])-(0|n[u>>2])|0))<0)?0-A|0:0)+((e=(0|(r=i+((0|n[l+4>>2])-(0|n[u+4>>2]))|0))<0)?0-r|0:0)|0))<0)?0:i)-(u=(0|(u=(0|l)<(0|(u=(0|(o=(e?0:r)-(i=o?i:0)|0))<(0|(i=(f?0:A)-(e?r:0)-i|0))?o:i))?l:u))>0?u:0)|0,o=o-u|0,l=(0|(u=(0|(u=i-u|0))>-1?u:0-u|0))>(0|(l=(0|(o=(0|o)>-1?o:0-o|0))>(0|(l=(0|l)>-1?l:0-l|0))?o:l))?u:l,n[(u=a)>>2]=l,n[u+4>>2]=((0|l)<0)<<31>>31,T=t,0|(u=0))}function qA(A,e,r,i,a,t,f,o,u,c,s){A|=0,e|=0,r|=0,i|=0,a|=0,t|=0,f|=0,o|=0,u|=0,c|=0,s|=0;var b,d,g,w,k,B,h,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,F=0;if(h=T,T=T+48|0,v=h+12|0,B=h,n[(m=h+24|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,0|JA(A,e,A,e,m)&&_(27634,27315,696,27575),0|JA(A,e,r,i,v)&&_(27634,27315,701,27575),n[m>>2]=r=(i=0|n[(D=m+8|0)>>2])-(0|n[m>>2])|0,n[(p=m+4|0)>>2]=i=(0|n[p>>2])-i|0,n[D>>2]=m=0-(p=i+r|0)|0,n[v>>2]=y=(M=0|n[(D=v+8|0)>>2])-(0|n[v>>2])|0,n[(I=v+4|0)>>2]=M=(0|n[I>>2])-M|0,n[D>>2]=0-(I=M+y|0),w=(P=1/(+(a>>>0)+4294967296*+(0|t)))*+(y-r|0),k=P*+(M-i|0),P*=+(p-I|0),n[B>>2]=r,n[(I=B+4|0)>>2]=i,n[(p=B+8|0)>>2]=m,(0|t)<0)return T=h,0;for(g=+(0|r),d=+(0|i),b=+(0|m),y=0,M=0;;){if(F=w*(E=+(y>>>0)+4294967296*+(0|M))+g,Q=k*E+d,E=P*E+b,i=~~+Oe(+F),m=~~+Oe(+Q),r=~~+Oe(+E),(F=+l(+(+(0|i)-F)))>(Q=+l(+(+(0|m)-Q)))&F>(E=+l(+(+(0|r)-E)))?i=0-(v=r+m|0)|0:(v=0-i|0,Q>E&&(m=v-r|0)),n[I>>2]=m,n[B>>2]=v,n[p>>2]=0,r=i+m|0,(0|i)>0?(n[I>>2]=r,n[p>>2]=i,n[B>>2]=0,v=0):(r=m,i=0),(0|r)<0?(n[B>>2]=m=v-r|0,n[p>>2]=i=i-r|0,n[I>>2]=0,v=m-i|0,r=0-i|0,(0|i)<0?(n[B>>2]=v,n[I>>2]=r,n[p>>2]=0,D=r,i=0):(D=0,v=m)):D=r,(0|(r=(0|i)<(0|(r=(0|D)<(0|v)?D:v))?i:r))>0&&(n[B>>2]=v-r,n[I>>2]=D-r,n[p>>2]=i-r),r=0|pe(0|(r=0|Ue(0|y,0|M,0|c,0|s)),0|C(),0|o,0|u),C(),0|(r=0|KA(A,e,B,f+(r<<3)|0))){i=20;break}if(D=y,y=0|pe(0|y,0|M,1,0),v=M,M=0|C(),!((0|v)<(0|t)|(0|v)==(0|t)&D>>>0<a>>>0)){r=0,i=20;break}}return 20==(0|i)?(T=h,0|r):0}function $A(A,e,r,i){A|=0,e|=0;var n=0,a=0,t=0;if(0==(0|(r|=0))&0==(0|(i|=0)))return a=1,D(0|(n=0)),0|a;a=A,n=e,A=1,e=0;do{A=0|Ue(0|((t=0==(1&r|0)&!0)?1:a),0|(t?0:n),0|A,0|e),e=0|C(),r=0|Ve(0|r,0|i,1),i=0|C(),a=0|Ue(0|a,0|n,0|a,0|n),n=0|C()}while(!(0==(0|r)&0==(0|i)));return D(0|e),0|A}function Ae(A,e,r,i){r|=0,i|=0;var t,f=0,o=0,l=0,u=0,s=0,b=0;t=T,T=T+16|0,o=t,l=0|Se(0|(A|=0),0|(e|=0),52),C(),l&=15;do{if(l){if(!(f=0|xA(A,e,o))){u=1/+c(+(s=+a[o>>3])),a[r>>3]=s+(b=+a[26032+(l<<3)>>3]),a[r+8>>3]=s-b,a[r+16>>3]=(u*=b)+(s=+a[o+8>>3]),a[r+24>>3]=s-u;break}return T=t,0|f}if(f=0|Se(0|A,0|e,45),C(),(f&=127)>>>0>121)return T=t,5;n[r>>2]=n[(o=22128+(f<<5)|0)>>2],n[r+4>>2]=n[o+4>>2],n[r+8>>2]=n[o+8>>2],n[r+12>>2]=n[o+12>>2],n[r+16>>2]=n[o+16>>2],n[r+20>>2]=n[o+20>>2],n[r+24>>2]=n[o+24>>2],n[r+28>>2]=n[o+28>>2];break}while(0);return function(A,e){var r,i,n,t,f,o,l,u=0,c=0;u=(t=+a[(n=16+(A|=0)|0)>>3])-(i=+a[(r=A+24|0)>>3]),c=+a[A>>3],u=.5*((u=t<i?u+6.283185307179586:u)*(e=+e)-u),a[A>>3]=(c+=e=.5*((l=c-(o=+a[(f=A+8|0)>>3]))*e-l))>1.5707963267948966?1.5707963267948966:c,a[f>>3]=(e=o-e)<-1.5707963267948966?-1.5707963267948966:e,a[n>>3]=(e=(e=t+u)>3.141592653589793?e+-6.283185307179586:e)<-3.141592653589793?e+6.283185307179586:e,a[r>>3]=(e=(e=i-u)>3.141592653589793?e+-6.283185307179586:e)<-3.141592653589793?e+6.283185307179586:e}(r,i?1.4:1.1),(0|n[(i=26160+(l<<3)|0)>>2])==(0|A)&&(0|n[i+4>>2])==(0|e)&&(a[r>>3]=1.5707963267948966),(0|n[(l=26288+(l<<3)|0)>>2])==(0|A)&&(0|n[l+4>>2])==(0|e)&&(a[r+8>>3]=-1.5707963267948966),1.5707963267948966!=+a[r>>3]&&-1.5707963267948966!=+a[r+8>>3]?(T=t,0|(l=0)):(a[r+16>>3]=3.141592653589793,a[r+24>>3]=-3.141592653589793,T=t,0|(l=0))}function ee(A,e,r,a){A|=0,e|=0,r|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0;o=T,T=T+48|0,t=o+40|0,f=o,QA(u=o+32|0,0,0,0),c=0|n[u>>2],u=0|n[u+4>>2];do{if(r>>>0<=15){if(0|(l=0|te(a))){n[(a=f)>>2]=0,n[a+4>>2]=0,n[f+8>>2]=l,n[f+12>>2]=-1,c=f+29|0,n[(a=f+16|0)>>2]=0,n[a+4>>2]=0,n[a+8>>2]=0,i[a+12>>0]=0,i[c>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}if(l=0|Me(1+(0|n[e+8>>2])|0,32)){fe(e,l),n[(s=f)>>2]=c,n[s+4>>2]=u,n[f+8>>2]=0,n[f+12>>2]=r,n[f+16>>2]=a,n[f+20>>2]=e,n[f+24>>2]=l,i[f+28>>0]=0,i[(c=f+29|0)>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}n[(a=f)>>2]=0,n[a+4>>2]=0,n[f+8>>2]=13,n[f+12>>2]=-1,c=f+29|0,n[(a=f+16|0)>>2]=0,n[a+4>>2]=0,n[a+8>>2]=0,i[a+12>>0]=0,i[c>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}n[(c=f)>>2]=0,n[c+4>>2]=0,n[f+8>>2]=4,n[f+12>>2]=-1,s=f+29|0,n[(c=f+16|0)>>2]=0,n[c+4>>2]=0,n[c+8>>2]=0,i[c+12>>0]=0,i[s>>0]=0|i[t>>0],i[s+1>>0]=0|i[t+1>>0],i[s+2>>0]=0|i[t+2>>0]}while(0);re(f),n[A>>2]=n[f>>2],n[A+4>>2]=n[f+4>>2],n[A+8>>2]=n[f+8>>2],n[A+12>>2]=n[f+12>>2],n[A+16>>2]=n[f+16>>2],n[A+20>>2]=n[f+20>>2],n[A+24>>2]=n[f+24>>2],n[A+28>>2]=n[f+28>>2],T=o}function re(A){var e,r,a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0;if(t=T,T=T+336|0,e=t+168|0,r=t,0==(0|(o=0|n[(l=A|=0)>>2]))&0==(0|(l=0|n[l+4>>2])))T=t;else{if(0|i[(f=A+28|0)>>0]?(o=0|ie(o,l),l=0|C()):i[f>>0]=1,!(0|n[n[(a=A+20|0)>>2]>>2]))return 0|(o=0|n[(f=A+24|0)>>2])&&ye(o),n[(Q=A)>>2]=0,n[Q+4>>2]=0,n[A+8>>2]=0,n[a>>2]=0,n[A+12>>2]=-1,n[A+16>>2]=0,n[f>>2]=0,void(T=t);u=15&(f=0|n[(Q=A+16|0)>>2]);A:do{if(0==(0|o)&0==(0|l))v=A+24|0;else{h=A+12|0,k=3==(0|u),w=255&f,d=3==(1|u),B=A+24|0,g=(u+-1|0)>>>0<3,s=3==(2|u),b=r+8|0;e:for(;;){if(c=0|Se(0|o,0|l,52),C(),(0|(c&=15))==(0|n[h>>2])){switch(15&w){case 0:case 2:case 3:if(0|(u=0|xA(o,l,e))){m=15;break e}if(0|oe(0|n[a>>2],0|n[B>>2],e)){m=19;break e}}if(d&&(n[e>>2]=n[(u=0|n[4+(0|n[a>>2])>>2])>>2],n[e+4>>2]=n[u+4>>2],n[e+8>>2]=n[u+8>>2],n[e+12>>2]=n[u+12>>2],0|q(26896,e))){if(0|GA(0|n[4+(0|n[a>>2])>>2],c,r)){m=25;break}if((0|n[(u=r)>>2])==(0|o)&&(0|n[u+4>>2])==(0|l)){m=29;break}}if(g){if(0|(u=0|VA(o,l,e))){m=32;break}if(0|Ae(o,l,r,0)){m=36;break}if(s&&0|le(0|n[a>>2],0|n[B>>2],e,r)){m=42;break}if(d&&0|ce(0|n[a>>2],0|n[B>>2],e,r)){m=42;break}}if(k){if(f=0|Ae(o,l,e,1),u=0|n[B>>2],0|f){m=45;break}if(0|$(u,e)){if(eA(r,e),0|AA(e,0|n[B>>2])){m=53;break}if(0|oe(0|n[a>>2],0|n[B>>2],b)){m=53;break}if(0|ce(0|n[a>>2],0|n[B>>2],r,e)){m=53;break}}}}do{if((0|c)<(0|n[h>>2])){if(f=0|Ae(o,l,e,1),u=0|n[B>>2],0|f){m=58;break e}if(!(0|$(u,e))){m=73;break}if(0|AA(0|n[B>>2],e)&&(eA(r,e),0|le(0|n[a>>2],0|n[B>>2],r,e))){m=65;break e}if(0|(o=0|yA(o,l,c+1|0,r))){m=67;break e}o=0|n[(l=r)>>2],l=0|n[l+4>>2]}else m=73}while(0);if(73==(0|m)&&(m=0,o=0|ie(o,l),l=0|C()),0==(0|o)&0==(0|l)){v=B;break A}}switch(0|m){case 15:0|(f=0|n[B>>2])&&ye(f),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=u,m=20;break;case 19:n[A>>2]=o,n[A+4>>2]=l,m=20;break;case 25:_(27634,27600,470,27611);break;case 29:return n[A>>2]=o,n[A+4>>2]=l,void(T=t);case 32:return 0|(f=0|n[B>>2])&&ye(f),n[(v=A)>>2]=0,n[v+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=u,void(T=t);case 36:_(27634,27600,493,27611);break;case 42:return n[A>>2]=o,n[A+4>>2]=l,void(T=t);case 45:0|u&&ye(u),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=f,m=55;break;case 53:n[A>>2]=o,n[A+4>>2]=l,m=55;break;case 58:0|u&&ye(u),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=f,m=71;break;case 65:n[A>>2]=o,n[A+4>>2]=l,m=71;break;case 67:return 0|(f=0|n[B>>2])&&ye(f),n[(v=A)>>2]=0,n[v+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=o,void(T=t)}if(20==(0|m))return void(T=t);if(55==(0|m))return void(T=t);if(71==(0|m))return void(T=t)}}while(0);0|(f=0|n[v>>2])&&ye(f),n[(m=A)>>2]=0,n[m+4>>2]=0,n[A+8>>2]=0,n[a>>2]=0,n[A+12>>2]=-1,n[Q>>2]=0,n[v>>2]=0,T=t}}function ie(A,e){var r,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0;r=T,T=T+16|0,s=r,a=0|Se(0|(A|=0),0|(e|=0),52),C(),a&=15,i=0|Se(0|A,0|e,45),C();do{if(a){for(;i=0|He(a+4095|0,0,52),t=0|C()|-15728641&e,i=i|A|(o=0|He(7,0,0|(f=3*(15-a|0)|0))),t|=l=0|C(),u=0|Se(0|A,0|e,0|f),C(),a=a+-1|0,!((u&=7)>>>0<6);){if(!a){c=4;break}e=t,A=i}if(4==(0|c)){i=0|Se(0|i,0|t,45),C();break}return s=0|He(((s=0==(0|u)&0!=(0|CA(i,t)))?2:1)+u|0,0,0|f),c=0|C()|e&~l,s|=A&~o,D(0|c),T=r,0|s}}while(0);return(i&=127)>>>0>120?(s=0,D(0|(c=0)),T=r,0|s):(QA(s,0,i+1|0,0),c=0|n[s+4>>2],s=0|n[s>>2],D(0|c),T=r,0|s)}function ne(A,e,r){A|=0;var i,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0;if(!(0|q(e|=0,r|=0)))return 0;if(e=0|function(A){return+a[16+(A|=0)>>3]<+a[A+24>>3]|0}(e),f=+a[r>>3],o=e&(o=+a[r+8>>3])<0?o+6.283185307179586:o,(0|(t=0|n[A>>2]))<=0)return 0;if(i=0|n[A+4>>2],e){e=0,d=o,r=-1,A=0;A:for(;;){for(b=A;o=+a[i+(b<<4)+8>>3],c=+a[i+((A=(r+2|0)%(0|t)|0)<<4)+8>>3],(u=+a[i+(b<<4)>>3])>(l=+a[i+(A<<4)>>3])?(s=u,u=c):(s=l,l=u,u=o,o=c),(f=f==l|f==s?f+2.220446049250313e-16:f)<l|f>s;){if((0|(r=b+1|0))>=(0|t)){r=22;break A}A=b,b=r,r=A}if(((s=(c=u<0?u+6.283185307179586:u)+(f-l)/(s-l)*((u=o<0?o+6.283185307179586:o)-c))<0?s+6.283185307179586:s)>(d=c==d|u==d?d+-2.220446049250313e-16:d)&&(e^=1),(0|(A=b+1|0))>=(0|t)){r=22;break}r=b}if(22==(0|r))return 0|e}else{e=0,d=o,r=-1,A=0;A:for(;;){for(b=A;o=+a[i+(b<<4)+8>>3],c=+a[i+((A=(r+2|0)%(0|t)|0)<<4)+8>>3],(u=+a[i+(b<<4)>>3])>(l=+a[i+(A<<4)>>3])?(s=u,u=c):(s=l,l=u,u=o,o=c),(f=f==l|f==s?f+2.220446049250313e-16:f)<l|f>s;){if((0|(r=b+1|0))>=(0|t)){r=22;break A}A=b,b=r,r=A}if(u+(f-l)/(s-l)*(o-u)>(d=u==d|o==d?d+-2.220446049250313e-16:d)&&(e^=1),(0|(A=b+1|0))>=(0|t)){r=22;break}r=b}if(22==(0|r))return 0|e}return 0}function ae(A,e){e|=0;var r,i,t,f,o,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0;if(!(i=0|n[(A|=0)>>2]))return n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,void(n[e+28>>2]=0);if(a[(t=e+8|0)>>3]=1.7976931348623157e308,a[(f=e+24|0)>>3]=1.7976931348623157e308,a[e>>3]=-1.7976931348623157e308,a[(o=e+16|0)>>3]=-1.7976931348623157e308,!((0|i)<=0)){for(r=0|n[A+4>>2],k=1.7976931348623157e308,B=-1.7976931348623157e308,h=0,A=-1,b=1.7976931348623157e308,d=1.7976931348623157e308,w=-1.7976931348623157e308,c=-1.7976931348623157e308,m=0;g=+a[r+(m<<4)+8>>3],s=+a[r+(((0|(A=A+2|0))==(0|i)?0:A)<<4)+8>>3],(u=+a[r+(m<<4)>>3])<b&&(a[t>>3]=u,b=u),g<d&&(a[f>>3]=g,d=g),u>w?a[e>>3]=u:u=w,g>c&&(a[o>>3]=g,c=g),k=g>0&g<k?g:k,B=g<0&g>B?g:B,h|=+l(+(g-s))>3.141592653589793,(0|(A=m+1|0))!=(0|i);)v=m,w=u,m=A,A=v;h&&(a[o>>3]=B,a[f>>3]=k)}}function te(A){return 0|((A|=0)>>>0<4?0:15)}function fe(A,e){e|=0;var r,i=0,t=0,f=0,o=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,C=0,_=0;if(B=0|n[(A|=0)>>2]){if(a[(h=e+8|0)>>3]=1.7976931348623157e308,a[(m=e+24|0)>>3]=1.7976931348623157e308,a[e>>3]=-1.7976931348623157e308,a[(v=e+16|0)>>3]=-1.7976931348623157e308,(0|B)>0){for(f=0|n[A+4>>2],w=1.7976931348623157e308,k=-1.7976931348623157e308,t=0,i=-1,s=1.7976931348623157e308,b=1.7976931348623157e308,g=-1.7976931348623157e308,u=-1.7976931348623157e308,Q=0;d=+a[f+(Q<<4)+8>>3],c=+a[f+(((0|(C=i+2|0))==(0|B)?0:C)<<4)+8>>3],(o=+a[f+(Q<<4)>>3])<s&&(a[h>>3]=o,s=o),d<b&&(a[m>>3]=d,b=d),o>g?a[e>>3]=o:o=g,d>u&&(a[v>>3]=d,u=d),w=d>0&d<w?d:w,k=d<0&d>k?d:k,t|=+l(+(d-c))>3.141592653589793,(0|(i=Q+1|0))!=(0|B);)C=Q,g=o,Q=i,i=C;t&&(a[v>>3]=k,a[m>>3]=w)}}else n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,n[e+28>>2]=0;if(!((0|(i=0|n[(C=A+8|0)>>2]))<=0)){r=A+12|0,D=0;do{if(t=D,m=e+((D=D+1|0)<<5)|0,v=0|n[(f=0|n[r>>2])+(t<<3)>>2]){if(a[(Q=e+(D<<5)+8|0)>>3]=1.7976931348623157e308,a[(A=e+(D<<5)+24|0)>>3]=1.7976931348623157e308,a[m>>3]=-1.7976931348623157e308,a[(E=e+(D<<5)+16|0)>>3]=-1.7976931348623157e308,(0|v)>0){for(B=0|n[f+(t<<3)+4>>2],w=1.7976931348623157e308,k=-1.7976931348623157e308,f=0,t=-1,h=0,s=1.7976931348623157e308,b=1.7976931348623157e308,d=-1.7976931348623157e308,u=-1.7976931348623157e308;g=+a[B+(h<<4)+8>>3],c=+a[B+(((0|(t=t+2|0))==(0|v)?0:t)<<4)+8>>3],(o=+a[B+(h<<4)>>3])<s&&(a[Q>>3]=o,s=o),g<b&&(a[A>>3]=g,b=g),o>d?a[m>>3]=o:o=d,g>u&&(a[E>>3]=g,u=g),w=g>0&g<w?g:w,k=g<0&g>k?g:k,f|=+l(+(g-c))>3.141592653589793,(0|(t=h+1|0))!=(0|v);)_=h,h=t,d=o,t=_;f&&(a[E>>3]=k,a[A>>3]=w)}}else n[m>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,n[m+12>>2]=0,n[m+16>>2]=0,n[m+20>>2]=0,n[m+24>>2]=0,n[m+28>>2]=0,i=0|n[C>>2]}while((0|D)<(0|i))}}function oe(A,e,r){var i,a=0;if(!(0|ne(A|=0,e|=0,r|=0)))return 0;if((0|n[(i=A+8|0)>>2])<=0)return 1;for(a=A+12|0,A=0;;){if(0|ne((0|n[a>>2])+(A<<3)|0,e+((A=A+1|0)<<5)|0,r)){A=0,a=6;break}if((0|A)>=(0|n[i>>2])){A=1,a=6;break}}return 6==(0|a)?0|A:0}function le(A,e,r,i){i|=0;var a,t,f,o=0,l=0,u=0;if(t=T,T=T+16|0,a=t,!(0|ne(A|=0,e|=0,u=8+(r|=0)|0)))return T=t,0;f=A+8|0;A:do{if((0|n[f>>2])>0){for(l=A+12|0,o=0;;){if(0|ne((0|n[l>>2])+(o<<3)|0,e+((o=o+1|0)<<5)|0,u)){o=0;break}if((0|o)>=(0|n[f>>2]))break A}return T=t,0|o}}while(0);if(0|ue(A,e,r,i))return T=t,0;n[a>>2]=n[r>>2],n[a+4>>2]=u,o=0|n[f>>2];A:do{if((0|o)>0)for(A=A+12|0,u=0,l=o;;){if((0|n[(o=0|n[A>>2])+(u<<3)>>2])>0){if(0|ne(a,i,0|n[o+(u<<3)+4>>2])){o=0;break A}if(0|ue((0|n[A>>2])+(u<<3)|0,e+((o=u+1|0)<<5)|0,r,i)){o=0;break A}l=0|n[f>>2]}else o=u+1|0;if(!((0|o)<(0|l))){o=1;break}u=o}else o=1}while(0);return T=t,0|o}function ue(A,e,r,i){A|=0,r|=0;var t,f,o,l,u,c,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,C=0,_=0;if(c=T,T=T+176|0,l=c+172|0,s=c+168|0,u=c,!(0|$(e|=0,i|=0)))return T=c,0;if(function(A,e,r,i){var t,f,o,l,u;i|=0,t=(l=+a[16+(e|=0)>>3])<(o=+a[e+24>>3]),e=(u=+a[24+(A|=0)>>3])-l<o-(f=+a[A+16>>3]),n[(r|=0)>>2]=(A=f<u)?t|e?1:2:0,n[i>>2]=t?A?1:e?2:1:0}(e,i,l,s),Ne(0|u,0|r,168),(0|n[r>>2])>0){e=0;do{Q=+OA(+a[(C=u+8+(e<<4)+8|0)>>3],0|n[s>>2]),a[C>>3]=Q,e=e+1|0}while((0|e)<(0|n[r>>2]))}f=+a[i>>3],o=+a[i+8>>3],Q=+OA(+a[i+16>>3],0|n[s>>2]),t=+OA(+a[i+24>>3],0|n[s>>2]);A:do{if((0|n[A>>2])>0){if(i=A+4|0,(0|(s=0|n[u>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|n[A>>2])){e=0;break A}for(r=0;;){if(m=+a[(e=0|n[i>>2])+(r<<4)>>3],v=+OA(+a[e+(r<<4)+8>>3],0|n[l>>2]),b=+a[(e=0|n[i>>2])+((C=(0|(r=r+1|0))%(0|n[A>>2])|0)<<4)>>3],d=+OA(+a[e+(C<<4)+8>>3],0|n[l>>2]),!(m>=f)|!(b>=f)&&!(m<=o)|!(b<=o)&&!(v<=t)|!(d<=t)&&!(v>=Q)|!(d>=Q)){h=b-m,k=d-v,e=0;do{if(_=e,!(0==(B=h*(d=+a[u+8+((C=(0|(e=e+1|0))==(0|s)?0:e)<<4)+8>>3]-(b=+a[u+8+(_<<4)+8>>3]))-k*(w=+a[u+8+(C<<4)>>3]-(g=+a[u+8+(_<<4)>>3])))||(E=v-b,D=m-g,w=(E*w-d*D)/B,w<0|w>1))&&(B=(h*E-k*D)/B)>=0&B<=1){e=1;break A}}while((0|e)<(0|s))}if((0|r)>=(0|n[A>>2])){e=0;break}}}else e=0}while(0);return T=c,0|e}function ce(A,e,r,i){var a,t=0;if(0|ue(A|=0,e|=0,r|=0,i|=0))return 1;if((0|n[(a=A+8|0)>>2])<=0)return 0;for(t=A+12|0,A=0;;){if(0|ue((0|n[t>>2])+(A<<3)|0,e+((A=A+1|0)<<5)|0,r,i)){A=1,t=6;break}if((0|A)>=(0|n[a>>2])){A=0,t=6;break}}return 6==(0|t)?0|A:0}function se(A,e,r,i,n){var t,f,o,l,u,c,s,b=0;a[(n|=0)>>3]=(l=+a[(A|=0)>>3])+(o=+a[(e|=0)>>3]-l)*(b=((b=+a[(i|=0)>>3]-(c=+a[(r|=0)>>3]))*((f=+a[A+8>>3])-(s=+a[r+8>>3]))-(l-c)*(u=+a[i+8>>3]-s))/(o*u-(t=+a[e+8>>3]-f)*b)),a[n+8>>3]=f+t*b}function be(A,e){return+l(+(+a[(A|=0)>>3]-+a[(e|=0)>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[A+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function de(A,e,r){r|=0;var i,a,t,f,o=0,l=0,u=0,c=0;if(f=T,T=T+32|0,c=f,0|(o=0|zA(A|=0,e|=0,a=f+16|0)))return T=f,0|o;i=0|mA(A,e),t=0|MA(A,e),function(A,e){n[(e|=0)>>2]=n[(A=7696+(28*(A|=0)|0)|0)>>2],n[e+4>>2]=n[A+4>>2],n[e+8>>2]=n[A+8>>2],n[e+12>>2]=n[A+12>>2]}(i,c),o=0|function(A,e){A|=0;var r=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|n[11120+(216*e|0)>>2])!=(0|A))if((0|n[11120+(216*e|0)+8>>2])!=(0|A))if((0|n[11120+(216*e|0)+16>>2])!=(0|A))if((0|n[11120+(216*e|0)+24>>2])!=(0|A))if((0|n[11120+(216*e|0)+32>>2])!=(0|A))if((0|n[11120+(216*e|0)+40>>2])!=(0|A))if((0|n[11120+(216*e|0)+48>>2])!=(0|A))if((0|n[11120+(216*e|0)+56>>2])!=(0|A))if((0|n[11120+(216*e|0)+64>>2])!=(0|A))if((0|n[11120+(216*e|0)+72>>2])!=(0|A))if((0|n[11120+(216*e|0)+80>>2])!=(0|A))if((0|n[11120+(216*e|0)+88>>2])!=(0|A))if((0|n[11120+(216*e|0)+96>>2])!=(0|A))if((0|n[11120+(216*e|0)+104>>2])!=(0|A))if((0|n[11120+(216*e|0)+112>>2])!=(0|A))if((0|n[11120+(216*e|0)+120>>2])!=(0|A))if((0|n[11120+(216*e|0)+128>>2])!=(0|A)){if((0|n[11120+(216*e|0)+136>>2])!=(0|A)){if((0|n[11120+(216*e|0)+144>>2])==(0|A)){A=0,r=2,i=0;break}if((0|n[11120+(216*e|0)+152>>2])==(0|A)){A=0,r=2,i=1;break}if((0|n[11120+(216*e|0)+160>>2])==(0|A)){A=0,r=2,i=2;break}if((0|n[11120+(216*e|0)+168>>2])==(0|A)){A=1,r=2,i=0;break}if((0|n[11120+(216*e|0)+176>>2])==(0|A)){A=1,r=2,i=1;break}if((0|n[11120+(216*e|0)+184>>2])==(0|A)){A=1,r=2,i=2;break}if((0|n[11120+(216*e|0)+192>>2])==(0|A)){A=2,r=2,i=0;break}if((0|n[11120+(216*e|0)+200>>2])==(0|A)){A=2,r=2,i=1;break}if((0|n[11120+(216*e|0)+208>>2])==(0|A)){A=2,r=2,i=2;break}return-1}A=2,r=1,i=2}else A=2,r=1,i=1;else A=2,r=1,i=0;else A=1,r=1,i=2;else A=1,r=1,i=1;else A=1,r=1,i=0;else A=0,r=1,i=2;else A=0,r=1,i=1;else A=0,r=1,i=0;else A=2,r=0,i=2;else A=2,r=0,i=1;else A=2,r=0,i=0;else A=1,r=0,i=2;else A=1,r=0,i=1;else A=1,r=0,i=0;else A=0,r=0,i=2;else A=0,r=0,i=1;else A=0,r=0,i=0}while(0);return 0|n[11120+(216*e|0)+(72*r|0)+(24*A|0)+(i<<3)+4>>2]}(i,0|n[a>>2]);do{if(0|Y(i)){switch(0|i){case 4:l=0;break;case 14:l=1;break;case 24:l=2;break;case 38:l=3;break;case 49:l=4;break;case 58:l=5;break;case 63:l=6;break;case 72:l=7;break;case 83:l=8;break;case 97:l=9;break;case 107:l=10;break;case 117:l=11;break;default:_(27634,27636,75,27645)}if(u=0|n[26480+(24*l|0)+8>>2],e=0|n[26480+(24*l|0)+16>>2],(0|(A=0|n[a>>2]))!=(0|n[c>>2])&&(c=0|j(i))|(0|(A=0|n[a>>2]))==(0|e)&&(o=(o+1|0)%6|0),3==(0|t)&(0|A)==(0|e)){o=(o+5|0)%6|0;break}5==(0|t)&(0|A)==(0|u)&&(o=(o+1|0)%6|0)}}while(0);return n[r>>2]=o,T=f,0}function ge(A,e,r,i){r|=0,i|=0;var a,t,f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0;if(l=T,T=T+32|0,m=l+24|0,o=l+20|0,f=l+8|0,t=l+16|0,a=l,d=(d=0==(0|CA(A|=0,e|=0)))?6:5,w=0|Se(0|A,0|e,52),C(),d>>>0<=r>>>0)return T=l,2;!(k=0==(0|(w&=15)))&&0==((B=0|He(7,0,3*(15^w)|0))&A|0)&0==((0|C())&e|0)?u=r:c=4;A:do{if(4==(0|c)){if((0|((u=0!=(0|CA(A,e)))?4:5))<(0|r))return T=l,1;if(0|de(A,e,m))return T=l,1;if(c=(0|n[m>>2])+r|0,7==(0|(B=0|n[(u=u?26768+(((0|c)%5|0)<<2)|0:26800+(((0|c)%6|0)<<2)|0)>>2])))return T=l,1;n[o>>2]=0,u=0|z(A,e,B,o,f);do{if(!u){if(g=0|n[(b=f)>>2],c=(s=(b=0|n[b+4>>2])>>>0<e>>>0|(0|b)==(0|e)&g>>>0<A>>>0)?g:A,s=s?b:e,!k&&0==(g&(k=0|He(7,0,3*(15^w)|0))|0)&0==(b&(0|C())|0))u=r;else{if(b=(r+-1+d|0)%(0|d)|0,u=0|CA(A,e),(0|b)<0&&_(27634,27636,248,27661),(0|((d=0!=(0|u))?4:5))<(0|b)&&_(27634,27636,248,27661),0|de(A,e,m)&&_(27634,27636,248,27661),u=(0|n[m>>2])+b|0,7==(0|(b=0|n[(u=d?26768+(((0|u)%5|0)<<2)|0:26800+(((0|u)%6|0)<<2)|0)>>2]))&&_(27634,27636,248,27661),n[t>>2]=0,0|(u=0|z(A,e,b,t,a)))break;d=0|n[(g=a)>>2],g=0|n[g+4>>2];do{if(g>>>0<s>>>0|(0|g)==(0|s)&d>>>0<c>>>0){if(c=0|CA(d,g)?0|S(d,g,A,e):0|n[26864+((((0|n[t>>2])+(0|n[26832+(b<<2)>>2])|0)%6|0)<<2)>>2],u=0|CA(d,g),(c+-1|0)>>>0>5){u=-1,c=d,s=g;break}if(1==(0|c)&(u=0!=(0|u))){u=-1,c=d,s=g;break}do{if(!(0|de(d,g,m))){if(u){u=(5+(0|n[26416+(c<<2)>>2])-(0|n[m>>2])|0)%5|0;break}u=(6+(0|n[26448+(c<<2)>>2])-(0|n[m>>2])|0)%6|0;break}u=-1}while(0);c=d,s=g}else u=r}while(0);g=0|n[(b=f)>>2],b=0|n[b+4>>2]}if((0|c)==(0|g)&(0|s)==(0|b)){if(A=(d=0!=(0|CA(g,b)))?0|S(g,b,A,e):0|n[26864+((((0|n[o>>2])+(0|n[26832+(B<<2)>>2])|0)%6|0)<<2)>>2],u=0|CA(g,b),(A+-1|0)>>>0<=5&&!(1==(0|A)&(h=0!=(0|u))))do{if(!(0|de(g,b,m))){if(h){u=(5+(0|n[26416+(A<<2)>>2])-(0|n[m>>2])|0)%5|0;break}u=(6+(0|n[26448+(A<<2)>>2])-(0|n[m>>2])|0)%6|0;break}u=-1}while(0);else u=-1;u=6==(0|(u=u+1|0))|d&5==(0|u)?0:u}e=s,A=c;break A}}while(0);return T=l,0|u}}while(0);return h=0|He(0|u,0,56),m=0|C()|-2130706433&e|536870912,n[i>>2]=h|A,n[i+4>>2]=m,T=l,0}function we(A,e){A|=0;var r,i,a=0,t=0;return i=T,T=T+16|0,r=i,!0&536870912==(2013265920&(e|=0)|0)&&0|vA(A,a=-2130706433&e|134217728)?(t=0|Se(0|A,0|e,56),C(),t=0==(0|ge(A,a,7&t,r)),T=i,0|(a=t&((0|n[(a=r)>>2])==(0|A)?(0|n[a+4>>2])==(0|e):0)&1)):(T=i,0|(a=0))}function ke(A,e,r,i){A|=0,i|=0;var a,t,f,o=0,l=0,u=0,c=0,s=0,b=0;f=T,T=T+208|0,a=f,t=f+192|0,u=0|h(r|=0,e|=0),n[(c=t)>>2]=1,n[c+4>>2]=0;A:do{if(0|u){for(c=0-r|0,n[a+4>>2]=r,n[a>>2]=r,o=2,e=r,l=r;n[a+(o<<2)>>2]=e=e+r+l|0,e>>>0<u>>>0;)b=l,o=o+1|0,l=e,e=b;if((l=A+u+c|0)>>>0>A>>>0){u=l,o=1,e=1;do{do{if(3!=(3&e|0)){if((0|n[a+((e=o+-1|0)<<2)>>2])>>>0<(u-A|0)>>>0?Be(A,r,i,o,a):me(A,r,i,t,o,0,a),1==(0|o)){ve(t,1),o=0;break}ve(t,e),o=1;break}Be(A,r,i,o,a),he(t,2),o=o+2|0}while(0);n[t>>2]=e=1|n[t>>2],A=A+r|0}while(A>>>0<l>>>0)}else o=1,e=1;for(me(A,r,i,t,o,0,a),l=t+4|0;;){if(1==(0|o)&1==(0|e)){if(!(0|n[l>>2]))break A;s=19}else(0|o)<2?s=19:(ve(t,2),b=o+-2|0,n[t>>2]=7^n[t>>2],he(t,1),me(A+(0-(0|n[a+(b<<2)>>2]))+c|0,r,i,t,o+-1|0,1,a),ve(t,1),n[t>>2]=e=1|n[t>>2],me(A=A+c|0,r,i,t,b,1,a),o=b);19==(0|s)&&(s=0,he(t,e=0|Qe(t)),A=A+c|0,o=e+o|0,e=0|n[t>>2])}}}while(0);T=f}function Be(A,e,r,i,a){e|=0,r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0,c=0,s=0;f=T,T=T+240|0,n[(t=f)>>2]=A|=0;A:do{if((0|i)>1)for(s=0-e|0,u=A,o=i,i=1,l=A;;){if((0|Xe[3&r](l,A=(u=u+s|0)+(0-(0|n[a+((c=o+-2|0)<<2)>>2]))|0))>-1&&(0|Xe[3&r](l,u))>-1)break A;if(l=t+(i<<2)|0,(0|Xe[3&r](A,u))>-1?(n[l>>2]=A,o=o+-1|0):(n[l>>2]=u,A=u,o=c),i=i+1|0,(0|o)<=1)break A;u=A,l=0|n[t>>2]}else i=1}while(0);De(e,t,i),T=f}function he(A,e){var r,i=0,a=0;r=4+(A|=0)|0,(e|=0)>>>0>31?(n[A>>2]=a=0|n[r>>2],n[r>>2]=0,e=e+-32|0,i=0):(i=0|n[r>>2],a=0|n[A>>2]),n[A>>2]=i<<32-e|a>>>e,n[r>>2]=i>>>e}function me(A,e,r,i,a,t,f){A|=0,e|=0,r|=0,a|=0,t|=0,f|=0;var o,l,u,c,s=0,b=0,d=0,g=0;c=T,T=T+240|0,u=c,n[(l=c+232|0)>>2]=g=0|n[(i|=0)>>2],n[(o=l+4|0)>>2]=b=0|n[i+4>>2],n[u>>2]=A;A:do{if(1!=(0|g)|0!=(0|b)&&(d=0-e|0,(0|Xe[3&r](s=A+(0-(0|n[f+(a<<2)>>2]))|0,A))>=1))for(i=1,t=0==(0|t),b=s;;){if(t&(0|a)>1){if(s=0|n[f+(a+-2<<2)>>2],(0|Xe[3&r](t=A+d|0,b))>-1){s=10;break A}if((0|Xe[3&r](t+(0-s)|0,b))>-1){s=10;break A}}if(t=i+1|0,n[u+(i<<2)>>2]=b,he(l,g=0|Qe(l)),a=g+a|0,!(1!=(0|n[l>>2])|0!=(0|n[o>>2]))){i=t,A=b,s=10;break A}if((0|Xe[3&r](A=b+(0-(0|n[f+(a<<2)>>2]))|0,0|n[u>>2]))<1){A=b,i=t,t=0,s=9;break}g=b,i=t,t=1,b=A,A=g}else i=1,s=9}while(0);9==(0|s)&&0==(0|t)&&(s=10),10==(0|s)&&(De(e,u,i),Be(A,e,r,a,f)),T=c}function ve(A,e){var r,i=0,a=0;r=4+(A|=0)|0,(e|=0)>>>0>31?(n[r>>2]=a=0|n[A>>2],n[A>>2]=0,e=e+-32|0,i=0):(i=0|n[A>>2],a=0|n[r>>2]),n[r>>2]=i>>>(32-e|0)|a<<e,n[A>>2]=i<<e}function Qe(A){var e=0;return(e=0|Ee((0|n[(A|=0)>>2])-1|0))?0|e:0|(0==(0|(e=0|Ee(0|n[A+4>>2])))?0:e+32|0)}function Ee(A){var e=0;if(A|=0)if(1&A)A=0;else for(e=A,A=0;A=A+1|0,!(2&e);)e>>>=1;else A=32;return 0|A}function De(A,e,r){A|=0,e|=0,r|=0;var i,a=0,t=0,f=0,o=0;i=T,T=T+256|0,a=i;A:do{if((0|r)>=2&&(n[(f=e+(r<<2)|0)>>2]=a,0|A))for(;;){Ne(0|a,0|n[e>>2],0|(t=A>>>0<256?A:256)),a=0;do{Ne(0|n[(o=e+(a<<2)|0)>>2],0|n[e+((a=a+1|0)<<2)>>2],0|t),n[o>>2]=(0|n[o>>2])+t}while((0|a)!=(0|r));if(!(A=A-t|0))break A;a=0|n[f>>2]}}while(0);T=i}function Ce(A){return 0|~~+Je(+(A=+A))}function _e(A){A|=0;var e,r=0,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0;e=T,T=T+16|0,d=e;do{if(A>>>0<245){if(3&(i=(b=0|n[6921])>>>(A=(c=A>>>0<11?16:A+11&-8)>>>3))|0)return(0|(f=0|n[(t=8+(a=0|n[(i=8+(A=27724+((r=(1&i^1)+A|0)<<1<<2)|0)|0)>>2])|0)>>2]))==(0|A)?n[6921]=b&~(1<<r):(n[f+12>>2]=A,n[i>>2]=f),n[a+4>>2]=3|(Q=r<<3),n[(Q=a+Q+4|0)>>2]=1|n[Q>>2],T=e,0|t;if(c>>>0>(s=0|n[6923])>>>0){if(0|i)return r=((r=i<<A&((r=2<<A)|0-r))&0-r)-1|0,(0|(i=0|n[(l=8+(f=0|n[(A=8+(r=27724+((a=((i=(r>>>=l=r>>>12&16)>>>5&8)|l|(f=(r>>>=i)>>>2&4)|(A=(r>>>=f)>>>1&2)|(a=(r>>>=A)>>>1&1))+(r>>>a)|0)<<1<<2)|0)|0)>>2])|0)>>2]))==(0|r)?n[6921]=A=b&~(1<<a):(n[i+12>>2]=r,n[A>>2]=i,A=b),o=(Q=a<<3)-c|0,n[f+4>>2]=3|c,n[4+(t=f+c|0)>>2]=1|o,n[f+Q>>2]=o,0|s&&(a=0|n[6926],i=27724+((r=s>>>3)<<1<<2)|0,A&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=a,n[r+12>>2]=a,n[a+8>>2]=r,n[a+12>>2]=i),n[6923]=o,n[6926]=t,T=e,0|l;if(f=0|n[6922]){for(i=(f&0-f)-1|0,i=u=0|n[27988+(((a=(i>>>=t=i>>>12&16)>>>5&8)|t|(o=(i>>>=a)>>>2&4)|(l=(i>>>=o)>>>1&2)|(u=(i>>>=l)>>>1&1))+(i>>>u)<<2)>>2],l=u,u=(-8&n[u+4>>2])-c|0;(A=0|n[i+16>>2])||(A=0|n[i+20>>2]);)i=A,l=(t=(o=(-8&n[A+4>>2])-c|0)>>>0<u>>>0)?A:l,u=t?o:u;if((o=l+c|0)>>>0>l>>>0){t=0|n[l+24>>2],r=0|n[l+12>>2];do{if((0|r)==(0|l)){if(!(r=0|n[(A=l+20|0)>>2])&&!(r=0|n[(A=l+16|0)>>2])){i=0;break}for(;;)if(i=0|n[(a=r+20|0)>>2])r=i,A=a;else{if(!(i=0|n[(a=r+16|0)>>2]))break;r=i,A=a}n[A>>2]=0,i=r}else n[12+(i=0|n[l+8>>2])>>2]=r,n[r+8>>2]=i,i=r}while(0);do{if(0|t){if((0|l)==(0|n[(A=27988+((r=0|n[l+28>>2])<<2)|0)>>2])){if(n[A>>2]=i,!i){n[6922]=f&~(1<<r);break}}else if(n[((0|n[(Q=t+16|0)>>2])==(0|l)?Q:t+20|0)>>2]=i,!i)break;n[i+24>>2]=t,0|(r=0|n[l+16>>2])&&(n[i+16>>2]=r,n[r+24>>2]=i),0|(r=0|n[l+20>>2])&&(n[i+20>>2]=r,n[r+24>>2]=i)}}while(0);return u>>>0<16?(n[l+4>>2]=3|(Q=u+c|0),n[(Q=l+Q+4|0)>>2]=1|n[Q>>2]):(n[l+4>>2]=3|c,n[o+4>>2]=1|u,n[o+u>>2]=u,0|s&&(a=0|n[6926],i=27724+((r=s>>>3)<<1<<2)|0,(r=1<<r)&b?r=0|n[(A=i+8|0)>>2]:(n[6921]=r|b,r=i,A=i+8|0),n[A>>2]=a,n[r+12>>2]=a,n[a+8>>2]=r,n[a+12>>2]=i),n[6923]=u,n[6926]=o),T=e,0|l+8}b=c}else b=c}else b=c}else if(A>>>0<=4294967231)if(c=-8&(A=A+11|0),a=0|n[6922]){t=0-c|0,u=(A>>>=8)?c>>>0>16777215?31:c>>>(7+(u=14-((l=(520192+(k=A<<(b=(A+1048320|0)>>>16&8))|0)>>>16&4)|b|(u=(245760+(k<<=l)|0)>>>16&2))+(k<<u>>>15)|0)|0)&1|u<<1:0,i=0|n[27988+(u<<2)>>2];A:do{if(i)for(A=0,l=c<<(31==(0|u)?0:25-(u>>>1)|0),f=0;;){if((o=(-8&n[i+4>>2])-c|0)>>>0<t>>>0){if(!o){A=i,t=0,k=65;break A}A=i,t=o}if(f=0==(0|(k=0|n[i+20>>2]))|(0|k)==(0|(i=0|n[i+16+(l>>>31<<2)>>2]))?f:k,!i){i=f,k=61;break}l<<=1}else i=0,A=0,k=61}while(0);if(61==(0|k)){if(0==(0|i)&0==(0|A)){if(!(A=((A=2<<u)|0-A)&a)){b=c;break}b=(A&0-A)-1|0,A=0,i=0|n[27988+(((f=(b>>>=o=b>>>12&16)>>>5&8)|o|(l=(b>>>=f)>>>2&4)|(u=(b>>>=l)>>>1&2)|(i=(b>>>=u)>>>1&1))+(b>>>i)<<2)>>2]}i?k=65:(l=A,o=t)}if(65==(0|k))for(f=i;;){if(t=(i=(b=(-8&n[f+4>>2])-c|0)>>>0<t>>>0)?b:t,A=i?f:A,(i=0|n[f+16>>2])||(i=0|n[f+20>>2]),!i){l=A,o=t;break}f=i}if(0!=(0|l)&&o>>>0<((0|n[6923])-c|0)>>>0&&(s=l+c|0)>>>0>l>>>0){f=0|n[l+24>>2],r=0|n[l+12>>2];do{if((0|r)==(0|l)){if(!(r=0|n[(A=l+20|0)>>2])&&!(r=0|n[(A=l+16|0)>>2])){r=0;break}for(;;)if(i=0|n[(t=r+20|0)>>2])r=i,A=t;else{if(!(i=0|n[(t=r+16|0)>>2]))break;r=i,A=t}n[A>>2]=0}else n[12+(Q=0|n[l+8>>2])>>2]=r,n[r+8>>2]=Q}while(0);do{if(f){if((0|l)==(0|n[(i=27988+((A=0|n[l+28>>2])<<2)|0)>>2])){if(n[i>>2]=r,!r){n[6922]=a&=~(1<<A);break}}else if(n[((0|n[(Q=f+16|0)>>2])==(0|l)?Q:f+20|0)>>2]=r,!r)break;n[r+24>>2]=f,0|(A=0|n[l+16>>2])&&(n[r+16>>2]=A,n[A+24>>2]=r),(A=0|n[l+20>>2])&&(n[r+20>>2]=A,n[A+24>>2]=r)}}while(0);A:do{if(o>>>0<16)n[l+4>>2]=3|(Q=o+c|0),n[(Q=l+Q+4|0)>>2]=1|n[Q>>2];else{if(n[l+4>>2]=3|c,n[s+4>>2]=1|o,n[s+o>>2]=o,r=o>>>3,o>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=s,n[r+12>>2]=s,n[s+8>>2]=r,n[s+12>>2]=i;break}if(r=27988+((i=(r=o>>>8)?o>>>0>16777215?31:o>>>(7+(i=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(i=(245760+(Q<<=m)|0)>>>16&2))+(Q<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[s+28>>2]=i,n[4+(A=s+16|0)>>2]=0,n[A>>2]=0,!(a&(A=1<<i))){n[6922]=a|A,n[r>>2]=s,n[s+24>>2]=r,n[s+12>>2]=s,n[s+8>>2]=s;break}r=0|n[r>>2];e:do{if((-8&n[r+4>>2]|0)!=(0|o)){for(a=o<<(31==(0|i)?0:25-(i>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|o)){r=A;break e}a<<=1,r=A}n[i>>2]=s,n[s+24>>2]=r,n[s+12>>2]=s,n[s+8>>2]=s;break A}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=s,n[v>>2]=s,n[s+8>>2]=Q,n[s+12>>2]=r,n[s+24>>2]=0}}while(0);return T=e,0|l+8}b=c}else b=c;else b=-1}while(0);if((i=0|n[6923])>>>0>=b>>>0)return A=0|n[6926],(r=i-b|0)>>>0>15?(n[6926]=Q=A+b|0,n[6923]=r,n[Q+4>>2]=1|r,n[A+i>>2]=r,n[A+4>>2]=3|b):(n[6923]=0,n[6926]=0,n[A+4>>2]=3|i,n[(Q=A+i+4|0)>>2]=1|n[Q>>2]),T=e,0|A+8;if((o=0|n[6924])>>>0>b>>>0)return n[6924]=m=o-b|0,n[6927]=v=(Q=0|n[6927])+b|0,n[v+4>>2]=1|m,n[Q+4>>2]=3|b,T=e,0|Q+8;if(0|n[7039]?A=0|n[7041]:(n[7041]=4096,n[7040]=4096,n[7042]=-1,n[7043]=-1,n[7044]=0,n[7032]=0,n[7039]=-16&d^1431655768,A=4096),l=b+48|0,(c=(f=A+(u=b+47|0)|0)&(t=0-A|0))>>>0<=b>>>0)return T=e,0;if(0|(A=0|n[7031])&&(d=(s=0|n[7029])+c|0)>>>0<=s>>>0|d>>>0>A>>>0)return T=e,0;A:do{if(4&n[7032])r=0,k=143;else{i=0|n[6927];e:do{if(i){for(a=28132;!((d=0|n[a>>2])>>>0<=i>>>0&&(d+(0|n[a+4>>2])|0)>>>0>i>>>0);){if(!(A=0|n[a+8>>2])){k=128;break e}a=A}if((r=f-o&t)>>>0<2147483647)if((0|(A=0|Ke(0|r)))==((0|n[a>>2])+(0|n[a+4>>2])|0)){if(-1!=(0|A)){o=r,f=A,k=145;break A}}else a=A,k=136;else r=0}else k=128}while(0);do{if(128==(0|k))if(-1!=(0|(i=0|Ke(0)))&&(w=(r=(0==((w=(g=0|n[7040])-1|0)&(r=i)|0)?0:(w+r&0-g)-r|0)+c|0)+(g=0|n[7029])|0,r>>>0>b>>>0&r>>>0<2147483647)){if(0|(d=0|n[7031])&&w>>>0<=g>>>0|w>>>0>d>>>0){r=0;break}if((0|(A=0|Ke(0|r)))==(0|i)){o=r,f=i,k=145;break A}a=A,k=136}else r=0}while(0);do{if(136==(0|k)){if(i=0-r|0,!(l>>>0>r>>>0&r>>>0<2147483647&-1!=(0|a))){if(-1==(0|a)){r=0;break}o=r,f=a,k=145;break A}if((A=u-r+(A=0|n[7041])&0-A)>>>0>=2147483647){o=r,f=a,k=145;break A}if(-1==(0|Ke(0|A))){Ke(0|i),r=0;break}o=A+r|0,f=a,k=145;break A}}while(0);n[7032]=4|n[7032],k=143}}while(0);if(143==(0|k)&&c>>>0<2147483647&&!(-1==(0|(m=0|Ke(0|c)))|1^(h=(B=(w=0|Ke(0))-m|0)>>>0>(b+40|0)>>>0)|m>>>0<w>>>0&-1!=(0|m)&-1!=(0|w)^1)&&(o=h?B:r,f=m,k=145),145==(0|k)){n[7029]=r=(0|n[7029])+o|0,r>>>0>(0|n[7030])>>>0&&(n[7030]=r),u=0|n[6927];A:do{if(u){for(r=28132;;){if((0|f)==((A=0|n[r>>2])+(i=0|n[r+4>>2])|0)){k=154;break}if(!(a=0|n[r+8>>2]))break;r=a}if(154==(0|k)&&(v=r+4|0,0==(8&n[r+12>>2]|0))&&f>>>0>u>>>0&A>>>0<=u>>>0){n[v>>2]=i+o,v=u+(m=0==(7&(m=u+8|0)|0)?0:0-m&7)|0,m=(Q=(0|n[6924])+o|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[u+Q+4>>2]=40,n[6928]=n[7043];break}for(f>>>0<(0|n[6925])>>>0&&(n[6925]=f),i=f+o|0,r=28132;;){if((0|n[r>>2])==(0|i)){k=162;break}if(!(A=0|n[r+8>>2]))break;r=A}if(162==(0|k)&&0==(8&n[r+12>>2]|0)){n[r>>2]=f,n[(s=r+4|0)>>2]=(0|n[s>>2])+o,c=(s=f+(0==(7&(s=f+8|0)|0)?0:0-s&7)|0)+b|0,l=(r=i+(0==(7&(r=i+8|0)|0)?0:0-r&7)|0)-s-b|0,n[s+4>>2]=3|b;e:do{if((0|u)==(0|r))n[6924]=Q=(0|n[6924])+l|0,n[6927]=c,n[c+4>>2]=1|Q;else{if((0|n[6926])==(0|r)){n[6923]=Q=(0|n[6923])+l|0,n[6926]=c,n[c+4>>2]=1|Q,n[c+Q>>2]=Q;break}if(1==(3&(A=0|n[r+4>>2])|0)){o=-8&A,a=A>>>3;r:do{if(A>>>0<256){if((0|(i=0|n[r+12>>2]))==(0|(A=0|n[r+8>>2]))){n[6921]=n[6921]&~(1<<a);break}n[A+12>>2]=i,n[i+8>>2]=A;break}f=0|n[r+24>>2],A=0|n[r+12>>2];do{if((0|A)==(0|r)){if(A=0|n[(a=4+(i=r+16|0)|0)>>2])i=a;else if(!(A=0|n[i>>2])){A=0;break}for(;;)if(a=0|n[(t=A+20|0)>>2])A=a,i=t;else{if(!(a=0|n[(t=A+16|0)>>2]))break;A=a,i=t}n[i>>2]=0}else n[12+(Q=0|n[r+8>>2])>>2]=A,n[A+8>>2]=Q}while(0);if(!f)break;a=27988+((i=0|n[r+28>>2])<<2)|0;do{if((0|n[a>>2])==(0|r)){if(n[a>>2]=A,0|A)break;n[6922]=n[6922]&~(1<<i);break r}if(n[((0|n[(Q=f+16|0)>>2])==(0|r)?Q:f+20|0)>>2]=A,!A)break r}while(0);if(n[A+24>>2]=f,0|(a=0|n[(i=r+16|0)>>2])&&(n[A+16>>2]=a,n[a+24>>2]=A),!(i=0|n[i+4>>2]))break;n[A+20>>2]=i,n[i+24>>2]=A}while(0);r=r+o|0,t=o+l|0}else t=l;if(n[(r=r+4|0)>>2]=-2&n[r>>2],n[c+4>>2]=1|t,n[c+t>>2]=t,r=t>>>3,t>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=c,n[r+12>>2]=c,n[c+8>>2]=r,n[c+12>>2]=i;break}r=t>>>8;do{if(r){if(t>>>0>16777215){a=31;break}a=t>>>(7+(a=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(a=(245760+(Q<<=m)|0)>>>16&2))+(Q<<a>>>15)|0)|0)&1|a<<1}else a=0}while(0);if(r=27988+(a<<2)|0,n[c+28>>2]=a,n[4+(A=c+16|0)>>2]=0,n[A>>2]=0,!((A=0|n[6922])&(i=1<<a))){n[6922]=A|i,n[r>>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break}r=0|n[r>>2];r:do{if((-8&n[r+4>>2]|0)!=(0|t)){for(a=t<<(31==(0|a)?0:25-(a>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|t)){r=A;break r}a<<=1,r=A}n[i>>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break e}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=c,n[v>>2]=c,n[c+8>>2]=Q,n[c+12>>2]=r,n[c+24>>2]=0}}while(0);return T=e,0|s+8}for(r=28132;!((A=0|n[r>>2])>>>0<=u>>>0&&(Q=A+(0|n[r+4>>2])|0)>>>0>u>>>0);)r=0|n[r+8>>2];r=(A=(A=(t=Q+-47|0)+(0==(7&(A=t+8|0)|0)?0:0-A&7)|0)>>>0<(t=u+16|0)>>>0?u:A)+8|0,v=f+(m=0==(7&(m=f+8|0)|0)?0:0-m&7)|0,m=(i=o+-40|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[f+i+4>>2]=40,n[6928]=n[7043],n[(i=A+4|0)>>2]=27,n[r>>2]=n[7033],n[r+4>>2]=n[7034],n[r+8>>2]=n[7035],n[r+12>>2]=n[7036],n[7033]=f,n[7034]=o,n[7036]=0,n[7035]=r,r=A+24|0;do{v=r,n[(r=r+4|0)>>2]=7}while((v+8|0)>>>0<Q>>>0);if((0|A)!=(0|u)){if(f=A-u|0,n[i>>2]=-2&n[i>>2],n[u+4>>2]=1|f,n[A>>2]=f,r=f>>>3,f>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=u,n[r+12>>2]=u,n[u+8>>2]=r,n[u+12>>2]=i;break}if(i=27988+((a=(r=f>>>8)?f>>>0>16777215?31:f>>>(7+(a=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(a=(245760+(Q<<=m)|0)>>>16&2))+(Q<<a>>>15)|0)|0)&1|a<<1:0)<<2)|0,n[u+28>>2]=a,n[u+20>>2]=0,n[t>>2]=0,!((r=0|n[6922])&(A=1<<a))){n[6922]=r|A,n[i>>2]=u,n[u+24>>2]=i,n[u+12>>2]=u,n[u+8>>2]=u;break}r=0|n[i>>2];e:do{if((-8&n[r+4>>2]|0)!=(0|f)){for(a=f<<(31==(0|a)?0:25-(a>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|f)){r=A;break e}a<<=1,r=A}n[i>>2]=u,n[u+24>>2]=r,n[u+12>>2]=u,n[u+8>>2]=u;break A}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=u,n[v>>2]=u,n[u+8>>2]=Q,n[u+12>>2]=r,n[u+24>>2]=0}}else 0==(0|(Q=0|n[6925]))|f>>>0<Q>>>0&&(n[6925]=f),n[7033]=f,n[7034]=o,n[7036]=0,n[6930]=n[7039],n[6929]=-1,n[6934]=27724,n[6933]=27724,n[6936]=27732,n[6935]=27732,n[6938]=27740,n[6937]=27740,n[6940]=27748,n[6939]=27748,n[6942]=27756,n[6941]=27756,n[6944]=27764,n[6943]=27764,n[6946]=27772,n[6945]=27772,n[6948]=27780,n[6947]=27780,n[6950]=27788,n[6949]=27788,n[6952]=27796,n[6951]=27796,n[6954]=27804,n[6953]=27804,n[6956]=27812,n[6955]=27812,n[6958]=27820,n[6957]=27820,n[6960]=27828,n[6959]=27828,n[6962]=27836,n[6961]=27836,n[6964]=27844,n[6963]=27844,n[6966]=27852,n[6965]=27852,n[6968]=27860,n[6967]=27860,n[6970]=27868,n[6969]=27868,n[6972]=27876,n[6971]=27876,n[6974]=27884,n[6973]=27884,n[6976]=27892,n[6975]=27892,n[6978]=27900,n[6977]=27900,n[6980]=27908,n[6979]=27908,n[6982]=27916,n[6981]=27916,n[6984]=27924,n[6983]=27924,n[6986]=27932,n[6985]=27932,n[6988]=27940,n[6987]=27940,n[6990]=27948,n[6989]=27948,n[6992]=27956,n[6991]=27956,n[6994]=27964,n[6993]=27964,n[6996]=27972,n[6995]=27972,v=f+(m=0==(7&(m=f+8|0)|0)?0:0-m&7)|0,m=(Q=o+-40|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[f+Q+4>>2]=40,n[6928]=n[7043]}while(0);if((r=0|n[6924])>>>0>b>>>0)return n[6924]=m=r-b|0,n[6927]=v=(Q=0|n[6927])+b|0,n[v+4>>2]=1|m,n[Q+4>>2]=3|b,T=e,0|Q+8}return n[(Q=27680)>>2]=12,T=e,0}function ye(A){var e=0,r=0,i=0,a=0,t=0,f=0,o=0,l=0;if(A|=0){a=0|n[6925],l=(r=A+-8|0)+(e=-8&(A=0|n[A+-4>>2]))|0;do{if(1&A)o=r,f=r;else{if(!(3&A))return;if(t=(i=0|n[r>>2])+e|0,(f=r+(0-i)|0)>>>0<a>>>0)return;if((0|n[6926])==(0|f)){if(3!=(3&(e=0|n[(A=l+4|0)>>2])|0)){o=f,e=t;break}return n[6923]=t,n[A>>2]=-2&e,n[f+4>>2]=1|t,void(n[f+t>>2]=t)}if(r=i>>>3,i>>>0<256){if((0|(e=0|n[f+12>>2]))==(0|(A=0|n[f+8>>2]))){n[6921]=n[6921]&~(1<<r),o=f,e=t;break}n[A+12>>2]=e,n[e+8>>2]=A,o=f,e=t;break}a=0|n[f+24>>2],A=0|n[f+12>>2];do{if((0|A)==(0|f)){if(A=0|n[(r=4+(e=f+16|0)|0)>>2])e=r;else if(!(A=0|n[e>>2])){A=0;break}for(;;)if(r=0|n[(i=A+20|0)>>2])A=r,e=i;else{if(!(r=0|n[(i=A+16|0)>>2]))break;A=r,e=i}n[e>>2]=0}else n[12+(o=0|n[f+8>>2])>>2]=A,n[A+8>>2]=o}while(0);if(a){if((0|n[(r=27988+((e=0|n[f+28>>2])<<2)|0)>>2])==(0|f)){if(n[r>>2]=A,!A){n[6922]=n[6922]&~(1<<e),o=f,e=t;break}}else if(n[((0|n[(o=a+16|0)>>2])==(0|f)?o:a+20|0)>>2]=A,!A){o=f,e=t;break}n[A+24>>2]=a,0|(r=0|n[(e=f+16|0)>>2])&&(n[A+16>>2]=r,n[r+24>>2]=A),(e=0|n[e+4>>2])?(n[A+20>>2]=e,n[e+24>>2]=A,o=f,e=t):(o=f,e=t)}else o=f,e=t}}while(0);if(!(f>>>0>=l>>>0)&&1&(i=0|n[(A=l+4|0)>>2])){if(2&i)n[A>>2]=-2&i,n[o+4>>2]=1|e,n[f+e>>2]=e,a=e;else{if((0|n[6927])==(0|l)){if(n[6924]=l=(0|n[6924])+e|0,n[6927]=o,n[o+4>>2]=1|l,(0|o)!=(0|n[6926]))return;return n[6926]=0,void(n[6923]=0)}if((0|n[6926])==(0|l))return n[6923]=l=(0|n[6923])+e|0,n[6926]=f,n[o+4>>2]=1|l,void(n[f+l>>2]=l);a=(-8&i)+e|0,r=i>>>3;do{if(i>>>0<256){if((0|(A=0|n[l+12>>2]))==(0|(e=0|n[l+8>>2]))){n[6921]=n[6921]&~(1<<r);break}n[e+12>>2]=A,n[A+8>>2]=e;break}t=0|n[l+24>>2],A=0|n[l+12>>2];do{if((0|A)==(0|l)){if(A=0|n[(r=4+(e=l+16|0)|0)>>2])e=r;else if(!(A=0|n[e>>2])){r=0;break}for(;;)if(r=0|n[(i=A+20|0)>>2])A=r,e=i;else{if(!(r=0|n[(i=A+16|0)>>2]))break;A=r,e=i}n[e>>2]=0,r=A}else n[12+(r=0|n[l+8>>2])>>2]=A,n[A+8>>2]=r,r=A}while(0);if(0|t){if((0|n[(e=27988+((A=0|n[l+28>>2])<<2)|0)>>2])==(0|l)){if(n[e>>2]=r,!r){n[6922]=n[6922]&~(1<<A);break}}else if(n[((0|n[(i=t+16|0)>>2])==(0|l)?i:t+20|0)>>2]=r,!r)break;n[r+24>>2]=t,0|(e=0|n[(A=l+16|0)>>2])&&(n[r+16>>2]=e,n[e+24>>2]=r),0|(A=0|n[A+4>>2])&&(n[r+20>>2]=A,n[A+24>>2]=r)}}while(0);if(n[o+4>>2]=1|a,n[f+a>>2]=a,(0|o)==(0|n[6926]))return void(n[6923]=a)}if(A=a>>>3,a>>>0<256)return r=27724+(A<<1<<2)|0,(e=0|n[6921])&(A=1<<A)?A=0|n[(e=r+8|0)>>2]:(n[6921]=e|A,A=r,e=r+8|0),n[e>>2]=o,n[A+12>>2]=o,n[o+8>>2]=A,void(n[o+12>>2]=r);A=27988+((i=(A=a>>>8)?a>>>0>16777215?31:a>>>(7+(i=14-((t=(520192+(l=A<<(f=(A+1048320|0)>>>16&8))|0)>>>16&4)|f|(i=(245760+(l<<=t)|0)>>>16&2))+(l<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[o+28>>2]=i,n[o+20>>2]=0,n[o+16>>2]=0,e=0|n[6922],r=1<<i;A:do{if(e&r){A=0|n[A>>2];e:do{if((-8&n[A+4>>2]|0)!=(0|a)){for(i=a<<(31==(0|i)?0:25-(i>>>1)|0);e=0|n[(r=A+16+(i>>>31<<2)|0)>>2];){if((-8&n[e+4>>2]|0)==(0|a)){A=e;break e}i<<=1,A=e}n[r>>2]=o,n[o+24>>2]=A,n[o+12>>2]=o,n[o+8>>2]=o;break A}}while(0);n[12+(l=0|n[(f=A+8|0)>>2])>>2]=o,n[f>>2]=o,n[o+8>>2]=l,n[o+12>>2]=A,n[o+24>>2]=0}else n[6922]=e|r,n[A>>2]=o,n[o+24>>2]=A,n[o+12>>2]=o,n[o+8>>2]=o}while(0);if(n[6929]=l=(0|n[6929])-1|0,!(0|l)){for(A=28140;A=0|n[A>>2];)A=A+8|0;n[6929]=-1}}}}function Me(A,e){e|=0;var r=0;return(A|=0)?(r=0|h(e,A),(e|A)>>>0>65535&&(r=(0|(r>>>0)/(A>>>0))==(0|e)?r:-1)):r=0,(A=0|_e(r))&&3&n[A+-4>>2]?(Ze(0|A,0,0|r),0|A):0|A}function Pe(A,e){e|=0;var r=0,i=0;return(A|=0)?e>>>0>4294967231?(n[(e=27680)>>2]=12,0|(e=0)):0|(r=0|function(A,e){e|=0;var r,i,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0;if(u=(A|=0)+(a=-8&(s=0|n[(i=A+4|0)>>2]))|0,!(3&s))return e>>>0<256?0|(A=0):a>>>0>=(e+4|0)>>>0&&(a-e|0)>>>0<=n[7041]<<1>>>0?0|A:0|(A=0);if(a>>>0>=e>>>0)return(a=a-e|0)>>>0<=15?0|A:(c=A+e|0,n[i>>2]=1&s|e|2,n[c+4>>2]=3|a,n[(s=u+4|0)>>2]=1|n[s>>2],Ie(c,a),0|A);if((0|n[6927])==(0|u))return a=(c=(0|n[6924])+a|0)-e|0,t=A+e|0,c>>>0<=e>>>0?0|(A=0):(n[i>>2]=1&s|e|2,n[t+4>>2]=1|a,n[6927]=t,n[6924]=a,0|A);if((0|n[6926])==(0|u))return(t=(0|n[6923])+a|0)>>>0<e>>>0?0|(A=0):((a=t-e|0)>>>0>15?(c=A+e|0,t=A+t|0,n[i>>2]=1&s|e|2,n[c+4>>2]=1|a,n[t>>2]=a,n[(t=t+4|0)>>2]=-2&n[t>>2],t=c):(n[i>>2]=1&s|t|2,n[(t=A+t+4|0)>>2]=1|n[t>>2],t=0,a=0),n[6923]=a,n[6926]=t,0|A);if(2&(t=0|n[u+4>>2])|0)return 0;if((r=(-8&t)+a|0)>>>0<e>>>0)return 0;c=r-e|0,f=t>>>3;do{if(t>>>0<256){if((0|(a=0|n[u+12>>2]))==(0|(t=0|n[u+8>>2]))){n[6921]=n[6921]&~(1<<f);break}n[t+12>>2]=a,n[a+8>>2]=t;break}l=0|n[u+24>>2],a=0|n[u+12>>2];do{if((0|a)==(0|u)){if(a=0|n[(f=4+(t=u+16|0)|0)>>2])t=f;else if(!(a=0|n[t>>2])){f=0;break}for(;;)if(f=0|n[(o=a+20|0)>>2])a=f,t=o;else{if(!(f=0|n[(o=a+16|0)>>2]))break;a=f,t=o}n[t>>2]=0,f=a}else n[12+(f=0|n[u+8>>2])>>2]=a,n[a+8>>2]=f,f=a}while(0);if(0|l){if((0|n[(t=27988+((a=0|n[u+28>>2])<<2)|0)>>2])==(0|u)){if(n[t>>2]=f,!f){n[6922]=n[6922]&~(1<<a);break}}else if(n[((0|n[(o=l+16|0)>>2])==(0|u)?o:l+20|0)>>2]=f,!f)break;n[f+24>>2]=l,0|(t=0|n[(a=u+16|0)>>2])&&(n[f+16>>2]=t,n[t+24>>2]=f),0|(a=0|n[a+4>>2])&&(n[f+20>>2]=a,n[a+24>>2]=f)}}while(0);return c>>>0<16?(n[i>>2]=1&s|r|2,n[(s=A+r+4|0)>>2]=1|n[s>>2],0|A):(u=A+e|0,n[i>>2]=1&s|e|2,n[u+4>>2]=3|c,n[(s=A+r+4|0)>>2]=1|n[s>>2],Ie(u,c),0|A)}(A+-8|0,e>>>0<11?16:e+11&-8))?0|(e=r+8|0):(r=0|_e(e))?(Ne(0|r,0|A,0|((i=(-8&(i=0|n[A+-4>>2]))-(0==(3&i|0)?8:4)|0)>>>0<e>>>0?i:e)),ye(A),0|(e=r)):0|(e=0):0|(e=0|_e(e))}function Ie(A,e){var r=0,i=0,a=0,t=0,f=0,o=0;o=(A|=0)+(e|=0)|0,r=0|n[A+4>>2];do{if(1&r)f=A;else{if(!(3&r))return;if(e=(a=0|n[A>>2])+e|0,(0|n[6926])==(0|(f=A+(0-a)|0))){if(3!=(3&(r=0|n[(A=o+4|0)>>2])|0))break;return n[6923]=e,n[A>>2]=-2&r,n[f+4>>2]=1|e,void(n[o>>2]=e)}if(i=a>>>3,a>>>0<256){if((0|(r=0|n[f+12>>2]))==(0|(A=0|n[f+8>>2]))){n[6921]=n[6921]&~(1<<i);break}n[A+12>>2]=r,n[r+8>>2]=A;break}t=0|n[f+24>>2],A=0|n[f+12>>2];do{if((0|A)==(0|f)){if(A=0|n[(i=4+(r=f+16|0)|0)>>2])r=i;else if(!(A=0|n[r>>2])){A=0;break}for(;;)if(i=0|n[(a=A+20|0)>>2])A=i,r=a;else{if(!(i=0|n[(a=A+16|0)>>2]))break;A=i,r=a}n[r>>2]=0}else n[12+(a=0|n[f+8>>2])>>2]=A,n[A+8>>2]=a}while(0);if(t){if((0|n[(i=27988+((r=0|n[f+28>>2])<<2)|0)>>2])==(0|f)){if(n[i>>2]=A,!A){n[6922]=n[6922]&~(1<<r);break}}else if(n[((0|n[(a=t+16|0)>>2])==(0|f)?a:t+20|0)>>2]=A,!A)break;n[A+24>>2]=t,0|(i=0|n[(r=f+16|0)>>2])&&(n[A+16>>2]=i,n[i+24>>2]=A),(r=0|n[r+4>>2])&&(n[A+20>>2]=r,n[r+24>>2]=A)}}}while(0);if(2&(i=0|n[(A=o+4|0)>>2]))n[A>>2]=-2&i,n[f+4>>2]=1|e,n[f+e>>2]=e,a=e;else{if((0|n[6927])==(0|o)){if(n[6924]=o=(0|n[6924])+e|0,n[6927]=f,n[f+4>>2]=1|o,(0|f)!=(0|n[6926]))return;return n[6926]=0,void(n[6923]=0)}if((0|n[6926])==(0|o))return n[6923]=o=(0|n[6923])+e|0,n[6926]=f,n[f+4>>2]=1|o,void(n[f+o>>2]=o);a=(-8&i)+e|0,r=i>>>3;do{if(i>>>0<256){if((0|(e=0|n[o+12>>2]))==(0|(A=0|n[o+8>>2]))){n[6921]=n[6921]&~(1<<r);break}n[A+12>>2]=e,n[e+8>>2]=A;break}t=0|n[o+24>>2],e=0|n[o+12>>2];do{if((0|e)==(0|o)){if(e=0|n[(r=4+(A=o+16|0)|0)>>2])A=r;else if(!(e=0|n[A>>2])){r=0;break}for(;;)if(r=0|n[(i=e+20|0)>>2])e=r,A=i;else{if(!(r=0|n[(i=e+16|0)>>2]))break;e=r,A=i}n[A>>2]=0,r=e}else n[12+(r=0|n[o+8>>2])>>2]=e,n[e+8>>2]=r,r=e}while(0);if(0|t){if((0|n[(A=27988+((e=0|n[o+28>>2])<<2)|0)>>2])==(0|o)){if(n[A>>2]=r,!r){n[6922]=n[6922]&~(1<<e);break}}else if(n[((0|n[(i=t+16|0)>>2])==(0|o)?i:t+20|0)>>2]=r,!r)break;n[r+24>>2]=t,0|(A=0|n[(e=o+16|0)>>2])&&(n[r+16>>2]=A,n[A+24>>2]=r),0|(e=0|n[e+4>>2])&&(n[r+20>>2]=e,n[e+24>>2]=r)}}while(0);if(n[f+4>>2]=1|a,n[f+a>>2]=a,(0|f)==(0|n[6926]))return void(n[6923]=a)}if(e=a>>>3,a>>>0<256)return r=27724+(e<<1<<2)|0,(A=0|n[6921])&(e=1<<e)?e=0|n[(A=r+8|0)>>2]:(n[6921]=A|e,e=r,A=r+8|0),n[A>>2]=f,n[e+12>>2]=f,n[f+8>>2]=e,void(n[f+12>>2]=r);if(e=27988+((i=(e=a>>>8)?a>>>0>16777215?31:a>>>(7+(i=14-((r=(520192+(o=e<<(t=(e+1048320|0)>>>16&8))|0)>>>16&4)|t|(i=(245760+(o<<=r)|0)>>>16&2))+(o<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[f+28>>2]=i,n[f+20>>2]=0,n[f+16>>2]=0,!((A=0|n[6922])&(r=1<<i)))return n[6922]=A|r,n[e>>2]=f,n[f+24>>2]=e,n[f+12>>2]=f,void(n[f+8>>2]=f);e=0|n[e>>2];A:do{if((-8&n[e+4>>2]|0)!=(0|a)){for(i=a<<(31==(0|i)?0:25-(i>>>1)|0);A=0|n[(r=e+16+(i>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|a)){e=A;break A}i<<=1,e=A}return n[r>>2]=f,n[f+24>>2]=e,n[f+12>>2]=f,void(n[f+8>>2]=f)}}while(0);n[12+(o=0|n[(t=e+8|0)>>2])>>2]=f,n[t>>2]=f,n[f+8>>2]=o,n[f+12>>2]=e,n[f+24>>2]=0}function pe(A,e,r,i){return 0|(D((e|=0)+(i|=0)+((r=(A|=0)+(r|=0)>>>0)>>>0<A>>>0|0)>>>0|0),0|r)}function Te(A,e,r,i){return 0|(D(0|(i=(e|=0)-(i|=0)-((r|=0)>>>0>(A|=0)>>>0|0)>>>0)),A-r>>>0|0)}function Fe(A){return 0|((A|=0)?31-(0|Q(A^A-1))|0:32)}function Le(A,e,r,i,a){a|=0;var t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(c=A|=0,f=r|=0,o=b=i|=0,!(u=l=e|=0))return t=0!=(0|a),o?t?(n[a>>2]=0|A,n[a+4>>2]=0&e,a=0,0|(D(0|(b=0)),a)):(a=0,0|(D(0|(b=0)),a)):(t&&(n[a>>2]=(c>>>0)%(f>>>0),n[a+4>>2]=0),a=(c>>>0)/(f>>>0)>>>0,0|(D(0|(b=0)),a));t=0==(0|o);do{if(f){if(!t){if((t=(0|Q(0|o))-(0|Q(0|u))|0)>>>0<=31){f=s=t+1|0,A=c>>>(s>>>0)&(e=t-31>>31)|u<<(o=31-t|0),e&=u>>>(s>>>0),t=0,o=c<<o;break}return a?(n[a>>2]=0|A,n[a+4>>2]=l|0&e,a=0,0|(D(0|(b=0)),a)):(a=0,0|(D(0|(b=0)),a))}if((t=f-1|0)&f|0){f=o=33+(0|Q(0|f))-(0|Q(0|u))|0,A=(s=32-o|0)-1>>31&u>>>((d=o-32|0)>>>0)|(u<<s|c>>>(o>>>0))&(e=d>>31),e&=u>>>(o>>>0),t=c<<(g=64-o|0)&(l=s>>31),o=(u<<g|c>>>(d>>>0))&l|c<<s&o-33>>31;break}return 0|a&&(n[a>>2]=t&c,n[a+4>>2]=0),1==(0|f)?(g=0|A,0|(D(0|(d=l|0&e)),g)):(d=u>>>((g=0|Fe(0|f))>>>0)|0,g=u<<32-g|c>>>(g>>>0)|0,0|(D(0|d),g))}if(t)return 0|a&&(n[a>>2]=(u>>>0)%(f>>>0),n[a+4>>2]=0),g=(u>>>0)/(f>>>0)>>>0,0|(D(0|(d=0)),g);if(!c)return 0|a&&(n[a>>2]=0,n[a+4>>2]=(u>>>0)%(o>>>0)),g=(u>>>0)/(o>>>0)>>>0,0|(D(0|(d=0)),g);if(!((t=o-1|0)&o))return 0|a&&(n[a>>2]=0|A,n[a+4>>2]=t&u|0&e),d=0,g=u>>>((0|Fe(0|o))>>>0),0|(D(0|d),g);if((t=(0|Q(0|o))-(0|Q(0|u))|0)>>>0<=30){f=e=t+1|0,A=u<<(o=31-t|0)|c>>>(e>>>0),e=u>>>(e>>>0),t=0,o=c<<o;break}return a?(n[a>>2]=0|A,n[a+4>>2]=l|0&e,g=0,0|(D(0|(d=0)),g)):(g=0,0|(D(0|(d=0)),g))}while(0);if(f){u=0|pe(0|(s=0|r),0|(c=b|0&i),-1,-1),r=0|C(),l=o,o=0;do{i=l,l=t>>>31|l<<1,t=o|t<<1,Te(0|u,0|r,0|(i=A<<1|i>>>31|0),0|(b=A>>>31|e<<1|0)),o=1&(d=(g=0|C())>>31|((0|g)<0?-1:0)<<1),A=0|Te(0|i,0|b,d&s|0,(((0|g)<0?-1:0)>>31|((0|g)<0?-1:0)<<1)&c|0),e=0|C(),f=f-1|0}while(0!=(0|f));u=l,l=0}else u=o,l=0,o=0;return f=0,0|a&&(n[a>>2]=A,n[a+4>>2]=e),g=-2&(t<<1|0)|o,0|(D(0|(d=(0|t)>>>31|(u|f)<<1|0&(f<<1|t>>>31)|l)),g)}function Ge(A,e,r,i){var n,a,t,f,o;return r|=0,a=(i|=0)>>31|((0|i)<0?-1:0)<<1,n=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,t=0|Te((o=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0)|0,(f=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|o,0|f),A=a^o,e=n^f,0|Te((0|Le(t,0|C(),0|Te(a^r|0,n^i|0,0|a,0|n),0|C(),0))^A|0,(0|C())^e|0,0|A,0|e)}function Ue(A,e,r,i){var n,a;return e|=0,i|=0,r=0|function(A,e){var r,i,n,a=0;return A=((r=0|h(a=65535&(e|=0),n=65535&(A|=0)))>>>16)+(0|h(a,i=A>>>16))|0,e=0|h(a=e>>>16,n),0|(D((A>>>16)+(0|h(a,i))+(((65535&A)+e|0)>>>16)|0),A+e<<16|65535&r|0)}(n=A|=0,a=r|=0),A=0|C(),0|(D((0|h(e,a))+(0|h(i,n))+A|0&A|0),0|r)}function ze(A,e,r,i){var a,t,f,o,l,u;return r|=0,a=T,T=T+16|0,o=0|a,u=(i|=0)>>31|((0|i)<0?-1:0)<<1,l=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,Le(A=0|Te((f=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0)|0,(t=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|f,0|t),e=0|C(),0|Te(u^r|0,l^i|0,0|u,0|l),0|C(),o),i=0|Te(n[o>>2]^f|0,n[o+4>>2]^t|0,0|f,0|t),r=0|C(),T=a,0|(D(0|r),i)}function xe(A,e,r,i){var a,t;return t=T,T=T+16|0,Le(A|=0,e|=0,r|=0,i|=0,a=0|t),T=t,0|(D(0|n[a+4>>2]),0|n[a>>2])}function Ve(A,e,r){return A|=0,e|=0,(0|(r|=0))<32?(D(e>>r|0),A>>>r|(e&(1<<r)-1)<<32-r):(D(0|((0|e)<0?-1:0)),e>>r-32|0)}function Se(A,e,r){return A|=0,e|=0,(0|(r|=0))<32?(D(e>>>r|0),A>>>r|(e&(1<<r)-1)<<32-r):(D(0),e>>>r-32|0)}function He(A,e,r){return A|=0,(0|(r|=0))<32?(D((e|=0)<<r|(A&(1<<r)-1<<32-r)>>>32-r|0),A<<r):(D(A<<r-32|0),0)}function Re(A,e,r){return A|=0,32==(0|(e=0|Q(e|=0)))&&(e=e+(0|Q(A))|0),D(0),0|e}function Ye(A,e){return e=+e,(A=+A)!=A?+e:e!=e?+A:+v(+A,+e)}function je(A,e){return e=+e,(A=+A)!=A?+e:e!=e?+A:+m(+A,+e)}function Oe(A){return(A=+A)>=0?+o(A+.5):+B(A-.5)}function Ne(A,e,r){A|=0,e|=0;var a,t,f=0;if((0|(r|=0))>=8192)return P(0|A,0|e,0|r),0|A;if(t=0|A,a=A+r|0,(3&A)==(3&e)){for(;3&A;){if(!r)return 0|t;i[A>>0]=0|i[e>>0],A=A+1|0,e=e+1|0,r=r-1|0}for(f=(r=-4&a|0)-64|0;(0|A)<=(0|f);)n[A>>2]=n[e>>2],n[A+4>>2]=n[e+4>>2],n[A+8>>2]=n[e+8>>2],n[A+12>>2]=n[e+12>>2],n[A+16>>2]=n[e+16>>2],n[A+20>>2]=n[e+20>>2],n[A+24>>2]=n[e+24>>2],n[A+28>>2]=n[e+28>>2],n[A+32>>2]=n[e+32>>2],n[A+36>>2]=n[e+36>>2],n[A+40>>2]=n[e+40>>2],n[A+44>>2]=n[e+44>>2],n[A+48>>2]=n[e+48>>2],n[A+52>>2]=n[e+52>>2],n[A+56>>2]=n[e+56>>2],n[A+60>>2]=n[e+60>>2],A=A+64|0,e=e+64|0;for(;(0|A)<(0|r);)n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}else for(r=a-4|0;(0|A)<(0|r);)i[A>>0]=0|i[e>>0],i[A+1>>0]=0|i[e+1>>0],i[A+2>>0]=0|i[e+2>>0],i[A+3>>0]=0|i[e+3>>0],A=A+4|0,e=e+4|0;for(;(0|A)<(0|a);)i[A>>0]=0|i[e>>0],A=A+1|0,e=e+1|0;return 0|t}function We(A,e,r){var n=0;if((0|(e|=0))<(0|(A|=0))&(0|A)<(e+(r|=0)|0)){for(n=A,e=e+r|0,A=A+r|0;(0|r)>0;)r=r-1|0,i[(A=A-1|0)>>0]=0|i[(e=e-1|0)>>0];A=n}else Ne(A,e,r);return 0|A}function Ze(A,e,r){e|=0;var a,t=0,f=0,o=0;if(a=(A|=0)+(r|=0)|0,e&=255,(0|r)>=67){for(;3&A;)i[A>>0]=e,A=A+1|0;for(o=e|e<<8|e<<16|e<<24,f=(t=-4&a|0)-64|0;(0|A)<=(0|f);)n[A>>2]=o,n[A+4>>2]=o,n[A+8>>2]=o,n[A+12>>2]=o,n[A+16>>2]=o,n[A+20>>2]=o,n[A+24>>2]=o,n[A+28>>2]=o,n[A+32>>2]=o,n[A+36>>2]=o,n[A+40>>2]=o,n[A+44>>2]=o,n[A+48>>2]=o,n[A+52>>2]=o,n[A+56>>2]=o,n[A+60>>2]=o,A=A+64|0;for(;(0|A)<(0|t);)n[A>>2]=o,A=A+4|0}for(;(0|A)<(0|a);)i[A>>0]=e,A=A+1|0;return a-r|0}function Je(A){return(A=+A)>=0?+o(A+.5):+B(A-.5)}function Ke(A){var e,r,i;return A|=0,i=0|M(),(0|A)>0&(0|(e=(r=0|n[f>>2])+A|0))<(0|r)|(0|e)<0?(p(0|e),y(12),-1):(0|e)>(0|i)&&!(0|I(0|e))?(y(12),-1):(n[f>>2]=e,0|r)}var Xe=[function(A,e){return E(0),0},function(A,e){var r=0,i=0;return A=0|n[(i=A|=0)>>2],e=0|n[(r=e|=0)>>2],0|((i=0|n[i+4>>2])>>>0<(r=0|n[r+4>>2])>>>0|(0|i)==(0|r)&A>>>0<e>>>0?-1:1&(i>>>0>r>>>0|(0|i)==(0|r)&A>>>0>e>>>0))},function(A,e){var r,i,t,f,o=0,l=0;return f=0|n[(l=A|=0)>>2],t=0|n[(o=e|=0)>>2],(l=0|n[l+4>>2])>>>0<(o=0|n[o+4>>2])>>>0|(0|l)==(0|o)&f>>>0<t>>>0?0|(e=-1):l>>>0>o>>>0|(0|l)==(0|o)&f>>>0>t>>>0?0|(e=1):(i=+a[A+8>>3])<(r=+a[e+8>>3])?0|(e=-1):0|(e=i>r&1)},function(A,e){var r,i;return 0|((i=+a[(A|=0)>>3])>(r=+a[(e|=0)>>3])?-1:i<r&1)}];return{___divdi3:Ge,___muldi3:Ue,___remdi3:ze,___uremdi3:xe,_areNeighborCells:function(A,e,r,i,a){a|=0;var t,f,o,l=0,u=0,c=0,s=0;if(o=T,T=T+64|0,f=o,t=o+56|0,!(!0&134217728==(2013265920&(e|=0)|0)&!0&134217728==(2013265920&(i|=0)|0)))return T=o,5;if((0|(A|=0))==(0|(r|=0))&(0|e)==(0|i))return n[a>>2]=0,T=o,0;if(u=0|Se(0|A,0|e,52),C(),u&=15,s=0|Se(0|r,0|i,52),C(),(0|u)!=(15&s|0))return T=o,12;if(l=u+-1|0,u>>>0>1){EA(A,e,l,f),EA(r,i,l,t),c=0|n[(s=f)>>2],s=0|n[s+4>>2];A:do{if((0|c)==(0|n[t>>2])&&(0|s)==(0|n[t+4>>2])){l=0|Se(0|A,0|e,0|(u=3*(15^u)|0)),C(),l&=7,u=0|Se(0|r,0|i,0|u),C(),u&=7;do{if(0==(0|l)|0==(0|u))n[a>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|u)&&0|CA(c,s)){l=5;break}if((0|n[15824+(l<<2)>>2])!=(0|u)&&(0|n[15856+(l<<2)>>2])!=(0|u))break A;n[a>>2]=1,l=0}}while(0);return T=o,0|l}}while(0)}u=(l=f)+56|0;do{n[l>>2]=0,l=l+4|0}while((0|l)<(0|u));return F(A,e,1,f),l=(0|n[(e=f)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+8|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+16|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+24|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+32|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+40|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)?1:1&((0|n[(l=f+48|0)>>2])==(0|r)?(0|n[l+4>>2])==(0|i):0),n[a>>2]=l,T=o,0},_bitshift64Ashr:Ve,_bitshift64Lshr:Se,_bitshift64Shl:He,_calloc:Me,_cellAreaKm2:function(A,e,r){r|=0;var i,t,f,o=0;return f=T,T=T+192|0,i=f+176|0,o=f+168|0,(A=0|VA(A|=0,e|=0,t=f))?(T=f,0|(o=A)):(n[o>>2]=n[t>>2],n[o+4>>2]=t+8,n[i>>2]=n[o>>2],n[i+4>>2]=n[o+4>>2],R(i,r),a[r>>3]=40589732.49931477*+a[r>>3],T=f,0|(o=0))},_cellAreaM2:function(A,e,r){r|=0;var i,t,f,o=0;return f=T,T=T+192|0,i=f+176|0,o=f+168|0,(A=0|VA(A|=0,e|=0,t=f))?(T=f,0|(o=A)):(n[o>>2]=n[t>>2],n[o+4>>2]=t+8,n[i>>2]=n[o>>2],n[i+4>>2]=n[o+4>>2],R(i,r),a[r>>3]=40589732.49931477*+a[r>>3]*1e6,T=f,0|(o=0))},_cellAreaRads2:function(A,e,r){r|=0;var i,a,t,f=0;return t=T,T=T+192|0,i=t+176|0,f=t+168|0,0|(A=0|VA(A|=0,e|=0,a=t))?(T=t,0|(f=A)):(n[f>>2]=n[a>>2],n[f+4>>2]=a+8,n[i>>2]=n[f>>2],n[i+4>>2]=n[f+4>>2],R(i,r),T=t,0|(f=0))},_cellToBoundary:VA,_cellToCenterChild:yA,_cellToChildPos:function(A,e,r,i){r|=0,i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0;if(a=T,T=T+16|0,B=a,h=0|Se(0|(A|=0),0|(e|=0),52),C(),r>>>0>15)return T=a,4;if((0|(h&=15))<(0|r))return T=a,12;if((0|h)!=(0|r))if(f=0|He(0|r,0,52),f|=A,l=0|C()|-15728641&e,(0|h)>(0|r)){u=r;do{k=0|He(7,0,3*(14-u|0)|0),u=u+1|0,f|=k,l=0|C()|l}while((0|u)<(0|h));k=f}else k=f;else k=A,l=e;w=0|Se(0|k,0|l,45),C();A:do{if(0|Y(127&w)){if(u=0|Se(0|k,0|l,52),C(),0|(u&=15))for(f=1;;){if(!(0==((w=0|He(7,0,3*(15-f|0)|0))&k|0)&0==((0|C())&l|0))){c=33;break A}if(!(f>>>0<u>>>0))break;f=f+1|0}if(n[(w=i)>>2]=0,n[w+4>>2]=0,(0|h)>(0|r)){for(w=-15728641&e,g=h;;){if(d=g,(g=g+-1|0)>>>0>15|(0|h)<(0|g)){c=19;break}if((0|h)!=(0|g))if(f=0|He(0|g,0,52),f|=A,u=0|C()|w,(0|h)<(0|d))b=f;else{c=g;do{b=0|He(7,0,3*(14-c|0)|0),c=c+1|0,f|=b,u=0|C()|u}while((0|c)<(0|h));b=f}else b=A,u=e;if(s=0|Se(0|b,0|u,45),C(),0|Y(127&s)){s=0|Se(0|b,0|u,52),C(),s&=15;e:do{if(s)for(c=1;;){if(f=0|Se(0|b,0|u,3*(15-c|0)|0),C(),0|(f&=7))break e;if(!(c>>>0<s>>>0)){f=0;break}c=c+1|0}else f=0}while(0);f=0==(0|f)&1}else f=0;if(u=0|Se(0|A,0|e,3*(15-d|0)|0),C(),7==(0|(u&=7))){t=5,c=42;break}if(1==(0|u)&(f=0!=(0|f))){t=5,c=42;break}if(0|(b=u+((0!=(0|u)&f)<<31>>31)|0)&&(c=0|$A(7,0,c=h-d|0,((0|c)<0)<<31>>31),s=0|C(),f?(f=0|pe(0|(f=0|Ue(0|c,0|s,5,0)),0|C(),-5,-1),f=0|pe(0|(f=0|Ge(0|f,0|C(),6,0)),0|C(),1,0),u=0|C()):(f=c,u=s),d=0|pe(0|f,0|u,0|(d=0|Ue(0|c,0|s,0|(d=b+-1|0),((0|d)<0)<<31>>31|0)),0|C()),s=0|pe(0|d,0|(b=0|C()),0|n[(s=i)>>2],0|n[s+4>>2]),b=0|C(),n[(d=i)>>2]=s,n[d+4>>2]=b),(0|g)<=(0|r)){c=37;break}}if(19==(0|c))_(27634,27225,1407,27259);else{if(37==(0|c)){t=0|n[(o=i)+4>>2],o=0|n[o>>2];break}if(42==(0|c))return T=a,0|t}}else t=0,o=0}else c=33}while(0);A:do{if(33==(0|c)){if(n[(w=i)>>2]=0,n[w+4>>2]=0,(0|h)>(0|r)){for(f=h;;){if(t=0|Se(0|A,0|e,3*(15-f|0)|0),C(),7==(0|(t&=7))){t=5;break}if(t=0|Ue(0|(o=0|$A(7,0,o=h-f|0,((0|o)<0)<<31>>31)),0|C(),0|t,0),o=0|C(),o=0|pe(0|n[(w=i)>>2],0|n[w+4>>2],0|t,0|o),t=0|C(),n[(w=i)>>2]=o,n[w+4>>2]=t,(0|(f=f+-1|0))<=(0|r))break A}return T=a,0|t}t=0,o=0}}while(0);return 0|DA(k,l,h,B)&&_(27634,27225,1367,27274),((0|t)>-1|-1==(0|t)&o>>>0>4294967295)&((0|(B=0|n[(h=B)+4>>2]))>(0|t)|((0|B)==(0|t)?(0|n[h>>2])>>>0>o>>>0:0))?(T=a,0|(h=0)):(_(27634,27225,1447,27259),0)},_cellToChildren:function(A,e,r,i){i|=0;var a,t,f=0,o=0;if(t=T,T=T+16|0,HA(a=t,A|=0,e|=0,r|=0),0==(0|(A=0|n[(e=a)>>2]))&0==(0|(e=0|n[e+4>>2])))return T=t,0;f=0,r=0;do{n[(o=i+(f<<3)|0)>>2]=A,n[o+4>>2]=e,f=0|pe(0|f,0|r,1,0),r=0|C(),YA(a),A=0|n[(o=a)>>2],e=0|n[o+4>>2]}while(!(0==(0|A)&0==(0|e)));return T=t,0},_cellToChildrenSize:DA,_cellToLatLng:xA,_cellToLocalIj:function(A,e,r,i,a,t){t|=0;var f,o=0;return f=T,T=T+16|0,o=f,0|(a|=0)?(T=f,0|(o=15)):((A=0|JA(A|=0,e|=0,r|=0,i|=0,o))||(a=0|n[o+4>>2],n[t>>2]=(0|n[o>>2])-(A=0|n[o+8>>2]),n[t+4>>2]=a-A,A=0),T=f,0|(o=A))},_cellToParent:EA,_cellToVertex:ge,_cellToVertexes:function(A,e,r){r|=0;var i,a=0,t=0;return t=0==(0|CA(A|=0,e|=0)),i=0==(0|(a=0|ge(A,e,0,r))),t?i?0|(a=0|ge(A,e,1,r+8|0))?0|(t=a):0|(a=0|ge(A,e,2,r+16|0))?0|(t=a):0|(a=0|ge(A,e,3,r+24|0))?0|(t=a):(a=0|ge(A,e,4,r+32|0))?0|(t=a):0|ge(A,e,5,r+40|0):0|(t=a):i?0|(a=0|ge(A,e,1,r+8|0))?0|(t=a):0|(a=0|ge(A,e,2,r+16|0))?0|(t=a):0|(a=0|ge(A,e,3,r+24|0))?0|(t=a):0|(a=0|ge(A,e,4,r+32|0))?0|(t=a):(n[(t=r+40|0)>>2]=0,n[t+4>>2]=0,0|(t=0)):0|(t=a)},_cellsToDirectedEdge:function(A,e,r,i,a){return a|=0,7==(0|(r=0|S(A|=0,e|=0,r|=0,i|=0)))?0|(a=11):(i=0|He(0|r,0,56),e=-2130706433&e|0|C()|268435456,n[a>>2]=A|i,n[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(A,e,r){r|=0;var i,a,t,f=0,o=0,l=0,u=0;if(a=T,T=T+16|0,0|(A=0|nA(A|=0,e|=0,((0|e)<0)<<31>>31,t=a)))return T=a,0|A;if(i=0|function(A,e){A|=0;var r,i,a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(n[(e|=0)>>2]=0,n[(i=e+4|0)>>2]=0,n[(a=e+8|0)>>2]=0,(0|(B=0|n[A>>2]))<=0)return 0;r=A+4|0,A=e,k=0;A:for(;;){if(k){if(!(t=0|Me(1,12))){t=5;break}n[A+8>>2]=t,A=t}if(s=0|n[r>>2],!(b=0|Me(1,12))){A=13,t=37;break}if(n[(0==(0|(f=0|n[(w=A+4|0)>>2]))?A:f+8|0)>>2]=b,n[w>>2]=b,(0|(f=0|n[s+(k<<4)>>2]))<3){A=1,t=37;break}o=s+(k<<4)+4|0,l=b+4|0,t=0,u=0;do{if(c=u,!(u=0|_e(24))){A=13,t=37;break A}We(0|u,(0|n[o>>2])+(t<<4)|0,16),n[u+16>>2]=0,c?n[c+16>>2]=u:n[b>>2]=u,n[l>>2]=u,t=t+1|0}while((0|t)<(0|f));if((0|(g=0|n[s+(k<<4)+8>>2]))>0){d=s+(k<<4)+12|0,s=0;do{if(f=0|n[d>>2],t=b,!(b=0|Me(1,12))){A=13,t=37;break A}if(n[t+8>>2]=b,n[w>>2]=b,(0|(c=0|n[f+(s<<3)>>2]))<3){A=1,t=37;break A}f=f+(s<<3)+4|0,o=b+4|0,t=0,l=0;do{if(u=l,!(l=0|_e(24))){A=13,t=37;break A}We(0|l,(0|n[f>>2])+(t<<4)|0,16),n[l+16>>2]=0,u?n[u+16>>2]=l:n[b>>2]=l,n[o>>2]=l,t=t+1|0}while((0|t)<(0|c));s=s+1|0}while((0|s)<(0|g))}if((0|(k=k+1|0))>=(0|B)){A=0,t=50;break}}if(5==(0|t)){if(!e)return 13;for(f=1,o=e;;){if(0|(A=0|n[o>>2]))do{if(0|(t=0|n[A>>2]))do{B=t,t=0|n[t+16>>2],ye(B)}while(0!=(0|t));B=A,A=0|n[A+8>>2],ye(B)}while(0!=(0|A));if(A=o,o=0|n[o+8>>2],f?(n[e>>2]=0,n[i>>2]=0,n[a>>2]=0):ye(A),!o){A=13;break}f=0}return 0|A}if(37==(0|t)){if(!e)return 0|A;for(o=1,l=e;;){if(0|(t=0|n[l>>2]))do{if(0|(f=0|n[t>>2]))do{B=f,f=0|n[f+16>>2],ye(B)}while(0!=(0|f));B=t,t=0|n[t+8>>2],ye(B)}while(0!=(0|t));if(t=l,l=0|n[l+8>>2],o?(n[e>>2]=0,n[i>>2]=0,n[a>>2]=0):ye(t),!l)break;o=0}return 0|A}return 50==(0|t)?0|A:0}(t,r),r=t+4|0,(0|n[t>>2])>0){e=0;do{if(ye(0|n[(f=(o=0|n[r>>2])+(e<<4)+4|0)>>2]),n[f>>2]=0,n[o+(e<<4)>>2]=0,f=o+(e<<4)+8|0,o=o+(e<<4)+12|0,(0|n[f>>2])>0){A=0;do{ye(0|n[(u=(l=0|n[o>>2])+(A<<3)+4|0)>>2]),n[u>>2]=0,n[l+(A<<3)>>2]=0,A=A+1|0}while((0|A)<(0|n[f>>2]))}ye(0|n[o>>2]),n[o>>2]=0,n[f>>2]=0,e=e+1|0}while((0|e)<(0|n[t>>2]))}return ye(0|n[r>>2]),n[r>>2]=0,n[t>>2]=0,T=a,0|i},_childPosToCell:function(A,e,r,i,a,t){A|=0,e|=0,t|=0;var f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(f=T,T=T+16|0,o=f,(a|=0)>>>0>15)return T=f,4;if(l=0|Se(0|(r|=0),0|(i|=0),52),C(),(0|(l&=15))>(0|a))return T=f,12;if(0|DA(r,i,a,o)&&_(27634,27225,1367,27274),!(((0|e)>-1|-1==(0|e)&A>>>0>4294967295)&((0|(c=0|n[(s=o)+4>>2]))>(0|e)|((0|c)==(0|e)?(0|n[s>>2])>>>0>A>>>0:0))))return T=f,2;s=a-l|0,a=0|He(0|a,0,52),u=0|C()|-15728641&i,n[(c=t)>>2]=a|r,n[c+4>>2]=u,c=0|Se(0|r,0|i,45),C();A:do{if(0|Y(127&c)){if(0|l)for(o=1;;){if(!(0==((c=0|He(7,0,3*(15-o|0)|0))&r|0)&0==((0|C())&i|0)))break A;if(!(o>>>0<l>>>0))break;o=o+1|0}if((0|s)<1)return T=f,0;for(c=15^l,i=-1,u=1,o=1;;){l=0|$A(7,0,l=s-u|0,((0|l)<0)<<31>>31),r=0|C();do{if(o){if(o=0|Ge(0|(o=0|pe(0|(o=0|Ue(0|l,0|r,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(a=0|C()))|(0|e)==(0|a)&A>>>0>o>>>0){e=0|Te(0|(e=0|pe(0|A,0|e,-1,-1)),0|C(),0|o,0|a),o=0|C(),g=0|n[(b=t)>>2],b=0|n[b+4>>2],d=0|He(7,0,0|(w=3*(c+i|0)|0)),b&=~(0|C()),w=0|He(0|(a=0|pe(0|(i=0|Ge(0|e,0|o,0|l,0|r)),0|(A=0|C()),2,0)),0|C(),0|w),b=0|C()|b,n[(a=t)>>2]=w|g&~d,n[a+4>>2]=b,A=0|Te(0|e,0|o,0|(A=0|Ue(0|i,0|A,0|l,0|r)),0|C()),o=0,e=0|C();break}d=0|n[(w=t)>>2],w=0|n[w+4>>2],g=0|He(7,0,3*(c+i|0)|0),w&=~(0|C()),n[(o=t)>>2]=d&~g,n[o+4>>2]=w,o=1;break}a=0|n[(d=t)>>2],d=0|n[d+4>>2],b=0|He(7,0,0|(i=3*(c+i|0)|0)),d&=~(0|C()),i=0|He(0|(w=0|Ge(0|A,0|e,0|l,0|r)),0|(o=0|C()),0|i),d=0|C()|d,n[(g=t)>>2]=i|a&~b,n[g+4>>2]=d,A=0|Te(0|A,0|e,0|(o=0|Ue(0|w,0|o,0|l,0|r)),0|C()),o=0,e=0|C()}while(0);if(!((0|s)>(0|u))){e=0;break}i=~u,u=u+1|0}return T=f,0|e}}while(0);if((0|s)<1)return T=f,0;for(a=15^l,o=1;;){if(g=0|$A(7,0,g=s-o|0,((0|g)<0)<<31>>31),w=0|C(),r=0|n[(u=t)>>2],u=0|n[u+4>>2],i=0|He(7,0,0|(l=3*(a-o|0)|0)),u&=~(0|C()),l=0|He(0|(b=0|Ge(0|A,0|e,0|g,0|w)),0|(d=0|C()),0|l),u=0|C()|u,n[(c=t)>>2]=l|r&~i,n[c+4>>2]=u,A=0|Te(0|A,0|e,0|(w=0|Ue(0|b,0|d,0|g,0|w)),0|C()),e=0|C(),(0|s)<=(0|o)){e=0;break}o=o+1|0}return T=f,0|e},_compactCells:function(A,e,r,i){e|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,T=0;if(0==(0|(r|=0))&0==(0|(i|=0)))return 0;if(f=0|n[(t=A|=0)>>2],!0&0==(15728640&(t=0|n[t+4>>2])|0)){if(!((0|i)>0|0==(0|i)&r>>>0>0))return 0;if(n[(T=e)>>2]=f,n[T+4>>2]=t,1==(0|r)&0==(0|i))return 0;t=1,f=0;do{p=0|n[4+(I=A+(t<<3)|0)>>2],n[(T=e+(t<<3)|0)>>2]=n[I>>2],n[T+4>>2]=p,t=0|pe(0|t,0|f,1,0),f=0|C()}while((0|f)<(0|i)|(0|f)==(0|i)&t>>>0<r>>>0);return 0}if(!(p=0|_e(a=r<<3)))return 13;if(Ne(0|p,0|A,0|a),!(I=0|Me(r,8)))return ye(p),13;A:for(;;){M=0|Se(0|(c=0|n[(t=p)>>2]),0|(t=0|n[t+4>>2]),52),C(),P=(M&=15)-1|0,y=0!=(0|M),D=(0|i)>0|0==(0|i)&r>>>0>0;e:do{if(y&D){if(m=0|He(0|P,0,52),v=0|C(),P>>>0>15){if(!(0==(0|c)&0==(0|t))){T=16;break A}for(f=0,A=0;;){if(f=0|pe(0|f,0|A,1,0),!((0|(A=0|C()))<(0|i)|(0|A)==(0|i)&f>>>0<r>>>0))break e;if(!(0==(0|(E=0|n[(o=p+(f<<3)|0)>>2]))&0==(0|(o=0|n[o+4>>2])))){t=o,T=16;break A}}}for(l=c,A=t,f=0,o=0;;){if(!(0==(0|l)&0==(0|A))){if(!(!0&0==(117440512&A|0))){T=21;break A}if(s=0|Se(0|l,0|A,52),C(),(0|(s&=15))<(0|P)){t=12,T=27;break A}if((0|s)!=(0|P)&&(l|=m,A=-15728641&A|v,s>>>0>=M>>>0)){u=P;do{E=0|He(7,0,3*(14-u|0)|0),u=u+1|0,l|=E,A=0|C()|A}while(u>>>0<s>>>0)}if(d=0|xe(0|l,0|A,0|r,0|i),g=0|C(),!(0==(0|(b=0|n[(s=u=I+(d<<3)|0)>>2]))&0==(0|(s=0|n[s+4>>2])))){B=0,h=0;do{if((0|B)>(0|i)|(0|B)==(0|i)&h>>>0>r>>>0){T=31;break A}if((0|b)==(0|l)&(-117440513&s|0)==(0|A)){w=0|Se(0|b,0|s,56),C(),k=1+(w&=7)|0,E=0|Se(0|b,0|s,45),C();r:do{if(0|Y(127&E)){if(b=0|Se(0|b,0|s,52),C(),!(b&=15)){s=6;break}for(s=1;;){if(!(0==((E=0|He(7,0,3*(15-s|0)|0))&l|0)&0==((0|C())&A|0))){s=7;break r}if(!(s>>>0<b>>>0)){s=6;break}s=s+1|0}}else s=7}while(0);if((w+2|0)>>>0>s>>>0){T=41;break A}E=0|He(0|k,0,56),A=0|C()|-117440513&A,n[(Q=u)>>2]=0,n[Q+4>>2]=0,l|=E}else d=0|ze(0|(d=0|pe(0|d,0|g,1,0)),0|C(),0|r,0|i),g=0|C();h=0|pe(0|h,0|B,1,0),B=0|C(),b=0|n[(s=u=I+(d<<3)|0)>>2],s=0|n[s+4>>2]}while(!(0==(0|b)&0==(0|s)))}n[(E=u)>>2]=l,n[E+4>>2]=A}if(f=0|pe(0|f,0|o,1,0),!((0|(o=0|C()))<(0|i)|(0|o)==(0|i)&f>>>0<r>>>0))break e;l=0|n[(A=p+(f<<3)|0)>>2],A=0|n[A+4>>2]}}}while(0);if(E=0|pe(0|r,0|i,5,0),(Q=0|C())>>>0<0|0==(0|Q)&E>>>0<11){T=85;break}if(E=0|Ge(0|r,0|i,6,0),C(),!(E=0|Me(E,8))){T=48;break}do{if(D){for(k=0,A=0,w=0,B=0;;){if(0==(0|(f=0|n[(o=s=I+(k<<3)|0)>>2]))&0==(0|(o=0|n[o+4>>2])))Q=w;else{b=0|Se(0|f,0|o,56),C(),l=1+(b&=7)|0,d=-117440513&o,Q=0|Se(0|f,0|o,45),C();e:do{if(0|Y(127&Q)){if(g=0|Se(0|f,0|o,52),C(),0|(g&=15))for(u=1;;){if(!(0==(f&(Q=0|He(7,0,3*(15-u|0)|0))|0)&0==(d&(0|C())|0)))break e;if(!(u>>>0<g>>>0))break;u=u+1|0}f|=o=0|He(0|l,0,56),o=0|C()|d,n[(l=s)>>2]=f,n[l+4>>2]=o,l=b+2|0}}while(0);7==(0|l)?(n[(Q=E+(A<<3)|0)>>2]=f,n[Q+4>>2]=-117440513&o,A=0|pe(0|A,0|w,1,0),Q=0|C()):Q=w}if(k=0|pe(0|k,0|B,1,0),!((0|(B=0|C()))<(0|i)|(0|B)==(0|i)&k>>>0<r>>>0))break;w=Q}if(D){if(h=P>>>0>15,m=0|He(0|P,0,52),v=0|C(),!y){for(f=0,u=0,l=0,o=0;0==(0|c)&0==(0|t)||(n[(P=e+(f<<3)|0)>>2]=c,n[P+4>>2]=t,f=0|pe(0|f,0|u,1,0),u=0|C()),l=0|pe(0|l,0|o,1,0),(0|(o=0|C()))<(0|i)|(0|o)==(0|i)&l>>>0<r>>>0;)c=0|n[(t=p+(l<<3)|0)>>2],t=0|n[t+4>>2];t=Q;break}for(f=0,u=0,o=0,l=0;;){do{if(!(0==(0|c)&0==(0|t))){if(g=0|Se(0|c,0|t,52),C(),h|(0|(g&=15))<(0|P)){T=80;break A}if((0|g)!=(0|P)){if(s=c|m,b=-15728641&t|v,g>>>0>=M>>>0){d=P;do{y=0|He(7,0,3*(14-d|0)|0),d=d+1|0,s|=y,b=0|C()|b}while(d>>>0<g>>>0)}}else s=c,b=t;w=0|xe(0|s,0|b,0|r,0|i),d=0,g=0,B=0|C();do{if((0|d)>(0|i)|(0|d)==(0|i)&g>>>0>r>>>0){T=81;break A}if((-117440513&(k=0|n[4+(y=I+(w<<3)|0)>>2])|0)==(0|b)&&(0|n[y>>2])==(0|s)){T=65;break}w=0|ze(0|(y=0|pe(0|w,0|B,1,0)),0|C(),0|r,0|i),B=0|C(),g=0|pe(0|g,0|d,1,0),d=0|C(),y=I+(w<<3)|0}while((0|n[y>>2])!=(0|s)||(0|n[y+4>>2])!=(0|b));if(65==(0|T)&&(T=0,!0&100663296==(117440512&k|0)))break;n[(y=e+(f<<3)|0)>>2]=c,n[y+4>>2]=t,f=0|pe(0|f,0|u,1,0),u=0|C()}}while(0);if(o=0|pe(0|o,0|l,1,0),!((0|(l=0|C()))<(0|i)|(0|l)==(0|i)&o>>>0<r>>>0))break;c=0|n[(t=p+(o<<3)|0)>>2],t=0|n[t+4>>2]}t=Q}else f=0,t=Q}else f=0,A=0,t=0}while(0);if(Ze(0|I,0,0|a),Ne(0|p,0|E,A<<3|0),ye(E),0==(0|A)&0==(0|t)){T=89;break}e=e+(f<<3)|0,i=t,r=A}if(16==(0|T))!0&0==(117440512&t|0)?(t=4,T=27):T=21;else if(31==(0|T))_(27634,27225,620,27235);else{if(41==(0|T))return ye(p),ye(I),10;if(48==(0|T))return ye(p),ye(I),13;80==(0|T)?_(27634,27225,711,27235):81==(0|T)?_(27634,27225,723,27235):85==(0|T)&&(Ne(0|e,0|p,r<<3|0),T=89)}return 21==(0|T)?(ye(p),ye(I),0|(T=5)):27==(0|T)?(ye(p),ye(I),0|(T=t)):89==(0|T)?(ye(p),ye(I),0|(T=0)):0},_constructCell:function(A,e,r,a){r|=0,a|=0;var t=0,f=0,o=0,l=0,u=0,c=0;if((A|=0)>>>0>15)return 4;if((e|=0)>>>0>121)return 17;o=0|He(0|A,0,52),t=0|C(),l=0|He(0|e,0,45),t=0|t|C()|134225919;A:do{if((0|A)>=1){for(l=1,o=0!=(0|i[20496+e>>0]),f=-1;;){if((e=0|n[r+(l+-1<<2)>>2])>>>0>6){t=18,e=10;break}if(!(0==(0|e)|1^o)){if(1==(0|e)){t=19,e=10;break}o=0}if(u=0|He(7,0,0|(c=3*(15-l|0)|0)),t&=~(0|C()),f=(e=0|He(0|e,((0|e)<0)<<31>>31|0,0|c))|f&~u,t=0|C()|t,!((0|l)<(0|A)))break A;l=l+1|0}if(10==(0|e))return 0|t}else f=-1}while(0);return n[(c=a)>>2]=f,n[c+4>>2]=t,0},_destroyLinkedMultiPolygon:function(A){var e,r,i=0,a=0,t=0,f=0,o=0;if(A|=0)for(e=A+4|0,r=A+8|0,t=1,f=A;;){if(0|(i=0|n[f>>2]))do{if(0|(a=0|n[i>>2]))do{o=a,a=0|n[a+16>>2],ye(o)}while(0!=(0|a));o=i,i=0|n[i+8>>2],ye(o)}while(0!=(0|i));if(i=f,f=0|n[f+8>>2],t?(n[A>>2]=0,n[e>>2]=0,n[r>>2]=0):ye(i),!f)break;t=0}},_directedEdgeToBoundary:oA,_directedEdgeToCells:function(A,e,r){A|=0;var i,a,t,f=0;return i=T,T=T+16|0,f=i,!0&268435456==(2013265920&(e|=0)|0)?(a=-2130706433&e|134217728,n[(t=r|=0)>>2]=A,n[t+4>>2]=a,n[f>>2]=0,e=0|Se(0|A,0|e,56),C(),f=0|z(A,a,7&e,f,r+8|0),T=i,0|f):(T=i,0|(f=6))},_edgeLengthKm:function(A,e,r){r|=0;var i,t=0,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,l=i)))return l=A,o=+a[r>>3],a[r>>3]=o*=6371.007180918475,T=i,0|l;if(a[r>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,o=0,a[r>>3]=o*=6371.007180918475,T=i,0|l;e=A+-1|0,A=0,t=+a[l+8>>3],f=+a[l+16>>3],o=0;do{d=t,b=f,b=(g=+s(.5*((t=+a[l+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((f=+a[l+8+(A<<4)+8>>3])-b)))*(+c(+d)*+c(+t)*b),o+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)!=(0|e));return a[r>>3]=o,l=0,g=o,a[r>>3]=g*=6371.007180918475,T=i,0|l},_edgeLengthM:function(A,e,r){r|=0;var i,t=0,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,l=i)))return l=A,o=+a[r>>3],o*=6371.007180918475,a[r>>3]=o*=1e3,T=i,0|l;if(a[r>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,o=0,o*=6371.007180918475,a[r>>3]=o*=1e3,T=i,0|l;e=A+-1|0,A=0,t=+a[l+8>>3],f=+a[l+16>>3],o=0;do{d=t,b=f,b=(g=+s(.5*((t=+a[l+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((f=+a[l+8+(A<<4)+8>>3])-b)))*(+c(+d)*+c(+t)*b),o+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)!=(0|e));return a[r>>3]=o,l=0,g=o,g*=6371.007180918475,a[r>>3]=g*=1e3,T=i,0|l},_edgeLengthRads:function(A,e,r){r|=0;var i,t,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,t=i)))return T=i,0|A;if(a[r>>3]=0,(0|(A=0|n[t>>2]))<=1)return T=i,0;e=A+-1|0,A=0,f=+a[t+8>>3],o=+a[t+16>>3],l=0;do{d=f,b=o,b=(g=+s(.5*((f=+a[t+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((o=+a[t+8+(A<<4)+8>>3])-b)))*(+c(+f)*+c(+d)*b),l+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)<(0|e));return a[r>>3]=l,T=i,0},_emscripten_replace_memory:function(A){return i=new Int8Array(A),new Uint8Array(A),n=new Int32Array(A),new Float32Array(A),a=new Float64Array(A),r=A,!0},_free:ye,_getBaseCellNumber:mA,_getDirectedEdgeDestination:function(A,e,r){A|=0,e|=0,r|=0;var i,a,t=0;return i=T,T=T+16|0,n[(t=i)>>2]=0,!0&268435456==(2013265920&e|0)?(a=0|Se(0|A,0|e,56),C(),t=0|z(A,-2130706433&e|134217728,7&a,t,r),T=i,0|t):(T=i,0|(t=6))},_getDirectedEdgeOrigin:function(A,e,r){return r|=0,!0&268435456==(2013265920&(e|=0)|0)?(n[r>>2]=A|=0,n[r+4>>2]=-2130706433&e|134217728,0|(r=0)):0|(r=6)},_getHexagonAreaAvgKm2:WA,_getHexagonAreaAvgM2:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20752+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20880+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[21008+(A<<3)>>3],0|(e=0))},_getIcosahedronFaces:function A(e,r,i){i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0;a=T,T=T+128|0,s=a+112|0,o=a+96|0,b=a,f=0|Se(0|(e|=0),0|(r|=0),52),C(),n[s>>2]=u=15&f,l=0|Se(0|e,0|r,45),C(),l&=127;A:do{if(0|Y(l)){if(0|u)for(t=1;;){if(!(0==((c=0|He(7,0,3*(15-t|0)|0))&e|0)&0==((0|C())&r|0))){f=0;break A}if(!(t>>>0<u>>>0))break;t=t+1|0}if(!(1&f))return c=0|He(u+1|0,0,52),b=0|C()|-15728641&r,b=0|A((c|e)&~(s=0|He(7,0,3*(14-u|0)|0)),b&~(0|C()),i),T=a,0|b;f=1}else f=0}while(0);if(!(t=0|zA(e,r,o))){f?(dA(o,s,b),c=5):(BA(o,s,b),c=6);A:do{if(0|Y(l))if(u)for(t=1;;){if(!(0==((l=0|He(7,0,3*(15-t|0)|0))&e|0)&0==((0|C())&r|0))){e=2;break A}if(!(t>>>0<u>>>0)){e=5;break}t=t+1|0}else e=5;else e=2}while(0);Ze(0|i,-1,e<<2|0);A:do{if(f)for(o=0;;){if(wA(l=b+(o<<4)|0,0|n[s>>2]),-1==(0|(u=0|n[i>>2]))|(0|u)==(0|(l=0|n[l>>2])))t=i;else{f=0;do{if((f=f+1|0)>>>0>=e>>>0){t=1;break A}u=0|n[(t=i+(f<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|l)))}if(n[t>>2]=l,(o=o+1|0)>>>0>=c>>>0){t=0;break}}else for(o=0;;){if(gA(l=b+(o<<4)|0,0|n[s>>2],0,1),-1==(0|(u=0|n[i>>2]))|(0|u)==(0|(l=0|n[l>>2])))t=i;else{f=0;do{if((f=f+1|0)>>>0>=e>>>0){t=1;break A}u=0|n[(t=i+(f<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|l)))}if(n[t>>2]=l,(o=o+1|0)>>>0>=c>>>0){t=0;break}}}while(0)}return T=a,0|t},_getIndexDigit:function(A,e,r,i){return i|=0,((r|=0)-1|0)>>>0>14?0|(i=4):(r=0|Se(0|(A|=0),0|(e|=0),3*(15-r|0)|0),C(),n[i>>2]=7&r,0|(i=0))},_getNumCells:ZA,_getPentagons:SA,_getRes0Cells:function(A){A|=0;var e=0,r=0,i=0;e=0;do{He(0|e,0,45),i=134225919|C(),n[(r=A+(e<<3)|0)>>2]=-1,n[r+4>>2]=i,e=e+1|0}while(122!=(0|e));return 0},_getResolution:hA,_greatCircleDistanceKm:NA,_greatCircleDistanceM:function(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))},_gridDisk:F,_gridDiskDistances:L,_gridDistance:XA,_gridPathCells:function(A,e,r,i,a){a|=0;var t,f,o=0,l=0;return f=T,T=T+16|0,0|(l=0|XA(A|=0,e|=0,r|=0,i|=0,o=f))?(T=f,0|(a=l)):0==(0|(o=0|n[(l=o)>>2]))&0==(0|(l=0|n[l+4>>2]))?(n[a>>2]=A,n[a+4>>2]=e,T=f,0|(a=0)):(t=0|qA(A,e,r,i,o,l,a,0,0,1,0))?(a=0==(0|qA(r,i,A,e,o,l,a,o,l,-1,-1)),T=f,0|(a=a?0:t)):(T=f,0|(a=0))},_gridPathCellsSize:function(A,e,r,i,a){a|=0;var t,f=0;return t=T,T=T+16|0,0|(A=0|XA(A|=0,e|=0,r|=0,i|=0,f=t))?(T=t,0|(f=A)):(r=0|pe(0|n[(r=f)>>2],0|n[r+4>>2],1,0),i=0|C(),n[(f=a)>>2]=r,n[f+4>>2]=i,T=t,0|(f=0))},_gridRing:function(A,e,r,i){return 0|x(A|=0,e|=0,r|=0,i|=0)?(Ze(0|i,0,48*r|0),0|(i=0|V(A,e,r,i))):0|(i=0)},_gridRingUnsafe:x,_i64Add:pe,_i64Subtract:Te,_isPentagon:CA,_isResClassIII:function(A,e){return e=0|Se(0|(A|=0),0|(e|=0),52),C(),1&e|0},_isValidCell:vA,_isValidDirectedEdge:tA,_isValidIndex:function(A,e){A|=0;var r=0,n=0,a=0,t=0;if(!0&134217728==(-16777216&(e|=0)|0)&&(n=0|Se(0|A,0|e,52),C(),n&=15,r=0|Se(0|A,0|e,45),C(),(r&=127)>>>0<=121)&&0==(613566756&(t=0|He(0|(a=0|Se(0|A,0|e,0|(t=3*(15^n)|0))),0|C(),0|t))&(0|Te(-1227133514,-1171,0|t,0|(a=0|C())))|0)&0==(4681&a&(0|C())|0)&&15==(0|n)|0==(0|(t=0|Se(0|He(0|~A,0|~e,0|(t=19+(3*n|0)|0)),0|C(),0|t)))&0==(0|C())){if(!(0|i[20496+r>>0]))return 1;if(0==(0|A)&0==(0|(r=8191&e)))return 1;if(t=0|Re(0|A,0|r),C(),0|(63-t|0)%3)return 1}return 0|tA(A,e)?0|(t=1):0|(t=0!=(0|we(A,e))&1)},_isValidVertex:we,_latLngToCell:GA,_llvm_ctlz_i64:Re,_llvm_maxnum_f64:Ye,_llvm_minnum_f64:je,_llvm_round_f64:Oe,_localIjToCell:function(A,e,r,i,a){A|=0,e|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0;return o=T,T=T+16|0,s=o,0|(i|=0)?(T=o,0|(s=15)):(u=0|n[4+(r|=0)>>2],n[s>>2]=c=0|n[r>>2],n[(t=s+4|0)>>2]=u,n[(f=s+8|0)>>2]=0,i=(r=(0|u)<(0|c))?c:u,(0|(r=r?u:c))<0&&(-2147483648==(0|r)||((0|i)>0?(2147483647-i|0)<(0|r):(-2147483648-i|0)>(0|r))||((0|i)>-1?(-2147483648|i|0)>=(0|r):(-2147483648^i|0)<(0|r)))?i=1:l=5,5==(0|l)&&(i=u-c|0,l=0-c|0,(0|c)<0?(n[t>>2]=i,n[f>>2]=l,n[s>>2]=0,c=0):(i=u,l=0),u=c-i|0,r=l-i|0,(0|i)<0?(n[s>>2]=u,n[f>>2]=r,n[t>>2]=0,c=u,i=0):r=l,u=c-r|0,l=i-r|0,(0|r)<0?(n[s>>2]=u,n[t>>2]=l,n[f>>2]=0,r=0):(l=i,u=c),(0|(i=(0|r)<(0|(i=(0|l)<(0|u)?l:u))?r:i))>0&&(n[s>>2]=u-i,n[t>>2]=l-i,n[f>>2]=r-i),i=0|KA(A,e,s,a)),T=o,0|(s=i))},_malloc:_e,_maxFaceCount:function(A,e,r){r|=0;var i=0,a=0;if(a=0|Se(0|(A|=0),0|(e|=0),45),C(),!(0|Y(127&a)))return n[r>>2]=a=2,0;if(a=0|Se(0|A,0|e,52),C(),!(a&=15))return n[r>>2]=a=5,0;for(i=1;;){if(!(0==((0|He(7,0,3*(15-i|0)|0))&A|0)&0==((0|C())&e|0))){i=2,A=6;break}if(!(i>>>0<a>>>0)){i=5,A=6;break}i=i+1|0}return 6==(0|A)?(n[r>>2]=i,0):0},_maxGridDiskSize:function(A,e){e|=0;var r=0,i=0,a=0;return(0|(A|=0))<0?0|(e=2):(0|A)>13780509?0|(e=0|ZA(15,e)):(a=0|Ue(0|A,0|(r=((0|A)<0)<<31>>31),3,0),i=0|C(),r=0|pe(0|A,0|r,1,0),r=0|pe(0|(r=0|Ue(0|a,0|i,0|r,0|C())),0|C(),1,0),A=0|C(),n[e>>2]=r,n[e+4>>2]=A,0|(e=0))},_maxPolygonToCellsSize:function(A,e,r,i){A|=0,e|=0,i|=0;var a,t,f=0,o=0,l=0,u=0;if(a=T,T=T+48|0,f=a+16|0,o=a+8|0,t=a,0|(r=0|te(r|=0)))return T=a,0|r;if(l=0|n[(u=A)+4>>2],n[(r=o)>>2]=n[u>>2],n[r+4>>2]=l,ae(o,f),!(r=0|rA(f,e,t))){if(e=0|n[o>>2],(0|(o=0|n[A+8>>2]))>0){f=0|n[A+12>>2],r=0;do{e=(0|n[f+(r<<3)>>2])+e|0,r=r+1|0}while((0|r)<(0|o))}f=0|n[(r=t)>>2],(0|(r=0|n[r+4>>2]))<(0|(o=((0|e)<0)<<31>>31))|(0|r)==(0|o)&f>>>0<e>>>0?(n[(r=t)>>2]=e,n[r+4>>2]=o,r=o):e=f,l=0|pe(0|e,0|r,12,0),u=0|C(),n[(r=t)>>2]=l,n[r+4>>2]=u,n[(r=i)>>2]=l,n[r+4>>2]=u,r=0}return T=a,0|r},_maxPolygonToCellsSizeExperimental:function(A,e,r,t){e|=0,r|=0,t|=0;var f,o,u=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(o=T,T=T+48|0,g=o+32|0,d=o+40|0,f=o,!(0|n[(A|=0)>>2]))return n[(w=t)>>2]=0,n[w+4>>2]=0,T=o,0;QA(g,0,0,0),u=0|n[(b=g)>>2],b=0|n[b+4>>2];do{if(e>>>0>15)n[(w=f)>>2]=0,n[w+4>>2]=0,n[f+8>>2]=4,n[f+12>>2]=-1,r=f+29|0,n[(w=f+16|0)>>2]=0,n[w+4>>2]=0,n[w+8>>2]=0,i[w+12>>0]=0,i[r>>0]=0|i[d>>0],i[r+1>>0]=0|i[d+1>>0],i[r+2>>0]=0|i[d+2>>0],r=4,w=9;else{if(0|(r=0|te(r))){n[(g=f)>>2]=0,n[g+4>>2]=0,n[f+8>>2]=r,n[f+12>>2]=-1,w=f+29|0,n[(g=f+16|0)>>2]=0,n[g+4>>2]=0,n[g+8>>2]=0,i[g+12>>0]=0,i[w>>0]=0|i[d>>0],i[w+1>>0]=0|i[d+1>>0],i[w+2>>0]=0|i[d+2>>0],w=9;break}if(!(r=0|Me(1+(0|n[A+8>>2])|0,32))){n[(w=f)>>2]=0,n[w+4>>2]=0,n[f+8>>2]=13,n[f+12>>2]=-1,r=f+29|0,n[(w=f+16|0)>>2]=0,n[w+4>>2]=0,n[w+8>>2]=0,i[w+12>>0]=0,i[r>>0]=0|i[d>>0],i[r+1>>0]=0|i[d+1>>0],i[r+2>>0]=0|i[d+2>>0],r=13,w=9;break}fe(A,r),n[(B=f)>>2]=u,n[B+4>>2]=b,n[(b=f+8|0)>>2]=0,n[f+12>>2]=e,n[f+20>>2]=A,n[f+24>>2]=r,i[f+28>>0]=0,i[(u=f+29|0)>>0]=0|i[d>>0],i[u+1>>0]=0|i[d+1>>0],i[u+2>>0]=0|i[d+2>>0],n[f+16>>2]=3,k=+X(r),k*=+K(r),s=+l(+ +a[r>>3]),s=k/+c(+ +je(+s,+ +l(+ +a[r+8>>3])))*6371.007180918475*6371.007180918475,r=0|n[(u=f+12|0)>>2];A:do{if((0|r)>0)do{if(WA(r+-1|0,g),!(s/+a[g>>3]>10))break A;n[u>>2]=r=(B=0|n[u>>2])-1|0}while((0|B)>1)}while(0);if(re(f),n[(u=t)>>2]=0,n[u+4>>2]=0,!(0==(0|(r=0|n[(u=f)>>2]))&0==(0|(u=0|n[u+4>>2]))))do{DA(r,u,e,g),d=0|pe(0|n[(A=t)>>2],0|n[A+4>>2],0|n[(d=g)>>2],0|n[d+4>>2]),A=0|C(),n[(B=t)>>2]=d,n[B+4>>2]=A,re(f),r=0|n[(B=f)>>2],u=0|n[B+4>>2]}while(!(0==(0|r)&0==(0|u)));r=0|n[b>>2]}}while(0);return T=o,0|r},_memcpy:Ne,_memmove:We,_memset:Ze,_originToDirectedEdges:fA,_pentagonCount:function(){return 12},_polygonToCells:function(A,e,r,i){A|=0,e|=0,i|=0;var a,t,f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,z=0,x=0,V=0;if(o=T,T=T+112|0,a=o+80|0,d=o+72|0,t=o,f=o+56|0,0|(u=0|te(r|=0)))return T=o,0|u;if(!(l=0|_e(32+(n[(g=A+8|0)>>2]<<5)|0)))return T=o,13;if(fe(A,l),!(u=0|te(r))){if(V=0|n[(x=A)+4>>2],n[(u=d)>>2]=n[x>>2],n[u+4>>2]=V,ae(d,a),u=0|rA(a,e,t))x=0,V=0;else{if(u=0|n[d>>2],(0|(c=0|n[g>>2]))>0){s=0|n[A+12>>2],r=0;do{u=(0|n[s+(r<<3)>>2])+u|0,r=r+1|0}while((0|r)!=(0|c));r=u}else r=u;c=0|n[(u=t)>>2],(0|(u=0|n[u+4>>2]))<(0|(s=((0|r)<0)<<31>>31))|(0|u)==(0|s)&c>>>0<r>>>0?(n[(u=t)>>2]=r,n[u+4>>2]=s,u=s):r=c,x=0|pe(0|r,0|u,12,0),V=0|C(),n[(u=t)>>2]=x,n[u+4>>2]=V,u=0}if(!u){if(!(r=0|Me(x,8)))return ye(l),T=o,13;if(!(b=0|Me(x,8)))return ye(l),ye(r),T=o,13;n[(L=a)>>2]=0,n[L+4>>2]=0,z=0|n[(L=A)+4>>2],n[(u=d)>>2]=n[L>>2],n[u+4>>2]=z,u=0|H(d,x,V,e,a,r,b);A:do{if(u)ye(r),ye(b),ye(l);else{e:do{if((0|n[g>>2])>0){for(s=A+12|0,c=0;u=0|H((0|n[s>>2])+(c<<3)|0,x,V,e,a,r,b),c=c+1|0,!(0|u);)if((0|c)>=(0|n[g>>2]))break e;ye(r),ye(b),ye(l);break A}}while(0);(0|V)>0|0==(0|V)&x>>>0>0&&Ze(0|b,0,x<<3|0),L=0|n[(z=a)+4>>2];e:do{if((0|L)>0|0==(0|L)&(0|n[z>>2])>>>0>0){I=r,p=b,F=r,L=b,z=r,u=r,y=r,M=b,P=b,r=b;r:for(;;){for(Q=0,E=0,D=0,_=0,c=0,s=0;;){d=(b=t)+56|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|d));if(0|G(g=0|n[(e=I+(Q<<3)|0)>>2],e=0|n[e+4>>2],1,t,0)){d=(b=t)+56|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|d));0|(b=0|Me(7,4))&&(U(g,e,1,t,b,7,0,0),ye(b))}for(v=0;;){h=0|n[(m=t+(v<<3)|0)>>2],m=0|n[m+4>>2];i:do{if(0==(0|h)&0==(0|m))b=c,d=s;else{if(w=0|xe(0|h,0|m,0|x,0|V),g=0|C(),!(0==(0|(d=0|n[(e=b=i+(w<<3)|0)>>2]))&0==(0|(e=0|n[e+4>>2])))){k=0,B=0;do{if((0|k)>(0|V)|(0|k)==(0|V)&B>>>0>x>>>0)break r;if((0|d)==(0|h)&(0|e)==(0|m)){b=c,d=s;break i}w=0|ze(0|(b=0|pe(0|w,0|g,1,0)),0|C(),0|x,0|V),g=0|C(),B=0|pe(0|B,0|k,1,0),k=0|C(),d=0|n[(e=b=i+(w<<3)|0)>>2],e=0|n[e+4>>2]}while(!(0==(0|d)&0==(0|e)))}if(0==(0|h)&0==(0|m)){b=c,d=s;break}xA(h,m,f),0|oe(A,l,f)&&(B=0|pe(0|c,0|s,1,0),s=0|C(),n[(k=b)>>2]=h,n[k+4>>2]=m,n[(c=p+(c<<3)|0)>>2]=h,n[c+4>>2]=m,c=B),b=c,d=s}}while(0);if((v=v+1|0)>>>0>=7)break;c=b,s=d}if(Q=0|pe(0|Q,0|E,1,0),E=0|C(),D=0|pe(0|D,0|_,1,0),_=0|C(),c=0|n[(s=a)>>2],!((0|_)<(0|(s=0|n[s+4>>2]))|(0|_)==(0|s)&D>>>0<c>>>0))break;c=b,s=d}if((0|s)>0|0==(0|s)&c>>>0>0){c=0,s=0;do{n[(_=I+(c<<3)|0)>>2]=0,n[_+4>>2]=0,c=0|pe(0|c,0|s,1,0),s=0|C(),D=0|n[(_=a)+4>>2]}while((0|s)<(0|D)|((0|s)==(0|D)?c>>>0<(0|n[_>>2])>>>0:0))}if(n[(_=a)>>2]=b,n[_+4>>2]=d,!((0|d)>0|0==(0|d)&b>>>0>0))break e;v=r,Q=P,E=z,D=M,_=p,r=y,P=u,M=F,y=v,u=Q,z=L,L=E,F=D,p=I,I=_}ye(F),ye(L),ye(l),u=1;break A}u=b}while(0);ye(l),ye(r),ye(u),u=0}}while(0);return T=o,0|u}}return ye(l),T=o,0|u},_polygonToCellsExperimental:function(A,e,r,i,a,t){i|=0,a|=0,t|=0;var f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0;l=T,T=T+160|0,c=l+64|0,d=l+112|0,k=l,ee(b=l+80|0,A|=0,e|=0,r|=0),HA(c,0|n[(s=b)>>2],0|n[s+4>>2],e),f=0|n[(s=c)>>2],s=0|n[s+4>>2],u=0|n[b+8>>2],n[(g=d+4|0)>>2]=n[b>>2],n[g+4>>2]=n[b+4>>2],n[g+8>>2]=n[b+8>>2],n[g+12>>2]=n[b+12>>2],n[g+16>>2]=n[b+16>>2],n[g+20>>2]=n[b+20>>2],n[g+24>>2]=n[b+24>>2],n[g+28>>2]=n[b+28>>2],n[(g=k)>>2]=f,n[g+4>>2]=s,n[(g=k+8|0)>>2]=u,e=d,r=36+(A=k+12|0)|0;do{n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}while((0|A)<(0|r));if(n[(d=k+48|0)>>2]=n[c>>2],n[d+4>>2]=n[c+4>>2],n[d+8>>2]=n[c+8>>2],n[d+12>>2]=n[c+12>>2],0==(0|f)&0==(0|s))return T=l,0|u;r=k+16|0,o=k+24|0,b=k+28|0,u=0,c=0,e=f,A=s;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&c>>>0<i>>>0)){w=4;break}if(s=c,c=0|pe(0|c,0|u,1,0),u=0|C(),n[(s=t+(s<<3)|0)>>2]=e,n[s+4>>2]=A,YA(d),0==(0|(e=0|n[(A=d)>>2]))&0==(0|(A=0|n[A+4>>2]))){if(re(r),0==(0|(A=0|n[(e=r)>>2]))&0==(0|(e=0|n[e+4>>2]))){w=10;break}RA(A,e,0|n[b>>2],d),e=0|n[(A=d)>>2],A=0|n[A+4>>2]}n[(s=k)>>2]=e,n[s+4>>2]=A}while(!(0==(0|e)&0==(0|A)));return 4==(0|w)?(0|(e=0|n[(A=k+40|0)>>2])&&ye(e),n[(w=k+16|0)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[k+36>>2]=0,n[b>>2]=-1,n[k+32>>2]=0,n[A>>2]=0,RA(0,0,0,d),n[k>>2]=0,n[k+4>>2]=0,n[g>>2]=0,T=l,0|(k=14)):(10==(0|w)&&(n[k>>2]=0,n[k+4>>2]=0,n[g>>2]=n[o>>2]),T=l,0|(k=0|n[g>>2]))},_readInt64AsDoubleFromPointer:function(A){return+(+((0|n[(A|=0)>>2])>>>0)+4294967296*+(0|n[A+4>>2]))},_res0CellCount:function(){return 122},_reverseDirectedEdge:lA,_round:Je,_sbrk:Ke,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(A,e,r,i,a,t,f){A|=0,i|=0,a|=0,t|=0;var o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(o=T,T=T+16|0,w=o,!((0|(r|=0))>0|0==(0|r)&(e|=0)>>>0>0))return T=o,0;if((0|(f|=0))>=16)return T=o,12;d=0,g=0,b=0,l=0;A:for(;;){if(s=0|Se(0|(u=0|n[(c=A+(d<<3)|0)>>2]),0|(c=0|n[c+4>>2]),52),C(),(15&s|0)>(0|f)){l=12,u=11;break}if(HA(w,u,c,f),0==(0|(c=0|n[(s=w)>>2]))&0==(0|(s=0|n[s+4>>2])))u=b;else{u=b;do{if(!((0|l)<(0|t)|(0|l)==(0|t)&u>>>0<a>>>0)){u=10;break A}n[(b=i+(u<<3)|0)>>2]=c,n[b+4>>2]=s,u=0|pe(0|u,0|l,1,0),l=0|C(),YA(w),c=0|n[(b=w)>>2],s=0|n[b+4>>2]}while(!(0==(0|c)&0==(0|s)))}if(d=0|pe(0|d,0|g,1,0),!((0|(g=0|C()))<(0|r)|(0|g)==(0|r)&d>>>0<e>>>0)){l=0,u=11;break}b=u}return 10==(0|u)?(T=o,0|(w=14)):11==(0|u)?(T=o,0|l):0},_uncompactCellsSize:function(A,e,r,i,a){A|=0,e|=0,r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0,c=0,s=0,b=0;f=T,T=T+16|0,t=f;A:do{if((0|r)>0|0==(0|r)&e>>>0>0){for(s=0,l=0,o=0,b=0;;){if(!(0==(0|(u=0|n[(c=A+(s<<3)|0)>>2]))&0==(0|(c=0|n[c+4>>2]))||(c=0==(0|DA(u,c,i,t)),l=0|pe(0|n[(u=t)>>2],0|n[u+4>>2],0|l,0|o),o=0|C(),c))){o=12;break}if(s=0|pe(0|s,0|b,1,0),!((0|(b=0|C()))<(0|r)|(0|b)==(0|r)&s>>>0<e>>>0))break A}return T=f,0|o}l=0,o=0}while(0);return n[a>>2]=l,n[a+4>>2]=o,T=f,0},_vertexToLatLng:function(A,e,r){r|=0;var i,a,t,f,o=0,l=0;return f=T,T=T+192|0,a=f,t=f+168|0,o=0|Se(0|(A|=0),0|(e|=0),56),C(),o&=7,0|(i=0|zA(A,l=-2130706433&e|134217728,t))?(T=f,0|(l=i)):(e=0|Se(0|A,0|e,52),C(),e&=15,0|CA(A,l)?bA(t,e,o,1,a):kA(t,e,o,1,a),n[r>>2]=n[(l=a+8|0)>>2],n[r+4>>2]=n[l+4>>2],n[r+8>>2]=n[l+8>>2],n[r+12>>2]=n[l+12>>2],T=f,0|(l=0))},dynCall_iii:function(A,e,r){return 0|Xe[3&(A|=0)](0|(e|=0),0|(r|=0))},establishStackSpace:function(A,e){T=A|=0},stackAlloc:function(A){var e;return e=T,T=15+(T=T+(A|=0)|0)&-16,0|e},stackRestore:function(A){T=A|=0},stackSave:function(){return 0|T}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:BA,b:function(A){B=A},c:function(){return B},d:function(A,e,r,i){BA("Assertion failed: "+I(A)+", at: "+[e?I(e):"unknown filename",r,i?I(i):"unknown function"])},e:function(A){return r.___errno_location&&(_[r.___errno_location()>>2]=A),A},f:AA,g:function(A,e,r){D.set(D.subarray(e,e+r),A)},h:function(A){var e=AA();if(A>2130706432)return!1;for(var r=Math.max(e,16777216);r<A;)r=r<=536870912?p(2*r,16777216):Math.min(p((3*r+2147483648)/4,16777216),2130706432);return!!eA(r)},i:function(A){BA("OOM")},j:X,k:q,l:eA,m:$,n:function(){var A=$();return r.extraStackTrace&&(A+="\\n"+r.extraStackTrace()),q(A)},o:28400,p:28384},Q),oA=(r.___divdi3=fA.___divdi3,r.___muldi3=fA.___muldi3,r.___remdi3=fA.___remdi3,r.___uremdi3=fA.___uremdi3,r._areNeighborCells=fA._areNeighborCells,r._bitshift64Ashr=fA._bitshift64Ashr,r._bitshift64Lshr=fA._bitshift64Lshr,r._bitshift64Shl=fA._bitshift64Shl,r._calloc=fA._calloc,r._cellAreaKm2=fA._cellAreaKm2,r._cellAreaM2=fA._cellAreaM2,r._cellAreaRads2=fA._cellAreaRads2,r._cellToBoundary=fA._cellToBoundary,r._cellToCenterChild=fA._cellToCenterChild,r._cellToChildPos=fA._cellToChildPos,r._cellToChildren=fA._cellToChildren,r._cellToChildrenSize=fA._cellToChildrenSize,r._cellToLatLng=fA._cellToLatLng,r._cellToLocalIj=fA._cellToLocalIj,r._cellToParent=fA._cellToParent,r._cellToVertex=fA._cellToVertex,r._cellToVertexes=fA._cellToVertexes,r._cellsToDirectedEdge=fA._cellsToDirectedEdge,r._cellsToLinkedMultiPolygon=fA._cellsToLinkedMultiPolygon,r._childPosToCell=fA._childPosToCell,r._compactCells=fA._compactCells,r._constructCell=fA._constructCell,r._destroyLinkedMultiPolygon=fA._destroyLinkedMultiPolygon,r._directedEdgeToBoundary=fA._directedEdgeToBoundary,r._directedEdgeToCells=fA._directedEdgeToCells,r._edgeLengthKm=fA._edgeLengthKm,r._edgeLengthM=fA._edgeLengthM,r._edgeLengthRads=fA._edgeLengthRads,r._emscripten_replace_memory=fA._emscripten_replace_memory),lA=(r._free=fA._free,r._getBaseCellNumber=fA._getBaseCellNumber,r._getDirectedEdgeDestination=fA._getDirectedEdgeDestination,r._getDirectedEdgeOrigin=fA._getDirectedEdgeOrigin,r._getHexagonAreaAvgKm2=fA._getHexagonAreaAvgKm2,r._getHexagonAreaAvgM2=fA._getHexagonAreaAvgM2,r._getHexagonEdgeLengthAvgKm=fA._getHexagonEdgeLengthAvgKm,r._getHexagonEdgeLengthAvgM=fA._getHexagonEdgeLengthAvgM,r._getIcosahedronFaces=fA._getIcosahedronFaces,r._getIndexDigit=fA._getIndexDigit,r._getNumCells=fA._getNumCells,r._getPentagons=fA._getPentagons,r._getRes0Cells=fA._getRes0Cells,r._getResolution=fA._getResolution,r._greatCircleDistanceKm=fA._greatCircleDistanceKm,r._greatCircleDistanceM=fA._greatCircleDistanceM,r._greatCircleDistanceRads=fA._greatCircleDistanceRads,r._gridDisk=fA._gridDisk,r._gridDiskDistances=fA._gridDiskDistances,r._gridDistance=fA._gridDistance,r._gridPathCells=fA._gridPathCells,r._gridPathCellsSize=fA._gridPathCellsSize,r._gridRing=fA._gridRing,r._gridRingUnsafe=fA._gridRingUnsafe,r._i64Add=fA._i64Add,r._i64Subtract=fA._i64Subtract,r._isPentagon=fA._isPentagon,r._isResClassIII=fA._isResClassIII,r._isValidCell=fA._isValidCell,r._isValidDirectedEdge=fA._isValidDirectedEdge,r._isValidIndex=fA._isValidIndex,r._isValidVertex=fA._isValidVertex,r._latLngToCell=fA._latLngToCell,r._llvm_ctlz_i64=fA._llvm_ctlz_i64,r._llvm_maxnum_f64=fA._llvm_maxnum_f64,r._llvm_minnum_f64=fA._llvm_minnum_f64,r._llvm_round_f64=fA._llvm_round_f64,r._localIjToCell=fA._localIjToCell,r._malloc=fA._malloc,r._maxFaceCount=fA._maxFaceCount,r._maxGridDiskSize=fA._maxGridDiskSize,r._maxPolygonToCellsSize=fA._maxPolygonToCellsSize,r._maxPolygonToCellsSizeExperimental=fA._maxPolygonToCellsSizeExperimental,r._memcpy=fA._memcpy,r._memmove=fA._memmove,r._memset=fA._memset,r._originToDirectedEdges=fA._originToDirectedEdges,r._pentagonCount=fA._pentagonCount,r._polygonToCells=fA._polygonToCells,r._polygonToCellsExperimental=fA._polygonToCellsExperimental,r._readInt64AsDoubleFromPointer=fA._readInt64AsDoubleFromPointer,r._res0CellCount=fA._res0CellCount,r._reverseDirectedEdge=fA._reverseDirectedEdge,r._round=fA._round,r._sbrk=fA._sbrk,r._sizeOfCellBoundary=fA._sizeOfCellBoundary,r._sizeOfCoordIJ=fA._sizeOfCoordIJ,r._sizeOfGeoLoop=fA._sizeOfGeoLoop,r._sizeOfGeoPolygon=fA._sizeOfGeoPolygon,r._sizeOfH3Index=fA._sizeOfH3Index,r._sizeOfLatLng=fA._sizeOfLatLng,r._sizeOfLinkedGeoPolygon=fA._sizeOfLinkedGeoPolygon,r._uncompactCells=fA._uncompactCells,r._uncompactCellsSize=fA._uncompactCellsSize,r._vertexToLatLng=fA._vertexToLatLng,r.establishStackSpace=fA.establishStackSpace,r.stackAlloc=fA.stackAlloc),uA=r.stackRestore=fA.stackRestore,cA=r.stackSave=fA.stackSave;if(r.dynCall_iii=fA.dynCall_iii,r.asm=fA,r.cwrap=function(A,e,r,i){var n=(r=r||[]).every(function(A){return"number"===A});return"string"!==e&&n&&!i?v(A):function(){return function(A,e,r,i,n){var a={string:function(A){var e=0;return null!=A&&0!==A&&(e=lA(1+(A.length<<2))),e},array:function(A){var e=lA(A.length);return E.set(A,e),e}},t=v(A),f=[],o=0;if(i)for(var l=0;l<i.length;l++){var u=a[r[l]];u?(0===o&&(o=cA()),f[l]=u(i[l])):f[l]=i[l]}var c=t.apply(null,f);return c=function(A){return"string"===e?I(A):"boolean"===e?Boolean(A):A}(c),0!==o&&uA(o),c}(A,e,r,arguments)}},r.setValue=function(A,e,r,i){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":E[A>>0]=e;break;case"i16":C[A>>1]=e;break;case"i32":_[A>>2]=e;break;case"i64":W=[e>>>0,(N=e,+V(N)>=1?N>0?(0|R(+H(N/4294967296),4294967295))>>>0:~~+S((N-+(~~N>>>0))/4294967296)>>>0:0)],_[A>>2]=W[0],_[A+4>>2]=W[1];break;case"float":y[A>>2]=e;break;case"double":M[A>>3]=e;break;default:BA("invalid type for setValue: "+r)}},r.getValue=function(A,e,r){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return E[A>>0];case"i16":return C[A>>1];case"i32":case"i64":return _[A>>2];case"float":return y[A>>2];case"double":return M[A>>3];default:BA("invalid type for getValue: "+e)}return null},Z)if(K(Z)||(aA=Z,Z=r.locateFile?r.locateFile(aA,g):g+aA),l||f){var sA=s(Z);D.set(sA,8)}else{Y++,r.monitorRunDependencies&&r.monitorRunDependencies(Y);var bA=function(A){A.byteLength&&(A=new Uint8Array(A)),D.set(A,8),r.memoryInitializerRequest&&delete r.memoryInitializerRequest.response,function(A){if(Y--,r.monitorRunDependencies&&r.monitorRunDependencies(Y),0==Y&&(null!==j&&(clearInterval(j),j=null),O)){var e=O;O=null,e()}}()},dA=function(){c(Z,bA,function(){throw"could not load memory initializer "+Z})},gA=nA(Z);if(gA)bA(gA.buffer);else if(r.memoryInitializerRequest){var wA=function(){var A=r.memoryInitializerRequest,e=A.response;if(200!==A.status&&0!==A.status){var i=nA(r.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+A.status+", retrying "+Z),void dA();e=i.buffer}bA(e)};r.memoryInitializerRequest.response?setTimeout(wA,0):r.memoryInitializerRequest.addEventListener("load",wA)}else dA()}function kA(A){function e(){tA||(tA=!0,h||(L(U),L(z),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)A=r.postRun.shift(),x.unshift(A);var A;L(x)}()))}A=A||o,Y>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)A=r.preRun.shift(),G.unshift(A);var A;L(G)}(),Y>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),e()},1)):e()))}function BA(A){throw r.onAbort&&r.onAbort(A),w(A+=""),k(A),h=!0,"abort("+A+"). Build with -s ASSERTIONS=1 for more info."}if(O=function A(){tA||kA(),tA||(O=A)},r.run=kA,r.abort=BA,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return kA(),A}("object"==typeof e?e:{}),r="number",i=[["sizeOfH3Index",r],["sizeOfLatLng",r],["sizeOfCellBoundary",r],["sizeOfGeoLoop",r],["sizeOfGeoPolygon",r],["sizeOfLinkedGeoPolygon",r],["sizeOfCoordIJ",r],["readInt64AsDoubleFromPointer",r],["isValidCell","number",["number","number"]],["isValidIndex","number",["number","number"]],["latLngToCell","number",[r,r,"number",r]],["cellToLatLng","number",["number","number",r]],["cellToBoundary","number",["number","number",r]],["maxGridDiskSize","number",[r,r]],["gridDisk","number",["number","number",r,r]],["gridDiskDistances","number",["number","number",r,r,r]],["gridRing","number",["number","number",r,r]],["gridRingUnsafe","number",["number","number",r,r]],["maxPolygonToCellsSize","number",[r,"number",r,r]],["polygonToCells","number",[r,"number",r,r]],["maxPolygonToCellsSizeExperimental","number",[r,"number",r,r]],["polygonToCellsExperimental","number",[r,"number",r,r,r,r]],["cellsToLinkedMultiPolygon","number",[r,r,r]],["destroyLinkedMultiPolygon",null,[r]],["compactCells","number",[r,r,r,r]],["uncompactCells","number",[r,r,r,r,r,"number"]],["uncompactCellsSize","number",[r,r,r,"number",r]],["isPentagon","number",["number","number"]],["isResClassIII","number",["number","number"]],["getBaseCellNumber",r,["number","number"]],["getResolution",r,["number","number"]],["getIndexDigit",r,["number","number",r]],["constructCell","number",[r,r,r,r]],["maxFaceCount","number",["number","number",r]],["getIcosahedronFaces","number",["number","number",r]],["cellToParent","number",["number","number","number",r]],["cellToChildren","number",["number","number","number",r]],["cellToCenterChild","number",["number","number","number",r]],["cellToChildrenSize","number",["number","number","number",r]],["cellToChildPos","number",["number","number","number",r]],["childPosToCell","number",[r,r,"number","number","number",r]],["areNeighborCells","number",["number","number","number","number",r]],["cellsToDirectedEdge","number",["number","number","number","number",r]],["getDirectedEdgeOrigin","number",["number","number",r]],["getDirectedEdgeDestination","number",["number","number",r]],["isValidDirectedEdge","number",["number","number"]],["directedEdgeToCells","number",["number","number",r]],["originToDirectedEdges","number",["number","number",r]],["directedEdgeToBoundary","number",["number","number",r]],["reverseDirectedEdge","number",["number","number",r]],["gridDistance","number",["number","number","number","number",r]],["gridPathCells","number",["number","number","number","number",r]],["gridPathCellsSize","number",["number","number","number","number",r]],["cellToLocalIj","number",["number","number","number","number",r,r]],["localIjToCell","number",["number","number",r,r,r]],["getHexagonAreaAvgM2","number",["number",r]],["getHexagonAreaAvgKm2","number",["number",r]],["getHexagonEdgeLengthAvgM","number",["number",r]],["getHexagonEdgeLengthAvgKm","number",["number",r]],["greatCircleDistanceM",r,[r,r]],["greatCircleDistanceKm",r,[r,r]],["greatCircleDistanceRads",r,[r,r]],["cellAreaM2","number",["number","number",r]],["cellAreaKm2","number",["number","number",r]],["cellAreaRads2","number",["number","number",r]],["edgeLengthM","number",["number","number",r]],["edgeLengthKm","number",["number","number",r]],["edgeLengthRads","number",["number","number",r]],["getNumCells","number",["number",r]],["getRes0Cells","number",[r]],["res0CellCount",r],["getPentagons","number",[r,r]],["pentagonCount",r],["cellToVertex","number",["number","number",r,r]],["cellToVertexes","number",["number","number",r]],["vertexToLatLng","number",["number","number",r]],["isValidVertex","number",["number","number"]]],n=4,a=5,t=13,f={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};f[n]="Resolution argument was outside of acceptable range",f[a]="Cell argument was not valid",f[6]="Directed edge argument was not valid",f[7]="Undirected edge argument was not valid",f[8]="Vertex argument was not valid",f[9]="Pentagon distortion was encountered",f[10]="Duplicate input",f[11]="Cell arguments were not neighbors",f[12]="Cell arguments had incompatible resolutions",f[t]="Memory allocation failed",f[14]="Bounds of provided memory were insufficient",f[15]="Mode or flags argument was not valid",f[16]="Index argument was not valid",f[17]="Base cell number was outside of acceptable range",f[18]="Child indexing digits invalid",f[19]="Child indexing digits refer to a deleted subsequence";var o=1001,l=1002,u={1000:"Unknown unit"};u[o]="Array length out of bounds",u[l]="Got unexpected null value for H3 index";var c="Unknown error";function s(A,e,r){var i=new Error((A[e]||c)+" (code: "+e+(r&&"value"in r?", value: "+r.value:"")+")");return i.code=e,i}function b(A,e){return s(f,A,2===arguments.length?{value:e}:{})}function d(A,e){return s(u,A,2===arguments.length?{value:e}:{})}function g(A){if(0!==A)throw b(A)}var w={};i.forEach(function(A){w[A[0]]=e.cwrap.apply(e,A)});var k=16,B=4,h=8,m=8,v=w.sizeOfH3Index(),Q=w.sizeOfLatLng(),E=w.sizeOfCellBoundary(),D=w.sizeOfGeoPolygon(),C=w.sizeOfGeoLoop(),_=w.sizeOfLinkedGeoPolygon(),y=w.sizeOfCoordIJ(),M={m:"m",m2:"m2",km:"km",km2:"km2",rads:"rads",rads2:"rads2"},P={containmentCenter:"containmentCenter",containmentFull:"containmentFull",containmentOverlapping:"containmentOverlapping",containmentOverlappingBbox:"containmentOverlappingBbox"};function I(A){if("number"!=typeof A||A<0||A>15||Math.floor(A)!==A)throw b(n,A);return A}function p(A){if(!A)throw d(l);return A}var T=Math.pow(2,32)-1,F=Math.pow(2,31)-1;function L(A){if(A>T)throw d(o,A);return A}function G(A,r){var i=A*r;if(!Number.isSafeInteger(i)||i>F)throw b(t,i);var n=e._calloc(A,r);if(!n&&i>0)throw b(t,i);return n}var U=/[^0-9a-fA-F]/;function z(A){if(Array.isArray(A)&&2===A.length&&Number.isInteger(A[0])&&Number.isInteger(A[1]))return A;if("string"!=typeof A||U.test(A))return[0,0];var e=parseInt(A.substring(0,A.length-8),k);return[parseInt(A.substring(A.length-8),k),e]}function x(A){if(A>=0)return A.toString(k);var e=S(8,(A&=2147483647).toString(k));return(parseInt(e[0],k)+8).toString(k)+e.substring(1)}function V(A,e){return x(e)+S(8,x(A))}function S(A,e){for(var r=A-e.length,i="",n=0;n<r;n++)i+="0";return i+e}var H=Math.pow(2,32);function R(A,r,i){for(var n=A.length,a=e._calloc(n,Q),t=i?1:0,f=i?0:1,o=0;o<2*n;o+=2)e.HEAPF64.set([A[o/2][t],A[o/2][f]].map(nA),a/h+o);return e.HEAPU32.set([n,a],r/B),r}function Y(A,r){var i,n=A.length-1,a=e._calloc(D),t=0+C,f=t+B;if(R(A[0],a+0,r),n>0){i=e._calloc(n,C);for(var o=0;o<n;o++)R(A[o+1],i+C*o,r)}return e.setValue(a+t,n,"i32"),e.setValue(a+f,i,"i32"),a}function j(A){var r=0+C,i=r+B,n=B;e._free(e.getValue(A+0+n,"i8*"));var a=e.getValue(A+r,"i32");if(a>0){for(var t=e.getValue(A+i,"i32"),f=0;f<a;f++)e._free(e.getValue(t+C*f+n,"i8*"));e._free(t)}e._free(A)}function O(A,r){void 0===r&&(r=0);var i=e.getValue(A+v*r,"i32"),n=e.getValue(A+v*r+B,"i32");return n?V(i,n):null}function N(A,r){return void 0===r&&(r=0),e.getValue(A+h*r,"double")}function W(A){return w.readInt64AsDoubleFromPointer(A)}function Z(A,r,i){e.HEAPU32.set(z(A),r/B+2*i)}function J(A,e){for(var r=[],i=0;i<e;i++){var n=O(A,i);null!==n&&r.push(n)}return r}function K(A,e){for(var r=e.length,i=0;i<r;i++)Z(e[i],A,i)}function X(A,r){var i=e._calloc(1,Q);return e.HEAPF64.set([A,r].map(nA),i/h),i}function q(A){return aA(e.getValue(A,"double"))}function $(A){return[q(A),q(A+h)]}function AA(A){return[q(A+h),q(A)]}function eA(A,r,i){for(var n=e.getValue(A,"i32"),a=A+h,t=[],f=r?AA:$,o=0;o<2*n;o+=2)t.push(f(a+h*o));return i&&t.push(t[0]),t}function rA(A){var e=z(A);return Boolean(w.isValidCell(e[0],e[1]))}function iA(A,r){if(!rA(A))throw b(a);var i=z(A),n=i[0],t=i[1],f=e._malloc(m);try{return g(w.cellToChildrenSize(n,t,r,f)),W(f)}finally{e._free(f)}}function nA(A){return A*Math.PI/180}function aA(A){return 180*A/Math.PI}A.UNITS=M,A.POLYGON_TO_CELLS_FLAGS=P,A.h3IndexToSplitLong=z,A.splitLongToH3Index=V,A.isValidCell=rA,A.isValidIndex=function(A){var e=z(A);return Boolean(w.isValidIndex(e[0],e[1]))},A.isPentagon=function(A){var e=z(A);return Boolean(w.isPentagon(e[0],e[1]))},A.isResClassIII=function(A){var e=z(A);return Boolean(w.isResClassIII(e[0],e[1]))},A.getBaseCellNumber=function(A){var e=z(A);return w.getBaseCellNumber(e[0],e[1])},A.getIndexDigit=function(A,r){var i=e._malloc(B),n=z(A),a=n[0],t=n[1];try{return g(w.getIndexDigit(a,t,r,i)),e.getValue(i,"i32")}finally{e._free(i)}},A.getIcosahedronFaces=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(B);try{g(w.maxFaceCount(i,n,a));var t=e.getValue(a,"i32"),f=e._malloc(B*t);try{return g(w.getIcosahedronFaces(i,n,f)),function(A,r){for(var i=[],n=0;n<r;n++){var a=e.getValue(A+B*n,"i32");a>=0&&i.push(a)}return i}(f,t)}finally{e._free(f)}}finally{e._free(a)}},A.getResolution=function(A){var e=z(A),r=e[0],i=e[1];return w.isValidCell(r,i)?w.getResolution(r,i):-1},A.constructCell=function(A,r,i){if(void 0===i&&(i=r.length),r.length!==i)throw b(18,r.length);if(r.length>15)throw b(18,r.length);var n=e._malloc(B*r.length),a=e._malloc(v);try{return r.forEach(function(A,r){e.setValue(n+B*r,A,"i32")}),g(w.constructCell(i,A,n,a)),p(O(a))}finally{e._free(a),e._free(n)}},A.latLngToCell=function(A,r,i){var n=e._malloc(Q);e.HEAPF64.set([A,r].map(nA),n/h);var a=e._malloc(v);try{return g(w.latLngToCell(n,i,a)),p(O(a))}finally{e._free(a),e._free(n)}},A.cellToLatLng=function(A){var r=e._malloc(Q),i=z(A),n=i[0],a=i[1];try{return g(w.cellToLatLng(n,a,r)),$(r)}finally{e._free(r)}},A.cellToBoundary=function(A,r){var i=e._malloc(E),n=z(A),a=n[0],t=n[1];try{return g(w.cellToBoundary(a,t,i)),eA(i,r,r)}finally{e._free(i)}},A.cellToParent=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToParent(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToChildren=function(A,r){if(!rA(A))return[];var i=z(A),n=i[0],a=i[1],t=L(iA(A,r)),f=e._calloc(t,v);try{return g(w.cellToChildren(n,a,r,f)),J(f,t)}finally{e._free(f)}},A.cellToChildrenSize=iA,A.cellToCenterChild=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToCenterChild(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToChildPos=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{return g(w.cellToChildPos(n,a,r,t)),W(t)}finally{e._free(t)}},A.childPosToCell=function(A,r,i){var n,a="number"!=typeof(n=A)?[0,0]:[0|n,n/H|0],t=a[0],f=a[1],o=z(r),l=o[0],u=o[1],c=e._malloc(v);try{return g(w.childPosToCell(t,f,l,u,i,c)),p(O(c))}finally{e._free(c)}},A.gridDisk=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{g(w.maxGridDiskSize(r,t));var f=L(W(t)),o=G(f,v);try{return g(w.gridDisk(n,a,r,o)),J(o,f)}finally{e._free(o)}}finally{e._free(t)}},A.gridDiskDistances=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{g(w.maxGridDiskSize(r,t));var f,o=L(W(t)),l=G(o,v);try{f=G(o,B),g(w.gridDiskDistances(n,a,r,l,f));for(var u=[],c=0;c<r+1;c++)u.push([]);for(var s=0;s<o;s++){var b=O(l,s),d=e.getValue(f+B*s,"i32");null!==b&&u[d].push(b)}return u}finally{e._free(l),f&&e._free(f)}}finally{e._free(t)}},A.gridRing=function(A,r){var i=0===r?1:6*r,n=e._calloc(i,v);try{return g(w.gridRing.apply(w,z(A).concat([r],[n]))),J(n,i)}finally{e._free(n)}},A.gridRingUnsafe=function(A,r){var i=0===r?1:6*r,n=e._calloc(i,v);try{return g(w.gridRingUnsafe.apply(w,z(A).concat([r],[n]))),J(n,i)}finally{e._free(n)}},A.polygonToCells=function(A,r,i){if(I(r),i=Boolean(i),0===A.length||0===A[0].length)return[];var n=Y("number"==typeof A[0][0]?[A]:A,i),a=e._malloc(m);try{g(w.maxPolygonToCellsSize(n,r,0,a));var t=L(W(a)),f=e._calloc(t,v);try{return g(w.polygonToCells(n,r,0,f)),J(f,t)}finally{e._free(f)}}finally{e._free(a),j(n)}},A.polygonToCellsExperimental=function(A,r,i,n){I(r),n=Boolean(n);var a=function(A){switch(A){case P.containmentCenter:return 0;case P.containmentFull:return 1;case P.containmentOverlapping:return 2;case P.containmentOverlappingBbox:return 3;default:throw d(15,A)}}(i);if(0===A.length||0===A[0].length)return[];var t=Y("number"==typeof A[0][0]?[A]:A,n),f=e._malloc(m);try{g(w.maxPolygonToCellsSizeExperimental(t,r,a,f));var o=L(W(f)),l=e._calloc(o,v);try{return g(w.polygonToCellsExperimental(t,r,a,o,0,l)),J(l,o)}finally{e._free(l)}}finally{e._free(f),j(t)}},A.cellsToMultiPolygon=function(A,r){if(!A||!A.length)return[];var i=A.length,n=e._calloc(i,v);K(n,A);var a=e._calloc(_);try{return g(w.cellsToLinkedMultiPolygon(n,i,a)),function(A,r){for(var i,n,a,t,f=[],o=r?AA:$;A;){for(f.push(i=[]),n=e.getValue(A,"i8*");n;){for(i.push(a=[]),t=e.getValue(n,"i8*");t;)a.push(o(t)),t=e.getValue(t+2*h,"i8*");r&&a.push(a[0]),n=e.getValue(n+8,"i8*")}A=e.getValue(A+8,"i8*")}return f}(a,r)}finally{w.destroyLinkedMultiPolygon(a),e._free(a),e._free(n)}},A.compactCells=function(A){if(!A||!A.length)return[];var r=A.length,i=e._calloc(r,v);K(i,A);var n=e._calloc(r,v);try{return g(w.compactCells(i,n,r,0)),J(n,r)}finally{e._free(i),e._free(n)}},A.uncompactCells=function(A,r){if(I(r),!A||!A.length)return[];var i=A.length,n=e._calloc(i,v);K(n,A);var a=e._malloc(m);try{g(w.uncompactCellsSize(n,i,0,r,a));var t=L(W(a)),f=e._calloc(t,v);try{return g(w.uncompactCells(n,i,0,f,t,0,r)),J(f,t)}finally{e._free(n),e._free(f)}}finally{e._free(a)}},A.areNeighborCells=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(B);try{return g(w.areNeighborCells(n,a,f,o,l)),function(A,r){void 0===r&&(r=0);var i=e.getValue(l+B*r,"i32");return Boolean(i)}()}finally{e._free(l)}},A.cellsToDirectedEdge=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(v);try{return g(w.cellsToDirectedEdge(n,a,f,o,l)),p(O(l))}finally{e._free(l)}},A.getDirectedEdgeOrigin=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.getDirectedEdgeOrigin(i,n,a)),p(O(a))}finally{e._free(a)}},A.getDirectedEdgeDestination=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.getDirectedEdgeDestination(i,n,a)),p(O(a))}finally{e._free(a)}},A.isValidDirectedEdge=function(A){var e=z(A);return Boolean(w.isValidDirectedEdge(e[0],e[1]))},A.directedEdgeToCells=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(2,v);try{return g(w.directedEdgeToCells(i,n,a)),J(a,2)}finally{e._free(a)}},A.originToDirectedEdges=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(6,v);try{return g(w.originToDirectedEdges(i,n,a)),J(a,6)}finally{e._free(a)}},A.directedEdgeToBoundary=function(A,r){var i=e._malloc(E),n=z(A),a=n[0],t=n[1];try{return g(w.directedEdgeToBoundary(a,t,i)),eA(i,r)}finally{e._free(i)}},A.reverseDirectedEdge=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.reverseDirectedEdge(i,n,a)),p(O(a))}finally{e._free(a)}},A.gridDistance=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(m);try{return g(w.gridDistance(n,a,f,o,l)),W(l)}finally{e._free(l)}},A.gridPathCells=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(m);try{g(w.gridPathCellsSize(n,a,f,o,l));var u=L(W(l)),c=e._calloc(u,v);try{return w.gridPathCells(n,a,f,o,c),J(c,u)}finally{e._free(c)}}finally{e._free(l)}},A.cellToLocalIj=function(A,r){var i,n=e._malloc(y);try{return g(w.cellToLocalIj.apply(w,z(A).concat(z(r),[0],[n]))),{i:e.getValue(i=n,"i32"),j:e.getValue(i+B,"i32")}}finally{e._free(n)}},A.localIjToCell=function(A,r){if(!r||"number"!=typeof r.i||"number"!=typeof r.j)throw new Error("Coordinates must be provided as an {i, j} object");var i,n,a,t=e._malloc(y),f=e._malloc(v);a=(n=r).j,e.setValue(i=t,n.i,"i32"),e.setValue(i+B,a,"i32");try{return g(w.localIjToCell.apply(w,z(A).concat([t],[0],[f]))),p(O(f))}finally{e._free(t),e._free(f)}},A.greatCircleDistance=function(A,r,i){var n,a=X(A[0],A[1]),t=X(r[0],r[1]);switch(i){case M.m:n=w.greatCircleDistanceM(a,t);break;case M.km:n=w.greatCircleDistanceKm(a,t);break;case M.rads:n=w.greatCircleDistanceRads(a,t);break;default:n=null}if(e._free(a),e._free(t),null===n)throw d(1e3,i);return n},A.cellArea=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(h);try{switch(r){case M.m2:g(w.cellAreaM2(n,a,t));break;case M.km2:g(w.cellAreaKm2(n,a,t));break;case M.rads2:g(w.cellAreaRads2(n,a,t));break;default:throw d(1e3,r)}return N(t)}finally{e._free(t)}},A.edgeLength=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(h);try{switch(r){case M.m:g(w.edgeLengthM(n,a,t));break;case M.km:g(w.edgeLengthKm(n,a,t));break;case M.rads:g(w.edgeLengthRads(n,a,t));break;default:throw d(1e3,r)}return N(t)}finally{e._free(t)}},A.getHexagonAreaAvg=function(A,r){I(A);var i=e._malloc(h);try{switch(r){case M.m2:g(w.getHexagonAreaAvgM2(A,i));break;case M.km2:g(w.getHexagonAreaAvgKm2(A,i));break;default:throw d(1e3,r)}return N(i)}finally{e._free(i)}},A.getHexagonEdgeLengthAvg=function(A,r){I(A);var i=e._malloc(h);try{switch(r){case M.m:g(w.getHexagonEdgeLengthAvgM(A,i));break;case M.km:g(w.getHexagonEdgeLengthAvgKm(A,i));break;default:throw d(1e3,r)}return N(i)}finally{e._free(i)}},A.cellToVertex=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToVertex(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToVertexes=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(6,v);try{return g(w.cellToVertexes(i,n,a)),J(a,6)}finally{e._free(a)}},A.vertexToLatLng=function(A){var r=e._malloc(Q),i=z(A),n=i[0],a=i[1];try{return g(w.vertexToLatLng(n,a,r)),$(r)}finally{e._free(r)}},A.isValidVertex=function(A){var e=z(A);return Boolean(w.isValidVertex(e[0],e[1]))},A.getNumCells=function(A){I(A);var r=e._malloc(m);try{return g(w.getNumCells(A,r)),W(r)}finally{e._free(r)}},A.getRes0Cells=function(){var A=w.res0CellCount(),r=e._malloc(v*A);try{return g(w.getRes0Cells(r)),J(r,A)}finally{e._free(r)}},A.getPentagons=function(A){I(A);var r=w.pentagonCount(),i=e._malloc(v*r);try{return g(w.getPentagons(A,i)),J(i,r)}finally{e._free(i)}},A.degsToRads=nA,A.radsToDegs=aA});\n//# sourceMappingURL=h3-js.umd.js.map\n\n;(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e};e=((e,r,i)=>(i=e==null?{}:t(a(e)),s(n(i,`default`,{value:e,enumerable:!0}),e)))(e,1);var c=.5,l=3,u=6,d=[`roadworks`,`road-closed`],f=1,p=.5,m=.1;function h(e,t,n){if(n===0)return e;let r=new Set(t);return e.filter(e=>{let t=e.properties.category,i=e.properties.delayInSeconds??0;return!(r.has(t)&&i<n)})}function g(t){let n=t.properties.id;if(t.geometry.type===`Point`)return e.point(t.geometry.coordinates,{_incidentId:n});let r=e.centroid(t);return r.properties={_incidentId:n},r}function ee(e){let t=new Map;for(let n of e)for(let e of n.properties.roadNumbers??[])t.set(e,(t.get(e)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>e)}function _(e){let t=new Map;for(let n of e){let e=n.properties.category;e&&t.set(e,(t.get(e)??0)+1)}return[...t.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]??`incident`}function te(e,t){let n=t.map(e=>new Set(e.memberIds)),r=[];for(let i=0;i<e.length;i++){let a=new Set(e[i].memberIds);for(let e=0;e<t.length;e++){let t=n[e],o=0;for(let e of a)t.has(e)&&o++;let s=a.size+t.size-o,c=s===0?0:o/s;c>=p&&r.push({freshIdx:i,prevIdx:e,overlap:c})}}r.sort((e,t)=>t.overlap-e.overlap);let i=new Map,a=new Set,o=new Set;for(let{freshIdx:e,prevIdx:n,overlap:s}of r)a.has(e)||o.has(n)||(i.set(e,t[n].id),a.add(e),o.add(n));return i}function v(e){if(e.length<3)return`steady`;let[t,n,r]=e.slice(-3),i=(r-t)/Math.max(t,1);return n>t&&r>n&&i>m?`growing`:n<t&&r<n&&i<-.1?`fading`:`steady`}function y(t,n,r,i,a){if(t.length===0)return{groups:[]};let o=h(t,n.preFilter?.excludeCategories??d,n.preFilter?.minDelaySeconds??f);if(o.length===0)return{groups:[]};let s=new Map;for(let e of o)s.set(e.properties.id,e);let p=o.map(g),m=e.featureCollection(p),y=n.eps??c,b=n.minMembers??l,x=e.clustersDbscan(m,y,{minPoints:b}),S=new Map;for(let e of x.features){let t=e.properties.cluster;if(t===void 0||t<0)continue;let n=S.get(t);n||(n=[],S.set(t,n)),n.push(e)}let C=n.maxClusters??u,w=[];for(let[,t]of S){let n=t.map(e=>e.properties._incidentId),r=n.map(e=>s.get(e)).filter(e=>e!==void 0),i=r.reduce((e,t)=>e+(t.properties.delayInSeconds??0),0),a=r.reduce((e,t)=>Math.max(e,t.properties.delayInSeconds??0),0),o=e.featureCollection(t),c=e.centroid(o).geometry.coordinates,l=0;if(t.length>=2){let t=e.bbox(o);l=e.distance([t[0],t[1]],[t[2],t[3]])}let u=ee(r);w.push({centroid:c,memberIds:n,size:r.length,totalDelaySeconds:i,peakDelaySeconds:a,diameterKm:l,primaryRoads:u,primaryCategory:_(r)})}w.sort((e,t)=>t.totalDelaySeconds-e.totalDelaySeconds);let T=w.slice(0,C),E=r?te(T,r):new Map,D=new Map;if(r)for(let e of r)D.set(e.id,e);let O=i===void 0||a===void 0||i>a;return{groups:T.map((e,t)=>{let n=E.get(t),r=n??`cluster-${e.centroid[0].toFixed(3)}-${e.centroid[1].toFixed(3)}-${[...e.memberIds].sort()[0]??t}`,i=n?D.get(n):void 0,a=i?.delaySamples??[],o=i?(O?[...a,e.totalDelaySeconds]:[...a.slice(0,-1),e.totalDelaySeconds]).slice(-3):[e.totalDelaySeconds],s=o.length===1?`new`:v(o);return{id:r,centroid:e.centroid,memberIds:e.memberIds,size:e.size,totalDelaySeconds:e.totalDelaySeconds,peakDelaySeconds:e.peakDelaySeconds,diameterKm:e.diameterKm,primaryRoads:e.primaryRoads,primaryCategory:e.primaryCategory,trend:s,delaySamples:o}})}}var b=e=>{if(e!=null)return e instanceof Date?e.getTime():e},x=(e,t={},n,r)=>{let i=b(r),{groups:a}=y(e,t,n?.groups,i,n?.sampledAt);return i===void 0?{groups:a}:{groups:a,sampledAt:i}},S=e=>Object.fromEntries(Object.entries(e??{}).filter(([,e])=>e!==void 0)),C={initialWaitMs:447,backoffFactor:1.618,timeoutMs:4e4},w={commonBaseURL:`https://api.tomtom.com`,apiKey:``,retry:C},T=(...e)=>e.reduce((e,t)=>({...e,...S(t)}),{...C}),E=()=>({...w,retry:T()});(class e{static{this.instance=new e}constructor(){this.config=E()}put(e){this.config={...this.config,...e,...e.retry&&{retry:T(e.retry)}}}reset(){this.config=E()}get(){return this.config}});var D=[`carpool`,`carTrain`,`country`,`ferry`,`importantRoadStretch`,`lowEmissionZone`,`motorway`,`pedestrian`,`roadShields`,`speedLimit`,`toll`,`tollRoad`,`tollVignette`,`traffic`,`tunnel`,`unpaved`,`urban`,`vehicleRestricted`,`curve`,`curvyStretch`,`lanes`],O=[...D,`leg`,`distinct`],ne=(e,t,n,r)=>e>n?[e===180?-180:e,t,n===-180?180:n,r]:[e,t,n,r],re=e=>e>180?e-360:e<-180?e+360:e,k=(e,t)=>{let n=e?.length;if(!n)return;let r={west:1/0,east:-1/0,crossingWest:1/0,crossingEast:-1/0,south:1/0,north:-1/0},i=e=>{if(!e||e.length<2)return;let n=t(e[0]);r.west=Math.min(r.west,n),r.east=Math.max(r.east,n),n<0?r.crossingEast=Math.max(r.crossingEast,n):r.crossingWest=Math.min(r.crossingWest,n),r.south=Math.min(r.south,e[1]),r.north=Math.max(r.north,e[1])},a=Math.ceil(n/1e3);for(let t=0;t<n;t+=a)i(e[t]);return a>1&&i(e[n-1]),r.south===1/0?void 0:r},A=e=>{let t=k(e,re);if(!t)return;let{west:n,south:r,east:i,north:a,crossingWest:o,crossingEast:s}=t,c=i-n,l=s+360-o;return Number.isFinite(l)&&c<360&&l<c?ne(o,r,s,a):[n,r,i,a]},j=(e,t)=>{if(e){if(Array.isArray(e))return e;if(e.coordinates)return e.coordinates;if(e.geometry)return t?.useEntryPoint===`main-when-available`?(e=>{let t=e?.properties?.entryPoints;return t?.find(e=>e.type===`main`)??t?.find(e=>!e.type)})(e)?.position??e.geometry.coordinates:e.geometry.coordinates}return null},M=(e,t)=>{let n=j(e,t);if(!n)throw Error(`The received object does not have lng-lat coordinates: ${JSON.stringify(e)}`);return n},N=(e,t,n)=>Math.max(t,Math.min(e,n)),P=({distanceInMeters:e,travelTimeInSeconds:t})=>e===void 0||t===void 0?void 0:{distanceInMeters:e,travelTimeInSeconds:t},F=(e,t,n)=>({distanceInMeters:e.distanceInMeters+n*(t.distanceInMeters-e.distanceInMeters),travelTimeInSeconds:e.travelTimeInSeconds+n*(t.travelTimeInSeconds-e.travelTimeInSeconds)}),I=(e,t)=>{let{progress:n}=e.properties;if(!n||n.length===0)return;let r=e.geometry.coordinates.length;if(t<0||t>=r)return;let i=B(n,`pointIndex`,t);if(!i)return;let{lower:a,lowerValue:o,upper:s,upperValue:c}=i,l=P(a),u=P(s);if(l&&u)return o===c?l:F(l,u,K(e.geometry.coordinates,o,t,c))},L=(e,t,n)=>{let r=I(e,t),i=I(e,n);if(r&&i)return{start:r,end:i,delta:{distanceInMeters:i.distanceInMeters-r.distanceInMeters,travelTimeInSeconds:i.travelTimeInSeconds-r.travelTimeInSeconds}}},ie=(e,t)=>L(e,t.startPointIndex,t.endPointIndex),ae=(e,t)=>{let n=e.geometry.coordinates;if(!n||n.length===0||t.startPointIndex<0||t.endPointIndex>=n.length||t.startPointIndex>t.endPointIndex)return;let r=Math.floor((t.startPointIndex+t.endPointIndex)/2);return A([n[t.startPointIndex],n[r],n[t.endPointIndex]])},oe=(e,t)=>{let n=Math.max(e.startPointIndex,t.startPointIndex),r=Math.min(e.endPointIndex,t.endPointIndex);return r>n?{startPointIndex:n,endPointIndex:r}:void 0},R=(e,t,n=[{startPointIndex:0,endPointIndex:e.length-1}])=>n.reduce((n,r)=>{let i=oe(r,t);return n+(i?e[i.endPointIndex]-e[i.startPointIndex]:0)},0),z=(e,t,n)=>{let r=e,i=0,a=e;for(;i<a;){let e=i+a>>>1,o=e;for(;o<a&&t(o)===void 0;)o++;let s=o<a?t(o):void 0;s===void 0?a=e:n(s)?(r=o,a=e):i=o+1}return r},B=(e,t,n)=>{let r=n=>e[n][t],i=e[z(e.length,r,e=>e>=n)],a=z(e.length,r,e=>e>n)-1;for(;a>=0&&e[a][t]===void 0;)a--;let o=e[a],s=o?.[t],c=i?.[t];return s!==void 0&&c!==void 0?{lower:o,lowerValue:s,upper:i,upperValue:c}:void 0},V=new WeakMap,H=Math.PI/180,U=e=>{let t=V.get(e);if(t?.length===e.length)return t;let n=new Float64Array(e.length),[r=0,i=0]=e[0]??[],a=Math.cos(i*H);for(let t=1;t<e.length;t++){let[o,s]=e[t],c=Math.cos(s*H),l=Math.sin((s-i)*H/2),u=Math.sin((o-r)*H/2),d=l*l+u*u*a*c;n[t]=n[t-1]+12742017.6*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)),r=o,i=s,a=c}return V.set(e,n),n},W=(e,t,n,r)=>{let i=N(z(e.length,t=>e[t],e=>e>=t)-1,n,r-1),a=e[i+1]-e[i];return{pathIndex:i,share:a>0?N((t-e[i])/a,0,1):0}},G=(e,t,n)=>[e[0]+n*(t[0]-e[0]),e[1]+n*(t[1]-e[1])],K=(e,t,n,r)=>{let i=U(e),a=i[r]-i[t];return a>0?(i[n]-i[t])/a:(n-t)/(r-t)},q=(e,t,n)=>{let r=e.geometry.coordinates,i=Math.min(t+1,r.length-1),a=I(e,t),o=I(e,i);if(a&&o)return{position:G(r[t],r[i],n),...F(a,o,n)}},J=(e,t)=>{let n=P(t);return n&&{position:e[t.pointIndex],...n}},Y=(e,t,n)=>{let{progress:r}=e.properties,i=r?.at(-1);if(!r||!i)return;let a=e.geometry.coordinates,o=r[0],s=o[t],c=i[t];if(s===void 0||c===void 0)return;if(n<=s)return J(a,o);if(n>=c)return J(a,i);let l=((e,t,n,r)=>{let i=B(e,n,r);if(!i)return;let{lower:a,lowerValue:o,upper:s,upperValue:c}=i,l=o===c?0:(r-o)/(c-o),u=U(t),d=u[s.pointIndex]-u[a.pointIndex];if(d===0){let e=a.pointIndex+l*(s.pointIndex-a.pointIndex),t=Math.floor(e);return{pathIndex:t,progressRatioTowardsNextPathPoint:e-t}}let f=W(u,u[a.pointIndex]+l*d,a.pointIndex,s.pointIndex);return{pathIndex:f.pathIndex,progressRatioTowardsNextPathPoint:f.share}})(r,a,t,n);return l===void 0?void 0:q(e,l.pathIndex,l.progressRatioTowardsNextPathPoint)},se=(e,t)=>{if(`traveledTimeInSeconds`in t)return Y(e,`travelTimeInSeconds`,t.traveledTimeInSeconds);if(`traveledDistanceInMeters`in t)return Y(e,`distanceInMeters`,t.traveledDistanceInMeters);let n=e.properties.summary.departureTime;if(!n)return;let r=(t.clockTime.getTime()-n.getTime())/1e3;return r<0?void 0:Y(e,`travelTimeInSeconds`,r)},ce=(t,n)=>{let{progress:r}=t.properties,i=t.geometry.coordinates;if(!r?.length||i.length<2)return;let a=(0,e.nearestPointOnLine)(t,M(n)),o=a.properties.segmentIndex,s=Math.min(o+1,i.length-1);return q(t,o,((e,t,n)=>{let r=n[0]-e[0],i=n[1]-e[1],a=r*r+i*i;return a===0?0:N(((t[0]-e[0])*r+(t[1]-e[1])*i)/a,0,1)})(i[o],a.geometry.coordinates,i[s]))},le=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),ue=e=>!e.maneuver&&Math.abs(e.headingChangeInDegrees)>=140&&e.radiusInMeters<=40,X=e=>Math.round(1e5*e),Z=(e,t)=>Math.imul(Math.imul(e,2654435761)^t,2246822507),Q=(e,t,n,r,i,a)=>e[t]===n&&e[t+1]===r&&e[t+2]===i&&e[t+3]===a,de=(e,t,n,r,i,a,o)=>{let s=Z(r,i)+Z(a,o),c=6*((s^s>>>15)&e.length/6-1);for(;e[c+4]&&!Q(e,c,r,i,a,o)&&!Q(e,c,a,o,r,i);)c=(c+6)%e.length;return e[c+4]||(e[c]=r,e[c+1]=i,e[c+2]=a,e[c+3]=o,e[c+4]=t+1,e[c+5]=n),c},fe=(e,{minLengthInMeters:t=0}={})=>{let n=Array.isArray(e)?e:e.features,{firsts:r,shared:i}=(e=>{let t=new Int32Array(6*2**Math.ceil(Math.log2(1.5*e.reduce((e,t)=>e+t.length,0)+1))),n=e.map(e=>new Int32Array(Math.max(e.length-1,0))),r=n.map(e=>new Uint8Array(e.length)),i=(e,t)=>{r[e][n[e][t]]=1};return e.forEach((r,a)=>{let o=n[a],s,[c=0,l=0]=r[0]??[],u=X(c),d=X(l);for(let n=0;n<o.length;n++){let c=u,l=d;if(u=X(r[n+1][0]),d=X(r[n+1][1]),c===u&&l===d){o[n]=-1;continue}o[n]=n;let f=s&&e[s.route][s.vertex+s.step];if(s&&f&&X(f[0])===u&&X(f[1])===d){i(a,n),i(s.route,Math.min(s.vertex,s.vertex+s.step)),s.vertex+=s.step;continue}let p=de(t,a,n,c,l,u,d),m=t[p+4]-1,h=t[p+5];if(s=void 0,m===a){o[n]=h;continue}i(a,n),i(m,h);let g=t[p]===c&&t[p+1]===l;s={route:m,vertex:g?h+1:h,step:g?1:-1}}}),{firsts:n,shared:r}})(n.map(e=>e.geometry.coordinates));return n.map((e,n)=>{let a=r[n],o=i[n],s=U(e.geometry.coordinates),c=[],l;for(let e=0;e<=a.length;e++){if(a[e]===-1)continue;if(e<a.length&&!o[a[e]]){l??=e;continue}if(l===void 0)continue;let n=s[e]-s[l];n>=t&&c.push({id:le(),startPointIndex:l,endPointIndex:e,lengthInMeters:n}),l=void 0}return c})},pe=(e,{within:t,minLengthInMeters:n=0}={})=>{let r=U(e.geometry.coordinates),i=new Map,a=[...e.properties.sections.importantRoadStretch??[]].sort((e,t)=>e.startPointIndex-t.startPointIndex);for(let e of a){let n=R(r,e,t);if(!n)continue;let{index:a,roadNumbers:o=[],streetName:s}=e,c=o[0]??s,l=c??a,u=i.get(l);u?(u.index=Math.min(u.index,a),u.roadNumbers=[...new Set([...u.roadNumbers,...o])],u.streetName??=s,u.lengthInMeters+=n,u.sections.push(e)):i.set(l,{index:a,...c&&{name:c},roadNumbers:o,...s&&{streetName:s},lengthInMeters:n,sections:[e]})}return[...i.values()].filter(e=>e.lengthInMeters>=n)},$=(e,{within:t,types:n=O}={})=>{let r=U(e.geometry.coordinates),i={};for(let a of n){let n=e.properties.sections[a]??[],o=[],s=[],c=0;for(let e of n){let{startPointIndex:n=0,endPointIndex:i=0}=e,a=R(r,{startPointIndex:n,endPointIndex:i},t);a>0&&(o.push(e),s.push(a/(r[i]-r[n])),c+=a)}o.length&&(i[a]={sections:o,shares:s,lengthInMeters:c})}return i};Object.assign(globalThis,{routeUtils:{calculateProgressAtRoutePoint:I,compareRoutes:(e,t,{types:n=D}={})=>{let[r,i]=fe([e,t]);return{distinct:r,referenceDistinct:i,adds:$(e,{within:r,types:n}),avoids:$(t,{within:i,types:n})}},getCoordinateAtRouteProgress:se,getImportantRoads:pe,getProgressAtNearestRoutePoint:ce,getRouteProgressBetween:L,getRouteProgressForSection:ie,getSectionBBox:ae,getSectionsWithin:$,isHairpin:ue},cluster:x})})(self.turf);';export{sandboxLibrarySource};
|
|
1
|
+
var sandboxLibrarySource='!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).turf={})}(this,function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if(Array.isArray(t))return t}function r(t,e,n){return e=l(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t)}(t,c()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,x(r.key),r)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=k(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function u(t,e,n){return(e=x(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(c=function(){return!!t})()}function f(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){\n/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\nvar t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var u=r&&r.prototype instanceof a?r:a,l=Object.create(u.prototype);return d(l,"_invoke",function(n,r,i){var o,a,u,l=0,h=i||[],c=!1,f={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,n){return o=e,a=0,u=t,f.n=n,s}};function v(n,r){for(a=n,u=r,e=0;!c&&l&&!i&&e<h.length;e++){var i,o=h[e],v=f.p,g=o[2];n>3?(i=g===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=v&&((i=n<2&&v<o[1])?(a=0,f.v=r,f.n=o[1]):v<g&&(i=n<3||o[0]>r||r>g)&&(o[4]=n,o[5]=r,f.n=g,a=0))}if(i||n>1)return s;throw c=!0,r}return function(i,h,g){if(l>1)throw TypeError("Generator is already running");for(c&&1===h&&v(h,g),a=h,u=g;(e=a<2?t:u)||!c;){o||(a?a<3?(a>1&&(f.n=-1),v(a,u)):f.n=u:f.v=u);try{if(l=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(u=TypeError("The iterator does not provide a \'"+i+"\' method"),a=1);o=t}else if((e=(c=f.n<0)?u:n.call(r,f))!==s)break}catch(e){o=t,a=1,u=e}finally{l=1}}return{value:e,done:c}}}(n,i,o),!0),l}var s={};function a(){}function u(){}function l(){}e=Object.getPrototypeOf;var h=[][r]?e(e([][r]())):(d(e={},r,function(){return this}),e),c=l.prototype=a.prototype=Object.create(h);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,d(t,i,"GeneratorFunction")),t.prototype=Object.create(c),t}return u.prototype=l,d(c,"constructor",l),d(l,"constructor",u),u.displayName="GeneratorFunction",d(l,i,"GeneratorFunction"),d(c),d(c,i,"Generator"),d(c,r,function(){return this}),d(c,"toString",function(){return"[object Generator]"}),(g=function(){return{w:o,m:f}})()}function d(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}d=function(t,e,n,r){function o(e,n){d(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},d(t,e,n,r)}function p(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(typeof t+" is not iterable")}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function m(t,e){return n(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||k(t,e)||v()}function _(t){return function(t){if(Array.isArray(t))return e(t)}(t)||f(t)||k(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function k(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var w=6371008.8,b={centimeters:637100880,centimetres:637100880,cm:637100880,degrees:360/(2*Math.PI),deg:360/(2*Math.PI),feet:20902260.511392,ft:20902260.511392,inches:39.37*w,in:39.37*w,kilometers:6371.0088,kilometres:6371.0088,km:6371.0088,meters:w,metres:w,m:w,miles:3958.761333810546,mi:3958.761333810546,millimeters:6371008800,millimetres:6371008800,mm:6371008800,nauticalmiles:w/1852,nmi:w/1852,radians:1,rad:1,yards:6967335.223679999,yd:6967335.223679999},I={acres:247105e-9,ac:247105e-9,centimeters:1e4,centimetres:1e4,cm:1e4,feet:10.763910417,ft:10.763910417,hectares:1e-4,ha:1e-4,inches:1550.003100006,in:1550.003100006,kilometers:1e-6,kilometres:1e-6,km:1e-6,meters:1,metres:1,m:1,miles:386e-9,mi:386e-9,nauticalmiles:2.9155334959812285e-7,nmi:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,mm:1e6,yards:1.195990046,yd:1.195990046};function N(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},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 S(t,e){switch(t){case"Point":return M(e).geometry;case"LineString":return T(e).geometry;case"Polygon":return P(e).geometry;case"MultiPoint":return D(e).geometry;case"MultiLineString":return A(e).geometry;case"MultiPolygon":return F(e).geometry;default:throw new Error(t+" is invalid")}}function M(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};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(!W(t[0])||!W(t[1]))throw new Error("coordinates must contain numbers");return N({type:"Point",coordinates:t},e,n)}function L(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return M(t,e)}),n)}function P(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=a(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}catch(t){i.e(t)}finally{i.f()}return N({type:"Polygon",coordinates:t},e,r)}function C(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return P(t,e)}),n)}function T(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return N({type:"LineString",coordinates:t},e,n)}function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return R(t.map(function(t){return T(t,e)}),n)}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function A(t,e){return N({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function D(t,e){return N({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function F(t,e){return N({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function q(t,e){return N({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t*n}function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t/n}function z(t,e){return U(B(t,e))}function j(t){var e=t%360;return e<0&&(e+=360),e}function X(t){return(t%=360)>180?t-360:t<-180?t+360:t}function U(t){return 180*(t%(2*Math.PI))/Math.PI}function V(t){return t%360*Math.PI/180}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number");return Y(B(t,e),n)}function H(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number");var r=I[e];if(!r)throw new Error("invalid original units");var i=I[n];if(!i)throw new Error("invalid final units");return t/r*i}function W(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function J(t){return null!==t&&"object"===E(t)&&!Array.isArray(t)}function K(t){delete t.bbox,"Feature"===t.type?t.geometry&&K(t.geometry):"FeatureCollection"===t.type?t.features.forEach(K):"GeometryCollection"===t.type&&t.geometries.forEach(K)}function Q(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(!W(t))throw new Error("bbox must only contain numbers")})}function $(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(E(t)))throw new Error("id must be a number or a string")}var tt=Object.freeze({__proto__:null,areaFactors:I,azimuthToBearing:X,bearingToAzimuth:j,convertArea:H,convertLength:Z,degreesToRadians:V,earthRadius:w,factors:b,feature:N,featureCollection:R,geometry:S,geometryCollection:q,isNumber:W,isObject:J,lengthToDegrees:z,lengthToRadians:B,lineString:T,lineStrings:O,multiLineString:A,multiPoint:D,multiPolygon:F,point:M,points:L,polygon:P,polygons:C,radiansToDegrees:U,radiansToLength:Y,removeBbox:K,round:G,validateBBox:Q,validateId:$});function et(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)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return _(t);throw new Error("coord must be GeoJSON Point or an Array of numbers")}function nt(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")}function rt(t){if(t.length>1&&W(t[0])&&W(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return rt(t[0]);throw new Error("coordinates must only contain numbers")}function it(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function ot(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function st(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");var r,i=a(t.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;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)}}catch(t){i.e(t)}finally{i.f()}}function at(t){return"Feature"===t.type?t.geometry:t}function ut(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}var lt=Object.freeze({__proto__:null,collectionOf:st,containsNumber:rt,featureOf:ot,geojsonType:it,getCoord:et,getCoords:nt,getGeom:at,getType:ut});function ht(t,e){if(!0===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final)return function(t,e){var n=ht(e,t);return(n=(n+180)%360)>180?n-360:n}(t,e);var n=et(t),r=et(e),i=V(n[0]),o=V(r[0]),s=V(n[1]),a=V(r[1]),u=Math.sin(o-i)*Math.cos(a),l=Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(o-i);return U(Math.atan2(u,l))}function ct(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=et(t),o=V(i[0]),s=V(i[1]),a=V(n),u=B(e,r.units),l=Math.asin(Math.sin(s)*Math.cos(u)+Math.cos(s)*Math.sin(u)*Math.cos(a)),h=U(o+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(s),Math.cos(u)-Math.sin(s)*Math.sin(l))),c=U(l);return void 0!==i[2]?M([h,c,i[2]],r.properties):M([h,c],r.properties)}function ft(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=et(e),o=V(i[1]-r[1]),s=V(i[0]-r[0]),a=V(r[1]),u=V(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(u);return Y(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}function vt(t,e){var n;return(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final?gt(et(e),et(t)):gt(et(t),et(e)))>180?-(360-n):n}function gt(t,e){var n=V(t[1]),r=V(e[1]),i=V(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(U(Math.atan2(i,o))+360)%360}function dt(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,h,c=0,f=0,v=t.type,g="FeatureCollection"===v,d="Feature"===v,p=g?t.features.length:1,y=0;y<p;y++){a=(h=!!(l=g?t.features[y].geometry:d?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var m=0;m<a;m++){var _=0,x=0;if(null!==(s=h?l.geometries[m]:l)){u=s.coordinates;var E=s.type;switch(c=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":if(!1===e(u,f,y,_,x))return!1;f++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,y,_,x))return!1;f++,"MultiPoint"===E&&_++}"LineString"===E&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(!1===e(u[r][i],f,y,_,x))return!1;f++}"MultiLineString"===E&&_++,"Polygon"===E&&x++}"Polygon"===E&&_++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(x=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(!1===e(u[r][i][o],f,y,_,x))return!1;f++}x++}_++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===dt(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function pt(t,e,n,r){var i=n;return dt(t,function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)},r),i}function yt(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 mt(t,e,n){var r=n;return yt(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function _t(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 xt(t,e,n){var r=n;return _t(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function Et(t){var e=[];return dt(t,function(t){e.push(t)}),e}function kt(t,e){var n,r,i,o,s,a,u,l,h,c,f=0,v="FeatureCollection"===t.type,g="Feature"===t.type,d=v?t.features.length:1;for(n=0;n<d;n++){for(a=v?t.features[n].geometry:g?t.geometry:t,l=v?t.features[n].properties:g?t.properties:{},h=v?t.features[n].bbox:g?t.bbox:void 0,c=v?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,h,c))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,h,c))return!1;f++}}function wt(t,e,n){var r=n;return kt(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r}function bt(t,e){kt(t,function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(N(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(N({type:s,coordinates:l},r),n,u))return!1}})}function It(t,e,n){var r=n;return bt(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r}function Nt(t,e){bt(t,function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==dt(t,function(o,h,c,f,v){if(void 0===s||n>a||f>u||v>l)return s=o,a=n,u=f,l=v,void(i=0);var g=T([s,o],t.properties);if(!1===e(g,n,r,v,i))return!1;i++,s=o})&&void 0}}})}function St(t,e,n){var r=n,i=!1;return Nt(t,function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}function Mt(t,e){if(!t)throw new Error("geojson is required");bt(t,function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(T(o[s],t.properties),n,r,s))return!1}}})}function Lt(t,e,n){var r=n;return Mt(t,function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)}),r}function Pt(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||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 u=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),T([u[s],u[s+1]],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),T([u[o][s],u[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),T([u[i][s],u[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),T([u[i][o][s],u[i][o][s+1]],a,e)}throw new Error("geojson is invalid")}function Ct(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||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 u=n.coordinates;switch(n.type){case"Point":return M(u,a,e);case"MultiPoint":return i<0&&(i=u.length+i),M(u[i],a,e);case"LineString":return s<0&&(s=u.length+s),M(u[s],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),M(u[o][s],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),M(u[i][s],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),M(u[i][o][s],a,e)}throw new Error("geojson is invalid")}var Tt=Object.freeze({__proto__:null,coordAll:Et,coordEach:dt,coordReduce:pt,featureEach:_t,featureReduce:xt,findPoint:Ct,findSegment:Pt,flattenEach:bt,flattenReduce:It,geomEach:kt,geomReduce:wt,lineEach:Mt,lineReduce:Lt,propEach:yt,propReduce:mt,segmentEach:Nt,segmentReduce:St});function Ot(t){return wt(t,function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Rt(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Rt(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},0)}function Rt(t){var e=0;if(t&&t.length>0){e+=Math.abs(Ft(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Ft(t[n]))}return e}var At=20294876564838.72,Dt=Math.PI/180;function Ft(t){var e=t.length-1;if(e<=2)return 0;for(var n=0,r=0;r<e;){var i=t[r],o=t[r+1===e?0:r+1],s=t[r+2>=e?(r+2)%e:r+2],a=i[0]*Dt,u=o[1]*Dt;n+=(s[0]*Dt-a)*Math.sin(u),r++}return n*At}function qt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==e.recompute)return t.bbox;var n=[1/0,1/0,-1/0,-1/0];return dt(t,function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]<t[0]&&(n[2]=t[0]),n[3]<t[1]&&(n[3]=t[1])}),n}function Gt(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(Bt(i=t[t.length-1],e)&r),s=0;s<t.length;s++)(u=!(Bt(a=t[s],e)&r))!==o&&n.push(Yt(i,a,r,e)),u&&n.push(a),i=a,o=u;if(!(t=n).length)break}return n}function Yt(t,e,n,r){return 8&n?[t[0]+(e[0]-t[0])*(r[3]-t[1])/(e[1]-t[1]),r[3]]:4&n?[t[0]+(e[0]-t[0])*(r[1]-t[1])/(e[1]-t[1]),r[1]]:2&n?[r[2],t[1]+(e[1]-t[1])*(r[2]-t[0])/(e[0]-t[0])]:1&n?[r[0],t[1]+(e[1]-t[1])*(r[0]-t[0])/(e[0]-t[0])]:null}function Bt(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function zt(t,e){var n,r=[],i=a(t);try{for(i.s();!(n=i.n()).done;){var o=Gt(n.value,e);o.length>0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}}catch(t){i.e(t)}finally{i.f()}return r}function jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return P([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}var Xt=function(){return s(function t(e){i(this,t),this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var n=0;n<this.length;n++)this.points[n].z=this.points[n].z||0;for(var r=0;r<this.length-1;r++){var o=this.points[r],s=this.points[r+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var a=0;a<this.centers.length-1;a++){var u=this.points[a+1].x-(this.centers[a].x+this.centers[a+1].x)/2,l=this.points[a+1].y-(this.centers[a].y+this.centers[a+1].y)/2,h=this.points[a+1].z-(this.centers[a].z+this.centers[a+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[a+1].x+this.sharpness*(this.centers[a].x+u),y:(1-this.sharpness)*this.points[a+1].y+this.sharpness*(this.centers[a].y+l),z:(1-this.sharpness)*this.points[a+1].z+this.sharpness*(this.centers[a].z+h)},{x:(1-this.sharpness)*this.points[a+1].x+this.sharpness*(this.centers[a+1].x+u),y:(1-this.sharpness)*this.points[a+1].y+this.sharpness*(this.centers[a+1].y+l),z:(1-this.sharpness)*this.points[a+1].z+this.sharpness*(this.centers[a+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this},[{key:"cacheSteps",value:function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e}},{key:"vector",value:function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}},{key:"pos",value:function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t),s={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return s}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}])}();function Ut(t){for(var e,n,r=nt(t),i=0,o=1;o<r.length;)e=n||r[0],i+=((n=r[o])[0]-e[0])*(n[1]+e[1]),o++;return i>0}function Vt(t,e){for(var n=0,r=0,i=0,o=0,s=0,a=0,u=0,l=0,h=null,c=null,f=t[0],v=t[1],g=e.length;n<g;n++){r=0;var d=e[n].length-1,p=e[n];if((h=p[0])[0]!==p[d][0]&&h[1]!==p[d][1])throw new Error("First and last coordinates in a ring must be the same");for(s=h[0]-f,a=h[1]-v;r<d;r++)if(l=(c=p[r+1])[1]-v,a<0&&l<0||a>0&&l>0)a=l,s=(h=c)[0]-f;else{if(u=c[0]-t[0],l>0&&a<=0){if((o=s*l-u*a)>0)i+=1;else if(0===o)return 0}else if(a>0&&l<=0){if((o=s*l-u*a)<0)i+=1;else if(0===o)return 0}else if(0===l&&a<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&l<0){if(0===(o=s*l-u*a))return 0}else if(0===a&&0===l){if(u<=0&&s>=0)return 0;if(s<=0&&u>=0)return 0}h=c,a=l,s=u}}return i%2!=0}function Zt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=et(t),i=at(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=0;u<a.length;++u){var l=Vt(r,a[u]);if(0===l&&!n.ignoreBoundary)return!0;if(l)return!0}return!1}function Ht(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=nt(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o&&o+1===i.length-1&&(s="both")),Wt(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1}function Wt(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=t[1],l=e[0],h=e[1],c=l-a,f=h-u,v=(n[0]-a)*f-(n[1]-u)*c;if(null!==i){if(Math.abs(v)>i)return!1}else if(0!==v)return!1;return Math.abs(c)===Math.abs(f)&&0===Math.abs(c)?!r&&(n[0]===t[0]&&n[1]===t[1]):r?"start"===r?Math.abs(c)>=Math.abs(f)?c>0?a<o&&o<=l:l<=o&&o<a:f>0?u<s&&s<=h:h<=s&&s<u:"end"===r?Math.abs(c)>=Math.abs(f)?c>0?a<=o&&o<l:l<o&&o<=a:f>0?u<=s&&s<h:h<s&&s<=u:"both"===r&&(Math.abs(c)>=Math.abs(f)?c>0?a<o&&o<l:l<o&&o<a:f>0?u<s&&s<h:h<s&&s<u):Math.abs(c)>=Math.abs(f)?c>0?a<=o&&o<=l:l<=o&&o<=a:f>0?u<=s&&s<=h:h<=s&&s<=u}function Jt(t,e,n,r,i){Kt(t,e,n||0,r||t.length-1,i||$t)}function Kt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Kt(t,e,Math.max(n,Math.floor(e-s*u/o+l)),Math.min(r,Math.floor(e+(o-s)*u/o+l)),i)}var h=t[e],c=n,f=r;for(Qt(t,n,e),i(t[r],h)>0&&Qt(t,n,r);c<f;){for(Qt(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Qt(t,n,f):Qt(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Qt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function $t(t,e){return t<e?-1:t>e?1:0}var te=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,n=[];if(!fe(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;fe(t,a)&&(e.leaf?n.push(s):ce(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}},{key:"collides",value:function(t){var e=this.data;if(!fe(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(fe(t,o)){if(e.leaf||ce(t,o))return!0;n.push(i)}}e=n.pop()}return!1}},{key:"load",value:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this}},{key:"insert",value:function(t){return t&&this._insert(t,this.data.height-1),this}},{key:"clear",value:function(){return this.data=ve([]),this}},{key:"remove",value:function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),a=[],u=[];o||a.length;){if(o||(o=a.pop(),r=a[a.length-1],n=u.pop(),i=!0),o.leaf){var l=ee(t,o.children,e);if(-1!==l)return o.children.splice(l,1),a.push(o),this._condense(a),this}i||o.leaf||!ce(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(a.push(o),u.push(n),n=0,r=o,o=o.children[0])}return this}},{key:"toBBox",value:function(t){return t}},{key:"compareMinX",value:function(t,e){return t.minX-e.minX}},{key:"compareMinY",value:function(t,e){return t.minY-e.minY}},{key:"toJSON",value:function(){return this.data}},{key:"fromJSON",value:function(t){return this.data=t,this}},{key:"_all",value: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}},{key:"_build",value:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return ne(i=ve(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=ve([])).leaf=!1,i.height=r;var a=Math.ceil(o/s),u=a*Math.ceil(Math.sqrt(s));ge(t,e,n,u,this.compareMinX);for(var l=e;l<=n;l+=u){var h=Math.min(l+u-1,n);ge(t,l,h,a,this.compareMinY);for(var c=l;c<=h;c+=a){var f=Math.min(c+a-1,h);i.children.push(this._build(t,c,f,r-1))}}return ne(i,this.toBBox),i}},{key:"_chooseSubtree",value:function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var u=e.children[a],l=ae(u),h=le(t,u)-l;h<o?(o=h,i=l<i?l:i,s=u):h===o&&l<i&&(i=l,s=u)}e=s||e.children[0]}return e}},{key:"_insert",value:function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),ie(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}},{key:"_split",value:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=ve(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ne(n,this.toBBox),ne(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}},{key:"_splitRoot",value:function(t,e){this.data=ve([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ne(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,n){for(var r,i=1/0,o=1/0,s=e;s<=n-e;s++){var a=re(t,0,s,this.toBBox),u=re(t,s,n,this.toBBox),l=he(a,u),h=ae(a)+ae(u);l<i?(i=l,r=s,o=h<o?h:o):l===i&&h<o&&(o=h,r=s)}return r||n-e}},{key:"_chooseSplitAxis",value:function(t,e,n){var r=t.leaf?this.compareMinX:oe,i=t.leaf?this.compareMinY:se;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}},{key:"_allDistMargin",value:function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=re(t,0,e,i),s=re(t,n-e,n,i),a=ue(o)+ue(s),u=e;u<n-e;u++){var l=t.children[u];ie(o,t.leaf?i(l):l),a+=ue(o)}for(var h=n-e-1;h>=e;h--){var c=t.children[h];ie(s,t.leaf?i(c):c),a+=ue(s)}return a}},{key:"_adjustParentBBoxes",value:function(t,e,n){for(var r=n;r>=0;r--)ie(e[r],t)}},{key:"_condense",value:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ne(t[n],this.toBBox)}}])}();function ee(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}function ne(t,e){re(t,0,t.children.length,e,t)}function re(t,e,n,r,i){i||(i=ve(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];ie(i,t.leaf?r(s):s)}return i}function ie(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 oe(t,e){return t.minX-e.minX}function se(t,e){return t.minY-e.minY}function ae(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ue(t){return t.maxX-t.minX+(t.maxY-t.minY)}function le(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function he(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function ce(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function fe(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ve(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ge(t,e,n,r,i){for(var o=[e,n];o.length;)if(!((n=o.pop())-(e=o.pop())<=r)){var s=e+Math.ceil((n-e)/r/2)*r;Jt(t,s,e,n,i),o.push(e,s,s,n)}}var de=Object.freeze({__proto__:null,default:te});function pe(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=qt(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=qt(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}}var ye=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this.tree=new te(e),this.tree.toBBox=pe},[{key:"insert",value:function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:qt(t),this.tree.insert(t),this}},{key:"load",value: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?t.bbox:qt(t),e.push(t)}):_t(t,function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:qt(t),e.push(t)}),this.tree.load(e),this}},{key:"remove",value:function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:qt(t),this.tree.remove(t,e),this}},{key:"clear",value:function(){return this.tree.clear(),this}},{key:"search",value:function(t){return R(this.tree.search(pe(t)))}},{key:"collides",value:function(t){return this.tree.collides(pe(t))}},{key:"all",value:function(){return R(this.tree.all())}},{key:"toJSON",value:function(){return this.tree.toJSON()}},{key:"fromJSON",value:function(t){return this.tree.fromJSON(t),this}}])}();function me(t){return new ye(t)}function _e(t,e){if(!J(e=null!=e?e:{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return dt(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)}),t}function xe(t){if(!t)throw new Error("geojson is required");var e=[];return bt(t,function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=nt(r);break;case"LineString":n=[nt(r)]}n.forEach(function(n){var r=function(t,e){var n=[];return t.reduce(function(t,r){var i=T([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=n<i?n:i,a=r<o?r:o,u=n>i?n:i,l=r>o?r:o;return[s,a,u,l]}(t,r),n.push(i),r}),n}(n,t.properties);r.forEach(function(t){t.id=e.length,e.push(t)})})}}(t,e)}),R(e)}var Ee=function(){return s(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)},[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}}])}();function ke(t,e){return t<e?-1:t>e?1:0}var we=Object.freeze({__proto__:null,default:Ee}),be=134217729;function Ie(t,e,n,r,i){var o,s,a,u,l=e[0],h=r[0],c=0,f=0;h>l==h>-l?(o=l,l=e[++c]):(o=h,h=r[++f]);var v=0;if(c<t&&f<n)for(h>l==h>-l?(a=o-((s=l+o)-l),l=e[++c]):(a=o-((s=h+o)-h),h=r[++f]),o=s,0!==a&&(i[v++]=a);c<t&&f<n;)h>l==h>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c]):(a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f]),o=s,0!==a&&(i[v++]=a);for(;c<t;)a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c],o=s,0!==a&&(i[v++]=a);for(;f<n;)a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f],o=s,0!==a&&(i[v++]=a);return 0===o&&0!==v||(i[v++]=o),v}function Ne(t){return new Float64Array(t)}var Se=Ne(4),Me=Ne(8),Le=Ne(12),Pe=Ne(16),Ce=Ne(4);function Te(t,e,n,r,i,o){var s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a;if(0===s||0===a||s>0!=a>0)return u;var l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){var a,u,l,h,c,f,v,g,d,p,y,m,_,x,E,k,w,b,I=t-i,N=n-i,S=e-o,M=r-o;c=(E=(g=I-(v=(f=be*I)-(f-I)))*(p=M-(d=(f=be*M)-(f-M)))-((x=I*M)-v*d-g*d-v*p))-(y=E-(w=(g=S-(v=(f=be*S)-(f-S)))*(p=N-(d=(f=be*N)-(f-N)))-((k=S*N)-v*d-g*d-v*p))),Se[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Se[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Se[2]=m-(b-c)+(y-c),Se[3]=b;var L=function(t,e){for(var n=e[0],r=1;r<t;r++)n+=e[r];return n}(4,Se),P=22204460492503146e-32*s;if(L>=P||-L>=P)return L;if(a=t-(I+(c=t-I))+(c-i),l=n-(N+(c=n-N))+(c-i),u=e-(S+(c=e-S))+(c-o),h=r-(M+(c=r-M))+(c-o),0===a&&0===u&&0===l&&0===h)return L;if(P=11093356479670487e-47*s+33306690738754706e-32*Math.abs(L),(L+=I*h+M*a-(S*l+N*u))>=P||-L>=P)return L;c=(E=(g=a-(v=(f=be*a)-(f-a)))*(p=M-(d=(f=be*M)-(f-M)))-((x=a*M)-v*d-g*d-v*p))-(y=E-(w=(g=u-(v=(f=be*u)-(f-u)))*(p=N-(d=(f=be*N)-(f-N)))-((k=u*N)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var C=Ie(4,Se,4,Ce,Me);c=(E=(g=I-(v=(f=be*I)-(f-I)))*(p=h-(d=(f=be*h)-(f-h)))-((x=I*h)-v*d-g*d-v*p))-(y=E-(w=(g=S-(v=(f=be*S)-(f-S)))*(p=l-(d=(f=be*l)-(f-l)))-((k=S*l)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var T=Ie(C,Me,4,Ce,Le);c=(E=(g=a-(v=(f=be*a)-(f-a)))*(p=h-(d=(f=be*h)-(f-h)))-((x=a*h)-v*d-g*d-v*p))-(y=E-(w=(g=u-(v=(f=be*u)-(f-u)))*(p=l-(d=(f=be*l)-(f-l)))-((k=u*l)-v*d-g*d-v*p))),Ce[0]=E-(y+c)+(c-w),c=(_=x-((m=x+y)-(c=m-x))+(y-c))-(y=_-k),Ce[1]=_-(y+c)+(c-k),c=(b=m+y)-m,Ce[2]=m-(b-c)+(y-c),Ce[3]=b;var O=Ie(T,Le,4,Ce,Pe);return Pe[O-1]}(t,e,n,r,i,o,l)}function Oe(t,e){var n=new Ee([],Re);return function(t,e){if("FeatureCollection"===t.type)for(var n=t.features,r=0;r<n.length;r++)Ge(n[r],e);else Ge(t,e)}(t,n),function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=new Ee([],Ae);for(;t.length;){var i=t.pop();if(i.isLeftEndpoint){for(var o=new Be(i),s=0;s<r.data.length;s++){var a=r.data[s];if(!e||a.leftSweepEvent.featureId!==i.featureId){var u=ze(o,a);!1!==u&&n.push(u)}}r.push(o)}else!1===i.isLeftEndpoint&&r.pop()}return n}(n,e)}function Re(t,e){return t.p.x>e.p.x?1:t.p.x<e.p.x?-1:t.p.x!==e.p.x||t.featureId===e.featureId&&t.ringId===e.ringId||!t.isLeftEndpoint||e.isLeftEndpoint?t.p.y!==e.p.y?t.p.y>e.p.y?1:-1:1:-1}function Ae(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x<e.rightSweepEvent.p.x?-1:t.rightSweepEvent.p.y!==e.rightSweepEvent.p.y?t.rightSweepEvent.p.y<e.rightSweepEvent.p.y?1:-1:1}var De=0,Fe=0,qe=0;function Ge(t,e){var n="Feature"===t.type?t.geometry:t,r=n.coordinates;"Polygon"!==n.type&&"MultiLineString"!==n.type||(r=[r]),"LineString"===n.type&&(r=[[r]]);for(var i=0;i<r.length;i++)for(var o=0;o<r[i].length;o++){var s=r[i][o][0],a=null;Fe+=1;for(var u=0;u<r[i][o].length-1;u++){a=r[i][o][u+1];var l=new Ye(s,De,Fe,qe),h=new Ye(a,De,Fe,qe+1);l.otherEvent=h,h.otherEvent=l,Re(l,h)>0?(h.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,h.isLeftEndpoint=!1),e.push(l),e.push(h),s=a,qe+=1}}De+=1}var Ye=function(){return s(function t(e,n,r,o){i(this,t),this.p={x:e[0],y:e[1]},this.featureId=n,this.ringId=r,this.eventId=o,this.otherEvent=null,this.isLeftEndpoint=null},[{key:"isSamePoint",value:function(t){return this.p.x===t.p.x&&this.p.y===t.p.y}},{key:"asNewXY",value:function(){return[this.p.x,this.p.y]}}])}();var Be=s(function t(e){i(this,t),this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent});function ze(t,e){if(null===t||null===e)return!1;var n=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y,i=t.rightSweepEvent.p.x,o=t.rightSweepEvent.p.y,s=e.leftSweepEvent.p.x,a=e.leftSweepEvent.p.y,u=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,h=Te(n,r,i,o,s,a),c=Te(n,r,i,o,u,l);if(h>0&&c>0)return!1;if(h<0&&c<0)return!1;if(t.leftSweepEvent.ringId===e.leftSweepEvent.ringId){if(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent))return!1}else{if(t.rightSweepEvent.isSamePoint(e.leftSweepEvent))return e.leftSweepEvent.asNewXY();if(t.rightSweepEvent.isSamePoint(e.rightSweepEvent))return e.rightSweepEvent.asNewXY();if(t.leftSweepEvent.isSamePoint(e.leftSweepEvent))return e.leftSweepEvent.asNewXY();if(t.leftSweepEvent.isSamePoint(e.rightSweepEvent))return e.rightSweepEvent.asNewXY()}var f=(l-a)*(i-n)-(u-s)*(o-r),v=(u-s)*(r-a)-(l-a)*(n-s),g=(i-n)*(r-a)-(o-r)*(n-s);if(0===f)return!1;var d=v/f,p=g/f;return d>=0&&d<=1&&p>=0&&p<=1&&[n+d*(i-n),r+d*(o-r)]}function je(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeDuplicates,i=void 0===r||r,o=n.ignoreSelfIntersections,s=void 0===o||o,a=[];"FeatureCollection"===t.type?a=a.concat(t.features):"Feature"===t.type?a.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||a.push(N(t)),"FeatureCollection"===e.type?a=a.concat(e.features):"Feature"===e.type?a.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||a.push(N(e));var u=Oe(R(a),s),l=[];if(i){var h={};u.forEach(function(t){var e=t.join(",");h[e]||(h[e]=!0,l.push(t))})}else l=u;return R(l.map(function(t){return M(t)}))}var Xe=Object.defineProperty,Ue=Object.defineProperties,Ve=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Je=function(t,e,n){return e in t?Xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ke=function(t,e){for(var n in e||(e={}))He.call(e,n)&&Je(t,n,e[n]);if(Ze){var r,i=a(Ze(e));try{for(i.s();!(r=i.n()).done;){n=r.value;We.call(e,n)&&Je(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},Qe=function(t,e){return Ue(t,Ve(e))};function $e(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("lines and inputPoint are required arguments");var r=et(e),i=M([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),o=0,s=0,a=-1;return bt(t,function(t,u,l){a!==l&&(a=l,s=0);for(var h=nt(t),c=0;c<h.length-1;c++){var f=M(h[c]),v=et(f),g=M(h[c+1]),d=et(g),p=ft(f,g,n),y=void 0,_=void 0;if(d[0]===r[0]&&d[1]===r[1])y=d,_=!0;else if(v[0]===r[0]&&v[1]===r[1])y=v,_=!1;else{var x=m(sn(v,d,r),2);y=x[0],_=x[1]}var E=ft(e,y,n);if(E<i.properties.pointDistance){var k=ft(f,y,n);(i=M(y,{lineStringIndex:l,segmentIndex:_?c+1:c,totalDistance:o+k,lineDistance:s+k,segmentDistance:k,pointDistance:E,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0})).properties=Qe(Ke({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}o+=p,s+=p}}),i}function tn(t,e){var n=m(t,3),r=n[0],i=n[1],o=n[2],s=m(e,3);return r*s[0]+i*s[1]+o*s[2]}function en(t,e){var n=m(t,3),r=n[0],i=n[1],o=n[2],s=m(e,3),a=s[0],u=s[1],l=s[2];return[i*l-o*u,o*a-r*l,r*u-i*a]}function nn(t){var e=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2))}(t);return[t[0]/e,t[1]/e,t[2]/e]}function rn(t){var e=V(t[1]),n=V(t[0]);return[Math.cos(e)*Math.cos(n),Math.cos(e)*Math.sin(n),Math.sin(e)]}function on(t){var e=m(t,3),n=e[0],r=e[1],i=e[2],o=Math.min(Math.max(i,-1),1),s=U(Math.asin(o));return[U(Math.atan2(r,n)),s]}function sn(t,e,n){var r=rn(t),i=rn(e),o=rn(n),s=en(r,i);if(0===s[0]&&0===s[1]&&0===s[2])return tn(r,i)>0?[_(e),!0]:[_(n),!1];var a=en(s,o);if(0===a[0]&&0===a[1]&&0===a[2])return[_(e),!0];var u=nn(en(a,s)),l=[-u[0],-u[1],-u[2]],h=tn(o,u)>tn(o,l)?u:l,c=nn(s),f=tn(en(r,h),c),v=tn(en(h,i),c);return f>=0&&v>=0?[on(h),!1]:tn(r,o)>tn(i,o)?[_(t),!1]:[_(e),!0]}function an(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=ut(t),r=ut(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var i=_e(e,{precision:7});switch("Feature"!==t.type&&(t=N(t)),r){case"Point":return ln(t,i);case"MultiPoint":return un(t,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return un(t,je(t,i,{ignoreSelfIntersections:!0}))}}function un(t,e){var n=[],r=me();return bt(e,function(e){if(n.forEach(function(t,e){t.id=e}),n.length){var i=r.search(e);if(i.features.length){var o=hn(e,i);n=n.filter(function(t){return t.id!==o.id}),r.remove(o),_t(ln(o,e),function(t){n.push(t),r.insert(t)})}}else n=ln(t,e).features,r.load(R(n))}),R(n)}function ln(t,e){var n=[],r=nt(t)[0],i=nt(t)[t.geometry.coordinates.length-1];if(cn(r,et(e))||cn(i,et(e)))return R([t]);var o=me(),s=xe(t);o.load(s);var a=o.search(e);if(!a.features.length)return R([t]);var u=hn(e,a),l=xt(s,function(t,r,i){var o=nt(r)[1],s=et(e);return i===u.id?(t.push(s),n.push(T(t)),cn(s,o)?[s]:[s,o]):(t.push(o),t)},[r]);return l.length>1&&n.push(T(l)),R(n)}function hn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return _t(e,function(e){var i=$e(e,t).properties.pointDistance;i<r&&(n=e,r=i)}),n}function cn(t,e){return t[0]===e[0]&&t[1]===e[1]}function fn(t,e){var n=at(t),r=at(e),i=n.type,o=r.type,s=n.coordinates,u=r.coordinates;switch(i){case"Point":if("Point"===o)return En(s,u);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(En(t.coordinates[n],e.coordinates)){r=!0;break}return r}(n,r);case"MultiPoint":return function(t,e){var n,r=a(e.coordinates);try{for(r.s();!(n=r.n()).done;){var i,o=n.value,s=!1,u=a(t.coordinates);try{for(u.s();!(i=u.n()).done;){if(En(o,i.value)){s=!0;break}}}catch(t){u.e(t)}finally{u.f()}if(!s)return!1}}catch(t){r.e(t)}finally{r.f()}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return Ht(r,n,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=e.coordinates,i=0;i<r.length;i++){var o=r[i];if(!Ht(o,t))return!1;if(!n)if(Ht(o,t,{ignoreEndVertices:!0}))n=!0;else if(i>0){Ht([(r[i-1][0]+o[0])/2,(r[i-1][1]+o[1])/2],t,{ignoreEndVertices:!0})&&(n=!0)}}return n}(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Ht(o,t))return!1;!r&&Ht(o,t,{ignoreEndVertices:!0})&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return Zt(r,n,{ignoreBoundary:!0});case"LineString":return gn(n,r);case"Polygon":return pn(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Zt(o,t))return!1;r||(r=Zt(o,t,{ignoreBoundary:!0}))}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"MultiPolygon":return function(t,e){return e.coordinates.every(function(e){return pn(t,{type:"Polygon",coordinates:e})})}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":switch(o){case"Point":return function(t,e){return Zt(e,t,{ignoreBoundary:!0})}(n,r);case"MultiPoint":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(!Zt(o,t))return!1;r||(r=Zt(o,t,{ignoreBoundary:!0}))}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"LineString":return function(t,e){return t.coordinates.some(function(t){return gn({type:"Polygon",coordinates:t},e)})}(n,r);case"MultiLineString":return function(t,e){var n,r=!1,i=a(e.coordinates);try{for(i.s();!(n=i.n()).done;){var o,s={type:"LineString",coordinates:n.value},u="outside",l=a(t.coordinates);try{for(l.s();!(o=l.n()).done;){var h=dn({type:"Polygon",coordinates:o.value},s);if("interior"===h){u=h;break}"boundary"===h&&(u=h)}}catch(t){l.e(t)}finally{l.f()}if("outside"===u)return!1;"interior"===u&&(r=!0)}}catch(t){i.e(t)}finally{i.f()}return r}(n,r);case"Polygon":return function(t,e){var n=qt(e);return t.coordinates.some(function(t){return pn({type:"Polygon",coordinates:t},e,n)})}(n,r);case"MultiPolygon":return function(t,e){var n,r=a(e.coordinates);try{var i,o=function(){var e={type:"Polygon",coordinates:n.value},r=qt(e);if(!t.coordinates.some(function(t){return pn({type:"Polygon",coordinates:t},e,r)}))return{v:!1}};for(r.s();!(n=r.n()).done;)if(i=o())return i.v}catch(t){r.e(t)}finally{r.f()}return!0}(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function vn(t,e){for(var n=t.coordinates,r=[],i=0;i<n.length-1;i++){var o=T([n[i],n[i+1]]),s=an(o,N(e));0===s.features.length?r.push(o):r.push.apply(r,_(s.features))}return R(r)}function gn(t,e){return"interior"===dn(t,e)}function dn(t,e){if(!xn(qt(t),qt(e)))return"outside";var n,r=a(e.coordinates);try{for(r.s();!(n=r.n()).done;){if(!Zt(n.value,t))return"outside"}}catch(t){r.e(t)}finally{r.f()}var i,o=!1,s=a(vn(e,t).features);try{for(s.s();!(i=s.n()).done;){var u=i.value,l=kn(u.geometry.coordinates[0],u.geometry.coordinates[1]);if(!Zt(l,t))return"outside";!o&&Zt(l,t,{ignoreBoundary:!0})&&(o=!0)}}catch(t){s.e(t)}finally{s.f()}return o?"interior":"boundary"}function pn(t,e,n){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!xn(qt(t),null!=n?n:qt(e)))return!1;var r,i=at(t),o=a(at(e).coordinates);try{for(o.s();!(r=o.n()).done;){var s,u=r.value,l=a(u);try{for(l.s();!(s=l.n()).done;){if(!Zt(s.value,t))return!1}}catch(t){l.e(t)}finally{l.f()}var h,c=a(vn({type:"LineString",coordinates:u},i).features);try{for(c.s();!(h=c.n()).done;){var f=h.value,v=kn(f.geometry.coordinates[0],f.geometry.coordinates[1]);if(!Zt(v,t)&&!_n(v,i))return!1}}catch(t){c.e(t)}finally{c.f()}}}catch(t){o.e(t)}finally{o.f()}return!0}var yn=1e-6;function mn(t,e,n){var r=n[0]-e[0],i=n[1]-e[1],o=r*r+i*i,s=0;o>0&&(s=((t[0]-e[0])*r+(t[1]-e[1])*i)/o,s=Math.max(0,Math.min(1,s)));var a=e[0]+s*r,u=e[1]+s*i,l=t[0]-a,h=t[1]-u;return Math.sqrt(l*l+h*h)}function _n(t,e){return e.coordinates.some(function(e){for(var n=0;n<e.length-1;n++)if(mn(t,e[n],e[n+1])<=yn)return!0;return!1})}function xn(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function En(t,e){return t[0]===e[0]&&t[1]===e[1]}function kn(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function wn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return bn(r,i)}(n,e);case"MultiPolygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=at(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return r.forEach(function(t){o.push(bn(t,i))}),R(o)}(n,e);default:throw new Error("invalid poly")}}function bn(t,e){return t.length>1?A(t,e):T(t[0],e)}var In=Object.defineProperty,Nn=function(t,e){return In(t,"name",{value:e,configurable:!0})},Sn=function(){return s(function t(e){var n,r,o;i(this,t),this.direction=!1,this.compareProperties=!0,this.precision=Math.pow(10,-(null!=(n=null==e?void 0:e.precision)?n:17)),this.direction=null!=(r=null==e?void 0:e.direction)&&r,this.compareProperties=null==(o=null==e?void 0:e.compareProperties)||o},[{key:"compare",value:function(t,e){var n=this;if(t.type!==e.type)return!1;if(!Ln(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){var r=Pn(t),i=Pn(e);return r.every(function(t){return i.some(function(e){return n.compare(t,e)})})}}return!1}},{key:"compareCoord",value:function(t,e){var n=this;return t.length===e.length&&t.every(function(t,r){return Math.abs(t-e[r])<n.precision})}},{key:"compareLine",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Ln(t,e))return!1;var i=t,o=e;if(r&&!this.compareCoord(i[0],o[0])){var s=this.fixStartIndex(o,i);if(!s)return!1;o=s}var a=this.compareCoord(i[n],o[n]);return this.direction||a?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},{key:"fixStartIndex",value:function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n}},{key:"comparePath",value:function(t,e){var n=this;return t.every(function(t,r){return n.compareCoord(t,e[r])})}},{key:"comparePolygon",value:function(t,e){var n=this;if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length);return r.every(function(t){return i.some(function(e){return n.compareLine(t,e,1,!0)})})}return!1}},{key:"compareGeometryCollection",value:function(t,e){var n=this;return Ln(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every(function(t,r){return n.compare(t,e.geometries[r])})}},{key:"compareFeature",value:function(t,e){return t.id===e.id&&(!this.compareProperties||Tn(t.properties,e.properties))&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}},{key:"compareFeatureCollection",value:function(t,e){var n=this;return Ln(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every(function(t,r){return n.compare(t,e.features[r])})}},{key:"compareBBox",value:function(t,e){return Boolean(!t.bbox&&!e.bbox)||!(!t.bbox||!e.bbox)&&this.compareCoord(t.bbox,e.bbox)}}])}();Nn(Sn,"GeojsonEquality");var Mn=Sn;function Ln(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}function Pn(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function Cn(t,e,n){return new Mn(n).compare(t,e)}function Tn(t,e){if(null===t&&null===e)return!0;if(null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0,o=n;i<o.length;i++){var s=o[i],a=t[s],u=e[s],l=An(a)&&An(u);if(l&&!Tn(a,u)||!l&&a!==u)return!1}return!0}Nn(Ln,"sameLength"),Nn(Pn,"explode"),Nn(Cn,"geojsonEquality"),Nn(Tn,"equal");var On,Rn,An=Nn(function(t){return null!=t&&"object"===E(t)},"isObject");function Dn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="object"===E(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var r=ut(t),i=[];switch(r){case"LineString":i=Fn(t,r);break;case"MultiLineString":case"Polygon":nt(t).forEach(function(t){i.push(Fn(t,r))});break;case"MultiPolygon":nt(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(Fn(t,r))}),i.push(e)});break;case"Point":return t;case"MultiPoint":var o={};nt(t).forEach(function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(o,e)||(i.push(t),o[e]=!0)});break;default:throw new Error(r+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=i,t):{type:r,coordinates:i}:!0===n?(t.geometry.coordinates=i,t):N({type:r,coordinates:i},t.properties,{bbox:t.bbox,id:t.id})}function Fn(t,e){var n=nt(t);if(2===n.length&&!qn(n[0],n[1]))return n;var r=[],i=0,o=1,s=2;for(r.push(n[i]);s<n.length;)Ht(n[o],T([n[i],n[s]]))?o=s:(r.push(n[o]),i=o,s=++o),s++;if(r.push(n[o]),"Polygon"===e||"MultiPolygon"===e){if(Ht(r[0],T([r[1],r[r.length-2]]))&&(r.shift(),r.pop(),r.push(r[0])),r.length<4)throw new Error("invalid polygon, fewer than 4 points");if(!qn(r[0],r[r.length-1]))throw new Error("invalid polygon, first and last points not equal")}return r}function qn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Gn(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).precision;if("number"!=typeof(n=null==n||isNaN(n)?6:n)||!(n>=0))throw new Error("precision must be a positive number");return at(t).type===at(e).type&&Cn(Dn(t),Dn(e),{precision:n})}function Yn(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return Bn(n,r);case"Polygon":return jn(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return Bn(r,n);case"LineString":return function(t,e){var n=je(t,e);if(0===n.features.length)return!1;var r,i=a(n.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!(Gn(o,M(t.coordinates[0]))||Gn(o,M(t.coordinates[t.coordinates.length-1]))||Gn(o,M(e.coordinates[0]))||Gn(o,M(e.coordinates[e.coordinates.length-1]))))return!0}}catch(t){i.e(t)}finally{i.f()}return!1}(n,r);case"Polygon":return zn(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"MultiPoint":return jn(r,n);case"LineString":return zn(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Bn(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++){for(var s=!1,a=0;a<e.coordinates.length-1;a++){var u=!0;if(0!==a&&a!==e.coordinates.length-2||(u=!1),Xn(e.coordinates[a],e.coordinates[a+1],t.coordinates[o],u)){s=!0;break}}s?n=!0:r=!0}return n&&r}function zn(t,e){return je(t,wn(e)).features.length>0}function jn(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&(!n||!r);o++)Zt(M(t.coordinates[o]),e)?n=!0:r=!0;return r&&n}function Xn(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0===i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}function Un(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{ignoreSelfIntersections:!0}).ignoreSelfIntersections,r=void 0===n||n,i=!0;return bt(t,function(t){bt(e,function(e){if(!1===i)return!1;i=function(t,e,n){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,i=e.coordinates,!(r[0]===i[0]&&r[1]===i[1]);case"LineString":return!Vn(e,t);case"Polygon":return!Zt(t,e)}break;case"LineString":switch(e.type){case"Point":return!Vn(t,e);case"LineString":return!function(t,e,n){var r=je(t,e,{ignoreSelfIntersections:n});if(r.features.length>0)return!0;var i,o=a(t.coordinates);try{for(o.s();!(i=o.n()).done;){if(Vn(e,{type:"Point",coordinates:i.value}))return!0}}catch(t){o.e(t)}finally{o.f()}var s,u=a(e.coordinates);try{for(u.s();!(s=u.n()).done;){if(Vn(t,{type:"Point",coordinates:s.value}))return!0}}catch(t){u.e(t)}finally{u.f()}return!1}(t,e,n);case"Polygon":return!Zn(e,t,n)}break;case"Polygon":switch(e.type){case"Point":return!Zt(e,t);case"LineString":return!Zn(t,e,n);case"Polygon":return!function(t,e,n){var r,i=a(t.coordinates[0]);try{for(i.s();!(r=i.n()).done;){if(Zt(r.value,e))return!0}}catch(t){i.e(t)}finally{i.f()}var o,s=a(e.coordinates[0]);try{for(s.s();!(o=s.n()).done;){if(Zt(o.value,t))return!0}}catch(t){s.e(t)}finally{s.f()}var u=je(wn(t),wn(e),{ignoreSelfIntersections:n});if(u.features.length>0)return!0;return!1}(e,t,n)}}var r,i;return!1}(t.geometry,e.geometry,r)})}),i}function Vn(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(Hn(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function Zn(t,e,n){var r,i=a(e.coordinates);try{for(i.s();!(r=i.n()).done;){if(Zt(r.value,t))return!0}}catch(t){i.e(t)}finally{i.f()}return je(e,wn(t),{ignoreSelfIntersections:n}).features.length>0}function Hn(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 0===r*s-i*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}function Wn(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections;return!Un(t,e,{ignoreSelfIntersections:void 0===n||n})}function Jn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Kn(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch(t){}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}),n}var Qn=(Rn||(Rn=1,On=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==E(e)&&"object"==E(n)){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!=e&&n!=n}),On),$n=Jn(Qn);function tr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=me(),a=xe(t);s.load(a);var u=[];return Nt(e,function(t){var e=!1;if(t){var n=t;if(0!==i){var a=z(i,"kilometers"),l=qt(t);n=[l[0]-a,l[1]-a,l[2]+a,l[3]+a]}_t(s.search(n),function(n){if(!1===e){var o=nt(t).sort(),s=nt(n).sort();if($n(o,s))e=!0,r=r?er(r,t)||r:t;else if(0===i?Ht(o[0],n)&&Ht(o[1],n):$e(n,o[0]).properties.pointDistance<=i&&$e(n,o[1]).properties.pointDistance<=i)e=!0,r=r?er(r,t)||r:t;else if(0===i?Ht(s[0],t)&&Ht(s[1],t):$e(t,s[0]).properties.pointDistance<=i&&$e(t,s[1]).properties.pointDistance<=i)if(r){var a=er(r,n);a?r=a:u.push(n)}else r=n}}),!1===e&&r&&(o.push(r),u.length&&(o=o.concat(u),u=[]),r=void 0)}}),r&&o.push(r),R(o)}function er(t,e){var n=nt(e),r=nt(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;if($n(n[0],i))s.unshift(n[1]);else if($n(n[0],o))s.push(n[1]);else if($n(n[1],i))s.unshift(n[0]);else{if(!$n(n[1],o))return;s.push(n[0])}return t}function nr(t,e){var n=j(vt(t[0],t[1])),r=j(vt(e[0],e[1]));return n===r||(r-n)%180==0}function rr(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function ir(t,e){return!!or(e.coordinates[0],t.coordinates)||!!or(e.coordinates[e.coordinates.length-1],t.coordinates)}function or(t,e){return t[0]===e[0]&&t[1]===e[1]}var sr=new Set(["Point","LineString","MultiLineString","MultiPoint","Polygon","MultiPolygon"]);function ar(t){return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}function ur(t){for(var e=0;e<t.length-1;e++)for(var n=t[e],r=e+1;r<t.length-2;r++){if(Ht(n,T([t[r],t[r+1]])))return!0}return!1}function lr(t,e,n){for(var r=P(t),i=n+1;i<e.length;i++)if(!Un(r,P(e[i]))&&Yn(r,T(e[i][0])))return!1;return!0}function hr(t,e){return fn(e,t)}function cr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=qt(t);return M([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}var fr,vr={exports:{}};var gr=(fr||(fr=1,function(t){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function a(t,e,n){return a=s()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&o(i,n.prototype),i},a.apply(null,arguments)}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)},u(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}function h(t,e){if(e&&("object"==E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function c(t){var e=s();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function f(t,e,n){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}},f(t,e,n||t)}function v(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=g(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var y=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=e.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=e.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==e.JOIN_ROUND&&(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(t){this._joinStyle=t}},{key:"setSimplifyFactor",value:function(t){this._simplifyFactor=t<0?0:t}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(t){this._endCapStyle=t}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(t){this._mitreLimit=t}},{key:"setSingleSided",value:function(t){this._isSingleSided=t}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}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)}}},{key:"bufferDistanceError",value:function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)}}]),e}();y.CAP_ROUND=1,y.CAP_FLAT=2,y.CAP_SQUARE=3,y.JOIN_ROUND=1,y.JOIN_MITRE=2,y.JOIN_BEVEL=3,y.DEFAULT_QUADRANT_SEGMENTS=8,y.DEFAULT_MITRE_LIMIT=5,y.DEFAULT_SIMPLIFY_FACTOR=.01;var m=function(e){r(o,e);var i=c(o);function o(e){var n;return t(this,o),(n=i.call(this,e)).name=Object.keys({Exception:o})[0],n}return n(o,[{key:"toString",value:function(){return this.message}}]),o}(u(Error)),_=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({IllegalArgumentException:i})[0],r}return i}(m),x=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}();function k(){}function w(){}function b(){}var I,N,S,M,L,P,C,T,O=function(){function e(){t(this,e)}return n(e,null,[{key:"equalsWithTolerance",value:function(t,e,n){return Math.abs(t-e)<=n}}]),e}(),R=function(){function e(n,r){t(this,e),this.low=r||0,this.high=n||0}return n(e,null,[{key:"toBinaryString",value:function(t){var e,n="";for(e=2147483648;e>0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]),e}();function A(){}function D(){}A.NaN=NaN,A.isNaN=function(t){return Number.isNaN(t)},A.isInfinite=function(t){return!Number.isFinite(t)},A.MAX_VALUE=Number.MAX_VALUE,A.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,A.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?(P=2146435072,C=new Float64Array(1),T=new Int32Array(C.buffer),A.doubleToLongBits=function(t){C[0]=t;var e=0|T[0],n=0|T[1];return(n&P)===P&&!!(1048575&n)&&0!==e&&(e=0,n=2146959360),new R(n,e)},A.longBitsToDouble=function(t){return T[0]=t.low,T[1]=t.high,C[0]}):(I=1023,N=Math.log2,S=Math.floor,M=Math.pow,L=function(){for(var t=53;t>0;t--){var e=M(2,t)-1;if(S(N(e))+1===t)return e}return 0}(),A.doubleToLongBits=function(t){var e,n,r,i,o,s,a,u,l;if(t<0||1/t===Number.NEGATIVE_INFINITY?(s=1<<31,t=-t):s=0,0===t)return new R(u=s,l=0);if(t===1/0)return new R(u=2146435072|s,l=0);if(t!=t)return new R(u=2146959360,l=0);if(i=0,l=0,(e=S(t))>1)if(e<=L)(i=S(N(e)))<=20?(l=0,u=e<<20-i&1048575):(l=e%(n=M(2,r=i-20))<<32-r,u=e/n&1048575);else for(r=e,l=0;0!==(r=S(n=r/2));)i++,l>>>=1,l|=(1&u)<<31,u>>>=1,n!==r&&(u|=524288);if(a=i+I,o=0===e,e=t-e,i<52&&0!==e)for(r=0;;){if((n=2*e)>=1?(e=n-1,o?(a--,o=!1):(r<<=1,r|=1,i++)):(e=n,o?0==--a&&(i++,o=!1):(r<<=1,i++)),20===i)u|=r,r=0;else if(52===i){l|=r;break}if(1===n){i<20?u|=r<<20-i:i<52&&(l|=r<<52-i);break}}return u|=a<<20,new R(u|=s,l)},A.longBitsToDouble=function(t){var e,n,r,i,o=t.high,s=t.low,a=o&1<<31?-1:1;for(r=((2146435072&o)>>20)-I,i=0,n=1<<19,e=1;e<=20;e++)o&n&&(i+=M(2,-e)),n>>>=1;for(n=1<<31,e=21;e<=52;e++)s&n&&(i+=M(2,-e)),n>>>=1;if(-1023===r){if(0===i)return 0*a;r=-1022}else{if(1024===r)return 0===i?a/0:NaN;i+=1}return a*i*M(2,r)});var F=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({RuntimeException:i})[0],r}return i}(m),q=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){if(0===arguments.length)F.constructor_.call(this);else if(1===arguments.length){var t=arguments[0];F.constructor_.call(this,t)}}}]),o}(F),G=function(){function e(){t(this,e)}return n(e,null,[{key:"shouldNeverReachHere",value:function(){if(0===arguments.length)e.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new q("Should never reach here"+(null!==t?": "+t:""))}}},{key:"isTrue",value:function(){if(1===arguments.length){var t=arguments[0];e.isTrue(t,null)}else if(2===arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new q:new q(n)}}},{key:"equals",value:function(){if(2===arguments.length){var t=arguments[0],n=arguments[1];e.equals(t,n,null)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(!i.equals(r))throw new q("Expected "+r+" but encountered "+i+(null!==o?": "+o:""))}}}]),e}(),Y=new ArrayBuffer(8),B=new Float64Array(Y),z=new Int32Array(Y),j=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(){return A.NaN}},{key:"setOrdinate",value:function(t,n){switch(t){case e.X:this.x=n;break;case e.Y:this.y=n;break;case e.Z:this.setZ(n);break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"equals2D",value: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!!O.equalsWithTolerance(this.x,e.x,n)&&!!O.equalsWithTolerance(this.y,e.y,n)}}},{key:"setM",value:function(t){throw new _("Invalid ordinate index: "+e.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(t){switch(t){case e.X:return this.x;case e.Y:return this.y;case e.Z:return this.getZ()}throw new _("Invalid ordinate index: "+t)}},{key:"equals3D",value:function(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||A.isNaN(this.getZ())&&A.isNaN(t.getZ()))}},{key:"equals",value:function(t){return t instanceof e&&this.equals2D(t)}},{key:"equalInZ",value:function(t,e){return O.equalsWithTolerance(this.getZ(),t.getZ(),e)}},{key:"setX",value:function(t){this.x=t}},{key:"compareTo",value: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}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(t){this.z=t}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return G.shouldNeverReachHere("this shouldn\'t happen because this class is Cloneable"),null;throw t}}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+r*r)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(t){this.y=t}},{key:"distance",value:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*t+e.hashCode(this.x))+e.hashCode(this.y)}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}},{key:"interfaces_",get:function(){return[k,w,b]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)e.constructor_.call(this,0,0);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){var n=arguments[0],r=arguments[1];e.constructor_.call(this,n,r,e.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this.x=i,this.y=o,this.z=s}}},{key:"hashCode",value:function(t){return B[0]=t,z[0]^z[1]}}]),e}(),X=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compare",value:function(t,n){var r=e.compare(t.x,n.x);if(0!==r)return r;var i=e.compare(t.y,n.y);return 0!==i?i:this._dimensionsToTest<=2?0:e.compare(t.getZ(),n.getZ())}},{key:"interfaces_",get:function(){return[D]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,0===arguments.length)e.constructor_.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}},{key:"compare",value:function(t,e){return t<e?-1:t>e?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0}}]),e}();j.DimensionalComparator=X,j.NULL_ORDINATE=A.NaN,j.X=0,j.Y=1,j.Z=2,j.M=3;var U=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()}},{key:"intersection",value:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new e;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny;return new e(n,this._maxx<t._maxx?this._maxx:t._maxx,r,this._maxy<t._maxy?this._maxy:t._maxy)}},{key:"isNull",value:function(){return this._maxx<this._minx}},{key:"getMaxX",value:function(){return this._maxx}},{key:"covers",value:function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof e){var n=arguments[0];return!this.isNull()&&!n.isNull()&&n.getMinX()>=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}}},{key:"intersects",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){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 j){var n=arguments[0];return this.intersects(n.x,n.y)}}else if(2===arguments.length){if(arguments[0]instanceof j&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1];return!(this.isNull()||(r.x<i.x?r.x:i.x)>this._maxx||(r.x>i.x?r.x:i.x)<this._minx||(r.y<i.y?r.y:i.y)>this._maxy||(r.y>i.y?r.y:i.y)<this._miny)}if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return!this.isNull()&&!(o>this._maxx||o<this._minx||s>this._maxy||s<this._miny)}}}},{key:"getMinY",value:function(){return this._miny}},{key:"getDiameter",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return Math.sqrt(t*t+e*e)}},{key:"getMinX",value:function(){return this._minx}},{key:"expandToInclude",value:function(){if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];if(n.isNull())return null;this.isNull()?(this._minx=n.getMinX(),this._maxx=n.getMaxX(),this._miny=n.getMinY(),this._maxy=n.getMaxY()):(n._minx<this._minx&&(this._minx=n._minx),n._maxx>this._maxx&&(this._maxx=n._maxx),n._miny<this._miny&&(this._miny=n._miny),n._maxy>this._maxy&&(this._maxy=n._maxy))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e}},{key:"getWidth",value:function(){return this.isNull()?0:this._maxx-this._minx}},{key:"compareTo",value: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}},{key:"translate",value:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny}},{key:"getHeight",value:function(){return this.isNull()?0:this._maxy-this._miny}},{key:"maxExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e}},{key:"expandBy",value: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()}}},{key:"contains",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof j){var n=arguments[0];return this.covers(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return this.covers(r,i)}}},{key:"centre",value:function(){return this.isNull()?null:new j((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}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];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}}},{key:"getMaxY",value:function(){return this._maxy}},{key:"distance",value: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)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*(t=37*(t=37*t+j.hashCode(this._minx))+j.hashCode(this._maxx))+j.hashCode(this._miny))+j.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[k,b]}}],[{key:"constructor_",value:function(){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 j){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){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)}}},{key:"intersects",value: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),l=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(l>u||h<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),h=Math.max(r.y,i.y),l>u||h<a))}}}]),e}(),V=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isGeometryCollection",value:function(){return this.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION}},{key:"getFactory",value:function(){return this._factory}},{key:"getGeometryN",value:function(t){return this}},{key:"getArea",value:function(){return 0}},{key:"isRectangle",value:function(){return!1}},{key:"equalsExact",value:function(t){return this===t||this.equalsExact(t,0)}},{key:"geometryChanged",value:function(){this.apply(e.geometryChangedFilter)}},{key:"geometryChangedAction",value:function(){this._envelope=null}},{key:"equalsNorm",value:function(t){return null!==t&&this.norm().equalsExact(t.norm())}},{key:"getLength",value:function(){return 0}},{key:"getNumGeometries",value:function(){return 1}},{key:"compareTo",value:function(){var t;if(1===arguments.length){var e=arguments[0];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return t=n,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(n,r)}}},{key:"getUserData",value:function(){return this._userData}},{key:"getSRID",value:function(){return this._SRID}},{key:"getEnvelope",value:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}},{key:"checkNotGeometryCollection",value:function(t){if(t.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")}},{key:"equal",value:function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n}},{key:"norm",value:function(){var t=this.copy();return t.normalize(),t}},{key:"reverse",value:function(){var t=this.reverseInternal();return null!=this.envelope&&(t.envelope=this.envelope.copy()),t.setSRID(this.getSRID()),t}},{key:"copy",value:function(){var t=this.copyInternal();return t.envelope=null==this._envelope?null:this._envelope.copy(),t._SRID=this._SRID,t._userData=this._userData,t}},{key:"getPrecisionModel",value:function(){return this._factory.getPrecisionModel()}},{key:"getEnvelopeInternal",value:function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new U(this._envelope)}},{key:"setSRID",value:function(t){this._SRID=t}},{key:"setUserData",value:function(t){this._userData=t}},{key:"compare",value: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}},{key:"hashCode",value:function(){return this.getEnvelopeInternal().hashCode()}},{key:"isEquivalentClass",value:function(t){return this.getClass()===t.getClass()}},{key:"isGeometryCollectionOrDerived",value:function(){return this.getTypeCode()===e.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===e.TYPECODE_MULTIPOINT||this.getTypeCode()===e.TYPECODE_MULTILINESTRING||this.getTypeCode()===e.TYPECODE_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[w,k,b]}},{key:"getClass",value:function(){return e}}],[{key:"hasNonEmptyElements",value:function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1}},{key:"hasNullElements",value:function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1}}]),e}();V.constructor_=function(t){t&&(this._envelope=null,this._userData=null,this._factory=t,this._SRID=t.getSRID())},V.TYPECODE_POINT=0,V.TYPECODE_MULTIPOINT=1,V.TYPECODE_LINESTRING=2,V.TYPECODE_LINEARRING=3,V.TYPECODE_MULTILINESTRING=4,V.TYPECODE_POLYGON=5,V.TYPECODE_MULTIPOLYGON=6,V.TYPECODE_GEOMETRYCOLLECTION=7,V.TYPENAME_POINT="Point",V.TYPENAME_MULTIPOINT="MultiPoint",V.TYPENAME_LINESTRING="LineString",V.TYPENAME_LINEARRING="LinearRing",V.TYPENAME_MULTILINESTRING="MultiLineString",V.TYPENAME_POLYGON="Polygon",V.TYPENAME_MULTIPOLYGON="MultiPolygon",V.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",V.geometryChangedFilter={get interfaces_(){return[x]},filter:function(t){t.geometryChangedAction()}};var Z=function(){function e(){t(this,e)}return n(e,null,[{key:"toLocationSymbol",value:function(t){switch(t){case e.EXTERIOR:return"e";case e.BOUNDARY:return"b";case e.INTERIOR:return"i";case e.NONE:return"-"}throw new _("Unknown location value: "+t)}}]),e}();Z.INTERIOR=0,Z.BOUNDARY=1,Z.EXTERIOR=2,Z.NONE=-1;var H=function(){function e(){t(this,e)}return n(e,[{key:"add",value:function(){}},{key:"addAll",value:function(){}},{key:"isEmpty",value:function(){}},{key:"iterator",value:function(){}},{key:"size",value:function(){}},{key:"toArray",value:function(){}},{key:"remove",value:function(){}}]),e}(),W=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({NoSuchElementException:i})[0],r}return i}(m),J=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({UnsupportedOperationException:i})[0],r}return i}(m),K=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.apply(this,arguments)}return n(o,[{key:"contains",value:function(){}}]),o}(H),Q=function(e,i){r(s,e);var o=c(s);function s(e){var n;return t(this,s),(n=o.call(this)).map=new Map,e instanceof H&&n.addAll(e),n}return n(s,[{key:"contains",value:function(t){var e=t.hashCode?t.hashCode():t;return!!this.map.has(e)}},{key:"add",value:function(t){var e=t.hashCode?t.hashCode():t;return!this.map.has(e)&&!!this.map.set(e,t)}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"remove",value:function(){throw new J}},{key:"size",value:function(){return this.map.size}},{key:"isEmpty",value:function(){return 0===this.map.size}},{key:"toArray",value:function(){return Array.from(this.map.values())}},{key:"iterator",value:function(){return new $(this.map)}},{key:i,value:function(){return this.map}}]),s}(K,Symbol.iterator),$=function(){function e(n){t(this,e),this.iterator=n.values();var r=this.iterator.next(),i=r.done,o=r.value;this.done=i,this.value=o}return n(e,[{key:"next",value:function(){if(this.done)throw new W;var t=this.value,e=this.iterator.next(),n=e.done,r=e.value;return this.done=n,this.value=r,t}},{key:"hasNext",value:function(){return!this.done}},{key:"remove",value:function(){throw new J}}]),e}(),tt=function(){function e(){t(this,e)}return n(e,null,[{key:"opposite",value:function(t){return t===e.LEFT?e.RIGHT:t===e.RIGHT?e.LEFT:t}}]),e}();tt.ON=0,tt.LEFT=1,tt.RIGHT=2;var et=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({EmptyStackException:i})[0],r}return i}(m),nt=function(e){r(i,e);var n=c(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({IndexOutOfBoundsException:i})[0],r}return i}(m),rt=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.apply(this,arguments)}return n(o,[{key:"get",value:function(){}},{key:"set",value:function(){}},{key:"isEmpty",value:function(){}}]),o}(H),it=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).array=[],e}return n(o,[{key:"add",value:function(t){return this.array.push(t),!0}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new nt;return this.array[t]}},{key:"push",value:function(t){return this.array.push(t),t}},{key:"pop",value:function(){if(0===this.array.length)throw new et;return this.array.pop()}},{key:"peek",value:function(){if(0===this.array.length)throw new et;return this.array[this.array.length-1]}},{key:"empty",value:function(){return 0===this.array.length}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(t){return this.array.indexOf(t)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),o}(rt);function ot(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}var st=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),at=function(){function e(n){t(this,e),this.value=n}return n(e,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(t){return this.value<t?-1:this.value>t?1:0}}],[{key:"compare",value:function(t,e){return t<e?-1:t>e?1:0}},{key:"isNan",value:function(t){return Number.isNaN(t)}},{key:"valueOf",value:function(t){return new e(t)}}]),e}(),ut=function(){function e(){t(this,e)}return n(e,null,[{key:"isWhitespace",value:function(t){return t<=32&&t>=0||127===t}},{key:"toUpperCase",value:function(t){return t.toUpperCase()}}]),e}(),lt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"le",value:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<=t._lo}},{key:"extractSignificantDigits",value:function(t,n){var r=this.abs(),i=e.magnitude(r._hi),o=e.TEN.pow(i);(r=r.divide(o)).gt(e.TEN)?(r=r.divide(e.TEN),i+=1):r.lt(e.ONE)&&(r=r.multiply(e.TEN),i-=1);for(var s=i+1,a=new st,u=e.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var h=Math.trunc(r._hi);if(h<0)break;var c=!1,f=0;h>9?(c=!0,f="9"):f="0"+h,a.append(f),r=r.subtract(e.valueOf(h)).multiply(e.TEN),c&&r.selfAdd(e.TEN);var v=!0,g=e.magnitude(r._hi);if(g<0&&Math.abs(g)>=u-l&&(v=!1),!v)break}return n[0]=i,a.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}},{key:"equals",value:function(){if(1===arguments.length&&arguments[0]instanceof e){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}},{key:"isZero",value:function(){return 0===this._hi&&0===this._lo}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(t){return this.le(t)?this:t}},{key:"selfDivide",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfDivide(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null,c=null,f=null;return l=this._hi/r,f=(o=(h=e.SPLIT*l)-(o=h-l))*(a=(f=e.SPLIT*r)-(a=f-r))-(c=l*r)+o*(u=r-a)+(s=l-o)*a+s*u,f=l+(h=(this._hi-c-f+this._lo-l*i)/r),this._hi=f,this._lo=l-f+h,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null,u=null,l=null;return r=(s=this._hi/t._hi)-(n=(a=e.SPLIT*s)-(n=a-s)),l=n*(i=(l=e.SPLIT*t._hi)-(i=l-t._hi))-(u=s*t._hi)+n*(o=t._hi-i)+r*i+r*o,new e(l=s+(a=(this._hi-u-l+this._lo-s*t._lo)/t._hi),s-l+a)}if("number"==typeof arguments[0]){var h=arguments[0];return A.isNaN(h)?e.createNaN():e.copy(this).selfDivide(h,0)}}},{key:"ge",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}},{key:"pow",value:function(t){if(0===t)return e.valueOf(1);var n=new e(this),r=e.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&r.selfMultiply(n),(i/=2)>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal():r}},{key:"ceil",value:function(){if(this.isNaN())return e.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new e(t,n)}},{key:"compareTo",value: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}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}},{key:"max",value:function(t){return this.ge(t)?this:t}},{key:"sqrt",value:function(){if(this.isZero())return e.valueOf(0);if(this.isNegative())return e.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=e.valueOf(n),i=this.subtract(r.sqr())._hi*(.5*t);return r.add(i)}},{key:"selfAdd",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0],r=null,i=null,o=null,s=null,a=null,u=null;return s=(o=this._hi+n)-(a=o-this._hi),i=(u=(s=n-a+(this._hi-s))+this._lo)+(o-(r=o+u)),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(2===arguments.length){var l=arguments[0],h=arguments[1],c=null,f=null,v=null,g=null,d=null,p=null,y=null;g=this._hi+l,f=this._lo+h,d=g-(p=g-this._hi),v=f-(y=f-this._lo);var m=(c=g+(p=(d=l-p+(this._hi-d))+f))+(p=(v=h-y+(this._lo-v))+(p+(g-c))),_=p+(c-m);return this._hi=m,this._lo=_,this}}},{key:"selfMultiply",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfMultiply(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,h=null;o=(l=e.SPLIT*this._hi)-this._hi,h=e.SPLIT*r,o=l-o,s=this._hi-o,a=h-r;var c=(l=this._hi*r)+(h=o*(a=h-a)-l+o*(u=r-a)+s*a+s*u+(this._hi*i+this._lo*r)),f=h+(o=l-c);return this._hi=c,this._lo=f,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return e.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new e(t,n)}},{key:"negate",value:function(){return this.isNaN()?this:new e(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}},{key:"multiply",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return t.isNaN()?e.createNaN():e.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var n=arguments[0];return A.isNaN(n)?e.createNaN():e.copy(this).selfMultiply(n,0)}}},{key:"isNaN",value:function(){return A.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var t=e.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;if("."===r.charAt(0))o="0"+r;else if(i<0)o="0."+e.stringOfChar("0",-i)+r;else if(-1===r.indexOf(".")){var s=i-r.length;o=r+e.stringOfChar("0",s)+".0"}return this.isNegative()?"-"+o:o}},{key:"reciprocal",value:function(){var t,n,r,i,o=null,s=null,a=null,u=null;t=(r=1/this._hi)-(o=(a=e.SPLIT*r)-(o=a-r)),s=(u=e.SPLIT*this._hi)-this._hi;var l=r+(a=(1-(i=r*this._hi)-(u=o*(s=u-s)-i+o*(n=this._hi-s)+t*s+t*n)-r*this._lo)/this._hi);return new e(l,r-l+a)}},{key:"toSciNotation",value:function(){if(this.isZero())return e.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!1,n),i=e.SCI_NOT_EXPONENT_CHAR+n[0];if("0"===r.charAt(0))throw new IllegalStateException("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var s=r.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i}},{key:"abs",value:function(){return this.isNaN()?e.NaN:this.isNegative()?this.negate():new e(this)}},{key:"isPositive",value:function(){return this._hi>0||0===this._hi&&this._lo>0}},{key:"lt",value:function(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<t._lo}},{key:"add",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return e.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var n=arguments[0];return e.copy(this).selfAdd(n)}}},{key:"init",value: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 e){var n=arguments[0];this._hi=n._hi,this._lo=n._lo}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}}},{key:"gt",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>t._lo}},{key:"isNegative",value:function(){return this._hi<0||0===this._hi&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?e.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[b,k,w]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];e.constructor_.call(this,e.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}},{key:"determinant",value:function(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];return e.determinant(e.valueOf(t),e.valueOf(n),e.valueOf(r),e.valueOf(i))}if(arguments[3]instanceof e&&arguments[2]instanceof e&&arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[1],s=arguments[2],a=arguments[3];return arguments[0].multiply(a).selfSubtract(o.multiply(s))}}},{key:"sqr",value:function(t){return e.valueOf(t).selfMultiply(t)}},{key:"valueOf",value:function(){if("string"==typeof arguments[0]){var t=arguments[0];return e.parse(t)}if("number"==typeof arguments[0])return new e(arguments[0])}},{key:"sqrt",value:function(t){return e.valueOf(t).sqrt()}},{key:"parse",value:function(t){for(var n=0,r=t.length;ut.isWhitespace(t.charAt(n));)n++;var i=!1;if(n<r){var o=t.charAt(n);"-"!==o&&"+"!==o||(n++,"-"===o&&(i=!0))}for(var s=new e,a=0,u=0,l=0,h=!1;!(n>=r);){var c=t.charAt(n);if(n++,ut.isDigit(c)){var f=c-"0";s.selfMultiply(e.TEN),s.selfAdd(f),a++}else{if("."!==c){if("e"===c||"E"===c){var v=t.substring(n);try{l=at.parseInt(v)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+v+" in string "+t):e}break}throw new NumberFormatException("Unexpected character \'"+c+"\' at position "+n+" in string "+t)}u=a,h=!0}}var g=s;h||(u=a);var d=a-u-l;if(0===d)g=s;else if(d>0){var p=e.TEN.pow(d);g=s.divide(p)}else if(d<0){var y=e.TEN.pow(-d);g=s.multiply(y)}return i?g.negate():g}},{key:"createNaN",value:function(){return new e(A.NaN,A.NaN)}},{key:"copy",value:function(t){return new e(t)}},{key:"magnitude",value: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}},{key:"stringOfChar",value:function(t,e){for(var n=new st,r=0;r<e;r++)n.append(t);return n.toString()}}]),e}();lt.PI=new lt(3.141592653589793,12246467991473532e-32),lt.TWO_PI=new lt(6.283185307179586,24492935982947064e-32),lt.PI_2=new lt(1.5707963267948966,6123233995736766e-32),lt.E=new lt(2.718281828459045,14456468917292502e-32),lt.NaN=new lt(A.NaN,A.NaN),lt.EPS=123259516440783e-46,lt.SPLIT=134217729,lt.MAX_PRINT_DIGITS=32,lt.TEN=lt.valueOf(10),lt.ONE=lt.valueOf(1),lt.SCI_NOT_EXPONENT_CHAR="E",lt.SCI_NOT_ZERO="0.0E0";var ht=function(){function e(){t(this,e)}return n(e,null,[{key:"orientationIndex",value:function(t,n,r){var i=e.orientationIndexFilter(t,n,r);if(i<=1)return i;var o=lt.valueOf(n.x).selfAdd(-t.x),s=lt.valueOf(n.y).selfAdd(-t.y),a=lt.valueOf(r.x).selfAdd(-n.x),u=lt.valueOf(r.y).selfAdd(-n.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()}},{key:"signOfDet2x2",value:function(){if(arguments[3]instanceof lt&&arguments[2]instanceof lt&&arguments[0]instanceof lt&&arguments[1]instanceof lt){var t=arguments[1],e=arguments[2],n=arguments[3];return arguments[0].multiply(n).selfSubtract(t.multiply(e)).signum()}if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=lt.valueOf(r),u=lt.valueOf(i),l=lt.valueOf(o),h=lt.valueOf(s);return a.multiply(h).selfSubtract(u.multiply(l)).signum()}}},{key:"intersection",value:function(t,e,n,r){var i=new lt(t.y).selfSubtract(e.y),o=new lt(e.x).selfSubtract(t.x),s=new lt(t.x).selfMultiply(e.y).selfSubtract(new lt(e.x).selfMultiply(t.y)),a=new lt(n.y).selfSubtract(r.y),u=new lt(r.x).selfSubtract(n.x),l=new lt(n.x).selfMultiply(r.y).selfSubtract(new lt(r.x).selfMultiply(n.y)),h=o.multiply(l).selfSubtract(u.multiply(s)),c=a.multiply(s).selfSubtract(i.multiply(l)),f=i.multiply(u).selfSubtract(a.multiply(o)),v=h.selfDivide(f).doubleValue(),g=c.selfDivide(f).doubleValue();return A.isNaN(v)||A.isInfinite(v)||A.isNaN(g)||A.isInfinite(g)?null:new j(v,g)}},{key:"orientationIndexFilter",value:function(t,n,r){var i=null,o=(t.x-r.x)*(n.y-r.y),s=(t.y-r.y)*(n.x-r.x),a=o-s;if(o>0){if(s<=0)return e.signum(a);i=o+s}else{if(!(o<0))return e.signum(a);if(s>=0)return e.signum(a);i=-o-s}var u=e.DP_SAFE_EPSILON*i;return a>=u||-a>=u?e.signum(a):2}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}}]),e}();ht.DP_SAFE_EPSILON=1e-15;var ct=function(){function e(){t(this,e)}return n(e,[{key:"getM",value:function(t){if(this.hasM()){var e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return A.NaN}},{key:"setOrdinate",value:function(t,e,n){}},{key:"getZ",value:function(t){return this.hasZ()?this.getOrdinate(t,2):A.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(t,e){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(t){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(t){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(t){}},{key:"copy",value:function(){}},{key:"getY",value:function(t){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[w]}}]),e}();ct.X=0,ct.Y=1,ct.Z=2,ct.M=3;var ft=function(){function e(){t(this,e)}return n(e,null,[{key:"index",value:function(t,e,n){return ht.orientationIndex(t,e,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var t=arguments[0],n=t.length-1;if(n<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=n;o++){var s=t[o];s.y>r.y&&(r=s,i=o)}var a=i;do{(a-=1)<0&&(a=n)}while(t[a].equals2D(r)&&a!==i);var u=i;do{u=(u+1)%n}while(t[u].equals2D(r)&&u!==i);var l=t[a],h=t[u];if(l.equals2D(r)||h.equals2D(r)||l.equals2D(h))return!1;var c=e.index(l,r,h);return 0===c?l.x>h.x:c>0}if(ot(arguments[0],ct)){var f=arguments[0],v=f.size()-1;if(v<3)throw new _("Ring has fewer than 4 points, so orientation cannot be determined");for(var g=f.getCoordinate(0),d=0,p=1;p<=v;p++){var y=f.getCoordinate(p);y.y>g.y&&(g=y,d=p)}var m=null,x=d;do{(x-=1)<0&&(x=v),m=f.getCoordinate(x)}while(m.equals2D(g)&&x!==d);var E=null,k=d;do{k=(k+1)%v,E=f.getCoordinate(k)}while(E.equals2D(g)&&k!==d);if(m.equals2D(g)||E.equals2D(g)||m.equals2D(E))return!1;var w=e.index(m,g,E);return 0===w?m.x>E.x:w>0}}}]),e}();ft.CLOCKWISE=-1,ft.RIGHT=ft.CLOCKWISE,ft.COUNTERCLOCKWISE=1,ft.LEFT=ft.COUNTERCLOCKWISE,ft.COLLINEAR=0,ft.STRAIGHT=ft.COLLINEAR;var vt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value: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}},{key:"findRightmostEdgeAtVertex",value:function(){var t=this._minDe.getEdge().getCoordinates();G.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=ft.index(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===ft.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===ft.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value: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=tt.LEFT;return n[e].y<n[e+1].y&&(r=tt.RIGHT),r}},{key:"getEdge",value:function(){return this._orientedDe}},{key:"checkForRightmostCoordinate",value: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])}},{key:"findRightmostEdgeAtNode",value: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)}},{key:"findEdge",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}G.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)===tt.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),e}(),gt=function(e){r(o,e);var i=c(o);function o(e,n){var r;return t(this,o),(r=i.call(this,n?e+" [ "+n+" ]":e)).pt=n?new j(n):void 0,r.name=Object.keys({TopologyException:o})[0],r}return n(o,[{key:"getCoordinate",value:function(){return this.pt}}]),o}(F),dt=function(){function e(){t(this,e),this.array=[]}return n(e,[{key:"addLast",value:function(t){this.array.push(t)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return 0===this.array.length}}]),e}(),pt=function(e,i){r(s,e);var o=c(s);function s(e){var n;return t(this,s),(n=o.call(this)).array=[],e instanceof H&&n.addAll(e),n}return n(s,[{key:"interfaces_",get:function(){return[rt,H]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.array.push(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"set",value:function(t,e){var n=this.array[t];return this.array[t]=e,n}},{key:"iterator",value:function(){return new yt(this)}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new nt;return this.array[t]}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"sort",value:function(t){t?this.array.sort(function(e,n){return t.compare(e,n)}):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(t){for(var e=0,n=this.array.length;e<n;e++)if(this.array[e]===t)return!!this.array.splice(e,1);return!1}},{key:i,value:function(){return this.array.values()}}]),s}(rt,Symbol.iterator),yt=function(){function e(n){t(this,e),this.arrayList=n,this.position=0}return n(e,[{key:"next",value:function(){if(this.position===this.arrayList.size())throw new W;return this.arrayList.get(this.position++)}},{key:"hasNext",value:function(){return this.position<this.arrayList.size()}},{key:"set",value:function(t){return this.arrayList.set(this.position-1,t)}},{key:"remove",value:function(){this.arrayList.remove(this.arrayList.get(this.position))}}]),e}(),mt=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"clearVisitedEdges",value:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)}},{key:"getRightmostCoordinate",value:function(){return this._rightMostCoord}},{key:"computeNodeDepth",value: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 gt("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)}}},{key:"computeDepth",value:function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(tt.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)}},{key:"create",value:function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}},{key:"findResultEdges",value:function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(tt.RIGHT)>=1&&e.getDepth(tt.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}},{key:"computeDepths",value:function(t){var e=new Q,n=new dt,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))}}}}},{key:"compareTo",value:function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(null===this._env){for(var t=new U,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}},{key:"addReachable",value:function(t){var e=new it;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}}},{key:"copySymDepths",value:function(t){var e=t.getSym();e.setDepth(tt.LEFT,t.getDepth(tt.RIGHT)),e.setDepth(tt.RIGHT,t.getDepth(tt.LEFT))}},{key:"add",value: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)}}},{key:"getNodes",value:function(){return this._nodes}},{key:"getDirectedEdges",value:function(){return this._dirEdgeList}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._finder=null,this._dirEdgeList=new pt,this._nodes=new pt,this._rightMostCoord=null,this._env=null,this._finder=new vt}}]),e}(),_t=function(){function e(){t(this,e)}return n(e,null,[{key:"intersection",value:function(t,e,n,r){var i=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,l=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,c=n.y>r.y?n.y:r.y,f=((i>u?i:u)+(s<h?s:h))/2,v=((o>l?o:l)+(a<c?a:c))/2,g=t.x-f,d=t.y-v,p=e.x-f,y=e.y-v,m=n.x-f,_=n.y-v,x=r.x-f,E=r.y-v,k=d-y,w=p-g,b=g*y-p*d,I=_-E,N=x-m,S=m*E-x*_,M=k*N-I*w,L=(w*S-N*b)/M,P=(I*b-k*S)/M;return A.isNaN(L)||A.isInfinite(L)||A.isNaN(P)||A.isInfinite(P)?null:new j(L+f,P+v)}}]),e}(),xt=function(){function e(){t(this,e)}return n(e,null,[{key:"arraycopy",value:function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++}},{key:"getProperty",value:function(t){return{"line.separator":"\\n"}[t]}}]),e}(),Et=function(){function e(){t(this,e)}return n(e,null,[{key:"log10",value:function(t){var n=Math.log(t);return A.isInfinite(n)||A.isNaN(n)?n:n/e.LOG_10}},{key:"min",value:function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i}},{key:"clamp",value: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}}},{key:"wrap",value:function(t,e){return t<0?e- -t%e:t%e}},{key:"max",value:function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}}},{key:"average",value:function(t,e){return(t+e)/2}}]),e}();Et.LOG_10=Math.log(10);var kt=function(){function e(){t(this,e)}return n(e,null,[{key:"segmentToSegment",value:function(t,n,r,i){if(t.equals(n))return e.pointToSegment(t,r,i);if(r.equals(i))return e.pointToSegment(i,t,n);var o=!1;if(U.intersects(t,n,r,i)){var s=(n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(0===s)o=!0;else{var a=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=((t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y))/s,l=a/s;(l<0||l>1||u<0||u>1)&&(o=!0)}}else o=!0;return o?Et.min(e.pointToSegment(t,r,i),e.pointToSegment(n,r,i),e.pointToSegment(r,t,n),e.pointToSegment(i,t,n)):0}},{key:"pointToSegment",value:function(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;if(i<=0)return t.distance(e);if(i>=1)return t.distance(n);var o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(o)*Math.sqrt(r)}},{key:"pointToLinePerpendicular",value: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)}},{key:"pointToSegmentString",value:function(t,n){if(0===n.length)throw new _("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i<n.length-1;i++){var o=e.pointToSegment(t,n[i],n[i+1]);o<r&&(r=o)}return r}}]),e}(),wt=function(){function e(){t(this,e)}return n(e,[{key:"create",value:function(){if(1===arguments.length)arguments[0]instanceof Array||ot(arguments[0],ct);else if(2===arguments.length);else if(3===arguments.length){var t=arguments[0],e=arguments[1];return this.create(t,e)}}}]),e}(),bt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),It=function(){function e(){t(this,e)}return n(e,null,[{key:"ofLine",value:function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new j;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,l=a-i,h=u-o;n+=Math.sqrt(l*l+h*h),i=a,o=u}return n}}]),e}(),Nt=function e(){t(this,e)},St=function(){function e(){t(this,e)}return n(e,null,[{key:"copyCoord",value: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))}},{key:"isRing",value:function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,ct.X)===t.getOrdinate(e-1,ct.X)&&t.getOrdinate(0,ct.Y)===t.getOrdinate(e-1,ct.Y)}},{key:"scroll",value:function(){if(2===arguments.length){if(ot(arguments[0],ct)&&Number.isInteger(arguments[1])){var t=arguments[0],n=arguments[1];e.scroll(t,n,e.isRing(t))}else if(ot(arguments[0],ct)&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1],o=e.indexOf(i,r);if(o<=0)return null;e.scroll(r,o)}}else if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2];if(a<=0)return null;for(var l=s.copy(),h=u?s.size()-1:s.size(),c=0;c<h;c++)for(var f=0;f<s.getDimension();f++)s.setOrdinate(c,f,l.getOrdinate((a+c)%h,f));if(u)for(var v=0;v<s.getDimension();v++)s.setOrdinate(h,v,s.getOrdinate(0,v))}}},{key:"isEqual",value: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)||A.isNaN(s)&&A.isNaN(a)))return!1}return!0}},{key:"minCoordinateIndex",value:function(){if(1===arguments.length){var t=arguments[0];return e.minCoordinateIndex(t,0,t.size()-1)}if(3===arguments.length){for(var n=arguments[0],r=arguments[2],i=-1,o=null,s=arguments[1];s<=r;s++){var a=n.getCoordinate(s);(null===o||o.compareTo(a)>0)&&(o=a,i=s)}return i}}},{key:"extend",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();if(e.copy(n,0,i,0,o),o>0)for(var s=o;s<r;s++)e.copy(n,o-1,i,s,1);return i}},{key:"reverse",value:function(t){for(var n=t.size()-1,r=Math.trunc(n/2),i=0;i<=r;i++)e.swap(t,i,n-i)}},{key:"swap",value: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)}}},{key:"copy",value:function(t,n,r,i,o){for(var s=0;s<o;s++)e.copyCoord(t,n+s,r,i+s)}},{key:"ensureValidRing",value:function(t,n){var r=n.size();return 0===r?n:r<=3?e.createClosedRing(t,n,4):n.getOrdinate(0,ct.X)===n.getOrdinate(r-1,ct.X)&&n.getOrdinate(0,ct.Y)===n.getOrdinate(r-1,ct.Y)?n:e.createClosedRing(t,n,r+1)}},{key:"indexOf",value:function(t,e){for(var n=0;n<e.size();n++)if(t.x===e.getOrdinate(n,ct.X)&&t.y===e.getOrdinate(n,ct.Y))return n;return-1}},{key:"createClosedRing",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();e.copy(n,0,i,0,o);for(var s=o;s<r;s++)e.copy(n,0,i,s,1);return i}},{key:"minCoordinate",value:function(t){for(var e=null,n=0;n<t.size();n++){var r=t.getCoordinate(n);(null===e||e.compareTo(r)>0)&&(e=r)}return e}}]),e}(),Mt=function(){function e(){t(this,e)}return n(e,null,[{key:"toDimensionSymbol",value:function(t){switch(t){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L;case e.A:return e.SYM_A}throw new _("Unknown dimension value: "+t)}},{key:"toDimensionValue",value:function(t){switch(ut.toUpperCase(t)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L;case e.SYM_A:return e.A}throw new _("Unknown dimension symbol: "+t)}}]),e}();Mt.P=0,Mt.L=1,Mt.A=2,Mt.FALSE=-1,Mt.TRUE=-2,Mt.DONTCARE=-3,Mt.SYM_FALSE="F",Mt.SYM_TRUE="T",Mt.SYM_DONTCARE="*",Mt.SYM_P="0",Mt.SYM_L="1",Mt.SYM_A="2";var Lt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),Pt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t,e){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),e}(),Ct=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new U:this._points.expandEnvelope(new U)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new s(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._points.size()!==n._points.size())return!1;for(var r=0;r<this._points.size();r++)if(!this.equal(this._points.getCoordinate(r),n._points.getCoordinate(r),e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value: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))){if(this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0){var n=this._points.copy();St.reverse(n),this._points=n}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Mt.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var t=this._points.copy();return St.reverse(t),this.getFactory().createLineString(t)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return V.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return It.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value: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)}}},{key:"apply",value:function(){if(ot(arguments[0],bt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(ot(arguments[0],Pt)){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(ot(arguments[0],Lt)||ot(arguments[0],x))&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){throw new J}},{key:"isEquivalentClass",value:function(t){return t instanceof s}},{key:"getCoordinateN",value:function(t){return this._points.getCoordinate(t)}},{key:"getGeometryType",value:function(){return V.TYPENAME_LINESTRING}},{key:"getCoordinateSequence",value:function(){return this._points}},{key:"isEmpty",value:function(){return 0===this._points.size()}},{key:"init",value:function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t}},{key:"isCoordinate",value:function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1}},{key:"getStartPoint",value:function(){return this.isEmpty()?null:this.getPointN(0)}},{key:"getPointN",value:function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))}},{key:"interfaces_",get:function(){return[Nt]}}],[{key:"constructor_",value:function(){if(this._points=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];V.constructor_.call(this,e),this.init(t)}}}]),s}(V),Tt=function e(){t(this,e)},Ot=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){if(this.isEmpty())return new U;var t=new U;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t}},{key:"getCoordinates",value:function(){return this.isEmpty()?[]:[this.getCoordinate()]}},{key:"copyInternal",value:function(){return new s(this._coordinates.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){}},{key:"getCoordinate",value:function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"reverseInternal",value:function(){return this.getFactory().createPoint(this._coordinates.copy())}},{key:"getTypeCode",value:function(){return V.TYPECODE_POINT}},{key:"getDimension",value:function(){return 0}},{key:"getNumPoints",value:function(){return this.isEmpty()?0:1}},{key:"getX",value:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}},{key:"compareToSameClass",value: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)}}},{key:"apply",value:function(){if(ot(arguments[0],bt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(ot(arguments[0],Pt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(ot(arguments[0],Lt)||ot(arguments[0],x))&&arguments[0].filter(this)}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return V.TYPENAME_POINT}},{key:"getCoordinateSequence",value:function(){return this._coordinates}},{key:"getY",value:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}},{key:"isEmpty",value:function(){return 0===this._coordinates.size()}},{key:"init",value:function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),G.isTrue(t.size()<=1),this._coordinates=t}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[Tt]}}],[{key:"constructor_",value:function(){this._coordinates=null;var t=arguments[0],e=arguments[1];V.constructor_.call(this,e),this.init(t)}}]),s}(V),Rt=function(){function e(){t(this,e)}return n(e,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var t=arguments[0];return Math.abs(e.ofRingSigned(t))}if(ot(arguments[0],ct)){var n=arguments[0];return Math.abs(e.ofRingSigned(n))}}},{key:"ofRingSigned",value: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(ot(arguments[0],ct)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new j,l=new j,h=new j;s.getCoordinate(0,l),s.getCoordinate(1,h);var c=l.x;h.x-=c;for(var f=0,v=1;v<a-1;v++)u.y=l.y,l.x=h.x,l.y=h.y,s.getCoordinate(v+1,h),h.x-=c,f+=l.x*(u.y-h.y);return f/2}}}]),e}(),At=function(){function e(){t(this,e)}return n(e,null,[{key:"sort",value:function(){var t=arguments,e=arguments[0];if(1===arguments.length)e.sort(function(t,e){return t.compareTo(e)});else if(2===arguments.length)e.sort(function(e,n){return t[1].compare(e,n)});else if(3===arguments.length){var n=e.slice(arguments[1],arguments[2]);n.sort();var r=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));e.splice(0,e.length);var i,o=p(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;e.push(s)}}catch(t){o.e(t)}finally{o.f()}}else if(4===arguments.length){var a=e.slice(arguments[1],arguments[2]);a.sort(function(e,n){return t[3].compare(e,n)});var u=e.slice(0,arguments[1]).concat(a,e.slice(arguments[2],e.length));e.splice(0,e.length);var l,h=p(u);try{for(h.s();!(l=h.n()).done;){var c=l.value;e.push(c)}}catch(t){h.e(t)}finally{h.f()}}}},{key:"asList",value:function(t){var e,n=new pt,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n.add(i)}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"copyOf",value:function(t,e){return t.slice(0,e)}}]),e}(),Dt=function e(){t(this,e)},Ft=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){return this._shell.getEnvelopeInternal()}},{key:"getCoordinates",value: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}},{key:"getArea",value:function(){var t=0;t+=Rt.ofRing(this._shell.getCoordinateSequence());for(var e=0;e<this._holes.length;e++)t-=Rt.ofRing(this._holes[e].getCoordinateSequence());return t}},{key:"copyInternal",value:function(){for(var t=this._shell.copy(),e=new Array(this._holes.length).fill(null),n=0;n<this._holes.length;n++)e[n]=this._holes[n].copy();return new s(t,e,this._factory)}},{key:"isRectangle",value: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),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}return!0}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t,r=this._shell,o=n._shell;if(!r.equalsExact(o,e))return!1;if(this._holes.length!==n._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(n._holes[a],e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){if(0===arguments.length){this._shell=this.normalized(this._shell,!0);for(var t=0;t<this._holes.length;t++)this._holes[t]=this.normalized(this._holes[t],!1);At.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=e.getCoordinateSequence(),i=St.minCoordinateIndex(r,0,r.size()-2);St.scroll(r,i,!0),ft.isCCW(r)===n&&St.reverse(r)}}},{key:"getCoordinate",value:function(){return this._shell.getCoordinate()}},{key:"getNumInteriorRing",value:function(){return this._holes.length}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"reverseInternal",value:function(){for(var t=this.getExteriorRing().reverse(),e=new Array(this.getNumInteriorRing()).fill(null),n=0;n<e.length;n++)e[n]=this.getInteriorRingN(n).reverse();return this.getFactory().createPolygon(t,e)}},{key:"getTypeCode",value:function(){return V.TYPECODE_POLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getLength",value:function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t}},{key:"getNumPoints",value:function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t}},{key:"convexHull",value:function(){return this.getExteriorRing().convexHull()}},{key:"normalized",value:function(t,e){var n=t.copy();return this.normalize(n,e),n}},{key:"compareToSameClass",value: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[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),h=0;h<u&&h<l;){var c=this.getInteriorRingN(h),f=i.getInteriorRingN(h),v=c.compareToSameClass(f,r);if(0!==v)return v;h++}return h<u?1:h<l?-1:0}}},{key:"apply",value:function(){if(ot(arguments[0],bt)){var t=arguments[0];this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(ot(arguments[0],Pt)){var n=arguments[0];if(this._shell.apply(n),!n.isDone())for(var r=0;r<this._holes.length&&(this._holes[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(ot(arguments[0],Lt))arguments[0].filter(this);else if(ot(arguments[0],x)){var i=arguments[0];i.filter(this),this._shell.apply(i);for(var o=0;o<this._holes.length;o++)this._holes[o].apply(i)}}},{key:"getBoundary",value: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)}},{key:"getGeometryType",value:function(){return V.TYPENAME_POLYGON}},{key:"getExteriorRing",value:function(){return this._shell}},{key:"isEmpty",value:function(){return this._shell.isEmpty()}},{key:"getInteriorRingN",value:function(t){return this._holes[t]}},{key:"interfaces_",get:function(){return[Dt]}}],[{key:"constructor_",value:function(){this._shell=null,this._holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(V.constructor_.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),V.hasNullElements(e))throw new _("holes must not contain null elements");if(t.isEmpty()&&V.hasNonEmptyElements(e))throw new _("shell is empty but holes are not");this._shell=t,this._holes=e}}]),s}(V),qt=function(e){r(i,e);var n=c(i);function i(){return t(this,i),n.apply(this,arguments)}return i}(K),Gt=function(e){r(o,e);var i=c(o);function o(e){var n;return t(this,o),(n=i.call(this)).array=[],e instanceof H&&n.addAll(e),n}return n(o,[{key:"contains",value:function(t){var e,n=p(this.array);try{for(n.s();!(e=n.n()).done;)if(0===e.value.compareTo(t))return!0}catch(t){n.e(t)}finally{n.f()}return!1}},{key:"add",value: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);return this.array.push(t),!0}},{key:"addAll",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"remove",value:function(){throw new J}},{key:"size",value:function(){return this.array.length}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"iterator",value:function(){return new Yt(this.array)}}]),o}(qt),Yt=function(){function e(n){t(this,e),this.array=n,this.position=0}return n(e,[{key:"next",value:function(){if(this.position===this.array.length)throw new W;return this.array[this.position++]}},{key:"hasNext",value:function(){return this.position<this.array.length}},{key:"remove",value:function(){throw new J}}]),e}(),Bt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"computeEnvelopeInternal",value:function(){for(var t=new U,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t}},{key:"getGeometryN",value:function(t){return this._geometries[t]}},{key:"getCoordinates",value: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}},{key:"getArea",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t}},{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._geometries.length!==n._geometries.length)return!1;for(var r=0;r<this._geometries.length;r++)if(!this._geometries[r].equalsExact(n._geometries[r],e))return!1;return!0}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"normalize",value:function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();At.sort(this._geometries)}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()}},{key:"getBoundaryDimension",value:function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t}},{key:"reverseInternal",value:function(){for(var t=this._geometries.length,e=new pt(t),n=0;n<t;n++)e.add(this._geometries[n].reverse());return this.getFactory().buildGeometry(e)}},{key:"getTypeCode",value:function(){return V.TYPECODE_GEOMETRYCOLLECTION}},{key:"getDimension",value:function(){for(var t=Mt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t}},{key:"getLength",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t}},{key:"getNumPoints",value:function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t}},{key:"getNumGeometries",value:function(){return this._geometries.length}},{key:"compareToSameClass",value:function(){if(1===arguments.length){var t=arguments[0],e=new Gt(At.asList(this._geometries)),n=new Gt(At.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=i.getGeometryN(a),h=u.compareToSameClass(l,r);if(0!==h)return h;a++}return a<o?1:a<s?-1:0}}},{key:"apply",value:function(){if(ot(arguments[0],bt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(ot(arguments[0],Pt)){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(ot(arguments[0],Lt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(ot(arguments[0],x)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}}},{key:"getBoundary",value:function(){return V.checkNotGeometryCollection(this),G.shouldNeverReachHere(),null}},{key:"getGeometryType",value:function(){return V.TYPENAME_GEOMETRYCOLLECTION}},{key:"isEmpty",value:function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0}}],[{key:"constructor_",value:function(){if(this._geometries=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];if(V.constructor_.call(this,e),null===t&&(t=[]),V.hasNullElements(t))throw new _("geometries must not contain null elements");this._geometries=t}}}]),s}(V),zt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"isValid",value:function(){return!0}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getCoordinate",value:function(){if(1===arguments.length&&Number.isInteger(arguments[0])){var t=arguments[0];return this._geometries[t].getCoordinate()}return f(i(s.prototype),"getCoordinate",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTIPOINT}},{key:"getDimension",value:function(){return 0}},{key:"getBoundary",value:function(){return this.getFactory().createGeometryCollection()}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTIPOINT}},{key:"interfaces_",get:function(){return[Tt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),jt=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){return new s(this._points.copy(),this._factory)}},{key:"getBoundaryDimension",value:function(){return Mt.FALSE}},{key:"isClosed",value:function(){return!!this.isEmpty()||f(i(s.prototype),"isClosed",this).call(this)}},{key:"reverseInternal",value:function(){var t=this._points.copy();return St.reverse(t),this.getFactory().createLinearRing(t)}},{key:"getTypeCode",value:function(){return V.TYPECODE_LINEARRING}},{key:"validateConstruction",value:function(){if(!this.isEmpty()&&!f(i(s.prototype),"isClosed",this).call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<s.MINIMUM_VALID_SIZE)throw new _("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")}},{key:"getGeometryType",value:function(){return V.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Ct.constructor_.call(this,t,e),this.validateConstruction()}}]),s}(Ct);jt.MINIMUM_VALID_SIZE=4;var Xt=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"getZ",value:function(){return j.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}],[{key:"constructor_",value:function(){if(0===arguments.length)j.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];j.constructor_.call(this,n,r,j.NULL_ORDINATE)}}}]),o}(j);Xt.X=0,Xt.Y=1,Xt.Z=-1,Xt.M=-1;var Ut=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;case o.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getZ",value:function(){return j.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y;case o.M:return this._m}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)j.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e.x,e.y),this._m=this.getM()}}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];j.constructor_.call(this,n,r,j.NULL_ORDINATE),this._m=i}}}]),o}(j);Ut.X=0,Ut.Y=1,Ut.Z=-1,Ut.M=2;var Vt=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case j.X:this.x=e;break;case j.Y:this.y=e;break;case j.Z:this.z=e;break;case j.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getOrdinate",value:function(t){switch(t){case j.X:return this.x;case j.Y:return this.y;case j.Z:return this.getZ();case j.M:return this.getM()}throw new _("Invalid ordinate index: "+t)}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)j.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];j.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof j){var e=arguments[0];j.constructor_.call(this,e),this._m=this.getM()}}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],s=arguments[3];j.constructor_.call(this,n,r,i),this._m=s}}}]),o}(j),Zt=function(){function e(){t(this,e)}return n(e,null,[{key:"measures",value:function(t){return t instanceof Xt?0:t instanceof Ut||t instanceof Vt?1:0}},{key:"dimension",value:function(t){return t instanceof Xt?2:t instanceof Ut?3:t instanceof Vt?4:3}},{key:"create",value:function(){if(1===arguments.length){var t=arguments[0];return e.create(t,0)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return 2===n?new Xt:3===n&&0===r?new j:3===n&&1===r?new Ut:4===n&&1===r?new Vt:new j}}}]),e}(),Ht=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getCoordinate",value:function(t){return this.get(t)}},{key:"addAll",value:function(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&ot(arguments[0],H)){for(var t=arguments[1],e=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),t),e=!0;return e}return f(i(s.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var t=f(i(s.prototype),"clone",this).call(this),e=0;e<this.size();e++)t.add(e,this.get(e).clone());return t}},{key:"toCoordinateArray",value:function(){if(0===arguments.length)return this.toArray(s.coordArrayType);if(1===arguments.length){if(arguments[0])return this.toArray(s.coordArrayType);for(var t=this.size(),e=new Array(t).fill(null),n=0;n<t;n++)e[n]=this.get(t-n-1);return e}}},{key:"add",value:function(){if(1===arguments.length){var t=arguments[0];return f(i(s.prototype),"add",this).call(this,t)}if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var e=arguments[0],n=arguments[1];return this.add(e,n,!0),!0}if(arguments[0]instanceof j&&"boolean"==typeof arguments[1]){var r=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(r))return null;f(i(s.prototype),"add",this).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1];if(arguments[2])for(var h=0;h<u.length;h++)this.add(u[h],l);else for(var c=u.length-1;c>=0;c--)this.add(u[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof j){var v=arguments[0],g=arguments[1];if(!arguments[2]){var d=this.size();if(d>0){if(v>0&&this.get(v-1).equals2D(g))return null;if(v<d&&this.get(v).equals2D(g))return null}}f(i(s.prototype),"add",this).call(this,v,g)}}else if(4===arguments.length){var p=arguments[0],y=arguments[1],m=arguments[2],_=arguments[3],x=1;m>_&&(x=-1);for(var E=m;E!==_;E+=x)this.add(p[E],y);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_",value:function(){if(0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}}]),s}(pt);Ht.coordArrayType=new Array(0).fill(null);var Wt=function(){function e(){t(this,e)}return n(e,null,[{key:"isRing",value:function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}},{key:"ptNotInList",value:function(t,n){for(var r=0;r<t.length;r++){var i=t[r];if(e.indexOf(i,n)<0)return i}return null}},{key:"scroll",value:function(t,n){var r=e.indexOf(n,t);if(r<0)return null;var i=new Array(t.length).fill(null);xt.arraycopy(t,r,i,0,t.length-r),xt.arraycopy(t,0,i,t.length-r,r),xt.arraycopy(i,0,t,0,t.length)}},{key:"equals",value: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}}},{key:"intersection",value:function(t,e){for(var n=new Ht,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()}},{key:"measures",value:function(t){if(null===t||0===t.length)return 0;var e,n=0,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n=Math.max(n,Zt.measures(i))}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"hasRepeatedPoints",value:function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1}},{key:"removeRepeatedPoints",value:function(t){return e.hasRepeatedPoints(t)?new Ht(t,!1).toCoordinateArray():t}},{key:"reverse",value: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}}},{key:"removeNull",value: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}},{key:"copyDeep",value: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]=t[n].copy();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]=r[i+u].copy()}},{key:"isEqualReversed",value: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}},{key:"envelope",value:function(t){for(var e=new U,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e}},{key:"toCoordinateArray",value:function(t){return t.toArray(e.coordArrayType)}},{key:"dimension",value:function(t){if(null===t||0===t.length)return 3;var e,n=0,r=p(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n=Math.max(n,Zt.dimension(i))}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"atLeastNCoordinatesOrNothing",value:function(t,e){return e.length>=t?e:[]}},{key:"indexOf",value:function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1}},{key:"increasingDirection",value: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}},{key:"compare",value: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}},{key:"minCoordinate",value:function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e}},{key:"extract",value:function(t,e,n){e=Et.clamp(e,0,t.length);var r=(n=Et.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}}]),e}(),Jt=function(){function e(){t(this,e)}return n(e,[{key:"compare",value:function(t,e){var n=t,r=e;return Wt.compare(n,r)}},{key:"interfaces_",get:function(){return[D]}}]),e}(),Kt=function(){function e(){t(this,e)}return n(e,[{key:"compare",value: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}},{key:"OLDcompare",value: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 l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0}},{key:"interfaces_",get:function(){return[D]}}]),e}();Wt.ForwardComparator=Jt,Wt.BidirectionalComparator=Kt,Wt.coordArrayType=new Array(0).fill(null);var Qt=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),$t=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(t){return this.hasM()?this._coordinates[t].getM():A.NaN}},{key:"setOrdinate",value:function(t,e,n){switch(e){case ct.X:this._coordinates[t].x=n;break;case ct.Y:this._coordinates[t].y=n;break;default:this._coordinates[t].setOrdinate(e,n)}}},{key:"getZ",value:function(t){return this.hasZ()?this._coordinates[t].getZ():A.NaN}},{key:"size",value:function(){return this._coordinates.length}},{key:"getOrdinate",value:function(t,e){switch(e){case ct.X:return this._coordinates[t].x;case ct.Y:return this._coordinates[t].y;default:return this._coordinates[t].getOrdinate(e)}}},{key:"getCoordinate",value:function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0];arguments[1].setCoordinate(this._coordinates[e])}}},{key:"getCoordinateCopy",value:function(t){var e=this.createCoordinate();return e.setCoordinate(this._coordinates[t]),e}},{key:"createCoordinate",value:function(){return Zt.create(this.getDimension(),this.getMeasures())}},{key:"getDimension",value:function(){return this._dimension}},{key:"getX",value:function(t){return this._coordinates[t].x}},{key:"getMeasures",value:function(){return this._measures}},{key:"expandEnvelope",value:function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t}},{key:"copy",value:function(){for(var t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++){var r=this.createCoordinate();r.setCoordinate(this._coordinates[n]),t[n]=r}return new e(t,this._dimension,this._measures)}},{key:"toString",value:function(){if(this._coordinates.length>0){var t=new Qt(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"()"}},{key:"getY",value:function(t){return this._coordinates[t].y}},{key:"toCoordinateArray",value:function(){return this._coordinates}},{key:"interfaces_",get:function(){return[ct,b]}}],[{key:"constructor_",value:function(){if(this._dimension=3,this._measures=0,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];e.constructor_.call(this,t,Wt.dimension(t),Wt.measures(t))}else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var r=0;r<n;r++)this._coordinates[r]=new j}else if(ot(arguments[0],ct)){var i=arguments[0];if(null===i)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._measures=i.getMeasures(),this._coordinates=new Array(i.size()).fill(null);for(var o=0;o<this._coordinates.length;o++)this._coordinates[o]=i.getCoordinateCopy(o)}}else if(2===arguments.length){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];e.constructor_.call(this,s,a,Wt.measures(s))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var h=0;h<u;h++)this._coordinates[h]=Zt.create(l)}}else if(3===arguments.length)if(Number.isInteger(arguments[2])&&arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var c=arguments[0],f=arguments[1],v=arguments[2];this._dimension=f,this._measures=v,this._coordinates=null===c?new Array(0).fill(null):c}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var g=arguments[0],d=arguments[1],p=arguments[2];this._coordinates=new Array(g).fill(null),this._dimension=d,this._measures=p;for(var y=0;y<g;y++)this._coordinates[y]=this.createCoordinate()}}}]),e}(),te=function(){function e(){t(this,e)}return n(e,[{key:"readResolve",value:function(){return e.instance()}},{key:"create",value:function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new $t(arguments[0]);if(ot(arguments[0],ct))return new $t(arguments[0])}else{if(2===arguments.length){var t=arguments[1];return t>3&&(t=3),t<2&&(t=2),new $t(arguments[0],t)}if(3===arguments.length){var e=arguments[2],n=arguments[1]-e;return e>1&&(e=1),n>3&&(n=3),n<2&&(n=2),new $t(arguments[0],n+e,e)}}}},{key:"interfaces_",get:function(){return[wt,b]}}],[{key:"instance",value:function(){return e.instanceObject}}]),e}();te.instanceObject=new te;var ee=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return 1}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTIPOLYGON}},{key:"getDimension",value:function(){return 2}},{key:"getBoundary",value:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new pt,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))}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTIPOLYGON}},{key:"interfaces_",get:function(){return[Dt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),ne=function(){function e(){t(this,e)}return n(e,[{key:"get",value:function(){}},{key:"put",value:function(){}},{key:"size",value:function(){}},{key:"values",value:function(){}},{key:"entrySet",value:function(){}}]),e}(),re=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).map=new Map,e}return n(o,[{key:"get",value:function(t){return this.map.get(t)||null}},{key:"put",value:function(t,e){return this.map.set(t,e),e}},{key:"values",value:function(){for(var t=new pt,e=this.map.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t}},{key:"entrySet",value:function(){var t=new Q;return this.map.entries().forEach(function(e){return t.add(e)}),t}},{key:"size",value:function(){return this.map.size()}}]),o}(ne),ie=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this._modelType===n._modelType&&this._scale===n._scale}},{key:"compareTo",value:function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return at.compare(n,r)}},{key:"getScale",value:function(){return this._scale}},{key:"isFloating",value:function(){return this._modelType===e.FLOATING||this._modelType===e.FLOATING_SINGLE}},{key:"getType",value:function(){return this._modelType}},{key:"toString",value:function(){var t="UNKNOWN";return this._modelType===e.FLOATING?t="Floating":this._modelType===e.FLOATING_SINGLE?t="Floating-Single":this._modelType===e.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t}},{key:"makePrecise",value:function(){if("number"==typeof arguments[0]){var t=arguments[0];return A.isNaN(t)||this._modelType===e.FLOATING_SINGLE?t:this._modelType===e.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof j){var n=arguments[0];if(this._modelType===e.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}}},{key:"getMaximumSignificantDigits",value:function(){var t=16;return this._modelType===e.FLOATING?t=16:this._modelType===e.FLOATING_SINGLE?t=6:this._modelType===e.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t}},{key:"setScale",value:function(t){this._scale=Math.abs(t)}},{key:"interfaces_",get:function(){return[b,k]}}],[{key:"constructor_",value:function(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=e.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof oe){var t=arguments[0];this._modelType=t,t===e.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=e.FIXED,this.setScale(n)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},{key:"mostPrecise",value:function(t,e){return t.compareTo(e)>=0?t:e}}]),e}(),oe=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"readResolve",value:function(){return e.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){this._name=null;var t=arguments[0];this._name=t,e.nameToTypeMap.put(t,this)}}]),e}();oe.nameToTypeMap=new re,ie.Type=oe,ie.FIXED=new oe("FIXED"),ie.FLOATING=new oe("FLOATING"),ie.FLOATING_SINGLE=new oe("FLOATING SINGLE"),ie.maximumPreciseValue=9007199254740992;var se=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this._geometries[e].copy();return new s(t,this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof V){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&f(i(s.prototype),"equalsExact",this).call(this,t,e)}return f(i(s.prototype),"equalsExact",this).apply(this,arguments)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Mt.FALSE:0}},{key:"isClosed",value:function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0}},{key:"getTypeCode",value:function(){return V.TYPECODE_MULTILINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getBoundary",value:function(){throw new J}},{key:"getGeometryType",value:function(){return V.TYPENAME_MULTILINESTRING}},{key:"interfaces_",get:function(){return[Nt]}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];Bt.constructor_.call(this,t,e)}}]),s}(Bt),ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"createEmpty",value:function(t){switch(t){case-1:return this.createGeometryCollection();case 0:return this.createPoint();case 1:return this.createLineString();case 2:return this.createPolygon();default:throw new _("Invalid dimension: "+t)}}},{key:"toGeometry",value:function(t){return t.isNull()?this.createPoint():t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new j(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new j(t.getMinX(),t.getMinY()),new j(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new j(t.getMinX(),t.getMinY()),new j(t.getMinX(),t.getMaxY()),new j(t.getMaxX(),t.getMaxY()),new j(t.getMaxX(),t.getMinY()),new j(t.getMinX(),t.getMinY())]),null)}},{key:"createLineString",value:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(ot(arguments[0],ct))return new Ct(arguments[0],this)}}},{key:"createMultiLineString",value:function(){return 0===arguments.length?new se(null,this):1===arguments.length?new se(arguments[0],this):void 0}},{key:"buildGeometry",value:function(t){for(var n=null,r=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getTypeCode();null===n&&(n=a),a!==n&&(r=!0),s instanceof Bt&&(i=!0)}if(null===n)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(e.toGeometryArray(t));var u=t.iterator().next();if(t.size()>1){if(u instanceof Ft)return this.createMultiPolygon(e.toPolygonArray(t));if(u instanceof Ct)return this.createMultiLineString(e.toLineStringArray(t));if(u instanceof Ot)return this.createMultiPoint(e.toPointArray(t));G.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}},{key:"createMultiPointFromCoords",value:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}},{key:"createPoint",value:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(ot(arguments[0],ct))return new Ot(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(ot(arguments[0],ct)){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 jt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Ft(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return 0===arguments.length?new Bt(null,this):1===arguments.length?new Bt(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value: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(ot(arguments[0],ct))return new jt(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return 0===arguments.length?new ee(null,this):1===arguments.length?new ee(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(0===arguments.length)return new zt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new zt(arguments[0],this);if(ot(arguments[0],ct)){var t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var r=this.getCoordinateSequenceFactory().create(1,t.getDimension(),t.getMeasures());St.copy(t,n,r,0,1),e[n]=this.createPoint(r)}return this.createMultiPoint(e)}}}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){if(this._precisionModel=null,this._coordinateSequenceFactory=null,this._SRID=null,0===arguments.length)e.constructor_.call(this,new ie,0);else if(1===arguments.length){if(ot(arguments[0],wt)){var t=arguments[0];e.constructor_.call(this,new ie,0,t)}else if(arguments[0]instanceof ie){var n=arguments[0];e.constructor_.call(this,n,0,e.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];e.constructor_.call(this,r,i,e.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this._precisionModel=o,this._coordinateSequenceFactory=a,this._SRID=s}}},{key:"toMultiPolygonArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toGeometryArray",value:function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"getDefaultCoordinateSequenceFactory",value:function(){return te.instance()}},{key:"toMultiLineStringArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toLineStringArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toMultiPointArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toLinearRingArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toPointArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"toPolygonArray",value:function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)}},{key:"createPointFromInternalCoord",value:function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)}}]),e}(),ue="XY",le="XYZ",he="XYM",ce="XYZM",fe={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},ve="EMPTY",ge=1,de=2,pe=3,ye=4,me=5,_e=6;for(var xe in fe)fe[xe].toUpperCase();var Ee=function(){function e(n){t(this,e),this.wkt=n,this.index_=-1}return n(e,[{key:"isAlpha_",value:function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}},{key:"isNumeric_",value:function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}},{key:"isWhiteSpace_",value:function(t){return" "==t||"\\t"==t||"\\r"==t||"\\n"==t}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=de;else if(","==e)t=me;else if(")"==e)t=pe;else if(this.isNumeric_(e)||"-"==e)t=ye,r=this.readNumber_();else if(this.isAlpha_(e))t=ge,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=_e}return{position:n,value:r,type:t}}},{key:"readNumber_",value:function(){var t,e=this.index_,n=!1,r=!1;do{"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}},{key:"readText_",value:function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}]),e}(),ke=function(){function e(n,r){t(this,e),this.lexer_=n,this.token_,this.layout_=ue,this.factory=r}return n(e,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(t){return this.token_.type==t}},{key:"match",value:function(t){var e=this.isTokenType(t);return e&&this.consume_(),e}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var t=ue,e=this.token_;if(this.isTokenType(ge)){var n=e.value;"Z"===n?t=le:"M"===n?t=he:"ZM"===n&&(t=ce),t!==ue&&this.consume_()}return t}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(de)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(me));if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(de)){var t=this.parsePoint_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(de)){var t=this.parsePointList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(de)){var t=this.parseLineStringTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var t;if(this.match(de)){if(t=this.token_.type==de?this.parsePointTextList_():this.parsePointList_(),this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(de)){var t=this.parseLineStringTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(de)){var t=this.parsePolygonTextList_();if(this.match(pe))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var t=[],e=this.layout_.length,n=0;n<e;++n){var r=this.token_;if(!this.match(ye))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}},{key:"parsePointList_",value:function(){for(var t=[this.parsePoint_()];this.match(me);)t.push(this.parsePoint_());return t}},{key:"parsePointTextList_",value:function(){for(var t=[this.parsePointText_()];this.match(me);)t.push(this.parsePointText_());return t}},{key:"parseLineStringTextList_",value:function(){for(var t=[this.parseLineStringText_()];this.match(me);)t.push(this.parseLineStringText_());return t}},{key:"parsePolygonTextList_",value:function(){for(var t=[this.parsePolygonText_()];this.match(me);)t.push(this.parsePolygonText_());return t}},{key:"isEmptyGeometry_",value:function(){var t=this.isTokenType(ge)&&this.token_.value==ve;return t&&this.consume_(),t}},{key:"formatErrorMessage_",value:function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}},{key:"parseGeometry_",value:function(){var t=this.factory,e=function(t){return a(j,v(t))},n=function(n){var r=n.map(function(n){return t.createLinearRing(n.map(e))});return r.length>1?t.createPolygon(r[0],r.slice(1)):t.createPolygon(r[0])},r=this.token_;if(this.match(ge)){var i=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==i){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(i){case"POINT":var s=this.parsePointText_();return s?t.createPoint(a(j,v(s))):t.createPoint();case"LINESTRING":var u=this.parseLineStringText_().map(e);return t.createLineString(u);case"LINEARRING":var l=this.parseLineStringText_().map(e);return t.createLinearRing(l);case"POLYGON":var h=this.parsePolygonText_();return h&&0!==h.length?n(h):t.createPolygon();case"MULTIPOINT":var c=this.parseMultiPointText_();if(!c||0===c.length)return t.createMultiPoint();var f=c.map(e).map(function(e){return t.createPoint(e)});return t.createMultiPoint(f);case"MULTILINESTRING":var g=this.parseMultiLineStringText_().map(function(n){return t.createLineString(n.map(e))});return t.createMultiLineString(g);case"MULTIPOLYGON":var d=this.parseMultiPolygonText_();if(!d||0===d.length)return t.createMultiPolygon();var p=d.map(n);return t.createMultiPolygon(p);default:throw new Error("Invalid geometry type: "+i)}}throw new Error(this.formatErrorMessage_())}}]),e}();function we(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")}function be(t){for(var e=t.getCoordinates().map(function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e}),n=[],r=0,i=e.length;r<i;++r)n.push(e[r].join(" "));return n.join(", ")}function Ie(t){var e=[];e.push("("+be(t.getExteriorRing())+")");for(var n=0,r=t.getNumInteriorRing();n<r;++n)e.push("("+be(t.getInteriorRingN(n))+")");return e.join(", ")}var Ne={Point:we,LineString:be,LinearRing:be,Polygon:Ie,MultiPoint:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+we(t.getGeometryN(n))+")");return e.join(", ")},MultiLineString:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+be(t.getGeometryN(n))+")");return e.join(", ")},MultiPolygon:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push("("+Ie(t.getGeometryN(n))+")");return e.join(", ")},GeometryCollection:function(t){for(var e=[],n=0,r=t.getNumGeometries();n<r;++n)e.push(Se(t.getGeometryN(n)));return e.join(", ")}};function Se(t){var e=t.getGeometryType(),n=Ne[e];e=e.toUpperCase();var r=function(t){var e="";if(t.isEmpty())return e;var n=t.getCoordinate();return void 0===n.z||Number.isNaN(n.z)||(e+="Z"),void 0===n.m||Number.isNaN(n.m)||(e+="M"),e}(t);return r.length>0&&(e+=" "+r),t.isEmpty()?e+" "+ve:e+" ("+n(t)+")"}var Me=function(){function e(n){t(this,e),this.geometryFactory=n||new ae,this.precisionModel=this.geometryFactory.getPrecisionModel()}return n(e,[{key:"read",value:function(t){var e=new Ee(t);return new ke(e,this.geometryFactory).parse()}},{key:"write",value:function(t){return Se(t)}}]),e}(),Le=function(){function e(n){t(this,e),this.parser=new Me(n)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}],[{key:"toLineString",value:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),e}(),Pe=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getIndexAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}},{key:"getTopologySummary",value:function(){var t=new Qt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}},{key:"computeIntersection",value: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)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value: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)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"isInteriorIntersection",value: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}}},{key:"getIntersection",value:function(t){return this._intPt[t]}},{key:"isEndPoint",value:function(){return this.hasIntersection()&&!this._isProper}},{key:"hasIntersection",value:function(){return this._result!==e.NO_INTERSECTION}},{key:"getEdgeDistance",value:function(t,n){return e.computeEdgeDistance(this._intPt[n],this._inputLines[t][0],this._inputLines[t][1])}},{key:"isCollinear",value:function(){return this._result===e.COLLINEAR_INTERSECTION}},{key:"toString",value:function(){return Le.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Le.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()}},{key:"getEndpoint",value:function(t,e){return this._inputLines[t][e]}},{key:"isIntersection",value:function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1}},{key:"getIntersectionAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]}}],[{key:"constructor_",value: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 j,this._intPt[1]=new j,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}},{key:"computeEdgeDistance",value: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 G.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o}},{key:"nonRobustComputeEdgeDistance",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return G.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o}}]),e}();Pe.DONT_INTERSECT=0,Pe.DO_INTERSECT=1,Pe.COLLINEAR=2,Pe.NO_INTERSECTION=0,Pe.POINT_INTERSECTION=1,Pe.COLLINEAR_INTERSECTION=2;var Ce=function(e){r(s,e);var o=c(s);function s(){return t(this,s),o.call(this)}return n(s,[{key:"isInSegmentEnvelopes",value:function(t){var e=new U(this._inputLines[0][0],this._inputLines[0][1]),n=new U(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}},{key:"computeIntersection",value:function(){if(3!==arguments.length)return f(i(s.prototype),"computeIntersection",this).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,U.intersects(e,n,t)&&0===ft.index(e,n,t)&&0===ft.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=Pe.POINT_INTERSECTION,null;this._result=Pe.NO_INTERSECTION}},{key:"intersection",value:function(t,e,n,r){var i=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(i)||(i=new j(s.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i}},{key:"checkDD",value:function(t,e,n,r,i){var o=ht.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);xt.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&xt.out.println("Distance = "+i.distance(o))}},{key:"intersectionSafe",value:function(t,e,n,r){var i=_t.intersection(t,e,n,r);return null===i&&(i=s.nearestEndpoint(t,e,n,r)),i}},{key:"computeCollinearIntersection",value:function(t,e,n,r){var i=U.intersects(t,e,n),o=U.intersects(t,e,r),s=U.intersects(n,r,t),a=U.intersects(n,r,e);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,Pe.COLLINEAR_INTERSECTION):s&&a?(this._intPt[0]=t,this._intPt[1]=e,Pe.COLLINEAR_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||a?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||s?Pe.COLLINEAR_INTERSECTION:Pe.POINT_INTERSECTION):Pe.NO_INTERSECTION}},{key:"computeIntersect",value:function(t,e,n,r){if(this._isProper=!1,!U.intersects(t,e,n,r))return Pe.NO_INTERSECTION;var i=ft.index(t,e,n),o=ft.index(t,e,r);if(i>0&&o>0||i<0&&o<0)return Pe.NO_INTERSECTION;var s=ft.index(n,r,t),a=ft.index(n,r,e);return s>0&&a>0||s<0&&a<0?Pe.NO_INTERSECTION:0===i&&0===o&&0===s&&0===a?this.computeCollinearIntersection(t,e,n,r):(0===i||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:0===i?this._intPt[0]=new j(n):0===o?this._intPt[0]=new j(r):0===s?this._intPt[0]=new j(t):0===a&&(this._intPt[0]=new j(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,r)),Pe.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(t,e,n,r){var i=t,o=kt.pointToSegment(t,n,r),s=kt.pointToSegment(e,n,r);return s<o&&(o=s,i=e),(s=kt.pointToSegment(n,t,e))<o&&(o=s,i=n),(s=kt.pointToSegment(r,t,e))<o&&(o=s,i=r),i}}]),s}(Pe),Te=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"countSegment",value: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=ft.index(t,e,this._p);if(i===ft.COLLINEAR)return this._isPointOnSegment=!0,null;e.y<t.y&&(i=-i),i===ft.LEFT&&this._crossingCount++}}},{key:"isPointInPolygon",value:function(){return this.getLocation()!==Z.EXTERIOR}},{key:"getLocation",value:function(){return this._isPointOnSegment?Z.BOUNDARY:this._crossingCount%2==1?Z.INTERIOR:Z.EXTERIOR}},{key:"isOnSegment",value:function(){return this._isPointOnSegment}}],[{key:"constructor_",value:function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}},{key:"locatePointInRing",value:function(){if(arguments[0]instanceof j&&ot(arguments[1],ct)){for(var t=arguments[1],n=new e(arguments[0]),r=new j,i=new j,o=1;o<t.size();o++)if(t.getCoordinate(o,r),t.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof j&&arguments[1]instanceof Array){for(var s=arguments[1],a=new e(arguments[0]),u=1;u<s.length;u++){var l=s[u],h=s[u-1];if(a.countSegment(l,h),a.isOnSegment())return a.getLocation()}return a.getLocation()}}}]),e}(),Oe=function(){function e(){t(this,e)}return n(e,null,[{key:"isOnLine",value:function(){if(arguments[0]instanceof j&&ot(arguments[1],ct)){for(var t=arguments[0],e=arguments[1],n=new Ce,r=new j,i=new j,o=e.size(),s=1;s<o;s++)if(e.getCoordinate(s-1,r),e.getCoordinate(s,i),n.computeIntersection(t,r,i),n.hasIntersection())return!0;return!1}if(arguments[0]instanceof j&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new Ce,h=1;h<u.length;h++){var c=u[h-1],f=u[h];if(l.computeIntersection(a,c,f),l.hasIntersection())return!0}return!1}}},{key:"locateInRing",value:function(t,e){return Te.locatePointInRing(t,e)}},{key:"isInRing",value:function(t,n){return e.locateInRing(t,n)!==Z.EXTERIOR}}]),e}(),Re=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setAllLocations",value:function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t}},{key:"isNull",value:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Z.NONE)return!1;return!0}},{key:"setAllLocationsIfNull",value:function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Z.NONE&&(this.location[e]=t)}},{key:"isLine",value:function(){return 1===this.location.length}},{key:"merge",value:function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[tt.ON]=this.location[tt.ON],e[tt.LEFT]=Z.NONE,e[tt.RIGHT]=Z.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===Z.NONE&&n<t.location.length&&(this.location[n]=t.location[n])}},{key:"getLocations",value:function(){return this.location}},{key:"flip",value:function(){if(this.location.length<=1)return null;var t=this.location[tt.LEFT];this.location[tt.LEFT]=this.location[tt.RIGHT],this.location[tt.RIGHT]=t}},{key:"toString",value:function(){var t=new st;return this.location.length>1&&t.append(Z.toLocationSymbol(this.location[tt.LEFT])),t.append(Z.toLocationSymbol(this.location[tt.ON])),this.location.length>1&&t.append(Z.toLocationSymbol(this.location[tt.RIGHT])),t.toString()}},{key:"setLocations",value:function(t,e,n){this.location[tt.ON]=t,this.location[tt.LEFT]=e,this.location[tt.RIGHT]=n}},{key:"get",value:function(t){return t<this.location.length?this.location[t]:Z.NONE}},{key:"isArea",value:function(){return this.location.length>1}},{key:"isAnyNull",value:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Z.NONE)return!0;return!1}},{key:"setLocation",value:function(){if(1===arguments.length){var t=arguments[0];this.setLocation(tt.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}}},{key:"init",value:function(t){this.location=new Array(t).fill(null),this.setAllLocations(Z.NONE)}},{key:"isEqualOnSide",value:function(t,e){return this.location[e]===t.location[e]}},{key:"allPositionsEqual",value:function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0}}],[{key:"constructor_",value:function(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[tt.ON]=n}else if(arguments[0]instanceof e){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[tt.ON]=o,this.location[tt.LEFT]=s,this.location[tt.RIGHT]=a}}}]),e}(),Ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getGeometryCount",value:function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t}},{key:"setAllLocations",value:function(t,e){this.elt[t].setAllLocations(e)}},{key:"isNull",value:function(t){return this.elt[t].isNull()}},{key:"setAllLocationsIfNull",value: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)}}},{key:"isLine",value:function(t){return this.elt[t].isLine()}},{key:"merge",value:function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])}},{key:"flip",value:function(){this.elt[0].flip(),this.elt[1].flip()}},{key:"getLocation",value:function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(tt.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}}},{key:"toString",value:function(){var t=new st;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()}},{key:"isArea",value: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()}}},{key:"isAnyNull",value:function(t){return this.elt[t].isAnyNull()}},{key:"setLocation",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(tt.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}}},{key:"isEqualOnSide",value:function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)}},{key:"allPositionsEqual",value:function(t,e){return this.elt[t].allPositionsEqual(e)}},{key:"toLine",value:function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))}}],[{key:"constructor_",value:function(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new Re(t),this.elt[1]=new Re(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(Z.NONE),this.elt[1]=new Re(Z.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 Re(o,s,a),this.elt[1]=new Re(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],h=arguments[2],c=arguments[3];this.elt[0]=new Re(Z.NONE,Z.NONE,Z.NONE),this.elt[1]=new Re(Z.NONE,Z.NONE,Z.NONE),this.elt[u].setLocations(l,h,c)}}},{key:"toLineLabel",value:function(t){for(var n=new e(Z.NONE),r=0;r<2;r++)n.setLocation(r,t.getLocation(r));return n}}]),e}(),De=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"computeRing",value: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=ft.isCCW(this._ring.getCoordinates())}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"computePoints",value:function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new gt("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new gt("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();G.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)}},{key:"getLinearRing",value:function(){return this._ring}},{key:"getCoordinate",value:function(t){return this._pts.get(t)}},{key:"computeMaxNodeDegree",value: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}},{key:"addPoints",value: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])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)}},{key:"containsPoint",value:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Oe.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0}},{key:"addHole",value:function(t){this._holes.add(t)}},{key:"isShell",value:function(){return null===this._shell}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value: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[1],n=arguments[0].getLocation(e,tt.RIGHT);if(n===Z.NONE)return null;if(this._label.getLocation(e)===Z.NONE)return this._label.setLocation(e,n),null}}},{key:"setShell",value:function(t){this._shell=t,null!==t&&t.addHole(this)}},{key:"toPolygon",value: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)}}],[{key:"constructor_",value:function(){if(this._startDe=null,this._maxNodeDegree=-1,this._edges=new pt,this._pts=new pt,this._label=new Ae(Z.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new pt,this._geometryFactory=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}}}]),e}(),Fe=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"setEdgeRing",value:function(t,e){t.setMinEdgeRing(e)}},{key:"getNext",value:function(t){return t.getNextMin()}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];De.constructor_.call(this,t,e)}}]),o}(De),qe=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"buildMinimalRings",value:function(){var t=new pt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Fe(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t}},{key:"setEdgeRing",value:function(t,e){t.setEdgeRing(e)}},{key:"linkDirectedEdgesForMinimalEdgeRings",value:function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)}},{key:"getNext",value:function(t){return t.getNext()}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];De.constructor_.call(this,t,e)}}]),o}(De),Ge=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setVisited",value:function(t){this._isVisited=t}},{key:"setInResult",value:function(t){this._isInResult=t}},{key:"isCovered",value:function(){return this._isCovered}},{key:"isCoveredSet",value:function(){return this._isCoveredSet}},{key:"setLabel",value:function(t){this._label=t}},{key:"getLabel",value:function(){return this._label}},{key:"setCovered",value:function(t){this._isCovered=t,this._isCoveredSet=!0}},{key:"updateIM",value:function(t){G.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value: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}}}]),e}(),Ye=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"isIncidentEdgeInResult",value:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(t){t.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(t){}},{key:"computeMergedLocation",value:function(t,e){var n=Z.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Z.BOUNDARY&&(n=r)}return n}},{key:"setLabel",value:function(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return f(i(s.prototype),"setLabel",this).apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new Ae(t,e):this._label.setLocation(t,e)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof s){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Ae)for(var e=arguments[0],n=0;n<2;n++){var r=this.computeMergedLocation(e,n);this._label.getLocation(n)===Z.NONE&&this._label.setLocation(n,r)}}},{key:"add",value:function(t){this._edges.insert(t),t.setNode(this)}},{key:"setLabelBoundary",value:function(t){if(null===this._label)return null;var e=Z.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Z.BOUNDARY:n=Z.INTERIOR;break;case Z.INTERIOR:default:n=Z.BOUNDARY}this._label.setLocation(t,n)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new Ae(0,Z.NONE)}}]),s}(Ge),Be=function(e){r(i,e);var n=c(i);function i(){return t(this,i),n.apply(this,arguments)}return i}(ne);function ze(t){return null==t?0:t.color}function je(t){return null==t?null:t.parent}function Xe(t,e){null!==t&&(t.color=e)}function Ue(t){return null==t?null:t.left}function Ve(t){return null==t?null:t.right}var Ze=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),(e=i.call(this)).root_=null,e.size_=0,e}return n(o,[{key:"get",value: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}},{key:"put",value:function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,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:0,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}},{key:"fixAfterInsertion",value:function(t){var e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)je(t)===Ue(je(je(t)))?1===ze(e=Ve(je(je(t))))?(Xe(je(t),0),Xe(e,0),Xe(je(je(t)),1),t=je(je(t))):(t===Ve(je(t))&&(t=je(t),this.rotateLeft(t)),Xe(je(t),0),Xe(je(je(t)),1),this.rotateRight(je(je(t)))):1===ze(e=Ue(je(je(t))))?(Xe(je(t),0),Xe(e,0),Xe(je(je(t)),1),t=je(je(t))):(t===Ue(je(t))&&(t=je(t),this.rotateRight(t)),Xe(je(t),0),Xe(je(je(t)),1),this.rotateLeft(je(je(t))));this.root_.color=0}},{key:"values",value:function(){var t=new pt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=o.successor(e));)t.add(e.value);return t}},{key:"entrySet",value:function(){var t=new Q,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=o.successor(e));)t.add(e);return t}},{key:"rotateLeft",value: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}}},{key:"rotateRight",value: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}}},{key:"getFirstEntry",value:function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value: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!0;e=e.right}}return!1}}],[{key:"successor",value:function(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}]),o}(Be),He=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"find",value:function(t){return this.nodeMap.get(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof j){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 Ye){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}}},{key:"print",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(t){for(var e=new pt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Z.BOUNDARY&&e.add(r)}return e}},{key:"add",value:function(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_",value:function(){this.nodeMap=new Ze,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),e}(),We=function(){function e(){t(this,e)}return n(e,null,[{key:"isNorthern",value:function(t){return t===e.NE||t===e.NW}},{key:"isOpposite",value:function(t,e){return t!==e&&2==(t-e+4)%4}},{key:"commonHalfPlane",value: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}},{key:"isInHalfPlane",value:function(t,n){return n===e.SE?t===e.SE||t===e.SW:t===n||t===n+1}},{key:"quadrant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new _("Cannot compute the quadrant for point ( "+t+", "+n+" )");return t>=0?n>=0?e.NE:e.SE:n>=0?e.NW:e.SW}if(arguments[0]instanceof j&&arguments[1]instanceof j){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new _("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?e.NE:e.SE:i.y>=r.y?e.NW:e.SW}}}]),e}();We.NE=0,We.NW=1,We.SW=2,We.SE=3;var Je=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareDirection",value:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:ft.index(t._p0,t._p1,this._p1)}},{key:"getDy",value:function(){return this._dy}},{key:"getCoordinate",value:function(){return this._p0}},{key:"setNode",value:function(t){this._node=t}},{key:"print",value: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)}},{key:"compareTo",value:function(t){var e=t;return this.compareDirection(e)}},{key:"getDirectedCoordinate",value:function(){return this._p1}},{key:"getDx",value:function(){return this._dx}},{key:"getLabel",value:function(){return this._label}},{key:"getEdge",value:function(){return this._edge}},{key:"getQuadrant",value:function(){return this._quadrant}},{key:"getNode",value:function(){return this._node}},{key:"toString",value: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}},{key:"computeLabel",value:function(t){}},{key:"init",value:function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=We.quadrant(this._dx,this._dy),G.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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 n=arguments[0],r=arguments[1],i=arguments[2];e.constructor_.call(this,n,r,i,null)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];e.constructor_.call(this,o),this.init(s,a),this._label=u}}}]),e}(),Ke=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getNextMin",value:function(){return this._nextMin}},{key:"getDepth",value:function(t){return this._depth[t]}},{key:"setVisited",value:function(t){this._isVisited=t}},{key:"computeDirectedLabel",value:function(){this._label=new Ae(this._edge.getLabel()),this._isForward||this._label.flip()}},{key:"getNext",value:function(){return this._next}},{key:"setDepth",value:function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new gt("assigned depths do not match",this.getCoordinate());this._depth[t]=e}},{key:"isInteriorAreaEdge",value:function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,tt.LEFT)===Z.INTERIOR&&this._label.getLocation(e,tt.RIGHT)===Z.INTERIOR||(t=!1);return t}},{key:"setNextMin",value:function(t){this._nextMin=t}},{key:"print",value:function(t){f(i(s.prototype),"print",this).call(this,t),t.print(" "+this._depth[tt.LEFT]+"/"+this._depth[tt.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")}},{key:"setMinEdgeRing",value:function(t){this._minEdgeRing=t}},{key:"isLineEdge",value:function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Z.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,Z.EXTERIOR);return t&&e&&n}},{key:"setEdgeRing",value:function(t){this._edgeRing=t}},{key:"getMinEdgeRing",value:function(){return this._minEdgeRing}},{key:"getDepthDelta",value:function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t}},{key:"setInResult",value:function(t){this._isInResult=t}},{key:"getSym",value:function(){return this._sym}},{key:"isForward",value:function(){return this._isForward}},{key:"getEdge",value:function(){return this._edge}},{key:"printEdge",value:function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)}},{key:"setSym",value:function(t){this._sym=t}},{key:"setVisitedEdge",value:function(t){this.setVisited(t),this._sym.setVisited(t)}},{key:"setEdgeDepths",value:function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===tt.LEFT&&(r=-1);var i=tt.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)}},{key:"getEdgeRing",value:function(){return this._edgeRing}},{key:"isInResult",value:function(){return this._isInResult}},{key:"setNext",value:function(t){this._next=t}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(Je.constructor_.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()}},{key:"depthFactor",value:function(t,e){return t===Z.EXTERIOR&&e===Z.INTERIOR?1:t===Z.INTERIOR&&e===Z.EXTERIOR?-1:0}}]),s}(Je),Qe=function(){function e(){t(this,e)}return n(e,[{key:"createNode",value:function(t){return new Ye(t,null)}}]),e}(),$e=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"printEdges",value: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)}}},{key:"find",value:function(t){return this._nodes.find(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof Ye){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof j){var e=arguments[0];return this._nodes.addNode(e)}}},{key:"getNodeIterator",value:function(){return this._nodes.iterator()}},{key:"linkResultDirectedEdges",value:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()}},{key:"debugPrintln",value:function(t){xt.out.println(t)}},{key:"isBoundaryNode",value:function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===Z.BOUNDARY}},{key:"linkAllDirectedEdges",value:function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()}},{key:"matchInSameDirection",value:function(t,e,n,r){return!!t.equals(n)&&ft.index(t,e,r)===ft.COLLINEAR&&We.quadrant(t,e)===We.quadrant(n,r)}},{key:"getEdgeEnds",value:function(){return this._edgeEndList}},{key:"debugPrint",value:function(t){xt.out.print(t)}},{key:"getEdgeIterator",value:function(){return this._edges.iterator()}},{key:"findEdgeInSameDirection",value: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}},{key:"insertEdge",value:function(t){this._edges.add(t)}},{key:"findEdgeEnd",value:function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null}},{key:"addEdges",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Ke(n,!0),i=new Ke(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}}},{key:"add",value:function(t){this._nodes.add(t),this._edgeEndList.add(t)}},{key:"getNodes",value:function(){return this._nodes.values()}},{key:"findEdge",value: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}}],[{key:"constructor_",value:function(){if(this._edges=new pt,this._nodes=null,this._edgeEndList=new pt,0===arguments.length)this._nodes=new He(new Qe);else if(1===arguments.length){var t=arguments[0];this._nodes=new He(t)}}},{key:"linkResultDirectedEdges",value:function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()}}]),e}(),tn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"sortShellsAndHoles",value:function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}}},{key:"computePolygons",value:function(t){for(var e=new pt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e}},{key:"placeFreeHoles",value:function(t,n){for(var r=n.iterator();r.hasNext();){var i=r.next();if(null===i.getShell()){var o=e.findEdgeRingContaining(i,t);if(null===o)throw new gt("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(o)}}}},{key:"buildMinimalEdgeRings",value:function(t,e,n){for(var r=new pt,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}},{key:"buildMaximalEdgeRings",value:function(t){for(var e=new pt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new qe(r,this._geometryFactory);e.add(i),i.setInResult()}}return e}},{key:"placePolygonHoles",value:function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return G.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value: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];$e.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new pt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new pt;var t=arguments[0];this._geometryFactory=t}},{key:"findEdgeRingContaining",value: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(),l=u.getLinearRing(),h=l.getEnvelopeInternal();if(!h.equals(r)&&h.contains(r)){i=Wt.ptNotInList(n.getCoordinates(),l.getCoordinates());var c=!1;Oe.isInRing(i,l.getCoordinates())&&(c=!0),c&&(null===o||s.contains(h))&&(s=(o=u).getLinearRing().getEnvelopeInternal())}}return o}}]),e}(),en=function(){function e(){t(this,e)}return n(e,[{key:"getBounds",value:function(){}}]),e}(),nn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[en,b]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}}]),e}(),rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"poll",value: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}},{key:"size",value:function(){return this._size}},{key:"reorder",value: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)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return 0===this._size}},{key:"add",value: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)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new pt,this._items.add(null)}}]),e}(),on=function(){function e(){t(this,e)}return n(e,[{key:"insert",value:function(t,e){}},{key:"remove",value:function(t,e){}},{key:"query",value:function(){}}]),e}(),sn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(t){G.isTrue(null===this._bounds),this._childBoundables.add(t)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[en,b]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new pt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}}]),e}(),an={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return an.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?At.sort(n,e):At.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},singletonList:function(t){var e=new pt;return e.add(t),e}},un=function(){function e(){t(this,e)}return n(e,null,[{key:"maxDistance",value:function(t,n,r,i,o,s,a,u){var l=e.distance(t,n,o,s);return l=Math.max(l,e.distance(t,n,a,u)),l=Math.max(l,e.distance(r,i,o,s)),Math.max(l,e.distance(r,i,a,u))}},{key:"distance",value:function(t,e,n,r){var i=n-t,o=r-e;return Math.sqrt(i*i+o*o)}},{key:"maximumDistance",value:function(t,n){var r=Math.min(t.getMinX(),n.getMinX()),i=Math.min(t.getMinY(),n.getMinY()),o=Math.max(t.getMaxX(),n.getMaxX()),s=Math.max(t.getMaxY(),n.getMaxY());return e.distance(r,i,o,s)}},{key:"minMaxDistance",value:function(t,n){var r=t.getMinX(),i=t.getMinY(),o=t.getMaxX(),s=t.getMaxY(),a=n.getMinX(),u=n.getMinY(),l=n.getMaxX(),h=n.getMaxY(),c=e.maxDistance(r,i,r,s,a,u,a,h);return c=Math.min(c,e.maxDistance(r,i,r,s,a,u,l,u)),c=Math.min(c,e.maxDistance(r,i,r,s,l,h,a,h)),c=Math.min(c,e.maxDistance(r,i,r,s,l,h,l,u)),c=Math.min(c,e.maxDistance(r,i,o,i,a,u,a,h)),c=Math.min(c,e.maxDistance(r,i,o,i,a,u,l,u)),c=Math.min(c,e.maxDistance(r,i,o,i,l,h,a,h)),c=Math.min(c,e.maxDistance(r,i,o,i,l,h,l,u)),c=Math.min(c,e.maxDistance(o,s,r,s,a,u,a,h)),c=Math.min(c,e.maxDistance(o,s,r,s,a,u,l,u)),c=Math.min(c,e.maxDistance(o,s,r,s,l,h,a,h)),c=Math.min(c,e.maxDistance(o,s,r,s,l,h,l,u)),c=Math.min(c,e.maxDistance(o,s,o,i,a,u,a,h)),c=Math.min(c,e.maxDistance(o,s,o,i,a,u,l,u)),c=Math.min(c,e.maxDistance(o,s,o,i,l,h,a,h)),Math.min(c,e.maxDistance(o,s,o,i,l,h,l,u))}}]),e}(),ln=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"maximumDistance",value:function(){return un.maximumDistance(this._boundable1.getBounds(),this._boundable2.getBounds())}},{key:"expandToQueue",value:function(t,n){var r=e.isComposite(this._boundable1),i=e.isComposite(this._boundable2);if(r&&i)return e.area(this._boundable1)>e.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,t,n),null):(this.expand(this._boundable2,this._boundable1,!0,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,!1,t,n),null;if(i)return this.expand(this._boundable2,this._boundable1,!0,t,n),null;throw new _("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(e.isComposite(this._boundable1)||e.isComposite(this._boundable2))}},{key:"compareTo",value:function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0}},{key:"expand",value:function(t,n,r,i,o){for(var s=t.getChildBoundables().iterator();s.hasNext();){var a=s.next(),u=null;(u=r?new e(n,a,this._itemDistance):new e(a,n,this._itemDistance)).getDistance()<o&&i.add(u)}}},{key:"getBoundable",value:function(t){return 0===t?this._boundable1:this._boundable2}},{key:"getDistance",value:function(){return this._distance}},{key:"distance",value:function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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()}},{key:"area",value:function(t){return t.getBounds().getArea()}},{key:"isComposite",value:function(t){return t instanceof sn}}]),e}(),hn=function(){function e(){t(this,e)}return n(e,[{key:"visitItem",value:function(t){}}]),e}(),cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"queryInternal",value:function(){if(ot(arguments[2],hn)&&arguments[0]instanceof Object&&arguments[1]instanceof sn)for(var t=arguments[0],e=arguments[2],n=arguments[1].getChildBoundables(),r=0;r<n.size();r++){var i=n.get(r);this.getIntersectsOp().intersects(i.getBounds(),t)&&(i instanceof sn?this.queryInternal(t,i,e):i instanceof nn?e.visitItem(i.getItem()):G.shouldNeverReachHere())}else if(ot(arguments[2],rt)&&arguments[0]instanceof Object&&arguments[1]instanceof sn)for(var o=arguments[0],s=arguments[2],a=arguments[1].getChildBoundables(),u=0;u<a.size();u++){var l=a.get(u);this.getIntersectsOp().intersects(l.getBounds(),o)&&(l instanceof sn?this.queryInternal(o,l,s):l instanceof nn?s.add(l.getItem()):G.shouldNeverReachHere())}}},{key:"getNodeCapacity",value:function(){return this._nodeCapacity}},{key:"lastNode",value:function(t){return t.get(t.size()-1)}},{key:"size",value: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 sn?t+=this.size(n):n instanceof nn&&(t+=1)}return t}}},{key:"removeItem",value:function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof nn&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)}},{key:"itemsTree",value:function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new pt:t}if(1===arguments.length){for(var e=arguments[0],n=new pt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof sn){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof nn?n.add(i.getItem()):G.shouldNeverReachHere()}return n.size()<=0?null:n}}},{key:"insert",value:function(t,e){G.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new nn(t,e))}},{key:"boundablesAtLevel",value:function(){if(1===arguments.length){var t=arguments[0],e=new pt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(G.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 sn?this.boundablesAtLevel(n,s,i):(G.isTrue(s instanceof nn),-1===n&&i.add(s))}return null}}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new pt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(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.queryInternal(n,this._root,r)}}},{key:"build",value: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}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value: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 sn&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}}},{key:"createHigherLevels",value:function(t,e){G.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}},{key:"depth",value: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 sn){var r=this.depth(n);r>t&&(t=r)}}return t+1}}},{key:"createParentBoundables",value:function(t,e){G.isTrue(!t.isEmpty());var n=new pt;n.add(this.createNode(e));var r=new pt(t);an.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}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[b]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new pt,this._nodeCapacity=null,0===arguments.length)e.constructor_.call(this,e.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];G.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}},{key:"compareDoubles",value:function(t,e){return t>e?1:t<e?-1:0}}]),e}();cn.IntersectsOp=function(){},cn.DEFAULT_NODE_CAPACITY=10;var fn=function(){function e(){t(this,e)}return n(e,[{key:"distance",value:function(t,e){}}]),e}(),vn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"createParentBoundablesFromVerticalSlices",value:function(t,e){G.isTrue(t.length>0);for(var n=new pt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n}},{key:"nearestNeighbourK",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.nearestNeighbourK(t,A.POSITIVE_INFINITY,e)}if(3===arguments.length){var n=arguments[0],r=arguments[2],i=arguments[1],o=new rn;o.add(n);for(var a=new rn;!o.isEmpty()&&i>=0;){var u=o.poll(),l=u.getDistance();if(l>=i)break;u.isLeaves()?a.size()<r?a.add(u):(a.peek().getDistance()>l&&(a.poll(),a.add(u)),i=a.peek().getDistance()):u.expandToQueue(o,i)}return s.getItems(a)}}},{key:"createNode",value:function(t){return new gn(t)}},{key:"size",value:function(){return 0===arguments.length?f(i(s.prototype),"size",this).call(this):f(i(s.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof U))return f(i(s.prototype),"insert",this).apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;f(i(s.prototype),"insert",this).call(this,t,e)}},{key:"getIntersectsOp",value:function(){return s.intersectsOp}},{key:"verticalSlices",value: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 pt;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];return f(i(s.prototype),"query",this).call(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];f(i(s.prototype),"query",this).call(this,e,n)}}},{key:"getComparator",value:function(){return s.yComparator}},{key:"createParentBoundablesFromVerticalSlice",value:function(t,e){return f(i(s.prototype),"createParentBoundables",this).call(this,t,e)}},{key:"remove",value:function(){if(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof U){var t=arguments[0],e=arguments[1];return f(i(s.prototype),"remove",this).call(this,t,e)}return f(i(s.prototype),"remove",this).apply(this,arguments)}},{key:"depth",value:function(){return 0===arguments.length?f(i(s.prototype),"depth",this).call(this):f(i(s.prototype),"depth",this).apply(this,arguments)}},{key:"createParentBoundables",value:function(t,e){G.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),r=new pt(t);an.sort(r,s.xComparator);var i=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(i,e)}},{key:"nearestNeighbour",value:function(){if(1===arguments.length){if(ot(arguments[0],fn)){var t=arguments[0];if(this.isEmpty())return null;var e=new ln(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof ln){var n=arguments[0],r=A.POSITIVE_INFINITY,i=null,o=new rn;for(o.add(n);!o.isEmpty()&&r>0;){var s=o.poll(),a=s.getDistance();if(a>=r)break;s.isLeaves()?(r=a,i=s):s.expandToQueue(o,r)}return null===i?null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var h=new ln(this.getRoot(),u.getRoot(),l);return this.nearestNeighbour(h)}if(3===arguments.length){var c=arguments[2],f=new nn(arguments[0],arguments[1]),v=new ln(this.getRoot(),f,c);return this.nearestNeighbour(v)[0]}if(4===arguments.length){var g=arguments[2],d=arguments[3],p=new nn(arguments[0],arguments[1]),y=new ln(this.getRoot(),p,g);return this.nearestNeighbourK(y,d)}}}},{key:"isWithinDistance",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=A.POSITIVE_INFINITY,r=new rn;for(r.add(t);!r.isEmpty();){var i=r.poll(),o=i.getDistance();if(o>e)return!1;if(i.maximumDistance()<=e)return!0;if(i.isLeaves()){if((n=o)<=e)return!0}else i.expandToQueue(r,n)}return!1}if(3===arguments.length){var s=arguments[0],a=arguments[1],u=arguments[2],l=new ln(this.getRoot(),s.getRoot(),a);return this.isWithinDistance(l,u)}}},{key:"interfaces_",get:function(){return[on,b]}}],[{key:"constructor_",value:function(){if(0===arguments.length)s.constructor_.call(this,s.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];cn.constructor_.call(this,t)}}},{key:"centreX",value:function(t){return s.avg(t.getMinX(),t.getMaxX())}},{key:"avg",value:function(t,e){return(t+e)/2}},{key:"getItems",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;!t.isEmpty();){var r=t.poll();e[n]=r.getBoundable(0).getItem(),n++}return e}},{key:"centreY",value:function(t){return s.avg(t.getMinY(),t.getMaxY())}}]),s}(cn),gn=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"computeBounds",value:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new U(n.getBounds()):t.expandToInclude(n.getBounds())}return t}}],[{key:"constructor_",value:function(){var t=arguments[0];sn.constructor_.call(this,t)}}]),o}(sn);vn.STRtreeNode=gn,vn.xComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[D]}},{key:"compare",value:function(t,e){return cn.compareDoubles(vn.centreX(t.getBounds()),vn.centreX(e.getBounds()))}}]),e}()),vn.yComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[D]}},{key:"compare",value:function(t,e){return cn.compareDoubles(vn.centreY(t.getBounds()),vn.centreY(e.getBounds()))}}]),e}()),vn.intersectsOp=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(t,e){return t.intersects(e)}}]),e}()),vn.DEFAULT_NODE_CAPACITY=10;var dn=function(){function e(){t(this,e)}return n(e,null,[{key:"relativeSign",value:function(t,e){return t<e?-1:t>e?1:0}},{key:"compare",value:function(t,n,r){if(n.equals2D(r))return 0;var i=e.relativeSign(n.x,r.x),o=e.relativeSign(n.y,r.y);switch(t){case 0:return e.compareValue(i,o);case 1:return e.compareValue(o,i);case 2:return e.compareValue(o,-i);case 3:return e.compareValue(-i,o);case 4:return e.compareValue(-i,-o);case 5:return e.compareValue(-o,-i);case 6:return e.compareValue(-o,i);case 7:return e.compareValue(i,-o)}return G.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}]),e}(),pn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?dn.compare(this._segmentOctant,this.coord,e.coord):1:-1}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value: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 j(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),e}(),yn=function(){function e(){t(this,e)}return n(e,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),e}(),mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSplitCoordinates",value:function(){var t=new Ht;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()}},{key:"addCollapsedNodes",value:function(){var t=new pt;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)}}},{key:"createSplitEdgePts",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new j(t.coord),new j(e.coord)];var 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 j(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new j(e.coord)),o}},{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"findCollapsesFromExistingVertices",value:function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e);this._edge.getCoordinate(e+1);var r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(at.valueOf(e+1))}}},{key:"addEdgeCoordinates",value:function(t,e,n){var r=this.createSplitEdgePts(t,e);n.add(r,!1)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value: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}}},{key:"findCollapseIndex",value: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)}},{key:"findCollapsesFromInsertedNodes",value: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(at.valueOf(e[0])),r=i}}},{key:"getEdge",value:function(){return this._edge}},{key:"addEndpoints",value:function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)}},{key:"createSplitEdge",value:function(t,e){var n=this.createSplitEdgePts(t,e);return new kn(n,this._edge.getData())}},{key:"add",value:function(t,e){var n=new pn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(G.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)}},{key:"checkSplitEdgesCorrectness",value:function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new F("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 F("bad split edge end point at "+i)}}],[{key:"constructor_",value:function(){this._nodeMap=new Ze,this._edge=null;var t=arguments[0];this._edge=t}}]),e}(),_n=function(){function e(){t(this,e)}return n(e,null,[{key:"octant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new _("Cannot compute the octant for point ( "+t+", "+n+" )");var r=Math.abs(t),i=Math.abs(n);return t>=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}if(arguments[0]instanceof j&&arguments[1]instanceof j){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(0===a&&0===u)throw new _("Cannot compute the octant for two identical points "+o);return e.octant(a,u)}}}]),e}(),xn=function(){function e(){t(this,e)}return n(e,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(t){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(t){}},{key:"getData",value:function(){}}]),e}(),En=function(){function e(){t(this,e)}return n(e,[{key:"addIntersection",value:function(t,e){}},{key:"interfaces_",get:function(){return[xn]}}]),e}(),kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(t){return this._pts[t]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}},{key:"setData",value:function(t){this._data=t}},{key:"safeOctant",value:function(t,e){return t.equals2D(e)?0:_n.octant(t,e)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new j(arguments[0].getIntersection(r));this.addIntersection(i,n)}}},{key:"toString",value:function(){return Le.toLineString(new $t(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value: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)}},{key:"addIntersections",value:function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)}},{key:"interfaces_",get:function(){return[En]}}],[{key:"constructor_",value:function(){this._nodeList=new mn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}},{key:"getNodedSubstrings",value:function(){if(1===arguments.length){var t=arguments[0],n=new pt;return e.getNodedSubstrings(t,n),n}if(2===arguments.length)for(var r=arguments[1],i=arguments[0].iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)}}]),e}(),wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"minX",value:function(){return Math.min(this.p0.x,this.p1.x)}},{key:"orientationIndex",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=ft.index(this.p0,this.p1,t.p0),r=ft.index(this.p0,this.p1,t.p1);return n>=0&&r>=0||n<=0&&r<=0?Math.max(n,r):0}if(arguments[0]instanceof j){var i=arguments[0];return ft.index(this.p0,this.p1,i)}}},{key:"toGeometry",value:function(t){return t.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)}},{key:"intersection",value:function(t){var e=new Ce;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof j){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new j(t);var n=this.projectionFactor(t),r=new j;return r.x=this.p0.x+n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof e){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1)return null;if(o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new e(a,u)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(t){return 0===t?this.p0:this.p1}},{key:"distancePerpendicular",value:function(t){return kt.pointToLinePerpendicular(t,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return e.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value: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?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r}},{key:"closestPoints",value:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=A.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}},{key:"closestPoint",value: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}},{key:"maxX",value:function(){return Math.max(this.p0.x,this.p1.x)}},{key:"getLength",value:function(){return this.p0.distance(this.p1)}},{key:"compareTo",value:function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)}},{key:"reverse",value:function(){var t=this.p0;this.p0=this.p1,this.p1=t}},{key:"equalsTopo",value:function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)}},{key:"lineIntersection",value:function(t){return _t.intersection(this.p0,this.p1,t.p0,t.p1)}},{key:"maxY",value:function(){return Math.max(this.p0.y,this.p1.y)}},{key:"pointAlongOffset",value: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 IllegalStateException("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new j(n-u,r+a)}},{key:"setCoordinates",value: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}}},{key:"segmentFraction",value:function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||A.isNaN(e))&&(e=1),e}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),r=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),i=e*e+n*n,o=e*e-n*n,s=t.getX(),a=t.getY();return new j((-o*s-2*e*n*a-2*e*r)/i,(o*a-2*e*n*s-2*n*r)/i)}},{key:"distance",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return kt.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof j){var n=arguments[0];return kt.pointToSegment(n,this.p0,this.p1)}}},{key:"pointAlong",value:function(t){var e=new j;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}},{key:"hashCode",value:function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=A.doubleToLongBits(this.p1.x);return n^=31*A.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)}},{key:"interfaces_",get:function(){return[k,b]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,0===arguments.length)e.constructor_.call(this,new j,new j);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.p0,t.p1)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.p0=n,this.p1=r}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];e.constructor_.call(this,new j(i,o),new j(s,a))}}},{key:"midPoint",value:function(t,e){return new j((t.x+e.x)/2,(t.y+e.y)/2)}}]),e}(),bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"overlap",value:function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new wn,this._overlapSeg2=new wn}}]),e}(),In=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLineSegment",value:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}},{key:"computeSelect",value:function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(n-e==1)return r.select(this,e),null;if(!t.intersects(i,o))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)}},{key:"getCoordinates",value: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}},{key:"computeOverlaps",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.computeOverlaps(this._start,this._end,t,t._start,t._end,e)}else if(6===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=arguments[5];if(r-n==1&&s-o==1)return a.overlap(this,n,i,o),null;if(!this.overlaps(n,r,i,o,s))return null;var u=Math.trunc((n+r)/2),l=Math.trunc((o+s)/2);n<u&&(o<l&&this.computeOverlaps(n,u,i,o,l,a),l<s&&this.computeOverlaps(n,u,i,l,s,a)),u<r&&(o<l&&this.computeOverlaps(u,r,i,o,l,a),l<s&&this.computeOverlaps(u,r,i,l,s,a))}}},{key:"setId",value:function(t){this._id=t}},{key:"select",value:function(t,e){this.computeSelect(t,this._start,this._end,e)}},{key:"getEnvelope",value:function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new U(t,e)}return this._env}},{key:"overlaps",value:function(t,e,n,r,i){return U.intersects(this._pts[t],this._pts[e],n._pts[r],n._pts[i])}},{key:"getEndIndex",value:function(){return this._end}},{key:"getStartIndex",value:function(){return this._start}},{key:"getContext",value:function(){return this._context}},{key:"getId",value:function(){return this._id}}],[{key:"constructor_",value: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}}]),e}(),Nn=function(){function e(){t(this,e)}return n(e,null,[{key:"findChainEnd",value: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=We.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||We.quadrant(t[i-1],t[i])===r);)i++;return i-1}},{key:"getChains",value:function(){if(1===arguments.length){var t=arguments[0];return e.getChains(t,null)}if(2===arguments.length){var n=arguments[0],r=arguments[1],i=new pt,o=0;do{var s=e.findChainEnd(n,o),a=new In(n,o,s,r);i.add(a),o=s}while(o<n.length-1);return i}}}]),e}(),Sn=function(){function e(){t(this,e)}return n(e,[{key:"computeNodes",value:function(t){}},{key:"getNodedSubstrings",value:function(){}}]),e}(),Mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setSegmentIntersector",value:function(t){this._segInt=t}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value:function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}}]),e}(),Ln=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getMonotoneChains",value:function(){return this._monoChains}},{key:"getNodedSubstrings",value:function(){return kn.getNodedSubstrings(this._nodedSegStrings)}},{key:"getIndex",value:function(){return this._index}},{key:"add",value:function(t){for(var e=Nn.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)}}},{key:"computeNodes",value:function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()}},{key:"intersectChains",value:function(){for(var t=new Pn(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}}}],[{key:"constructor_",value:function(){if(this._monoChains=new pt,this._index=new vn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];Mn.constructor_.call(this,t)}}}]),o}(Mn),Pn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"overlap",value:function(){if(4!==arguments.length)return f(i(s.prototype),"overlap",this).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),o=e.getContext();this._si.processIntersections(r,t,o,n)}}],[{key:"constructor_",value:function(){this._si=null;var t=arguments[0];this._si=t}}]),s}(bn);Ln.SegmentOverlapAction=Pn;var Cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isDeletable",value: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)}},{key:"deleteShallowConcavities",value:function(){for(var t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),i=!1;r<this._inputLine.length;){var o=!1;this.isDeletable(t,n,r,this._distanceTol)&&(this._isDeleted[n]=e.DELETE,o=!0,i=!0),t=o?r:n,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n)}return i}},{key:"isShallowConcavity",value:function(t,e,n,r){return ft.index(t,e,n)===this._angleOrientation&&kt.pointToSegment(e,t,n)<r}},{key:"isShallowSampled",value:function(t,n,r,i,o){var s=Math.trunc((i-r)/e.NUM_PTS_TO_CHECK);s<=0&&(s=1);for(var a=r;a<i;a+=s)if(!this.isShallow(t,n,this._inputLine[a],o))return!1;return!0}},{key:"isConcave",value:function(t,e,n){return ft.index(t,e,n)===this._angleOrientation}},{key:"simplify",value:function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=ft.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()}},{key:"findNextNonDeletedIndex",value:function(t){for(var n=t+1;n<this._inputLine.length&&this._isDeleted[n]===e.DELETE;)n++;return n}},{key:"isShallow",value:function(t,e,n,r){return kt.pointToSegment(e,t,n)<r}},{key:"collapseLine",value:function(){for(var t=new Ht,n=0;n<this._inputLine.length;n++)this._isDeleted[n]!==e.DELETE&&t.add(this._inputLine[n]);return t.toCoordinateArray()}}],[{key:"constructor_",value:function(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ft.COUNTERCLOCKWISE;var t=arguments[0];this._inputLine=t}},{key:"simplify",value:function(t,n){return new e(t).simplify(n)}}]),e}();Cn.INIT=0,Cn.DELETE=1,Cn.KEEP=1,Cn.NUM_PTS_TO_CHECK=10;var Tn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._ptList.toArray(e.COORDINATE_ARRAY_TYPE)}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"addPt",value:function(t){var e=new j(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)}},{key:"reverse",value:function(){}},{key:"addPts",value: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])}},{key:"isRedundant",value:function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance}},{key:"toString",value:function(){return(new ae).createLineString(this.getCoordinates()).toString()}},{key:"closeRing",value:function(){if(this._ptList.size()<1)return null;var t=new j(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)}},{key:"setMinimumVertexDistance",value:function(t){this._minimimVertexDistance=t}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new pt}}]),e}();Tn.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);var On=function(){function e(){t(this,e)}return n(e,null,[{key:"toDegrees",value:function(t){return 180*t/Math.PI}},{key:"normalize",value:function(t){for(;t>Math.PI;)t-=e.PI_TIMES_2;for(;t<=-Math.PI;)t+=e.PI_TIMES_2;return t}},{key:"angle",value: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)}}},{key:"isAcute",value: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}},{key:"isObtuse",value: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}},{key:"interiorAngle",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return Math.abs(o-i)}},{key:"normalizePositive",value:function(t){if(t<0){for(;t<0;)t+=e.PI_TIMES_2;t>=e.PI_TIMES_2&&(t=0)}else{for(;t>=e.PI_TIMES_2;)t-=e.PI_TIMES_2;t<0&&(t=0)}return t}},{key:"angleBetween",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return e.diff(i,o)}},{key:"diff",value:function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(t){return t*Math.PI/180}},{key:"getTurn",value:function(t,n){var r=Math.sin(n-t);return r>0?e.COUNTERCLOCKWISE:r<0?e.CLOCKWISE:e.NONE}},{key:"angleBetweenOriented",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r)-i;return o<=-Math.PI?o+e.PI_TIMES_2:o>Math.PI?o-e.PI_TIMES_2:o}}]),e}();On.PI_TIMES_2=2*Math.PI,On.PI_OVER_2=Math.PI/2,On.PI_OVER_4=Math.PI/4,On.COUNTERCLOCKWISE=ft.COUNTERCLOCKWISE,On.CLOCKWISE=ft.CLOCKWISE,On.NONE=ft.COLLINEAR;var Rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addNextSegment",value: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=ft.index(this._s0,this._s1,this._s2),r=n===ft.CLOCKWISE&&this._side===tt.LEFT||n===ft.COUNTERCLOCKWISE&&this._side===tt.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}},{key:"addLineEndCap",value:function(t,e){var n=new wn(t,e),r=new wn;this.computeOffsetSegment(n,tt.LEFT,this._distance,r);var i=new wn;this.computeOffsetSegment(n,tt.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 y.CAP_ROUND:this._segList.addPt(r.p1),this.addDirectedFillet(e,a+Math.PI/2,a-Math.PI/2,ft.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case y.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case y.CAP_SQUARE:var u=new j;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new j(r.p1.x+u.x,r.p1.y+u.y),h=new j(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(h)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(t,e,n,r){var i=_t.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==i&&(r<=0?1:i.distance(t)/Math.abs(r))<=this._bufParams.getMitreLimit())return this._segList.addPt(i),null;this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(t,n){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*e.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===y.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===y.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(n&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))}},{key:"createSquare",value:function(t){this._segList.addPt(new j(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new j(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new j(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new j(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()}},{key:"addSegments",value:function(t,e){this._segList.addPts(t,e)}},{key:"addFirstSegment",value:function(){this._segList.addPt(this._offset1.p0)}},{key:"addCornerFillet",value: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,l=n.y-t.y,h=Math.atan2(l,u);r===ft.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,a,h,r,i),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value: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)}},{key:"addLimitedMitreJoin",value: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),l=r*n,h=n-l*Math.abs(Math.sin(s)),c=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),v=new j(c,f),g=new wn(i,v),d=g.pointAlongOffset(1,h),p=g.pointAlongOffset(1,-h);this._side===tt.LEFT?(this._segList.addPt(d),this._segList.addPt(p)):(this._segList.addPt(p),this._segList.addPt(d))}},{key:"addDirectedFillet",value:function(t,e,n,r,i){var o=r===ft.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,l=new j,h=0;h<a;h++){var c=e+o*h*u;l.x=t.x+i*Math.cos(c),l.y=t.y+i*Math.sin(c),this._segList.addPt(l)}}},{key:"computeOffsetSegment",value:function(t,e,n,r){var i=e===tt.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,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u}},{key:"addInsideTurn",value:function(t,n){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*e.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new j((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(r);var i=new j((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(t){var e=new j(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}},{key:"init",value:function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Tn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*e.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===y.JOIN_BEVEL||this._bufParams.getJoinStyle()===y.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ft.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){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 wn,this._seg1=new wn,this._offset0=new wn,this._offset1=new wn,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new Ce,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===y.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}}]),e}();Rn.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Rn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Rn.MAX_CLOSING_SEG_LEN_FACTOR=80;var An=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getOffsetCurve",value: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}},{key:"computeSingleSidedBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],tt.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);e===tt.RIGHT&&(r=-r);var i=Cn.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()}},{key:"computeLineBufferCurve",value:function(t,e){var n=this.simplifyTolerance(this._distance),r=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],tt.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],tt.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()}},{key:"computePointCurve",value:function(t,e){switch(this._bufParams.getEndCapStyle()){case y.CAP_ROUND:e.createCircle(t);break;case y.CAP_SQUARE:e.createSquare(t)}}},{key:"getLineCurve",value:function(t,e){if(this._distance=e,this.isLineOffsetEmpty(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()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(t){return t*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return e.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,n,i),i.getCoordinates()}},{key:"computeOffsetCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],tt.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],tt.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(t){return new Rn(this._precisionModel,this._bufParams,t)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}},{key:"copyCoordinates",value:function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new j(t[n]);return e}}]),e}(),Dn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"findStabbedSegments",value:function(){if(1===arguments.length){for(var t=arguments[0],e=new pt,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(ot(arguments[2],rt)&&arguments[0]instanceof j&&arguments[1]instanceof Ke){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+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||ft.index(this._seg.p0,this._seg.p1,o)===ft.RIGHT)){var h=s.getDepth(tt.LEFT);this._seg.p0.equals(u[l])||(h=s.getDepth(tt.RIGHT));var c=new Fn(this._seg,h);a.add(c)}}else if(ot(arguments[2],rt)&&arguments[0]instanceof j&&ot(arguments[1],rt))for(var f=arguments[0],v=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(f,d,v)}}},{key:"getDepth",value:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:an.min(e)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new wn;var t=arguments[0];this._subgraphs=t}}]),e}(),Fn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value: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)}},{key:"compareX",value:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new wn(t),this._leftDepth=e}}]),e}();Dn.DepthSegment=Fn;var qn=function(e){r(o,e);var i=c(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){m.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),o}(m),Gn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getY",value:function(){var t=this.y/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new qn;return t}},{key:"getX",value:function(){var t=this.x/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new qn;return t}},{key:"getCoordinate",value:function(){var t=new j;return t.x=this.getX(),t.y=this.getY(),t}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){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 j&&arguments[1]instanceof j){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],l=arguments[1],h=arguments[2];this.x=u,this.y=l,this.w=h}else if(4===arguments.length){var c=arguments[0],f=arguments[1],v=arguments[2],g=arguments[3],d=c.y-f.y,p=f.x-c.x,y=c.x*f.y-f.x*c.y,m=v.y-g.y,_=g.x-v.x,x=v.x*g.y-g.x*v.y;this.x=p*x-_*y,this.y=m*y-d*x,this.w=d*_-m*p}}}]),e}(),Yn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"area",value:function(){return e.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return e.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(t){if(null===t)throw new _("Supplied point is null.");return e.interpolateZ(t,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return e.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return e.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return e.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return e.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return e.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return e.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}},{key:"area",value:function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)}},{key:"signedArea",value:function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2}},{key:"det",value:function(t,e,n,r){return t*r-e*n}},{key:"interpolateZ",value:function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,h=s*l-a*u,c=t.x-i,f=t.y-o,v=(l*c-a*f)/h,g=(-u*c+s*f)/h;return e.getZ()+v*(n.getZ()-e.getZ())+g*(r.getZ()-e.getZ())}},{key:"longestSideLength",value: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}},{key:"circumcentreDD",value:function(t,e,n){var r=lt.valueOf(t.x).subtract(n.x),i=lt.valueOf(t.y).subtract(n.y),o=lt.valueOf(e.x).subtract(n.x),s=lt.valueOf(e.y).subtract(n.y),a=lt.determinant(r,i,o,s).multiply(2),u=r.sqr().add(i.sqr()),l=o.sqr().add(s.sqr()),h=lt.determinant(i,u,s,l),c=lt.determinant(r,u,o,l),f=lt.valueOf(n.x).subtract(h.divide(a)).doubleValue(),v=lt.valueOf(n.y).add(c.divide(a)).doubleValue();return new j(f,v)}},{key:"isAcute",value:function(t,e,n){return!!On.isAcute(t,e,n)&&!!On.isAcute(e,n,t)&&!!On.isAcute(n,t,e)}},{key:"circumcentre",value:function(t,n,r){var i=r.x,o=r.y,s=t.x-i,a=t.y-o,u=n.x-i,l=n.y-o,h=2*e.det(s,a,u,l),c=e.det(a,s*s+a*a,l,u*u+l*l),f=e.det(s,s*s+a*a,u,u*u+l*l);return new j(i-c/h,o+f/h)}},{key:"perpendicularBisector",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Gn(t.x+n/2,t.y+r/2,1),o=new Gn(t.x-r+n/2,t.y+n+r/2,1);return new Gn(i,o)}},{key:"angleBisector",value: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 j(t.x+i*o,t.y+i*s)}},{key:"area3D",value:function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.getZ()-t.getZ(),s=n.x-t.x,a=n.y-t.y,u=n.getZ()-t.getZ(),l=i*u-o*a,h=o*s-r*u,c=r*a-i*s,f=l*l+h*h+c*c;return Math.sqrt(f)/2}},{key:"centroid",value:function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new j(r,i)}},{key:"inCentre",value: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 j(a,u)}}]),e}(),Bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addRingSide",value:function(t,e,n,r,i){if(0===e&&t.length<jt.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=jt.MINIMUM_VALID_SIZE&&ft.isCCW(t)&&(o=i,s=r,n=tt.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)}},{key:"addRingBothSides",value:function(t,e){this.addRingSide(t,e,tt.LEFT,Z.EXTERIOR,Z.INTERIOR),this.addRingSide(t,e,tt.RIGHT,Z.INTERIOR,Z.EXTERIOR)}},{key:"addPoint",value:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Z.EXTERIOR,Z.INTERIOR)}},{key:"addPolygon",value:function(t){var e=this._distance,n=tt.LEFT;this._distance<0&&(e=-this._distance,n=tt.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.addRingSide(i,e,n,Z.EXTERIOR,Z.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.addRingSide(a,e,tt.opposite(n),Z.INTERIOR,Z.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(t,e){var n=new Yn(t[0],t[1],t[2]),r=n.inCentre();return kt.pointToSegment(r,n.p0,n.p1)<Math.abs(e)}},{key:"addLineString",value:function(t){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;var e=Wt.removeRepeatedPoints(t.getCoordinates());if(Wt.isRing(e)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(e,this._distance);else{var n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Z.EXTERIOR,Z.INTERIOR)}}},{key:"addCurve",value:function(t,e,n){if(null===t||t.length<2)return null;var r=new kn(t,new Ae(0,Z.BOUNDARY,e,n));this._curveList.add(r)}},{key:"getCurves",value:function(){return this.add(this._inputGeom),this._curveList}},{key:"add",value:function(t){if(t.isEmpty())return null;if(t instanceof Ft)this.addPolygon(t);else if(t instanceof Ct)this.addLineString(t);else if(t instanceof Ot)this.addPoint(t);else if(t instanceof zt)this.addCollection(t);else if(t instanceof se)this.addCollection(t);else if(t instanceof ee)this.addCollection(t);else{if(!(t instanceof Bt))throw new J(t.getGeometryType());this.addCollection(t)}}},{key:"isErodedCompletely",value: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}},{key:"addCollection",value:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}}}],[{key:"constructor_",value:function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new pt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}}]),e}(),zn=function(){function e(){t(this,e)}return n(e,[{key:"locate",value:function(t){}}]),e}(),jn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"next",value:function(){if(this._atStart)return this._atStart=!1,e.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 W;var t=this._parent.getGeometryN(this._index++);return t instanceof Bt?(this._subcollectionIterator=new e(t),this._subcollectionIterator.next()):t}},{key:"remove",value:function(){throw new J(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[yn]}}],[{key:"constructor_",value: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()}},{key:"isAtomic",value:function(t){return!(t instanceof Bt)}}]),e}(),Xn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"locate",value:function(t){return e.locate(t,this._geom)}},{key:"interfaces_",get:function(){return[zn]}}],[{key:"constructor_",value:function(){this._geom=null;var t=arguments[0];this._geom=t}},{key:"locatePointInPolygon",value:function(t,n){if(n.isEmpty())return Z.EXTERIOR;var r=n.getExteriorRing(),i=e.locatePointInRing(t,r);if(i!==Z.INTERIOR)return i;for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o),a=e.locatePointInRing(t,s);if(a===Z.BOUNDARY)return Z.BOUNDARY;if(a===Z.INTERIOR)return Z.EXTERIOR}return Z.INTERIOR}},{key:"locatePointInRing",value:function(t,e){return e.getEnvelopeInternal().intersects(t)?Oe.locateInRing(t,e.getCoordinates()):Z.EXTERIOR}},{key:"containsPointInPolygon",value:function(t,n){return Z.EXTERIOR!==e.locatePointInPolygon(t,n)}},{key:"locateInGeometry",value:function(t,n){if(n instanceof Ft)return e.locatePointInPolygon(t,n);if(n instanceof Bt)for(var r=new jn(n);r.hasNext();){var i=r.next();if(i!==n){var o=e.locateInGeometry(t,i);if(o!==Z.EXTERIOR)return o}}return Z.EXTERIOR}},{key:"isContained",value:function(t,n){return Z.EXTERIOR!==e.locate(t,n)}},{key:"locate",value:function(t,n){return n.isEmpty()?Z.EXTERIOR:n.getEnvelopeInternal().intersects(t)?e.locateInGeometry(t,n):Z.EXTERIOR}}]),e}(),Un=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getNextCW",value: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)}},{key:"propagateSideLabels",value:function(t){for(var e=Z.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,tt.LEFT)!==Z.NONE&&(e=r.getLocation(t,tt.LEFT))}if(e===Z.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,tt.ON)===Z.NONE&&a.setLocation(t,tt.ON,i),a.isArea(t)){var u=a.getLocation(t,tt.LEFT),l=a.getLocation(t,tt.RIGHT);if(l!==Z.NONE){if(l!==i)throw new gt("side location conflict",s.getCoordinate());u===Z.NONE&&G.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else G.isTrue(a.getLocation(t,tt.LEFT)===Z.NONE,"found single null side"),a.setLocation(t,tt.RIGHT,i),a.setLocation(t,tt.LEFT,i)}}}},{key:"getCoordinate",value:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}},{key:"print",value:function(t){xt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"isAreaLabelsConsistent",value:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,tt.LEFT);G.isTrue(r!==Z.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();G.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,tt.LEFT),u=s.getLocation(t,tt.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0}},{key:"findIndex",value:function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1}},{key:"iterator",value:function(){return this.getEdges().iterator()}},{key:"getEdges",value:function(){return null===this._edgeList&&(this._edgeList=new pt(this._edgeMap.values())),this._edgeList}},{key:"getLocation",value:function(t,e,n){return this._ptInAreaLocation[t]===Z.NONE&&(this._ptInAreaLocation[t]=Xn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]}},{key:"toString",value:function(){var t=new st;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()}},{key:"computeEdgeEndLabels",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)}},{key:"computeLabelling",value: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)===Z.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 l=Z.NONE;if(e[u])l=Z.EXTERIOR;else{var h=s.getCoordinate();l=this.getLocation(u,h,t)}a.setAllLocationsIfNull(u,l)}}},{key:"getDegree",value:function(){return this._edgeMap.size()}},{key:"insertEdgeEnd",value:function(t,e){this._edgeMap.put(t,e),this._edgeList=null}}],[{key:"constructor_",value:function(){this._edgeMap=new Ze,this._edgeList=null,this._ptInAreaLocation=[Z.NONE,Z.NONE]}}]),e}(),Vn=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"linkResultDirectedEdges",value: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 gt("no outgoing dirEdge found",this.getCoordinate());G.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}}},{key:"insert",value:function(t){var e=t;this.insertEdgeEnd(e,e)}},{key:"getRightmostEdge",value: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 We.isNorthern(i)&&We.isNorthern(o)?n:We.isNorthern(i)||We.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(G.shouldNeverReachHere("found two horizontal edges incident on node"),null):r}},{key:"print",value:function(t){xt.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()}}},{key:"getResultAreaEdges",value:function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new pt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList}},{key:"updateLabelling",value: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))}}},{key:"linkAllDirectedEdges",value: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)}},{key:"computeDepths",value:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(tt.LEFT),r=t.getDepth(tt.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new gt("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(tt.RIGHT,s),s=u.getDepth(tt.LEFT)}return s}}},{key:"mergeSymLabels",value:function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}}},{key:"linkMinimalDirectedEdges",value: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&&(G.isTrue(null!==e,"found null for first outgoing dirEdge"),G.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))}},{key:"getOutgoingDegree",value: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}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var t=Z.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Z.INTERIOR;break}if(r.isInResult()){t=Z.EXTERIOR;break}}}if(t===Z.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===Z.INTERIOR):(s.isInResult()&&(i=Z.EXTERIOR),a.isInResult()&&(i=Z.INTERIOR))}}},{key:"computeLabelling",value:function(t){f(i(s.prototype),"computeLabelling",this).call(this,t),this._label=new Ae(Z.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),r=0;r<2;r++){var o=n.getLocation(r);o!==Z.INTERIOR&&o!==Z.BOUNDARY||this._label.setLocation(r,Z.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),s}(Un),Zn=function(e){r(o,e);var i=c(o);function o(){return t(this,o),i.call(this)}return n(o,[{key:"createNode",value:function(t){return new Ye(t,new Vn)}}]),o}(Qe),Hn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value:function(t){var n=t;return e.compareOriented(this._pts,this._orientation,n._pts,n._orientation)}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)}},{key:"orientation",value:function(t){return 1===Wt.increasingDirection(t)}},{key:"compareOriented",value: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,l=r?0:n.length-1;;){var h=t[u].compareTo(n[l]);if(0!==h)return h;var c=(u+=i)===s,f=(l+=o)===a;if(c&&!f)return-1;if(!c&&f)return 1;if(c&&f)return 0}}}]),e}(),Wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value: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(") ")}},{key:"addAll",value:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}},{key:"findEdgeIndex",value:function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1}},{key:"iterator",value:function(){return this._edges.iterator()}},{key:"getEdges",value:function(){return this._edges}},{key:"get",value:function(t){return this._edges.get(t)}},{key:"findEqualEdge",value:function(t){var e=new Hn(t.getCoordinates());return this._ocaMap.get(e)}},{key:"add",value:function(t){this._edges.add(t);var e=new Hn(t.getCoordinates());this._ocaMap.put(e,t)}}],[{key:"constructor_",value:function(){this._edges=new pt,this._ocaMap=new Ze}}]),e}(),Jn=function(){function e(){t(this,e)}return n(e,[{key:"processIntersections",value:function(t,e,n,r){}},{key:"isDone",value:function(){}}]),e}(),Kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isTrivialIntersection",value:function(t,n,r,i){if(t===r&&1===this._li.getIntersectionNum()){if(e.isAdjacentSegments(n,i))return!0;if(t.isClosed()){var o=t.size()-1;if(0===n&&i===o||0===i&&n===o)return!0}}return!1}},{key:"getProperIntersectionPoint",value:function(){return this._properIntersectionPoint}},{key:"hasProperInteriorIntersection",value:function(){return this._hasProperInterior}},{key:"getLineIntersector",value:function(){return this._li}},{key:"hasProperIntersection",value:function(){return this._hasProper}},{key:"processIntersections",value: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)))}},{key:"hasIntersection",value:function(){return this._hasIntersection}},{key:"isDone",value:function(){return!1}},{key:"hasInteriorIntersection",value:function(){return this._hasInterior}},{key:"interfaces_",get:function(){return[Jn]}}],[{key:"constructor_",value: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}},{key:"isAdjacentSegments",value:function(t,e){return 1===Math.abs(t-e)}}]),e}(),Qn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSegmentIndex",value:function(){return this.segmentIndex}},{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)}},{key:"compareTo",value:function(t){var e=t;return this.compare(e.segmentIndex,e.dist)}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t}},{key:"toString",value:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist}},{key:"getDistance",value:function(){return this.dist}},{key:"compare",value:function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0}},{key:"interfaces_",get:function(){return[k]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new j(t),this.segmentIndex=e,this.dist=n}}]),e}(),$n=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value: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}}},{key:"addEndpoints",value:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}},{key:"createSplitEdge",value: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 j(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 or(o,new Ae(this.edge._label))}},{key:"add",value:function(t,e,n){var r=new Qn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)}},{key:"isIntersection",value:function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new Ze,this.edge=null;var t=arguments[0];this.edge=t}}]),e}(),tr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"isCoveredBy",value:function(){return(e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])||e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}},{key:"set",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),r=e%3;this._matrix[n][r]=Mt.toDimensionValue(t.charAt(e))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._matrix[i][o]=s}}},{key:"isContains",value:function(){return e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"setAtLeast",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),r=e%3;this.setAtLeast(n,r,Mt.toDimensionValue(t.charAt(e)))}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._matrix[i][o]<s&&(this._matrix[i][o]=s)}}},{key:"setAtLeastIfValid",value:function(t,e,n){t>=0&&e>=0&&this.setAtLeast(t,e,n)}},{key:"isWithin",value:function(){return e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE}},{key:"isTouches",value:function(t,n){return t>n?this.isTouches(n,t):(t===Mt.A&&n===Mt.A||t===Mt.L&&n===Mt.L||t===Mt.L&&n===Mt.A||t===Mt.P&&n===Mt.A||t===Mt.P&&n===Mt.L)&&this._matrix[Z.INTERIOR][Z.INTERIOR]===Mt.FALSE&&(e.isTrue(this._matrix[Z.INTERIOR][Z.BOUNDARY])||e.isTrue(this._matrix[Z.BOUNDARY][Z.INTERIOR])||e.isTrue(this._matrix[Z.BOUNDARY][Z.BOUNDARY]))}},{key:"isOverlaps",value:function(t,n){return t===Mt.P&&n===Mt.P||t===Mt.A&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]):t===Mt.L&&n===Mt.L&&1===this._matrix[Z.INTERIOR][Z.INTERIOR]&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR])}},{key:"isEquals",value:function(t,n){return t===n&&e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&this._matrix[Z.INTERIOR][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.EXTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.EXTERIOR][Z.BOUNDARY]===Mt.FALSE}},{key:"toString",value:function(){for(var t=new Qt("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,Mt.toDimensionSymbol(this._matrix[e][n]));return t.toString()}},{key:"setAll",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t}},{key:"get",value:function(t,e){return this._matrix[t][e]}},{key:"transpose",value:function(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}},{key:"matches",value:function(t){if(9!==t.length)throw new _("Should be length 9: "+t);for(var n=0;n<3;n++)for(var r=0;r<3;r++)if(!e.matches(this._matrix[n][r],t.charAt(3*n+r)))return!1;return!0}},{key:"add",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))}},{key:"isDisjoint",value:function(){return this._matrix[Z.INTERIOR][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.INTERIOR][Z.BOUNDARY]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.INTERIOR]===Mt.FALSE&&this._matrix[Z.BOUNDARY][Z.BOUNDARY]===Mt.FALSE}},{key:"isCrosses",value:function(t,n){return t===Mt.P&&n===Mt.L||t===Mt.P&&n===Mt.A||t===Mt.L&&n===Mt.A?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.INTERIOR][Z.EXTERIOR]):t===Mt.L&&n===Mt.P||t===Mt.A&&n===Mt.P||t===Mt.A&&n===Mt.L?e.isTrue(this._matrix[Z.INTERIOR][Z.INTERIOR])&&e.isTrue(this._matrix[Z.EXTERIOR][Z.INTERIOR]):t===Mt.L&&n===Mt.L&&0===this._matrix[Z.INTERIOR][Z.INTERIOR]}},{key:"interfaces_",get:function(){return[w]}}],[{key:"constructor_",value:function(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(Mt.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];e.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof e){var n=arguments[0];e.constructor_.call(this),this._matrix[Z.INTERIOR][Z.INTERIOR]=n._matrix[Z.INTERIOR][Z.INTERIOR],this._matrix[Z.INTERIOR][Z.BOUNDARY]=n._matrix[Z.INTERIOR][Z.BOUNDARY],this._matrix[Z.INTERIOR][Z.EXTERIOR]=n._matrix[Z.INTERIOR][Z.EXTERIOR],this._matrix[Z.BOUNDARY][Z.INTERIOR]=n._matrix[Z.BOUNDARY][Z.INTERIOR],this._matrix[Z.BOUNDARY][Z.BOUNDARY]=n._matrix[Z.BOUNDARY][Z.BOUNDARY],this._matrix[Z.BOUNDARY][Z.EXTERIOR]=n._matrix[Z.BOUNDARY][Z.EXTERIOR],this._matrix[Z.EXTERIOR][Z.INTERIOR]=n._matrix[Z.EXTERIOR][Z.INTERIOR],this._matrix[Z.EXTERIOR][Z.BOUNDARY]=n._matrix[Z.EXTERIOR][Z.BOUNDARY],this._matrix[Z.EXTERIOR][Z.EXTERIOR]=n._matrix[Z.EXTERIOR][Z.EXTERIOR]}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],n=arguments[1];return n===Mt.SYM_DONTCARE||n===Mt.SYM_TRUE&&(t>=0||t===Mt.TRUE)||n===Mt.SYM_FALSE&&t===Mt.FALSE||n===Mt.SYM_P&&t===Mt.P||n===Mt.SYM_L&&t===Mt.L||n===Mt.SYM_A&&t===Mt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var r=arguments[1];return new e(arguments[0]).matches(r)}}},{key:"isTrue",value:function(t){return t>=0||t===Mt.TRUE}}]),e}(),er=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),xt.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}},{key:"ensureCapacity",value:function(t){if(t<=this._data.length)return null;var e=Math.max(t,2*this._data.length);this._data=At.copyOf(this._data,e)}},{key:"toArray",value:function(){var t=new Array(this._size).fill(null);return xt.arraycopy(this._data,0,t,0,this._size),t}},{key:"add",value:function(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,0===arguments.length)e.constructor_.call(this,10);else if(1===arguments.length){var t=arguments[0];this._data=new Array(t).fill(null)}}}]),e}(),nr=function(){function e(){t(this,e)}return n(e,[{key:"getChainStartIndices",value:function(t){var e=0,n=new er(Math.trunc(t.length/2));n.add(e);do{var r=this.findChainEnd(t,e);n.add(r),e=r}while(e<t.length-1);return n.toArray()}},{key:"findChainEnd",value:function(t,e){for(var n=We.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&We.quadrant(t[r-1],t[r])===n;)r++;return r-1}},{key:"OLDgetChainStartIndices",value:function(t){var n=0,r=new pt;r.add(n);do{var i=this.findChainEnd(t,n);r.add(i),n=i}while(n<t.length-1);return e.toIntArray(r)}}],[{key:"toIntArray",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e}}]),e}(),rr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this.pts}},{key:"getMaxX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n}},{key:"getMinX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n}},{key:"computeIntersectsForChain",value: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],l=arguments[5];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(!this.overlaps(i,o,s,a,u))return null;var h=Math.trunc((i+o)/2),c=Math.trunc((a+u)/2);i<h&&(a<c&&this.computeIntersectsForChain(i,h,s,a,c,l),c<u&&this.computeIntersectsForChain(i,h,s,c,u,l)),h<o&&(a<c&&this.computeIntersectsForChain(h,o,s,a,c,l),c<u&&this.computeIntersectsForChain(h,o,s,c,u,l))}}},{key:"overlaps",value:function(t,e,n,r,i){return U.intersects(this.pts[t],this.pts[e],n.pts[r],n.pts[i])}},{key:"getStartIndexes",value:function(){return this.startIndex}},{key:"computeIntersects",value: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)}}],[{key:"constructor_",value:function(){this.e=null,this.pts=null,this.startIndex=null;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new nr;this.startIndex=e.getChainStartIndices(this.pts)}}]),e}(),ir=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getDepth",value:function(t,e){return this._depth[t][e]}},{key:"setDepth",value:function(t,e,n){this._depth[t][e]=n}},{key:"isNull",value:function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var n=0;n<3;n++)if(this._depth[t][n]!==e.NULL_VALUE)return!1;return!0}if(1===arguments.length){var r=arguments[0];return this._depth[r][1]===e.NULL_VALUE}if(2===arguments.length){var i=arguments[0],o=arguments[1];return this._depth[i][o]===e.NULL_VALUE}}},{key:"normalize",value: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}}}},{key:"getDelta",value:function(t){return this._depth[t][tt.RIGHT]-this._depth[t][tt.LEFT]}},{key:"getLocation",value:function(t,e){return this._depth[t][e]<=0?Z.EXTERIOR:Z.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(1===arguments.length)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=t.getLocation(n,r);i!==Z.EXTERIOR&&i!==Z.INTERIOR||(this.isNull(n,r)?this._depth[n][r]=e.depthAtLocation(i):this._depth[n][r]+=e.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],s=arguments[1];arguments[2]===Z.INTERIOR&&this._depth[o][s]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var n=0;n<3;n++)this._depth[t][n]=e.NULL_VALUE}},{key:"depthAtLocation",value:function(t){return t===Z.EXTERIOR?0:t===Z.INTERIOR?1:e.NULL_VALUE}}]),e}();ir.NULL_VALUE=-1;var or=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new s(t,Ae.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(t){this._isIsolated=t}},{key:"setName",value:function(t){this._name=t}},{key:"equals",value:function(t){if(!(t instanceof s))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(e.pts[o])||(n=!1),this.pts[o].equals2D(e.pts[--i])||(r=!1),!n&&!r)return!1;return!0}},{key:"getCoordinate",value: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]}}},{key:"print",value: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)}},{key:"computeIM",value:function(t){s.updateIM(this._label,t)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}},{key:"getMonotoneChainEdge",value:function(){return null===this._mce&&(this._mce=new rr(this)),this._mce}},{key:"getEnvelope",value:function(){if(null===this._env){this._env=new U;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env}},{key:"addIntersection",value:function(t,e,n,r){var i=new j(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)}},{key:"toString",value:function(){var t=new Qt;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()}},{key:"isPointwiseEqual",value: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}},{key:"setDepthDelta",value:function(t){this._depthDelta=t}},{key:"getEdgeIntersectionList",value:function(){return this.eiList}},{key:"addIntersections",value:function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)}}],[{key:"constructor_",value:function(){if(this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ir,this._depthDelta=0,1===arguments.length){var t=arguments[0];s.constructor_.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this._label=n}}},{key:"updateIM",value:function(){if(!(2===arguments.length&&arguments[1]instanceof tr&&arguments[0]instanceof Ae))return f(i(s),"updateIM",this).apply(this,arguments);var t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,tt.ON),t.getLocation(1,tt.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,tt.LEFT),t.getLocation(1,tt.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,tt.RIGHT),t.getLocation(1,tt.RIGHT),2))}}]),s}(Ge),sr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"setWorkingPrecisionModel",value:function(t){this._workingPrecisionModel=t}},{key:"insertUniqueEdge",value:function(t){var n=this._edgeList.findEqualEdge(t);if(null!==n){var r=n.getLabel(),i=t.getLabel();n.isPointwiseEqual(t)||(i=new Ae(t.getLabel())).flip(),r.merge(i);var o=e.depthDelta(i),s=n.getDepthDelta()+o;n.setDepthDelta(s)}else this._edgeList.add(t),t.setDepthDelta(e.depthDelta(t.getLabel()))}},{key:"buildSubgraphs",value:function(t,e){for(var n=new pt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Dn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}}},{key:"createSubgraphs",value:function(t){for(var e=new pt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new mt;i.create(r),e.add(i)}}return an.sort(e,an.reverseOrder()),e}},{key:"createEmptyResultGeometry",value:function(){return this._geomFact.createPolygon()}},{key:"getNoder",value:function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new Ln,n=new Ce;return n.setPrecisionModel(t),e.setSegmentIntersector(new Kn(n)),e}},{key:"buffer",value:function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new An(n,this._bufParams),i=new Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new $e(new Zn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new tn(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)}},{key:"computeNodedEdges",value: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 or(i.getCoordinates(),new Ae(s));this.insertUniqueEdge(a)}}}},{key:"setNoder",value:function(t){this._workingNoder=t}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Wn;var t=arguments[0];this._bufParams=t}},{key:"depthDelta",value:function(t){var e=t.getLocation(0,tt.LEFT),n=t.getLocation(0,tt.RIGHT);return e===Z.INTERIOR&&n===Z.EXTERIOR?1:e===Z.EXTERIOR&&n===Z.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(t){for(var e=new ae,n=new pt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)}}]),e}(),ar=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"rescale",value:function(){if(ot(arguments[0],H))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])&&xt.out.println(n)}}},{key:"scale",value:function(){if(ot(arguments[0],H)){for(var t=arguments[0],e=new pt(t.size()),n=t.iterator();n.hasNext();){var r=n.next();e.add(new kn(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 j(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].getZ());return Wt.removeRepeatedPoints(o)}}},{key:"isIntegerPrecision",value:function(){return 1===this._scaleFactor}},{key:"getNodedSubstrings",value:function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t}},{key:"computeNodes",value:function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value:function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],n=arguments[1];e.constructor_.call(this,t,n,0,0)}else if(4===arguments.length){var r=arguments[0],i=arguments[1];this._noder=r,this._scaleFactor=i,this._isScaled=!this.isIntegerPrecision()}}}]),e}(),ur=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"checkEndPtVertexIntersections",value: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 F("found endpt/interior pt intersection at index "+o+" :pt "+n)}},{key:"checkInteriorIntersections",value: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 l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var h=arguments[0],c=arguments[1],f=arguments[2],v=arguments[3];if(h===f&&c===v)return null;var g=h.getCoordinates()[c],d=h.getCoordinates()[c+1],p=f.getCoordinates()[v],y=f.getCoordinates()[v+1];if(this._li.computeIntersection(g,d,p,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,p,y)))throw new F("found non-noded intersection at "+g+"-"+d+" and "+p+"-"+y)}}},{key:"checkValid",value:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}},{key:"checkCollapses",value: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])}},{key:"hasInteriorIntersection",value: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}},{key:"checkCollapse",value:function(t,n,r){if(t.equals(r))throw new F("found non-noded collapse at "+e.fact.createLineString([t,n,r]))}}],[{key:"constructor_",value:function(){this._li=new Ce,this._segStrings=null;var t=arguments[0];this._segStrings=t}}]),e}();ur.fact=new ae;var lr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"intersectsScaled",value: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 G.isTrue(!(s&&a),"Found bad envelope test"),a}},{key:"initCorners",value:function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new j(this._maxx,this._maxy),this._corner[1]=new j(this._minx,this._maxy),this._corner[2]=new j(this._minx,this._miny),this._corner[3]=new j(this._maxx,this._miny)}},{key:"intersects",value: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))}},{key:"scale",value:function(t){return Math.round(t*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}},{key:"getSafeEnvelope",value:function(){if(null===this._safeEnv){var t=e.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new U(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}},{key:"intersectsPixelClosure",value: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()))))}},{key:"intersectsToleranceSquare",value: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)))))}},{key:"addSnappedNode",value:function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_",value: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 _("Scale factor must be non-zero");1!==e&&(this._pt=new j(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new j,this._p1Scaled=new j),this.initCorners(this._pt)}}]),e}();lr.SAFE_ENV_EXPANSION_FACTOR=.75;var hr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"select",value:function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}],[{key:"constructor_",value:function(){this.selectedSegment=new wn}}]),e}(),cr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"snap",value:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=r.getSafeEnvelope(),a=new fr(r,i,o);return this._index.query(s,new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[hn]}},{key:"visitItem",value:function(t){t.select(s,a)}}]),e}())),a.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var t=arguments[0];this._index=t}}]),e}(),fr=function(e){r(s,e);var o=c(s);function s(){var e;return t(this,s),e=o.call(this),s.constructor_.apply(l(e),arguments),e}return n(s,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof In))return f(i(s.prototype),"select",this).apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}}]),s}(hr);cr.HotPixelSnapAction=fr;var vr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"processIntersections",value: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)}}},{key:"isDone",value:function(){return!1}},{key:"getInteriorIntersections",value:function(){return this._interiorIntersections}},{key:"interfaces_",get:function(){return[Jn]}}],[{key:"constructor_",value:function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new pt}}]),e}(),gr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"checkCorrectness",value:function(t){var e=kn.getNodedSubstrings(t),n=new ur(e);try{n.checkValid()}catch(t){if(!(t instanceof m))throw t;t.printStackTrace()}}},{key:"getNodedSubstrings",value:function(){return kn.getNodedSubstrings(this._nodedSegStrings)}},{key:"snapRound",value:function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)}},{key:"findInteriorIntersections",value:function(t,e){var n=new vr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()}},{key:"computeVertexSnaps",value:function(){if(ot(arguments[0],H))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof kn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new lr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}}},{key:"computeNodes",value:function(t){this._nodedSegStrings=t,this._noder=new Ln,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)}},{key:"computeIntersectionSnaps",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new lr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}}},{key:"interfaces_",get:function(){return[Sn]}}],[{key:"constructor_",value: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 Ce,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}}]),e}(),dr=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"bufferFixedPrecision",value:function(t){var e=new ar(new gr(new ie(1)),t.getScale()),n=new sr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)}},{key:"bufferReducedPrecision",value:function(){if(0===arguments.length){for(var t=e.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof gt))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=e.precisionScaleFactor(this._argGeom,this._distance,n),i=new ie(r);this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ie.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(t){this._bufParams.setQuadrantSegments(t)}},{key:"bufferOriginalPrecision",value:function(){try{var t=new sr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof F))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new y,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}}},{key:"bufferOp",value:function(){if(2===arguments.length){var t=arguments[1];return new e(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof V&&"number"==typeof arguments[1]){var n=arguments[1],r=arguments[2],i=new e(arguments[0]);return i.setQuadrantSegments(r),i.getResultGeometry(n)}if(arguments[2]instanceof y&&arguments[0]instanceof V&&"number"==typeof arguments[1]){var o=arguments[1];return new e(arguments[0],arguments[2]).getResultGeometry(o)}}else if(4===arguments.length){var s=arguments[1],a=arguments[2],u=arguments[3],l=new e(arguments[0]);return l.setQuadrantSegments(a),l.setEndCapStyle(u),l.getResultGeometry(s)}}},{key:"precisionScaleFactor",value:function(t,e,n){var r=t.getEnvelopeInternal(),i=Et.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)}}]),e}();dr.CAP_ROUND=y.CAP_ROUND,dr.CAP_BUTT=y.CAP_FLAT,dr.CAP_FLAT=y.CAP_FLAT,dr.CAP_SQUARE=y.CAP_SQUARE,dr.MAX_PRECISION_DIGITS=12;var pr=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],yr=function(){function e(n){t(this,e),this.geometryFactory=n||new ae}return n(e,[{key:"read",value:function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!mr[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==pr.indexOf(n)?mr[n].call(this,e.coordinates):"GeometryCollection"===n?mr[n].call(this,e.geometries):mr[n].call(this,e)}},{key:"write",value:function(t){var e=t.getGeometryType();if(!_r[e])throw new Error("Geometry is not supported");return _r[e].call(this,t)}}]),e}(),mr={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!mr[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=mr.bbox.call(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.call(this,t.bbox)),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(a(j,v(r)))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new j(t[0],t[1]),new j(t[2],t[1]),new j(t[2],t[3]),new j(t[0],t[3]),new j(t[0],t[1])])},Point:function(t){var e=a(j,v(t));return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(mr.Point.call(this,t[n]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=mr.coordinates.call(this,t);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(mr.LineString.call(this,t[n]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=mr.coordinates.call(this,t[0]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=mr.coordinates.call(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(mr.Polygon.call(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)}},_r={coordinate:function(t){var e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e},Point:function(t){return{type:"Point",coordinates:_r.coordinate.call(this,t.getCoordinate())}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=_r.Point.call(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(_r.coordinate.call(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=_r.LineString.call(this,r);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=_r.LineString.call(this,t._shell);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=_r.LineString.call(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=_r.Polygon.call(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(_r[i].call(this,r))}return{type:"GeometryCollection",geometries:e}}};return{BufferOp:dr,GeoJSONReader:function(){function e(n){t(this,e),this.parser=new yr(n||new ae)}return n(e,[{key:"read",value:function(t){return this.parser.read(t)}}]),e}(),GeoJSONWriter:function(){function e(){t(this,e),this.parser=new yr(this.geometryFactory)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}]),e}()}}()}(vr)),vr.exports),dr=Jn(gr),pr=function(){return s(function t(){i(this,t),this._partials=new Float64Array(32),this._n=0},[{key:"add",value:function(t){for(var e=this._partials,n=0,r=0;r<this._n&&r<32;r++){var i=e[r],o=t+i,s=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);s&&(e[n++]=s),t=o}return e[n]=t,this._n=n+1,this}},{key:"valueOf",value:function(){var t,e,n,r=this._partials,i=this._n,o=0;if(i>0){for(o=r[--i];i>0&&(t=o,!(n=(e=r[--i])-((o=t+e)-t))););i>0&&(n<0&&r[i-1]<0||n>0&&r[i-1]>0)&&(e=2*n)==(t=o+e)-o&&(o=t)}return o}}])}(),yr=g().m(mr);function mr(t){var e,n,r,i;return g().w(function(o){for(;;)switch(o.p=o.n){case 0:e=a(t),o.p=1,e.s();case 2:if((n=e.n()).done){o.n=4;break}return r=n.value,o.d(p(r),3);case 3:o.n=2;break;case 4:o.n=6;break;case 5:o.p=5,i=o.v,e.e(i);case 6:return o.p=6,e.f(),o.f(6);case 7:return o.a(2)}},yr,null,[[1,5,6,7]])}function _r(t){return Array.from(mr(t))}var xr=1e-6,Er=Math.PI,kr=Er/2,wr=Er/4,br=2*Er,Ir=180/Er,Nr=Er/180,Sr=Math.abs,Mr=Math.atan,Lr=Math.atan2,Pr=Math.cos,Cr=Math.sin,Tr=Math.sign||function(t){return t>0?1:t<0?-1:0},Or=Math.sqrt;function Rr(t){return t>1?0:t<-1?Er:Math.acos(t)}function Ar(t){return t>1?kr:t<-1?-kr:Math.asin(t)}function Dr(){}function Fr(t,e){t&&Gr.hasOwnProperty(t.type)&&Gr[t.type](t,e)}var qr={Feature:function(t,e){Fr(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Fr(n[r].geometry,e)}},Gr={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){Yr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Yr(n[r],e,0)},Polygon:function(t,e){Br(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Br(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Fr(n[r],e)}};function Yr(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 Br(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Yr(t[n],e,1);e.polygonEnd()}function zr(t){return[Lr(t[1],t[0]),Ar(t[2])]}function jr(t){var e=t[0],n=t[1],r=Pr(n);return[r*Pr(e),r*Cr(e),Cr(n)]}function Xr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ur(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 Vr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Zr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hr(t){var e=Or(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Wr(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 Jr(t,e){return[Sr(t)>Er?t+Math.round(-t/br)*br:t,e]}function Kr(t){return function(e,n){return[(e+=t)>Er?e-br:e<-Er?e+br:e,n]}}function Qr(t){var e=Kr(t);return e.invert=Kr(-t),e}function $r(t,e){var n=Pr(t),r=Cr(t),i=Pr(e),o=Cr(e);function s(t,e){var s=Pr(e),a=Pr(t)*s,u=Cr(t)*s,l=Cr(e),h=l*n+a*r;return[Lr(u*i-h*o,a*n-l*r),Ar(h*i+u*o)]}return s.invert=function(t,e){var s=Pr(e),a=Pr(t)*s,u=Cr(t)*s,l=Cr(e),h=l*i-u*o;return[Lr(u*i+l*o,a*n+h*r),Ar(h*n-a*r)]},s}function ti(t,e){(e=jr(e))[0]-=t,Hr(e);var n=Rr(-e[1]);return((-e[2]<0?-n:n)+br-xr)%br}function ei(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Dr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ni(t,e){return Sr(t[0]-e[0])<xr&&Sr(t[1]-e[1])<xr}function ri(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ii(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(ni(r,s)){if(!r[2]&&!s[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}s[0]+=2e-6}a.push(n=new ri(r,t,null,!0)),u.push(n.o=new ri(r,null,n,!1)),a.push(n=new ri(s,t,null,!1)),u.push(n.o=new ri(s,null,n,!0))}}),a.length){for(u.sort(e),oi(a),oi(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,h,c=a[0];;){for(var f=c,v=!0;f.v;)if((f=f.n)===c)return;l=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(v)for(o=0,s=l.length;o<s;++o)i.point((h=l[o])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(v)for(l=f.p.z,o=l.length-1;o>=0;--o)i.point((h=l[o])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,v=!v}while(!f.v);i.lineEnd()}}}function oi(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 si(t){return Sr(t[0])<=Er?t[0]:Tr(t[0])*((Sr(t[0])+Er)%br-Er)}function ai(t,e,n,r){return function(i){var o,s,a,u=e(i),l=ei(),h=e(l),c=!1,f={point:v,lineStart:d,lineEnd:p,polygonStart:function(){f.point=y,f.lineStart=m,f.lineEnd=_,s=[],o=[]},polygonEnd:function(){f.point=v,f.lineStart=d,f.lineEnd=p,s=_r(s);var t=function(t,e){var n=si(e),r=e[1],i=Cr(r),o=[Cr(n),-Pr(n),0],s=0,a=0,u=new pr;1===i?r=kr+xr:-1===i&&(r=-kr-xr);for(var l=0,h=t.length;l<h;++l)if(f=(c=t[l]).length)for(var c,f,v=c[f-1],g=si(v),d=v[1]/2+wr,p=Cr(d),y=Pr(d),m=0;m<f;++m,g=x,p=k,y=w,v=_){var _=c[m],x=si(_),E=_[1]/2+wr,k=Cr(E),w=Pr(E),b=x-g,I=b>=0?1:-1,N=I*b,S=N>Er,M=p*k;if(u.add(Lr(M*I*Cr(N),y*w+M*Pr(N))),s+=S?b+I*br:b,S^g>=n^x>=n){var L=Ur(jr(v),jr(_));Hr(L);var P=Ur(o,L);Hr(P);var C=(S^b>=0?-1:1)*Ar(P[2]);(r>C||r===C&&(L[0]||L[1]))&&(a+=S^b>=0?1:-1)}}return(s<-1e-6||s<xr&&u<-1e-12)^1&a}(o,r);s.length?(c||(i.polygonStart(),c=!0),ii(s,li,t,n,i)):t&&(c||(i.polygonStart(),c=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&(i.polygonEnd(),c=!1),s=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function v(e,n){t(e,n)&&i.point(e,n)}function g(t,e){u.point(t,e)}function d(){f.point=g,u.lineStart()}function p(){f.point=v,u.lineEnd()}function y(t,e){a.push([t,e]),h.point(t,e)}function m(){h.lineStart(),a=[]}function _(){y(a[0][0],a[0][1]),h.lineEnd();var t,e,n,r,u=h.clean(),f=l.result(),v=f.length;if(a.pop(),o.push(a),a=null,v)if(1&u){if((e=(n=f[0]).length-1)>0){for(c||(i.polygonStart(),c=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else v>1&&2&u&&f.push(f.pop().concat(f.shift())),s.push(f.filter(ui))}return f}}function ui(t){return t.length>1}function li(t,e){return((t=t.x)[0]<0?t[1]-kr-xr:kr-t[1])-((e=e.x)[0]<0?e[1]-kr-xr:kr-e[1])}Jr.invert=Jr;var hi=ai(function(){return!0},function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Er:-Er,u=Sr(o-n);Sr(u-Er)<xr?(t.point(n,r=(r+s)/2>0?kr:-kr),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Er&&(Sr(n-i)<xr&&(n-=i*xr),Sr(o-a)<xr&&(o-=a*xr),r=function(t,e,n,r){var i,o,s=Cr(t-n);return Sr(s)>xr?Mr((Cr(e)*(o=Pr(r))*Cr(n)-Cr(r)*(i=Pr(e))*Cr(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}},function(t,e,n,r){var i;if(null==t)i=n*kr,r.point(-Er,i),r.point(0,i),r.point(Er,i),r.point(Er,0),r.point(Er,-i),r.point(0,-i),r.point(-Er,-i),r.point(-Er,0),r.point(-Er,i);else if(Sr(t[0]-e[0])>xr){var o=t[0]<e[0]?Er:-Er;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])},[-Er,-kr]);function ci(t){var e=Pr(t),n=6*Nr,r=e>0,i=Sr(e)>xr;function o(t,n){return Pr(t)*Pr(n)>e}function s(t,n,r){var i=[1,0,0],o=Ur(jr(t),jr(n)),s=Xr(o,o),a=o[0],u=s-a*a;if(!u)return!r&&t;var l=e*s/u,h=-e*a/u,c=Ur(i,o),f=Zr(i,l);Vr(f,Zr(o,h));var v=c,g=Xr(f,v),d=Xr(v,v),p=g*g-d*(Xr(f,f)-1);if(!(p<0)){var y=Or(p),m=Zr(v,(-g-y)/d);if(Vr(m,f),m=zr(m),!r)return m;var _,x=t[0],E=n[0],k=t[1],w=n[1];E<x&&(_=x,x=E,E=_);var b=E-x,I=Sr(b-Er)<xr;if(!I&&w<k&&(_=k,k=w,w=_),I||b<xr?I?k+w>0^m[1]<(Sr(m[0]-x)<xr?k:w):k<=m[1]&&m[1]<=w:b>Er^(x<=m[0]&&m[0]<=E)){var N=Zr(v,(-g+y)/d);return Vr(N,f),[m,zr(N)]}}}function a(e,n){var i=r?t:Er-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return ai(o,function(t){var e,n,u,l,h;return{lineStart:function(){l=u=!1,h=1},point:function(c,f){var v,g=[c,f],d=o(c,f),p=r?d?0:a(c,f):d?a(c+(c<0?Er:-Er),f):0;if(!e&&(l=u=d)&&t.lineStart(),d!==u&&(!(v=s(e,g))||ni(e,v)||ni(g,v))&&(g[2]=1),d!==u)h=0,d?(t.lineStart(),v=s(g,e),t.point(v[0],v[1])):(v=s(e,g),t.point(v[0],v[1],2),t.lineEnd()),e=v;else if(i&&e&&r^d){var y;p&n||!(y=s(g,e,!0))||(h=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!d||e&&ni(e,g)||t.point(g[0],g[1]),e=g,u=d,n=p},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(l&&u)<<1}}},function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Pr(e),a=Cr(e),u=r*n;null==i?(i=e+r*br,o=e-u/2):(i=ti(s,i),o=ti(s,o),(r>0?i<o:i>o)&&(i+=r*br));for(var l,h=i;r>0?h>o:h<o;h-=u)l=zr([s,-a*Pr(h),-a*Cr(h)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)},r?[0,-t]:[-Er,t-Er])}var fi=1e9,vi=-fi;function gi(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var h=0,c=0;if(null==i||(h=s(i,a))!==(c=s(o,a))||u(i,o)<0^a>0)do{l.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==c);else l.point(o[0],o[1])}function s(r,i){return Sr(r[0]-t)<xr?i>0?0:3:Sr(r[0]-n)<xr?i>0?2:1:Sr(r[1]-e)<xr?i>0?1:0:i>0?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,l,h,c,f,v,g,d,p,y,m,_=s,x=ei(),E={point:k,lineStart:function(){E.point=w,l&&l.push(h=[]);y=!0,p=!1,g=d=NaN},lineEnd:function(){u&&(w(c,f),v&&p&&x.rejoin(),u.push(x.result()));E.point=k,p&&_.lineEnd()},polygonStart:function(){_=x,u=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,h=a.length,c=a[0],f=c[0],v=c[1];u<h;++u)o=f,s=v,f=(c=a[u])[0],v=c[1],s<=r?v>r&&(f-o)*(r-s)>(v-s)*(t-o)&&++e:v<=r&&(f-o)*(r-s)<(v-s)*(t-o)&&--e;return e}(),n=m&&e,i=(u=_r(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ii(u,a,e,o,s),s.polygonEnd());_=s,u=l=h=null}};function k(t,e){i(t,e)&&_.point(t,e)}function w(o,s){var a=i(o,s);if(l&&h.push([o,s]),y)c=o,f=s,v=a,y=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&p)_.point(o,s);else{var u=[g=Math.max(vi,Math.min(fi,g)),d=Math.max(vi,Math.min(fi,d))],x=[o=Math.max(vi,Math.min(fi,o)),s=Math.max(vi,Math.min(fi,s))];!function(t,e,n,r,i,o){var s,a=t[0],u=t[1],l=0,h=1,c=e[0]-a,f=e[1]-u;if(s=n-a,c||!(s>0)){if(s/=c,c<0){if(s<l)return;s<h&&(h=s)}else if(c>0){if(s>h)return;s>l&&(l=s)}if(s=i-a,c||!(s<0)){if(s/=c,c<0){if(s>h)return;s>l&&(l=s)}else if(c>0){if(s<l)return;s<h&&(h=s)}if(s=r-u,f||!(s>0)){if(s/=f,f<0){if(s<l)return;s<h&&(h=s)}else if(f>0){if(s>h)return;s>l&&(l=s)}if(s=o-u,f||!(s<0)){if(s/=f,f<0){if(s>h)return;s>l&&(l=s)}else if(f>0){if(s<l)return;s<h&&(h=s)}return l>0&&(t[0]=a+l*c,t[1]=u+l*f),h<1&&(e[0]=a+h*c,e[1]=u+h*f),!0}}}}}(u,x,t,e,n,r)?a&&(_.lineStart(),_.point(o,s),m=!1):(p||(_.lineStart(),_.point(u[0],u[1])),_.point(x[0],x[1]),a||_.lineEnd(),m=!1)}g=o,d=s,p=a}return E}}var di=function(t){return t},pi=1/0,yi=pi,mi=-pi,_i=mi,xi={point:function(t,e){t<pi&&(pi=t);t>mi&&(mi=t);e<yi&&(yi=e);e>_i&&(_i=e)},lineStart:Dr,lineEnd:Dr,polygonStart:Dr,polygonEnd:Dr,result:function(){var t=[[pi,yi],[mi,_i]];return mi=_i=-(yi=pi=1/0),t}};function Ei(t){return function(e){var n=new ki;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ki(){}function wi(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&qr.hasOwnProperty(t.type)?qr[t.type](t,e):Fr(t,e)}(n,t.stream(xi)),e(xi.result()),null!=r&&t.clipExtent(r),t}function bi(t,e,n){return wi(t,function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),s=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([s,a])},n)}ki.prototype={constructor:ki,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 Ii=Pr(30*Nr);function Ni(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,l,h,c,f,v,g,d,p){var y=l-r,m=h-i,_=y*y+m*m;if(_>4*e&&d--){var x=s+f,E=a+v,k=u+g,w=Or(x*x+E*E+k*k),b=Ar(k/=w),I=Sr(Sr(k)-1)<xr||Sr(o-c)<xr?(o+c)/2:Lr(E,x),N=t(I,b),S=N[0],M=N[1],L=S-r,P=M-i,C=m*L-y*P;(C*C/_>e||Sr((y*L+m*P)/_-.5)>.3||s*f+a*v+u*g<Ii)&&(n(r,i,o,s,a,u,S,M,I,x/=w,E/=w,k,d,p),p.point(S,M),n(S,M,I,x,E,k,l,h,c,f,v,g,d,p))}}return function(e){var r,i,o,s,a,u,l,h,c,f,v,g,d={point:p,lineStart:y,lineEnd:_,polygonStart:function(){e.polygonStart(),d.lineStart=x},polygonEnd:function(){e.polygonEnd(),d.lineStart=y}};function p(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){h=NaN,d.point=m,e.lineStart()}function m(r,i){var o=jr([r,i]),s=t(r,i);n(h,c,l,f,v,g,h=s[0],c=s[1],l=r,f=o[0],v=o[1],g=o[2],16,e),e.point(h,c)}function _(){d.point=p,e.lineEnd()}function x(){y(),d.point=E,d.lineEnd=k}function E(t,e){m(r=t,e),i=h,o=c,s=f,a=v,u=g,d.point=m}function k(){n(h,c,l,f,v,g,i,o,r,s,a,u,16,e),d.lineEnd=_,_()}return d}}(t,e):function(t){return Ei({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Si=Ei({point:function(t,e){this.stream.point(t*Nr,e*Nr)}});function Mi(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,s){return[e+t*(o*=r),n-t*(s*=i)]}return o.invert=function(o,s){return[(o-e)/t*r,(n-s)/t*i]},o}(t,e,n,r,i);var s=Pr(o),a=Cr(o),u=s*t,l=a*t,h=s/t,c=a/t,f=(a*n-s*e)/t,v=(a*e+s*n)/t;function g(t,o){return[u*(t*=r)-l*(o*=i)+e,n-l*t-u*o]}return g.invert=function(t,e){return[r*(h*t-c*e+f),i*(v-c*t-h*e)]},g}function Li(t){return function(t){var e,n,r,i,o,s,a,u,l,h,c=150,f=480,v=250,g=0,d=0,p=0,y=0,m=0,_=0,x=1,E=1,k=null,w=hi,b=null,I=di,N=.5;function S(t){return u(t[0]*Nr,t[1]*Nr)}function M(t){return(t=u.invert(t[0],t[1]))&&[t[0]*Ir,t[1]*Ir]}function L(){var t=Mi(c,0,0,x,E,_).apply(null,e(g,d)),r=Mi(c,f-t[0],v-t[1],x,E,_);return n=function(t,e,n){return(t%=br)?e||n?Wr(Qr(t),$r(e,n)):Qr(t):e||n?$r(e,n):Jr}(p,y,m),a=Wr(e,r),u=Wr(n,a),s=Ni(a,N),P()}function P(){return l=h=null,S}return S.stream=function(t){return l&&h===t?l:l=Si(function(t){return Ei({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(w(s(I(h=t)))))},S.preclip=function(t){return arguments.length?(w=t,k=void 0,P()):w},S.postclip=function(t){return arguments.length?(I=t,b=r=i=o=null,P()):I},S.clipAngle=function(t){return arguments.length?(w=+t?ci(k=t*Nr):(k=null,hi),P()):k*Ir},S.clipExtent=function(t){return arguments.length?(I=null==t?(b=r=i=o=null,di):gi(b=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==b?null:[[b,r],[i,o]]},S.scale=function(t){return arguments.length?(c=+t,L()):c},S.translate=function(t){return arguments.length?(f=+t[0],v=+t[1],L()):[f,v]},S.center=function(t){return arguments.length?(g=t[0]%360*Nr,d=t[1]%360*Nr,L()):[g*Ir,d*Ir]},S.rotate=function(t){return arguments.length?(p=t[0]%360*Nr,y=t[1]%360*Nr,m=t.length>2?t[2]%360*Nr:0,L()):[p*Ir,y*Ir,m*Ir]},S.angle=function(t){return arguments.length?(_=t%360*Nr,L()):_*Ir},S.reflectX=function(t){return arguments.length?(x=t?-1:1,L()):x<0},S.reflectY=function(t){return arguments.length?(E=t?-1:1,L()):E<0},S.precision=function(t){return arguments.length?(s=Ni(a,N=t*t),P()):Or(N)},S.fitExtent=function(t,e){return bi(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return bi(t,[[0,0],e],n)}(S,t,e)},S.fitWidth=function(t,e){return function(t,e,n){return wi(t,function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,s=-i*n[0][1];t.scale(150*i).translate([o,s])},n)}(S,t,e)},S.fitHeight=function(t,e){return function(t,e,n){return wi(t,function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],s=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,s])},n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,L()}}(function(){return t})()}var Pi=function(t){return function(e,n){var r=Pr(e),i=Pr(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Cr(e),o*Cr(n)]}}(function(t){return(t=Rr(t))&&t/Cr(t)});function Ci(){return Li(Pi).scale(79.4188).clipAngle(179.999)}Pi.invert=function(t){return function(e,n){var r=Or(e*e+n*n),i=t(r),o=Cr(i),s=Pr(i);return[Lr(e*o,r*s),Ar(r&&n*o/r)]}}(function(t){return t});var Ti=dr.BufferOp,Oi=dr.GeoJSONReader,Ri=dr.GeoJSONWriter;function Ai(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return kt(t,function(t){var i=Ai(t,e,n,r);i&&s.push(i)}),R(s)}var a=function(t){var e=cr(t).geometry.coordinates,n=[-e[0],-e[1]];return Ci().rotate(n).scale(w)}(o),u={type:o.type,coordinates:Fi(o.coordinates,a)},l=(new Oi).read(u),h=Y(B(e,n),"meters"),c=Ti.bufferOp(l,h,r);if(!Di((c=(new Ri).write(c)).coordinates))return N({type:c.type,coordinates:qi(c.coordinates,a)},i)}function Di(t){return Array.isArray(t[0])?Di(t[0]):isNaN(t[0])}function Fi(t,e){return"object"!==E(t[0])?e(t):t.map(function(t){return Fi(t,e)})}function qi(t,e){return"object"!==E(t[0])?e.invert(t):t.map(function(t){return qi(t,e)})}function Gi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return kt(t,function(t,o,s){var a=e.weight?null==s?void 0:s[e.weight]:void 0;if(!W(a=null==a?1:a))throw new Error("weight value must be a number for feature index "+o);(a=Number(a))>0&&dt(t,function(t){n+=t[0]*a,r+=t[1]*a,i+=a})}),M([n/i,r/i],e.properties,e)}function Yi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return dt(t,function(t){n+=t[0],r+=t[1],i++},!0),M([n/i,r/i],e.properties)}function Bi(t,e,n,r,i){var o=r.tolerance||.001,s=0,a=0,u=0,l=0;if(_t(n,function(e){var n,r=null==(n=e.properties)?void 0:n.weight,i=null==r?1:r;if(!W(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*ft(e,t);0===o&&(o=1);var h=i/o;s+=e.geometry.coordinates[0]*h,a+=e.geometry.coordinates[1]*h,u+=h}}),l<1)throw new Error("no features to measure");var h=s/u,c=a/u;return 1===l||0===i||Math.abs(h-e[0])<o&&Math.abs(c-e[1])<o?M([h,c],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([h,c]),Bi([h,c],t,n,r,i-1))}var zi,ji,Xi,Ui,Vi,Zi={exports:{}},Hi=Kn(de),Wi=Kn(we),Ji={exports:{}};function Ki(){if(Vi)return Ji.exports;Vi=1;var t=(ji||(ji=1,zi=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,u=0,l=a-1;u<a;l=u++){var h=e[n+2*u+0],c=e[n+2*u+1],f=e[n+2*l+0],v=e[n+2*l+1];c>o!=v>o&&i<(f-h)*(o-c)/(v-c)+h&&(s=!s)}return s}),zi),e=(Ui||(Ui=1,Xi=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,u=0,l=a-1;u<a;l=u++){var h=e[u+n][0],c=e[u+n][1],f=e[l+n][0],v=e[l+n][1];c>o!=v>o&&i<(f-h)*(o-c)/(v-c)+h&&(s=!s)}return s}),Xi);return Ji.exports=function(n,r,i,o){return r.length>0&&Array.isArray(r[0])?e(n,r,i,o):t(n,r,i,o)},Ji.exports.nested=e,Ji.exports.flat=t,Ji.exports}var Qi,$i,to={exports:{}};function eo(){return Qi||(Qi=1,function(t,e){!function(t){var e=134217729,n=33306690738754706e-32;function r(t,e,n,r,i){var o,s,a,u,l=e[0],h=r[0],c=0,f=0;h>l==h>-l?(o=l,l=e[++c]):(o=h,h=r[++f]);var v=0;if(c<t&&f<n)for(h>l==h>-l?(a=o-((s=l+o)-l),l=e[++c]):(a=o-((s=h+o)-h),h=r[++f]),o=s,0!==a&&(i[v++]=a);c<t&&f<n;)h>l==h>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c]):(a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f]),o=s,0!==a&&(i[v++]=a);for(;c<t;)a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++c],o=s,0!==a&&(i[v++]=a);for(;f<n;)a=o-((s=o+h)-(u=s-o))+(h-u),h=r[++f],o=s,0!==a&&(i[v++]=a);return 0===o&&0!==v||(i[v++]=o),v}function i(t){return new Float64Array(t)}var o=33306690738754716e-32,s=22204460492503146e-32,a=11093356479670487e-47,u=i(4),l=i(8),h=i(12),c=i(16),f=i(4);t.orient2d=function(t,i,v,g,d,p){var y=(i-p)*(v-d),m=(t-d)*(g-p),_=y-m;if(0===y||0===m||y>0!=m>0)return _;var x=Math.abs(y+m);return Math.abs(_)>=o*x?_:-function(t,i,o,v,g,d,p){var y,m,_,x,E,k,w,b,I,N,S,M,L,P,C,T,O,R,A=t-g,D=o-g,F=i-d,q=v-d;E=(C=(b=A-(w=(k=e*A)-(k-A)))*(N=q-(I=(k=e*q)-(k-q)))-((P=A*q)-w*I-b*I-w*N))-(S=C-(O=(b=F-(w=(k=e*F)-(k-F)))*(N=D-(I=(k=e*D)-(k-D)))-((T=F*D)-w*I-b*I-w*N))),u[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),u[1]=L-(S+E)+(E-T),E=(R=M+S)-M,u[2]=M-(R-E)+(S-E),u[3]=R;var G=function(t,e){for(var n=e[0],r=1;r<t;r++)n+=e[r];return n}(4,u),Y=s*p;if(G>=Y||-G>=Y)return G;if(y=t-(A+(E=t-A))+(E-g),_=o-(D+(E=o-D))+(E-g),m=i-(F+(E=i-F))+(E-d),x=v-(q+(E=v-q))+(E-d),0===y&&0===m&&0===_&&0===x)return G;if(Y=a*p+n*Math.abs(G),(G+=A*x+q*y-(F*_+D*m))>=Y||-G>=Y)return G;E=(C=(b=y-(w=(k=e*y)-(k-y)))*(N=q-(I=(k=e*q)-(k-q)))-((P=y*q)-w*I-b*I-w*N))-(S=C-(O=(b=m-(w=(k=e*m)-(k-m)))*(N=D-(I=(k=e*D)-(k-D)))-((T=m*D)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var B=r(4,u,4,f,l);E=(C=(b=A-(w=(k=e*A)-(k-A)))*(N=x-(I=(k=e*x)-(k-x)))-((P=A*x)-w*I-b*I-w*N))-(S=C-(O=(b=F-(w=(k=e*F)-(k-F)))*(N=_-(I=(k=e*_)-(k-_)))-((T=F*_)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var z=r(B,l,4,f,h);E=(C=(b=y-(w=(k=e*y)-(k-y)))*(N=x-(I=(k=e*x)-(k-x)))-((P=y*x)-w*I-b*I-w*N))-(S=C-(O=(b=m-(w=(k=e*m)-(k-m)))*(N=_-(I=(k=e*_)-(k-_)))-((T=m*_)-w*I-b*I-w*N))),f[0]=C-(S+E)+(E-O),E=(L=P-((M=P+S)-(E=M-P))+(S-E))-(S=L-T),f[1]=L-(S+E)+(E-T),E=(R=M+S)-M,f[2]=M-(R-E)+(S-E),f[3]=R;var j=r(z,h,4,f,c);return c[j-1]}(t,i,v,g,d,p,x)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,to.exports)),to.exports}var no=function(){if($i)return Zi.exports;$i=1;var t=Hi,e=Wi,n=Ki(),r=eo().orient2d;function i(e,r,i){r=Math.max(0,void 0===r?2:r),i=i||0;var s=function(t){for(var e=t[0],r=t[0],i=t[0],o=t[0],s=0;s<t.length;s++){var a=t[s];a[0]<e[0]&&(e=a),a[0]>i[0]&&(i=a),a[1]<r[1]&&(r=a),a[1]>o[1]&&(o=a)}var u=[e,r,i,o],l=u.slice();for(s=0;s<t.length;s++)n(t[s],u)||l.push(t[s]);return function(t){t.sort(y);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&h(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&h(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(e),a=new t(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(e);for(var u,l=[],c=0;c<s.length;c++){var d=s[c];a.remove(d),u=v(d,u),l.push(u)}var p=new t(16);for(c=0;c<l.length;c++)p.insert(f(l[c]));for(var m=r*r,_=i*i;l.length;){var x=l.shift(),E=x.p,k=x.next.p,w=g(E,k);if(!(w<_)){var b=w/m;(d=o(a,x.prev.p,E,k,x.next.next.p,b,p))&&Math.min(g(d,E),g(d,k))<=b&&(l.push(x),l.push(v(d,x)),a.remove(d),p.remove(x),p.insert(f(x)),p.insert(f(x.next)))}}x=u;var I=[];do{I.push(x.p),x=x.next}while(x!==u);return I.push(x.p),I}function o(t,n,r,i,o,u,h){for(var c=new e([],s),f=t.data;f;){for(var v=0;v<f.children.length;v++){var g=f.children[v],p=f.leaf?d(g,r,i):a(r,i,g);p>u||c.push({node:g,dist:p})}for(;c.length&&!c.peek().node.children;){var y=c.pop(),m=y.node,_=d(m,n,r),x=d(m,i,o);if(y.dist<_&&y.dist<x&&l(r,m,h)&&l(i,m,h))return m}(f=c.pop())&&(f=f.node)}return null}function s(t,e){return t.dist-e.dist}function a(t,e,n){if(u(t,n)||u(e,n))return 0;var r=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=p(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=p(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=p(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function u(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function l(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u<a.length;u++)if(c(a[u].p,a[u].next.p,t,e))return!1;return!0}function h(t,e,n){return r(t[0],t[1],e[0],e[1],n[0],n[1])}function c(t,e,n,r){return t!==r&&e!==n&&h(t,e,n)>0!=h(t,e,r)>0&&h(n,r,t)>0!=h(n,r,e)>0}function f(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function v(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function g(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function p(t,e,n,r,i,o,s,a){var u,l,h,c,f=n-t,v=r-e,g=s-i,d=a-o,p=t-i,y=e-o,m=f*f+v*v,_=f*g+v*d,x=g*g+d*d,E=f*p+v*y,k=g*p+d*y,w=m*x-_*_,b=w,I=w;0===w?(l=0,b=1,c=k,I=x):(c=m*k-_*E,(l=_*k-x*E)<0?(l=0,c=k,I=x):l>b&&(l=b,c=k+_,I=x)),c<0?(c=0,-E<0?l=0:-E>m?l=b:(l=-E,b=m)):c>I&&(c=I,-E+_<0?l=0:-E+_>m?l=b:(l=-E+_,b=m));var N=(1-(h=0===c?0:c/I))*i+h*s-((1-(u=0===l?0:l/b))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return N*N+S*S}function y(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}return e.default&&(e=e.default),Zi.exports=i,Zi.exports.default=i,Zi.exports}(),ro=Jn(no);function io(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.concavity=e.concavity||1/0;var n=[];if(dt(t,function(t){n.push([t[0],t[1]])}),!n.length)return null;var r=ro(n,e.concavity);return r.length>3?P([r],e.properties):null}function oo(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s=0;s<r;s++)o.push(ct(t,e,-360*s/r,n).geometry.coordinates);return o.push(o[0]),P([o],i)}function so(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return ao(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach(function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}}),e.features=t.features.map(function(t){return ao(t)}),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return lo(t);default:throw new Error("unknown GeoJSON type")}}function ao(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=uo(t.properties),null==t.geometry?e.geometry=null:e.geometry=lo(t.geometry),e}function uo(t){var e={};return t?(Object.keys(t).forEach(function(n){var r=t[n];"object"===E(r)?null===r?e[n]=null:Array.isArray(r)?e[n]=r.map(function(t){return t}):e[n]=uo(r):e[n]=r}),e):e}function lo(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map(function(t){return lo(t)}),e):(e.coordinates=ho(t.coordinates),e)}function ho(t){var e=t;return"object"!==E(e[0])?e.slice():e.map(function(t){return ho(t)})}function co(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("filter is required");var n=[];return _t(t,function(t){po(t.properties,e)&&n.push(t)}),R(n)}function fo(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("property is required");for(var r=go(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],l=0;l<a.length;l++)u.push(t.features[a[l]]);n(R(u),s,o)}}function vo(t,e,n,r){var i=r;return fo(t,e,function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)}),i}function go(t,e){var n={};return _t(t,function(t,r){var i=t.properties||{};if(Object.prototype.hasOwnProperty.call(i,String(e))){var o=i[e];Object.prototype.hasOwnProperty.call(n,o)?n[o].push(r):n[o]=[r]}}),n}function po(t,e){if(void 0===t)return!1;var n=E(e);if("number"===n||"string"===n)return Object.prototype.hasOwnProperty.call(t,e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!po(t,e[r]))return!1;return!0}return yo(t,e)}function yo(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function mo(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}var _o,xo,Eo,ko,wo,bo,Io=Object.freeze({__proto__:null,applyFilter:po,clusterEach:fo,clusterReduce:vo,createBins:go,filterProperties:mo,getCluster:co,propertiesContainsFilter:yo});function No(){return xo||(xo=1,_o={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i},mandist:function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++)i+=Math.abs((t[o]||0)-(e[o]||0));return n?Math.sqrt(i):i},dist:function(t,e,n){var r=Math.abs(t-e);return n?r:r*r}}),_o}var So=function(){if(bo)return wo;bo=1;var t=No(),e=function(){if(ko)return Eo;ko=1;var t=No(),e=t.eudist,n=t.dist;return Eo={kmrand:function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},kmpp:function(t,r){var i=t[0].length?e:n,o=[],s=t.length,a=t[0].length>0,u=t[Math.floor(Math.random()*s)];for(a&&u.join("_"),o.push(u);o.length<r;){for(var l=[],h=o.length,c=0,f=[],v=0;v<s;v++){for(var g=1/0,d=0;d<h;d++){var p=i(t[v],o[d]);p<=g&&(g=p)}l[v]=g}for(var y=0;y<s;y++)c+=l[y];for(var m=0;m<s;m++)f[m]={i:m,v:t[m],pr:l[m]/c,cs:0};f.sort(function(t,e){return t.pr-e.pr}),f[0].cs=f[0].pr;for(var _=1;_<s;_++)f[_].cs=f[_-1].cs+f[_].pr;for(var x=Math.random(),E=0;E<s-1&&f[E++].cs<x;);o.push(f[E-1].v)}return o}},Eo}(),n=t.eudist;t.mandist,t.dist;var r=e.kmrand,i=e.kmpp;function o(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}return wo=function(t,e,s,a){var u=[],l=[],h=[],c=[],f=!1,v=a||1e4,g=t.length,d=t[0].length,p=d>0,y=[];if(s)u="kmrand"==s?r(t,e):"kmpp"==s?i(t,e):s;else for(var m={};u.length<e;){var _=Math.floor(Math.random()*g);m[_]||(m[_]=!0,u.push(t[_]))}do{o(e,0,y);for(var x=0;x<g;x++){for(var E=1/0,k=0,w=0;w<e;w++){(c=p?n(t[x],u[w]):Math.abs(t[x]-u[w]))<=E&&(E=c,k=w)}h[x]=k,y[k]++}for(var b=[],I=(l=[],0);I<e;I++)b[I]=p?o(d,0,b[I]):0,l[I]=u[I];if(p){for(var N=0;N<e;N++)u[N]=[];for(var S=0;S<g;S++)for(var M=b[h[S]],L=t[S],P=0;P<d;P++)M[P]+=L[P];f=!0;for(var C=0;C<e;C++){for(var T=u[C],O=b[C],R=l[C],A=y[C],D=0;D<d;D++)T[D]=O[D]/A||0;if(f)for(var F=0;F<d;F++)if(R[F]!=T[F]){f=!1;break}}}else{for(var q=0;q<g;q++){b[h[q]]+=t[q]}for(var G=0;G<e;G++)u[G]=b[G]/y[G]||0;f=!0;for(var Y=0;Y<e;Y++)if(l[Y]!=u[Y]){f=!1;break}}f=f||--v<=0}while(!f);return{it:1e4-v,k:e,idxs:h,centroids:u}},wo}(),Mo=Jn(So);function Lo(t,e){var n=!1;return R(function(t){if(t.length<3)return[];t.sort(Co);var e,n,r,i,o,s,a=t.length-1,u=t[a].x,l=t[0].x,h=t[a].y,c=h,f=1e-12;for(;a--;)t[a].y<h&&(h=t[a].y),t[a].y>c&&(c=t[a].y);var v,g=l-u,d=c-h,p=g>d?g:d,y=.5*(l+u),m=.5*(c+h),_=[new Po({__sentinel:!0,x:y-20*p,y:m-p},{__sentinel:!0,x:y,y:m+20*p},{__sentinel:!0,x:y+20*p,y:m-p})],x=[],E=[];a=t.length;for(;a--;){for(E.length=0,v=_.length;v--;)(g=t[a].x-_[v].x)>0&&g*g>_[v].r?(x.push(_[v]),_.splice(v,1)):g*g+(d=t[a].y-_[v].y)*d>_[v].r||(E.push(_[v].a,_[v].b,_[v].b,_[v].c,_[v].c,_[v].a),_.splice(v,1));for(To(E),v=E.length;v;)n=E[--v],e=E[--v],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>f&&_.push(new Po(e,n,r))}Array.prototype.push.apply(x,_),a=x.length;for(;a--;)(x[a].a.__sentinel||x[a].b.__sentinel||x[a].c.__sentinel)&&x.splice(a,1);return x}(t.features.map(function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r})).map(function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},P([[e,r,i,e]],o)}))}var Po=s(function t(e,n,r){i(this,t),this.a=e,this.b=n,this.c=r;var o,s,a=n.x-e.x,u=n.y-e.y,l=r.x-e.x,h=r.y-e.y,c=a*(e.x+n.x)+u*(e.y+n.y),f=l*(e.x+r.x)+h*(e.y+r.y),v=2*(a*(r.y-n.y)-u*(r.x-n.x));this.x=(h*c-u*f)/v,this.y=(a*f-l*c)/v,o=this.x-e.x,s=this.y-e.y,this.r=o*o+s*s});function Co(t,e){return e.x-t.x}function To(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function Oo(t){return t}function Ro(t,e){var n=function(t){if(null==t)return Oo;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,l=t.length,h=new Array(l);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u<l;)h[u]=t[u],++u;return h}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,s=i.length;o<s;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,s)}function o(t){return n(t)}function s(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function a(t){for(var e=s(t);e.length<4;)e.push(e[0]);return e}function u(t){return t.map(a)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=s(e.arcs);break;case"MultiLineString":n=e.arcs.map(s);break;case"Polygon":n=u(e.arcs);break;case"MultiPolygon":n=e.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(e)}function Ao(t,e){var n={},r={},i={},o=[],s=-1;function a(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}return e.forEach(function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++s],e[s]=n,e[r]=i)}),e.forEach(function(e){var n,o,s=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),a=s[0],u=s[1];if(n=i[a])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=a,o=i[a]){delete i[o.end];var h=o===n?n:o.concat(n);r[h.start=o.start]=i[h.end=n.end]=h}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=a]=i[n.end=u]=n}),a(i,r),a(r,i),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o}function Do(t){return Ro(t,Fo.apply(this,arguments))}function Fo(t,e){var n={},r=[],i=[];function o(t){t.forEach(function(e){e.forEach(function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)})}),r.push(t)}function s(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(Ro(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}}),r.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,i.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),r.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:i.map(function(e){var r,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].length<2&&i.push(t)})})}),(r=(i=Ao(t,i)).length)>1)for(var o,a,u=1,l=s(i[0]);u<r;++u)(o=s(i[u]))>l&&(a=i[0],i[0]=i[u],i[u]=a,l=o);return i}).filter(function(t){return t.length>0})}}var qo=Object.prototype.hasOwnProperty;function Go(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,l=0;l<t;++l)s[l]=i;return{set:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l]=o;if(++c>=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o},maybeSet:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)throw new Error("full hashmap");h=s[l=l+1&u]}return s[l]=r,a[l]=o,o},get:function(r,o){for(var l=e(r)&u,h=s[l],c=0;h!=i;){if(n(h,r))return a[l];if(++c>=t)break;h=s[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var r=s[e];r!=i&&t.push(r)}return t}}}function Yo(t,e){return t[0]===e[0]&&t[1]===e[1]}var Bo=new ArrayBuffer(16),zo=new Float64Array(Bo),jo=new Uint32Array(Bo);function Xo(t){zo[0]=t[0],zo[1]=t[1];var e=jo[0]^jo[1];return 2147483647&(e=e<<5^e>>7^jo[2]^jo[3])}function Uo(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=function(){for(var t=Go(1.4*o.length,E,k,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n<r;++n)e[n]=t.maybeSet(n,n);return e}(),l=new Int32Array(o.length),h=new Int32Array(o.length),c=new Int32Array(o.length),f=new Int8Array(o.length),v=0;for(e=0,n=o.length;e<n;++e)l[e]=h[e]=c[e]=-1;for(e=0,n=s.length;e<n;++e){var g=s[e],d=g[0],p=g[1];for(r=u[d],i=u[++d],++v,f[r]=1;++d<=p;)x(e,r,r=i,i=u[d]);++v,f[i]=1}for(e=0,n=o.length;e<n;++e)l[e]=-1;for(e=0,n=a.length;e<n;++e){var y=a[e],m=y[0]+1,_=y[1];for(x(e,u[_-1],r=u[m-1],i=u[m]);++m<=_;)x(e,r,r=i,i=u[m])}function x(t,e,n,r){if(l[n]!==t){l[n]=t;var i=h[n];if(i>=0){var o=c[n];i===e&&o===r||i===r&&o===e||(++v,f[n]=1)}else h[n]=e,c[n]=r}}function E(t){return Xo(o[t])}function k(t,e){return Yo(o[t],o[e])}l=h=c=null;var w,b=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=i;return{add:function(r){for(var a=e(r)&s,u=o[a],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*v,Xo,Yo);for(e=0,n=o.length;e<n;++e)f[w=u[e]]&&b.add(o[w]);return b}function Vo(t,e,n,r){Zo(t,e,n),Zo(t,e,e+r),Zo(t,e+r,n)}function Zo(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function Ho(t){return null==t?{type:null}:("FeatureCollection"===t.type?Wo:"Feature"===t.type?Jo:Ko)(t)}function Wo(t){var e={type:"GeometryCollection",geometries:t.features.map(Jo)};return null!=t.bbox&&(e.bbox=t.bbox),e}function Jo(t){var e,n=Ko(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function Ko(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(Ko)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function Qo(t,e){var n=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;function o(t){null!=t&&qo.call(s,t.type)&&s[t.type](t)}var s={GeometryCollection:function(t){t.geometries.forEach(o)},Point:function(t){a(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(a)},LineString:function(t){u(t.arcs)},MultiLineString:function(t){t.arcs.forEach(u)},Polygon:function(t){t.arcs.forEach(u)},MultiPolygon:function(t){t.arcs.forEach(l)}};function a(t){var o=t[0],s=t[1];o<e&&(e=o),o>r&&(r=o),s<n&&(n=s),s>i&&(i=s)}function u(t){t.forEach(a)}function l(t){t.forEach(u)}for(var h in t)o(t[h]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Ho(t[e]);return n}(t)),r=function(t){var e,n,r,i,o=t.coordinates,s=t.lines,a=t.rings,u=s.length+a.length;for(delete t.lines,delete t.rings,r=0,i=s.length;r<i;++r)for(e=s[r];e=e.next;)++u;for(r=0,i=a.length;r<i;++r)for(n=a[r];n=n.next;)++u;var l=Go(2*u*1.4,Xo,Yo),h=t.arcs=[];for(r=0,i=s.length;r<i;++r){e=s[r];do{c(e)}while(e=e.next)}for(r=0,i=a.length;r<i;++r)if((n=a[r]).next)do{c(n)}while(n=n.next);else f(n);function c(t){var e,n,r,i,s,a,u,c;if(r=l.get(e=o[t[0]]))for(u=0,c=r.length;u<c;++u)if(v(i=r[u],t))return t[0]=i[0],void(t[1]=i[1]);if(s=l.get(n=o[t[1]]))for(u=0,c=s.length;u<c;++u)if(g(a=s[u],t))return t[1]=a[0],void(t[0]=a[1]);r?r.push(t):l.set(e,[t]),s?s.push(t):l.set(n,[t]),h.push(t)}function f(t){var e,n,r,i,s;if(n=l.get(o[t[0]]))for(i=0,s=n.length;i<s;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(p(r,t))return t[0]=r[1],void(t[1]=r[0])}if(n=l.get(e=o[t[0]+y(t)]))for(i=0,s=n.length;i<s;++i){if(d(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(p(r,t))return t[0]=r[1],void(t[1]=r[0])}n?n.push(t):l.set(e,[t]),h.push(t)}function v(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!==r-e[1])return!1;for(;n<=i;++n,++r)if(!Yo(o[n],o[r]))return!1;return!0}function g(t,e){var n=t[0],r=e[0],i=t[1],s=e[1];if(n-i!==r-s)return!1;for(;n<=i;++n,--s)if(!Yo(o[n],o[s]))return!1;return!0}function d(t,e){var n=t[0],r=e[0],i=t[1]-n;if(i!==e[1]-r)return!1;for(var s=y(t),a=y(e),u=0;u<i;++u)if(!Yo(o[n+(u+s)%i],o[r+(u+a)%i]))return!1;return!0}function p(t,e){var n=t[0],r=e[0],i=t[1],s=e[1],a=i-n;if(a!==s-r)return!1;for(var u=y(t),l=a-y(e),h=0;h<a;++h)if(!Yo(o[n+(h+u)%a],o[s-(h+l)%a]))return!1;return!0}function y(t){for(var e=t[0],n=t[1],r=e,i=r,s=o[r];++r<n;){var a=o[r];(a[0]<s[0]||a[0]===s[0]&&a[1]<s[1])&&(i=r,s=a)}return i-e}return t}(function(t){var e,n,r,i=Uo(t),o=t.coordinates,s=t.lines,a=t.rings;for(n=0,r=s.length;n<r;++n)for(var u=s[n],l=u[0],h=u[1];++l<h;)i.has(o[l])&&(e={0:l,1:u[1]},u[1]=l,u=u.next=e);for(n=0,r=a.length;n<r;++n)for(var c=a[n],f=c[0],v=f,g=c[1],d=i.has(o[f]);++v<g;)i.has(o[v])&&(d?(e={0:v,1:c[1]},c[1]=v,c=c.next=e):(Vo(o,f,g,g-v),o[g]=o[f],d=!0,v=f));return t}(function(t){var e=-1,n=[],r=[],i=[];function o(t){t&&qo.call(s,t.type)&&s[t.type](t)}var s={GeometryCollection:function(t){t.geometries.forEach(o)},LineString:function(t){t.arcs=a(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(a)},Polygon:function(t){t.arcs=t.arcs.map(u)},MultiPolygon:function(t){t.arcs=t.arcs.map(l)}};function a(t){for(var r=0,o=t.length;r<o;++r)i[++e]=t[r];var s={0:e-o+1,1:e};return n.push(s),s}function u(t){for(var n=0,o=t.length;n<o;++n)i[++e]=t[n];var s={0:e-o+1,1:e};return r.push(s),s}function l(t){return t.map(u)}for(var h in t)o(t[h]);return{type:"Topology",coordinates:i,lines:n,rings:r,objects:t}}(t))),i=r.coordinates,o=Go(1.4*r.arcs.length,$o,ts);function s(t){t&&qo.call(a,t.type)&&a[t.type](t)}t=r.objects,r.bbox=n,r.arcs=r.arcs.map(function(t,e){return o.set(t,e),i.slice(t[0],t[1]+1)}),delete r.coordinates,i=null;var a={GeometryCollection:function(t){t.geometries.forEach(s)},LineString:function(t){t.arcs=u(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(u)},Polygon:function(t){t.arcs=t.arcs.map(u)},MultiPolygon:function(t){t.arcs=t.arcs.map(l)}};function u(t){var e=[];do{var n=o.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function l(t){return t.map(u)}for(var h in t)s(t[h]);return r}function $o(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function ts(t,e){var n,r=t[0],i=t[1],o=e[0],s=e[1];return i<r&&(n=r,r=i,i=n),s<o&&(n=o,o=s,s=n),r===o&&i===s}function es(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=so(t));var r=[],i=Lt(t,function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=ns(r[0]),s=ns(r[r.length-1]),a=ns(i[0]),u=ns(i[i.length-1]);if(o===u)n=i.concat(r.slice(1));else if(a===s)n=r.concat(i.slice(1));else if(o===a)n=r.slice(1).reverse().concat(i);else{if(s!==u)return null;n=r.concat(i.reverse().slice(1))}return T(n)}(t,e);return n||(r.push(t),e)});return i&&r.push(i),r.length?1===r.length?r[0]:A(r.map(function(t){return t.coordinates})):null}function ns(t){return t[0].toString()+","+t[1].toString()}function rs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=so(t));var r=function(t){var e={};bt(t,function(t){e[t.geometry.type]=!0});var n=Object.keys(e);if(1===n.length)return n[0];return null}(t);if(!r)throw new Error("geojson must be homogenous");var i=t;switch(r){case"LineString":return es(i,e);case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("FeatureCollection"!==ut(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=so(t));var n=[];bt(t,function(t){n.push(t.geometry)});var r=Qo({geoms:q(n).geometry});return Do(r,r.objects.geoms.geometries)}(i,e);default:throw new Error(r+" is not supported")}}var is=/^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,os=Math.ceil,ss=Math.floor,as="[BigNumber Error] ",us=as+"Number primitive has more than 15 significant digits: ",ls=1e14,hs=14,cs=9007199254740991,fs=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],vs=1e7,gs=1e9;function ds(t){var e=0|t;return t>0||t===e?e:e-1}function ps(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=hs-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function ys(t,e){var n,r,i=t.c,o=e.c,s=t.s,a=e.s,u=t.e,l=e.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=u==l,!i||!o)return r?0:!i^n?1:-1;if(!r)return u>l^n?1:-1;for(a=(u=i.length)<(l=o.length)?u:l,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return u==l?0:u>l^n?1:-1}function ms(t,e,n,r){if(t<e||t>n||t!==ss(t))throw Error(as+(r||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _s(t){var e=t.c.length-1;return ds(t.e/hs)==e&&t.c[e]%2!=0}function xs(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Es(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}var ks=function t(e){var n,r,i,o,s,a,u,l,h,c,f=S.prototype={constructor:S,toString:null,valueOf:null},v=new S(1),g=20,d=4,p=-7,y=21,m=-1e7,_=1e7,x=!1,k=1,w=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function S(t,e){var n,o,s,a,u,l,h,c,f=this;if(!(f instanceof S))return new S(t,e);if(null==e){if(t&&!0===t._isBigNumber)return f.s=t.s,void(!t.c||t.e>_?f.c=f.e=null:t.e<m?f.c=[f.e=0]:(f.e=t.e,f.c=t.c.slice()));if((l="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(a=0,u=t;u>=10;u/=10,a++);return void(a>_?f.c=f.e=null:(f.e=a,f.c=[t]))}c=String(t)}else{if(!is.test(c=String(t)))return i(f,c,l);f.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}(a=c.indexOf("."))>-1&&(c=c.replace(".","")),(u=c.search(/e/i))>0?(a<0&&(a=u),a+=+c.slice(u+1),c=c.substring(0,u)):a<0&&(a=c.length)}else{if(ms(e,2,I.length,"Base"),10==e&&N)return C(f=new S(t),g+f.e+1,d);if(c=String(t),l="number"==typeof t){if(0*t!=0)return i(f,c,l,e);if(f.s=1/t<0?(c=c.slice(1),-1):1,S.DEBUG&&c.replace(/^0\\.0*|\\./,"").length>15)throw Error(us+t)}else f.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1;for(n=I.slice(0,e),a=u=0,h=c.length;u<h;u++)if(n.indexOf(o=c.charAt(u))<0){if("."==o){if(u>a){a=h;continue}}else if(!s&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){s=!0,u=-1,a=0;continue}return i(f,String(t),l,e)}l=!1,(a=(c=r(c,e,10,f.s)).indexOf("."))>-1?c=c.replace(".",""):a=c.length}for(u=0;48===c.charCodeAt(u);u++);for(h=c.length;48===c.charCodeAt(--h););if(c=c.slice(u,++h)){if(h-=u,l&&S.DEBUG&&h>15&&(t>cs||t!==ss(t)))throw Error(us+f.s*t);if((a=a-u-1)>_)f.c=f.e=null;else if(a<m)f.c=[f.e=0];else{if(f.e=a,f.c=[],u=(a+1)%hs,a<0&&(u+=hs),u<h){for(u&&f.c.push(+c.slice(0,u)),h-=hs;u<h;)f.c.push(+c.slice(u,u+=hs));u=hs-(c=c.slice(u)).length}else u-=h;for(;u--;c+="0");f.c.push(+c)}}else f.c=[f.e=0]}function M(t,e,n,r){var i,o,s,a,u;if(null==n?n=d:ms(n,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)u=ps(t.c),u=1==r||2==r&&(s<=p||s>=y)?xs(u,s):Es(u,s,"0");else if(o=(t=C(new S(t),e,n)).e,a=(u=ps(t.c)).length,1==r||2==r&&(e<=o||o<=p)){for(;a<e;u+="0",a++);u=xs(u,o)}else if(e-=s,u=Es(u,o,"0"),o+1>a){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-a)>0)for(o+1==a&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function L(t,e){for(var n,r,i=1,o=new S(t[0]);i<t.length;i++)(!(r=new S(t[i])).s||(n=ys(o,r))===e||0===n&&o.s===e)&&(o=r);return o}function P(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*hs-1)>_?t.c=t.e=null:n<m?t.c=[t.e=0]:(t.e=n,t.c=e),t}function C(t,e,n,r){var i,o,s,a,u,l,h,c=t.c,f=fs;if(c){t:{for(i=1,a=c[0];a>=10;a/=10,i++);if((o=e-i)<0)o+=hs,s=e,u=c[l=0],h=ss(u/f[i-s-1]%10);else if((l=os((o+1)/hs))>=c.length){if(!r)break t;for(;c.length<=l;c.push(0));u=h=0,i=1,s=(o%=hs)-hs+1}else{for(u=a=c[l],i=1;a>=10;a/=10,i++);h=(s=(o%=hs)-hs+i)<0?0:ss(u/f[i-s-1]%10)}if(r=r||e<0||null!=c[l+1]||(s<0?u:u%f[i-s-1]),r=n<4?(h||r)&&(0==n||n==(t.s<0?3:2)):h>5||5==h&&(4==n||r||6==n&&(o>0?s>0?u/f[i-s]:0:c[l-1])%10&1||n==(t.s<0?8:7)),e<1||!c[0])return c.length=0,r?(e-=t.e+1,c[0]=f[(hs-e%hs)%hs],t.e=-e||0):c[0]=t.e=0,t;if(0==o?(c.length=l,a=1,l--):(c.length=l+1,a=f[hs-o],c[l]=s>0?ss(u/f[i-s]%f[s])*a:0),r)for(;;){if(0==l){for(o=1,s=c[0];s>=10;s/=10,o++);for(s=c[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(t.e++,c[0]==ls&&(c[0]=1));break}if(c[l]+=a,c[l]!=ls)break;c[l--]=0,a=1}for(o=c.length;0===c[--o];c.pop());}t.e>_?t.c=t.e=null:t.e<m&&(t.c=[t.e=0])}return t}function T(t){var e,n=t.e;return null===n?t.toString():(e=ps(t.c),e=n<=p||n>=y?xs(e,n):Es(e,n,"0"),t.s<0?"-"+e:e)}return S.clone=t,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(t){var e,n;if(null!=t){if("object"!=E(t))throw Error(as+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(ms(n=t[e],0,gs,e),g=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(ms(n=t[e],0,8,e),d=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(ms(n[0],-gs,0,e),ms(n[1],0,gs,e),p=n[0],y=n[1]):(ms(n,-gs,gs,e),p=-(y=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)ms(n[0],-gs,-1,e),ms(n[1],1,gs,e),m=n[0],_=n[1];else{if(ms(n,-gs,gs,e),!n)throw Error(as+e+" cannot be zero: "+n);m=-(_=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(as+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw x=!n,Error(as+"crypto unavailable");x=n}else x=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(ms(n=t[e],0,9,e),k=n),t.hasOwnProperty(e="POW_PRECISION")&&(ms(n=t[e],0,gs,e),w=n),t.hasOwnProperty(e="FORMAT")){if("object"!=E(n=t[e]))throw Error(as+e+" not an object: "+n);b=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\\-.\\s]|(.).*\\1/.test(n))throw Error(as+e+" invalid: "+n);N="0123456789"==n.slice(0,10),I=n}}return{DECIMAL_PLACES:g,ROUNDING_MODE:d,EXPONENTIAL_AT:[p,y],RANGE:[m,_],CRYPTO:x,MODULO_MODE:k,POW_PRECISION:w,FORMAT:b,ALPHABET:I}},S.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!S.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-gs&&i<=gs&&i===ss(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%hs)<1&&(e+=hs),String(r[0]).length==e){for(e=0;e<r.length;e++)if((n=r[e])<0||n>=ls||n!==ss(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(as+"Invalid BigNumber: "+t)},S.maximum=S.max=function(){return L(arguments,-1)},S.minimum=S.min=function(){return L(arguments,1)},S.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return ss(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,n,r,i,o,a=0,u=[],l=new S(v);if(null==t?t=g:ms(t,0,gs),i=os(t/hs),x)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*e[a]+(e[a+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[a]=n[0],e[a+1]=n[1]):(u.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw x=!1,Error(as+"crypto unavailable");for(e=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&e[a])+1099511627776*e[a+1]+4294967296*e[a+2]+16777216*e[a+3]+(e[a+4]<<16)+(e[a+5]<<8)+e[a+6])>=9e15?crypto.randomBytes(7).copy(e,a):(u.push(o%1e14),a+=7);a=i/7}if(!x)for(;a<i;)(o=s())<9e15&&(u[a++]=o%1e14);for(i=u[--a],t%=hs,i&&t&&(o=fs[hs-t],u[a]=ss(i/o)*o);0===u[a];u.pop(),a--);if(a<0)u=[r=0];else{for(r=-1;0===u[0];u.splice(0,1),r-=hs);for(a=1,o=u[0];o>=10;o/=10,a++);a<hs&&(r-=hs-a)}return l.e=r,l.c=u,l}),S.sum=function(){for(var t=1,e=arguments,n=new S(e[0]);t<e.length;)n=n.plus(e[t++]);return n},r=function(){var t="0123456789";function e(t,e,n,r){for(var i,o,s=[0],a=0,u=t.length;a<u;){for(o=s.length;o--;s[o]*=e);for(s[0]+=r.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,i,o,s,a){var u,l,h,c,f,v,p,y,m=r.indexOf("."),_=g,x=d;for(m>=0&&(c=w,w=0,r=r.replace(".",""),v=(y=new S(i)).pow(r.length-m),w=c,y.c=e(Es(ps(v.c),v.e,"0"),10,o,t),y.e=y.c.length),h=c=(p=e(r,i,o,a?(u=I,t):(u=t,I))).length;0==p[--c];p.pop());if(!p[0])return u.charAt(0);if(m<0?--h:(v.c=p,v.e=h,v.s=s,p=(v=n(v,y,_,x,o)).c,f=v.r,h=v.e),m=p[l=h+_+1],c=o/2,f=f||l<0||null!=p[l+1],f=x<4?(null!=m||f)&&(0==x||x==(v.s<0?3:2)):m>c||m==c&&(4==x||f||6==x&&1&p[l-1]||x==(v.s<0?8:7)),l<1||!p[0])r=f?Es(u.charAt(1),-_,u.charAt(0)):u.charAt(0);else{if(p.length=l,f)for(--o;++p[--l]>o;)p[l]=0,l||(++h,p=[1].concat(p));for(c=p.length;!p[--c];);for(m=0,r="";m<=c;r+=u.charAt(p[m++]));r=Es(r,h,u.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,s,a=0,u=t.length,l=e%vs,h=e/vs|0;for(t=t.slice();u--;)a=((i=l*(o=t[u]%vs)+(r=h*o+(s=t[u]/vs|0)*l)%vs*vs+a)/n|0)+(r/vs|0)+h*s,t[u]=i%n;return a&&(t=[a].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(r,i,o,s,a){var u,l,h,c,f,v,g,d,p,y,m,_,x,E,k,w,b,I=r.s==i.s?1:-1,N=r.c,M=i.c;if(!(N&&N[0]&&M&&M[0]))return new S(r.s&&i.s&&(N?!M||N[0]!=M[0]:M)?N&&0==N[0]||!M?0*I:I/0:NaN);for(p=(d=new S(I)).c=[],I=o+(l=r.e-i.e)+1,a||(a=ls,l=ds(r.e/hs)-ds(i.e/hs),I=I/hs|0),h=0;M[h]==(N[h]||0);h++);if(M[h]>(N[h]||0)&&l--,I<0)p.push(1),c=!0;else{for(E=N.length,w=M.length,h=0,I+=2,(f=ss(a/(M[0]+1)))>1&&(M=t(M,f,a),N=t(N,f,a),w=M.length,E=N.length),x=w,m=(y=N.slice(0,w)).length;m<w;y[m++]=0);b=M.slice(),b=[0].concat(b),k=M[0],M[1]>=a/2&&k++;do{if(f=0,(u=e(M,y,w,m))<0){if(_=y[0],w!=m&&(_=_*a+(y[1]||0)),(f=ss(_/k))>1)for(f>=a&&(f=a-1),g=(v=t(M,f,a)).length,m=y.length;1==e(v,y,g,m);)f--,n(v,w<g?b:M,g,a),g=v.length,u=1;else 0==f&&(u=f=1),g=(v=M.slice()).length;if(g<m&&(v=[0].concat(v)),n(y,v,m,a),m=y.length,-1==u)for(;e(M,y,w,m)<1;)f++,n(y,w<m?b:M,m,a),m=y.length}else 0===u&&(f++,y=[0]);p[h++]=f,y[0]?y[m++]=N[x]||0:(y=[N[x]],m=1)}while((x++<E||null!=y[0])&&I--);c=null!=y[0],p[0]||p.splice(0,1)}if(a==ls){for(h=1,I=p[0];I>=10;I/=10,h++);C(d,o+(d.e=h+l*hs-1)+1,s,c)}else d.e=l,d.r=+c;return d}}(),a=/^(-?)0([xbo])(?=\\w[\\w.]*$)/i,u=/^([^.]+)\\.$/,l=/^\\.([^.]+)$/,h=/^-?(Infinity|NaN)$/,c=/^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g,i=function(t,e,n,r){var i,o=n?e:e.replace(c,"");if(h.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(a,function(t,e,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?t:e}),r&&(i=r,o=o.replace(u,"$1").replace(l,"0.$1")),e!=o))return new S(o,i);if(S.DEBUG)throw Error(as+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},f.absoluteValue=f.abs=function(){var t=new S(this);return t.s<0&&(t.s=1),t},f.comparedTo=function(t,e){return ys(this,new S(t,e))},f.decimalPlaces=f.dp=function(t,e){var n,r,i,o=this;if(null!=t)return ms(t,0,gs),null==e?e=d:ms(e,0,8),C(new S(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-ds(this.e/hs))*hs,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(t,e){return n(this,new S(t,e),g,d)},f.dividedToIntegerBy=f.idiv=function(t,e){return n(this,new S(t,e),0,1)},f.exponentiatedBy=f.pow=function(t,e){var n,r,i,o,s,a,u,l,h=this;if((t=new S(t)).c&&!t.isInteger())throw Error(as+"Exponent not an integer: "+T(t));if(null!=e&&(e=new S(e)),s=t.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!t.c||!t.c[0])return l=new S(Math.pow(+T(h),s?t.s*(2-_s(t)):+T(t))),e?l.mod(e):l;if(a=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new S(NaN);(r=!a&&h.isInteger()&&e.isInteger())&&(h=h.mod(e))}else{if(t.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||s&&h.c[1]>=24e7:h.c[0]<8e13||s&&h.c[0]<=9999975e7)))return o=h.s<0&&_s(t)?-0:0,h.e>-1&&(o=1/o),new S(a?1/o:o);w&&(o=os(w/hs+2))}for(s?(n=new S(.5),a&&(t.s=1),u=_s(t)):u=(i=Math.abs(+T(t)))%2,l=new S(v);;){if(u){if(!(l=l.times(h)).c)break;o?l.c.length>o&&(l.c.length=o):r&&(l=l.mod(e))}if(i){if(0===(i=ss(i/2)))break;u=i%2}else if(C(t=t.times(n),t.e+1,1),t.e>14)u=_s(t);else{if(0===(i=+T(t)))break;u=i%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):r&&(h=h.mod(e))}return r?l:(a&&(l=v.div(l)),e?l.mod(e):o?C(l,w,d,void 0):l)},f.integerValue=function(t){var e=new S(this);return null==t?t=d:ms(t,0,8),C(e,e.e+1,t)},f.isEqualTo=f.eq=function(t,e){return 0===ys(this,new S(t,e))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(t,e){return ys(this,new S(t,e))>0},f.isGreaterThanOrEqualTo=f.gte=function(t,e){return 1===(e=ys(this,new S(t,e)))||0===e},f.isInteger=function(){return!!this.c&&ds(this.e/hs)>this.c.length-2},f.isLessThan=f.lt=function(t,e){return ys(this,new S(t,e))<0},f.isLessThanOrEqualTo=f.lte=function(t,e){return-1===(e=ys(this,new S(t,e)))||0===e},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(t,e){var n,r,i,o,s=this,a=s.s;if(e=(t=new S(t,e)).s,!a||!e)return new S(NaN);if(a!=e)return t.s=-e,s.plus(t);var u=s.e/hs,l=t.e/hs,h=s.c,c=t.c;if(!u||!l){if(!h||!c)return h?(t.s=-e,t):new S(c?s:NaN);if(!h[0]||!c[0])return c[0]?(t.s=-e,t):new S(h[0]?s:3==d?-0:0)}if(u=ds(u),l=ds(l),h=h.slice(),a=u-l){for((o=a<0)?(a=-a,i=h):(l=u,i=c),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(r=(o=(a=h.length)<(e=c.length))?a:e,a=e=0;e<r;e++)if(h[e]!=c[e]){o=h[e]<c[e];break}if(o&&(i=h,h=c,c=i,t.s=-t.s),(e=(r=c.length)-(n=h.length))>0)for(;e--;h[n++]=0);for(e=ls-1;r>a;){if(h[--r]<c[r]){for(n=r;n&&!h[--n];h[n]=e);--h[n],h[r]+=ls}h[r]-=c[r]}for(;0==h[0];h.splice(0,1),--l);return h[0]?P(t,h,l):(t.s=3==d?-1:1,t.c=[t.e=0],t)},f.modulo=f.mod=function(t,e){var r,i,o=this;return t=new S(t,e),!o.c||!t.s||t.c&&!t.c[0]?new S(NaN):!t.c||o.c&&!o.c[0]?new S(o):(9==k?(i=t.s,t.s=1,r=n(o,t,0,3),t.s=i,r.s*=i):r=n(o,t,0,k),(t=o.minus(r.times(t))).c[0]||1!=k||(t.s=o.s),t)},f.multipliedBy=f.times=function(t,e){var n,r,i,o,s,a,u,l,h,c,f,v,g,d,p,y=this,m=y.c,_=(t=new S(t,e)).c;if(!(m&&_&&m[0]&&_[0]))return!y.s||!t.s||m&&!m[0]&&!_||_&&!_[0]&&!m?t.c=t.e=t.s=null:(t.s*=y.s,m&&_?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=ds(y.e/hs)+ds(t.e/hs),t.s*=y.s,(u=m.length)<(c=_.length)&&(g=m,m=_,_=g,i=u,u=c,c=i),i=u+c,g=[];i--;g.push(0));for(d=ls,p=vs,i=c;--i>=0;){for(n=0,f=_[i]%p,v=_[i]/p|0,o=i+(s=u);o>i;)n=((l=f*(l=m[--s]%p)+(a=v*l+(h=m[s]/p|0)*f)%p*p+g[o]+n)/d|0)+(a/p|0)+v*h,g[o--]=l%d;g[o]=n}return n?++r:g.splice(0,1),P(t,g,r)},f.negated=function(){var t=new S(this);return t.s=-t.s||null,t},f.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new S(t,e)).s,!i||!e)return new S(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/hs,s=t.e/hs,a=r.c,u=t.c;if(!o||!s){if(!a||!u)return new S(i/0);if(!a[0]||!u[0])return u[0]?t:new S(a[0]?r:0*i)}if(o=ds(o),s=ds(s),a=a.slice(),i=o-s){for(i>0?(s=o,n=u):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(e=u.length)<0&&(n=u,u=a,a=n,e=i),i=0;e;)i=(a[--e]=a[e]+u[e]+i)/ls|0,a[e]=ls===a[e]?0:a[e]%ls;return i&&(a=[i].concat(a),++s),P(t,a,s)},f.precision=f.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return ms(t,1,gs),null==e?e=d:ms(e,0,8),C(new S(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*hs+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},f.shiftedBy=function(t){return ms(t,-9007199254740991,cs),this.times("1e"+t)},f.squareRoot=f.sqrt=function(){var t,e,r,i,o,s=this,a=s.c,u=s.s,l=s.e,h=g+4,c=new S("0.5");if(1!==u||!a||!a[0])return new S(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+T(s)))||u==1/0?(((e=ps(a)).length+l)%2==0&&(e+="0"),u=Math.sqrt(+e),l=ds((l+1)/2)-(l<0||l%2),r=new S(e=u==1/0?"5e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new S(u+""),r.c[0])for((u=(l=r.e)+h)<3&&(u=0);;)if(o=r,r=c.times(o.plus(n(s,o,h,1))),ps(o.c).slice(0,u)===(e=ps(r.c)).slice(0,u)){if(r.e<l&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(C(r,r.e+g+2,1),t=!r.times(r).eq(s));break}if(!i&&(C(o,o.e+g+2,0),o.times(o).eq(s))){r=o;break}h+=4,u+=4,i=1}return C(r,r.e+g+1,d,t)},f.toExponential=function(t,e){return null!=t&&(ms(t,0,gs),t++),M(this,t,e,1)},f.toFixed=function(t,e){return null!=t&&(ms(t,0,gs),t=t+this.e+1),M(this,t,e)},f.toFormat=function(t,e,n){var r,i=this;if(null==n)null!=t&&e&&"object"==E(e)?(n=e,e=null):t&&"object"==E(t)?(n=t,t=e=null):n=b;else if("object"!=E(n))throw Error(as+"Argument not an object: "+n);if(r=i.toFixed(t,e),i.c){var o,s=r.split("."),a=+n.groupSize,u=+n.secondaryGroupSize,l=n.groupSeparator||"",h=s[0],c=s[1],f=i.s<0,v=f?h.slice(1):h,g=v.length;if(u&&(o=a,a=u,u=o,g-=o),a>0&&g>0){for(o=g%a||a,h=v.substr(0,o);o<g;o+=a)h+=l+v.substr(o,a);u>0&&(h+=l+v.slice(o)),f&&(h="-"+h)}r=c?h+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?c.replace(new RegExp("\\\\d{"+u+"}\\\\B","g"),"$&"+(n.fractionGroupSeparator||"")):c):h}return(n.prefix||"")+r+(n.suffix||"")},f.toFraction=function(t){var e,r,i,o,s,a,u,l,h,c,f,g,p=this,y=p.c;if(null!=t&&(!(u=new S(t)).isInteger()&&(u.c||1!==u.s)||u.lt(v)))throw Error(as+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+T(u));if(!y)return new S(p);for(e=new S(v),h=r=new S(v),i=l=new S(v),g=ps(y),s=e.e=g.length-p.e-1,e.c[0]=fs[(a=s%hs)<0?hs+a:a],t=!t||u.comparedTo(e)>0?s>0?e:h:u,a=_,_=1/0,u=new S(g),l.c[0]=0;c=n(u,e,0,1),1!=(o=r.plus(c.times(i))).comparedTo(t);)r=i,i=o,h=l.plus(c.times(o=h)),l=o,e=u.minus(c.times(o=e)),u=o;return o=n(t.minus(r),i,0,1),l=l.plus(o.times(h)),r=r.plus(o.times(i)),l.s=h.s=p.s,f=n(h,i,s*=2,d).minus(p).abs().comparedTo(n(l,r,s,d).minus(p).abs())<1?[h,i]:[l,r],_=a,f},f.toNumber=function(){return+T(this)},f.toPrecision=function(t,e){return null!=t&&ms(t,1,gs),M(this,t,e,2)},f.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=p||o>=y?xs(ps(n.c),o):Es(ps(n.c),o,"0"):10===t&&N?e=Es(ps((n=C(new S(n),g+o+1,d)).c),n.e,"0"):(ms(t,2,I.length,"Base"),e=r(Es(ps(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},f.valueOf=f.toJSON=function(){return T(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&S.set(e),S}(),ws=function(t){function e(t){return i(this,e),r(this,e,[t])}return h(e,t),s(e)}(s(function t(e){i(this,t),u(this,"key",void 0),u(this,"left",null),u(this,"right",null),this.key=e})),bs=function(){return s(function t(){i(this,t),u(this,"size",0),u(this,"modificationCount",0),u(this,"splayCount",0)},[{key:"splay",value:function(t){var e=this.root;if(null==e)return this.compare(t,t),-1;for(var n,r=null,i=null,o=null,s=null,a=e,u=this.compare;;)if((n=u(a.key,t))>0){var l=a.left;if(null==l)break;if((n=u(l.key,t))>0&&(a.left=l.right,l.right=a,null==(l=(a=l).left)))break;null==r?i=a:r.left=a,r=a,a=l}else{if(!(n<0))break;var h=a.right;if(null==h)break;if((n=u(h.key,t))<0&&(a.right=h.left,h.left=a,null==(h=(a=h).right)))break;null==o?s=a:o.right=a,o=a,a=h}return null!=o&&(o.right=a.left,a.left=s),null!=r&&(r.left=a.right,a.right=i),this.root!==a&&(this.root=a,this.splayCount++),n}},{key:"splayMin",value:function(t){for(var e=t,n=e.left;null!=n;){var r=n;e.left=r.right,r.right=e,n=(e=r).left}return e}},{key:"splayMax",value:function(t){for(var e=t,n=e.right;null!=n;){var r=n;e.right=r.left,r.left=e,n=(e=r).right}return e}},{key:"_delete",value:function(t){if(null==this.root)return null;if(0!=this.splay(t))return null;var e=this.root,n=e,r=e.left;if(this.size--,null==r)this.root=e.right;else{var i=e.right;(e=this.splayMax(r)).right=i,this.root=e}return this.modificationCount++,n}},{key:"addNewRoot",value:function(t,e){this.size++,this.modificationCount++;var n=this.root;null!=n?(e<0?(t.left=n,t.right=n.right,n.right=null):(t.right=n,t.left=n.left,n.left=null),this.root=t):this.root=t}},{key:"_first",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMin(t),this.root)}},{key:"_last",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMax(t),this.root)}},{key:"clear",value:function(){this.root=null,this.size=0,this.modificationCount++}},{key:"has",value:function(t){return this.validKey(t)&&0==this.splay(t)}},{key:"defaultCompare",value:function(){return function(t,e){return t<e?-1:t>e?1:0}}},{key:"wrap",value:function(){var t=this;return{getRoot:function(){return t.root},setRoot:function(e){t.root=e},getSize:function(){return t.size},getModificationCount:function(){return t.modificationCount},getSplayCount:function(){return t.splayCount},setSplayCount:function(e){t.splayCount=e},splay:function(e){return t.splay(e)},has:function(e){return t.has(e)}}}}])}(),Is=function(t){function e(t,n){var o;return i(this,e),u(o=r(this,e),"root",null),u(o,"compare",void 0),u(o,"validKey",void 0),u(o,Symbol.toStringTag,"[object Set]"),o.compare=null!=t?t:o.defaultCompare(),o.validKey=null!=n?n:function(t){return null!=t&&null!=t},o}return h(e,t),s(e,[{key:"delete",value:function(t){return!!this.validKey(t)&&null!=this._delete(t)}},{key:"deleteAll",value:function(t){var e,n=a(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.delete(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"forEach",value:function(t){for(var e,n=this[Symbol.iterator]();!(e=n.next()).done;)t(e.value,e.value,this)}},{key:"add",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new ws(t),e),this}},{key:"addAndReturn",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new ws(t),e),this.root.key}},{key:"addAll",value:function(t){var e,n=a(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"isEmpty",value:function(){return null==this.root}},{key:"isNotEmpty",value:function(){return null!=this.root}},{key:"single",value:function(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}},{key:"first",value:function(){if(0==this.size)throw"Bad state: No element";return this._first().key}},{key:"last",value:function(){if(0==this.size)throw"Bad state: No element";return this._last().key}},{key:"lastBefore",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)<0)return this.root.key;var e=this.root.left;if(null==e)return null;for(var n=e.right;null!=n;)n=(e=n).right;return e.key}},{key:"firstAfter",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)>0)return this.root.key;var e=this.root.right;if(null==e)return null;for(var n=e.left;null!=n;)n=(e=n).left;return e.key}},{key:"retainAll",value:function(t){var n,r=new e(this.compare,this.validKey),i=this.modificationCount,o=a(t);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(s)&&0==this.splay(s)&&r.add(this.root.key)}}catch(t){o.e(t)}finally{o.f()}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}},{key:"lookup",value:function(t){return this.validKey(t)?0!=this.splay(t)?null:this.root.key:null}},{key:"intersection",value:function(t){var n,r=new e(this.compare,this.validKey),i=a(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)&&r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"difference",value:function(t){var n,r=new e(this.compare,this.validKey),i=a(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)||r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"union",value:function(t){var e=this.clone();return e.addAll(t),e}},{key:"clone",value:function(){var t=new e(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}},{key:"copyNode",value:function(t){if(null==t)return null;var e=new ws(t.key);return function t(e,n){var r,i;do{if(r=e.left,i=e.right,null!=r){var o=new ws(r.key);n.left=o,t(r,o)}if(null!=i){var s=new ws(i.key);n.right=s,e=i,n=s}}while(null!=i)}(t,e),e}},{key:"toSet",value:function(){return this.clone()}},{key:"entries",value:function(){return new Ms(this.wrap())}},{key:"keys",value:function(){return this[Symbol.iterator]()}},{key:"values",value:function(){return this[Symbol.iterator]()}},{key:Symbol.iterator,value:function(){return new Ss(this.wrap())}}])}(bs),Ns=function(){return s(function t(e){i(this,t),u(this,"tree",void 0),u(this,"path",new Array),u(this,"modificationCount",null),u(this,"splayCount",void 0),this.tree=e,this.splayCount=e.getSplayCount()},[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}},{key:"current",value:function(){if(!this.path.length)return null;var t=this.path[this.path.length-1];return this.getValue(t)}},{key:"rebuildPath",value:function(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}},{key:"findLeftMostDescendent",value:function(t){for(;null!=t;)this.path.push(t),t=t.left}},{key:"moveNext",value:function(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();for(var t=this.tree.getRoot();null!=t;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);var e=this.path[this.path.length-1],n=e.right;if(null!=n){for(;null!=n;)this.path.push(n),n=n.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}}])}(),Ss=function(t){function e(){return i(this,e),r(this,e,arguments)}return h(e,t),s(e,[{key:"getValue",value:function(t){return t.key}}])}(Ns),Ms=function(t){function e(){return i(this,e),r(this,e,arguments)}return h(e,t),s(e,[{key:"getValue",value:function(t){return[t.key,t.key]}}])}(Ns),Ls=function(t){return function(){return t}},Ps=function(t){var e=t?function(e,n){return n.minus(e).abs().isLessThanOrEqualTo(t)}:Ls(!1);return function(t,n){return e(t,n)?0:t.comparedTo(n)}};function Cs(t){var e=t?function(e,n,r,i,o){return e.exponentiatedBy(2).isLessThanOrEqualTo(i.minus(n).exponentiatedBy(2).plus(o.minus(r).exponentiatedBy(2)).times(t))}:Ls(!1);return function(t,n,r){var i=t.x,o=t.y,s=r.x,a=r.y,u=o.minus(a).times(n.x.minus(s)).minus(i.minus(s).times(n.y.minus(a)));return e(u,i,o,s,a)?0:u.comparedTo(0)}}var Ts=function(t){return t},Os=function(t){if(t){var e=new Is(Ps(t)),n=new Is(Ps(t)),r=function(t,e){return e.addAndReturn(t)},i=function(t){return{x:r(t.x,e),y:r(t.y,n)}};return i({x:new ks(0),y:new ks(0)}),i}return Ts},Rs=function(t){return{set:function(t){As=Rs(t)},reset:function(){return Rs(t)},compare:Ps(t),snap:Os(t),orient:Cs(t)}},As=Rs(),Ds=function(t,e){return t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y)},Fs=function(t,e){if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;var n=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,r=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y}}},qs=function(t,e){return t.x.times(e.y).minus(t.y.times(e.x))},Gs=function(t,e){return t.x.times(e.x).plus(t.y.times(e.y))},Ys=function(t){return Gs(t,t).sqrt()},Bs=function(t,e,n){var r={x:e.x.minus(t.x),y:e.y.minus(t.y)},i={x:n.x.minus(t.x),y:n.y.minus(t.y)};return Gs(i,r).div(Ys(i)).div(Ys(r))},zs=function(t,e,n){return e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(n.minus(t.y))),y:n}},js=function(t,e,n){return e.x.isZero()?null:{x:n,y:t.y.plus(e.y.div(e.x).times(n.minus(t.x)))}},Xs=function(){function t(e,n){i(this,t),u(this,"point",void 0),u(this,"isLeft",void 0),u(this,"segment",void 0),u(this,"otherSE",void 0),u(this,"consumedBy",void 0),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return s(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n<r;n++){var i=e[n];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var n=this.point.events[e];if(void 0===n.segment.consumedBy)for(var r=e+1;r<t;r++){var i=this.point.events[r];void 0===i.consumedBy&&(n.otherSE.point.events===i.otherSE.point.events&&n.segment.consume(i.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,n=this.point.events.length;e<n;e++){var r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,n=new Map,r=function(r){var i,o,s,a,u,l=r.otherSE;n.set(r,{sine:(i=e.point,o=t.point,s=l.point,a={x:o.x.minus(i.x),y:o.y.minus(i.y)},u={x:s.x.minus(i.x),y:s.y.minus(i.y)},qs(u,a).div(Ys(u)).div(Ys(a))),cosine:Bs(e.point,t.point,l.point)})};return function(t,e){n.has(t)||r(t),n.has(e)||r(e);var i=n.get(t),o=i.sine,s=i.cosine,a=n.get(e),u=a.sine,l=a.cosine;return o.isGreaterThanOrEqualTo(0)&&u.isGreaterThanOrEqualTo(0)?s.isLessThan(l)?1:s.isGreaterThan(l)?-1:0:o.isLessThan(0)&&u.isLessThan(0)?s.isLessThan(l)?-1:s.isGreaterThan(l)?1:0:u.isLessThan(o)?-1:u.isGreaterThan(o)?1:0}}}],[{key:"compare",value:function(e,n){var r=t.comparePoints(e.point,n.point);return 0!==r?r:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Qs.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(t,e){return t.x.isLessThan(e.x)?-1:t.x.isGreaterThan(e.x)?1:t.y.isLessThan(e.y)?-1:t.y.isGreaterThan(e.y)?1:0}}])}(),Us=function(){function t(e){i(this,t),u(this,"events",void 0),u(this,"poly",void 0),u(this,"_isExteriorRing",void 0),u(this,"_enclosingRing",void 0),this.events=e;for(var n=0,r=e.length;n<r;n++)e[n].segment.ringOut=this;this.poly=null}return s(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point,o=this.events[n+1].point;0!==As.orient(i,t,o)&&(e.push(i),t=i)}if(1===e.length)return null;var s=e[0],a=e[1];0===As.orient(s,t,a)&&e.shift(),e.push(e[0]);for(var u=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],f=l;f!=h;f+=u)c.push([e[f].x.toNumber(),e[f].y.toNumber()]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,n=this.events.length;e<n;e++){var r=this.events[e];Xs.compare(t,r)>0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;var s,a;if(o.ringOut!==i.ringOut)return(null===(s=o.ringOut)||void 0===s?void 0:s.enclosingRing())!==i.ringOut?i.ringOut:null===(a=i.ringOut)||void 0===a?void 0:a.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}],[{key:"factory",value:function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,u=o.rightSE,l=[a],h=a.point,c=[];s=a,a=u,l.push(a),a.point!==h;)for(;;){var f=a.getAvailableLinkedEvents();if(0===f.length){var v=l[0].point,g=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(v.x,", ").concat(v.y,"]. Last matching segment found ends at [").concat(g.x,", ").concat(g.y,"]."))}if(1===f.length){u=f[0].otherSE;break}for(var d=null,p=0,y=c.length;p<y;p++)if(c[p].point===a.point){d=p;break}if(null===d){c.push({index:l.length,point:a.point});var m=a.getLeftmostComparator(s);u=f.sort(m)[0].otherSE;break}var _=c.splice(d)[0],x=l.splice(_.index);x.unshift(x[0].otherSE),n.push(new t(x.reverse()))}n.push(new t(l))}}return n}}])}(),Vs=function(){return s(function t(e){i(this,t),u(this,"exteriorRing",void 0),u(this,"interiorRings",void 0),this.exteriorRing=e,e.poly=this,this.interiorRings=[]},[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=this.exteriorRing.getGeom();if(null===t)return null;for(var e=[t],n=0,r=this.interiorRings.length;n<r;n++){var i=this.interiorRings[n].getGeom();null!==i&&e.push(i)}return e}}])}(),Zs=function(){return s(function t(e){i(this,t),u(this,"rings",void 0),u(this,"polys",void 0),this.rings=e,this.polys=this._composePolys(e)},[{key:"getGeom",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++){var r=this.polys[e].getGeom();null!==r&&t.push(r)}return t}},{key:"_composePolys",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new Vs(i));else{var o,s=i.enclosingRing();null!=s&&s.poly||e.push(new Vs(s)),null==s||null===(o=s.poly)||void 0===o||o.addInterior(i)}}return e}}])}(),Hs=function(){return s(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qs.compare;i(this,t),u(this,"queue",void 0),u(this,"tree",void 0),u(this,"segments",void 0),this.queue=e,this.tree=new Is(n),this.segments=[]},[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.delete(t.otherSE):this.tree.delete(e),n;t.isLeft&&this.tree.add(e);var r=e,i=e;do{r=this.tree.lastBefore(r)}while(null!=r&&null!=r.consumedBy);do{i=this.tree.firstAfter(i)}while(null!=i&&null!=i.consumedBy);if(t.isLeft){var o=null;if(r){var s=r.getIntersection(e);if(null!==s&&(e.isAnEndpoint(s)||(o=s),!r.isAnEndpoint(s)))for(var a=this._splitSafely(r,s),u=0,l=a.length;u<l;u++)n.push(a[u])}var h=null;if(i){var c=i.getIntersection(e);if(null!==c&&(e.isAnEndpoint(c)||(h=c),!i.isAnEndpoint(c)))for(var f=this._splitSafely(i,c),v=0,g=f.length;v<g;v++)n.push(f[v])}if(null!==o||null!==h){var d=null;if(null===o)d=h;else if(null===h)d=o;else{d=Xs.comparePoints(o,h)<=0?o:h}this.queue.delete(e.rightSE),n.push(e.rightSE);for(var p=e.split(d),y=0,m=p.length;y<m;y++)n.push(p[y])}n.length>0?(this.tree.delete(e),n.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&i){var _=r.getIntersection(i);if(null!==_){if(!r.isAnEndpoint(_))for(var x=this._splitSafely(r,_),E=0,k=x.length;E<k;E++)n.push(x[E]);if(!i.isAnEndpoint(_))for(var w=this._splitSafely(i,_),b=0,I=w.length;b<I;b++)n.push(w[b])}}this.tree.delete(e)}return n}},{key:"_splitSafely",value:function(t,e){this.tree.delete(t);var n=t.rightSE;this.queue.delete(n);var r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}])}(),Ws=new(function(){return s(function t(){i(this,t),u(this,"type",void 0),u(this,"numMultiPolys",void 0)},[{key:"run",value:function(t,e,n){Ws.type=t;for(var r=[new ea(e,!0)],i=0,o=n.length;i<o;i++)r.push(new ea(n[i],!1));if(Ws.numMultiPolys=r.length,"difference"===Ws.type)for(var s=r[0],a=1;a<r.length;)null!==Fs(r[a].bbox,s.bbox)?a++:r.splice(a,1);if("intersection"===Ws.type)for(var u=0,l=r.length;u<l;u++)for(var h=r[u],c=u+1,f=r.length;c<f;c++)if(null===Fs(h.bbox,r[c].bbox))return[];for(var v=new Is(Xs.compare),g=0,d=r.length;g<d;g++)for(var p=r[g].getSweepEvents(),y=0,m=p.length;y<m;y++)v.add(p[y]);var _=new Hs(v),x=null;for(0!=v.size&&(x=v.first(),v.delete(x));x;){for(var E=_.process(x),k=0,w=E.length;k<w;k++){var b=E[k];void 0===b.consumedBy&&v.add(b)}0!=v.size?(x=v.first(),v.delete(x)):x=null}As.reset();var I=Us.factory(_.segments);return new Zs(I).getGeom()}}])}()),Js=Ws,Ks=0,Qs=function(){function t(e,n,r,o){i(this,t),u(this,"id",void 0),u(this,"leftSE",void 0),u(this,"rightSE",void 0),u(this,"rings",void 0),u(this,"windings",void 0),u(this,"ringOut",void 0),u(this,"consumedBy",void 0),u(this,"prev",void 0),u(this,"_prevInResult",void 0),u(this,"_beforeState",void 0),u(this,"_afterState",void 0),u(this,"_isInResult",void 0),this.id=++Ks,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=o}return s(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(e)?t:e},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(e)?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}},{key:"isAnEndpoint",value:function(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}},{key:"comparePoint",value:function(t){return As.orient(this.leftSE.point,t,this.rightSE.point)}},{key:"getIntersection",value:function(t){var e=this.bbox(),n=t.bbox(),r=Fs(e,n);if(null===r)return null;var i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=Ds(e,s)&&0===this.comparePoint(s),l=Ds(n,i)&&0===t.comparePoint(i),h=Ds(e,a)&&0===this.comparePoint(a),c=Ds(n,o)&&0===t.comparePoint(o);if(l&&u)return c&&!h?o:!c&&h?a:null;if(l)return h&&i.x.eq(a.x)&&i.y.eq(a.y)?null:i;if(u)return c&&o.x.eq(s.x)&&o.y.eq(s.y)?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var f=function(t,e,n,r){if(e.x.isZero())return js(n,r,t.x);if(r.x.isZero())return js(t,e,n.x);if(e.y.isZero())return zs(n,r,t.y);if(r.y.isZero())return zs(t,e,n.y);var i=qs(e,r);if(i.isZero())return null;var o={x:n.x.minus(t.x),y:n.y.minus(t.y)},s=qs(o,e).div(i),a=qs(o,r).div(i),u=t.x.plus(a.times(e.x)),l=n.x.plus(s.times(r.x)),h=t.y.plus(a.times(e.y)),c=n.y.plus(s.times(r.y));return{x:u.plus(l).div(2),y:h.plus(c).div(2)}}(i,this.vector(),s,t.vector());return null===f?null:Ds(r,f)?As.snap(f):null}},{key:"split",value:function(e){var n=[],r=void 0!==e.events,i=new Xs(e,!0),o=new Xs(e,!1),s=this.rightSE;this.replaceRightSE(o),n.push(o),n.push(i);var a=new t(i,s,this.rings.slice(),this.windings.slice());return Xs.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Xs.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var n=this,r=e;n.consumedBy;)n=n.consumedBy;for(;r.consumedBy;)r=r.consumedBy;var i=t.compare(n,r);if(0!==i){if(i>0){var o=n;n=r,r=o}if(n.prev===r){var s=n;n=r,r=s}for(var a=0,u=r.rings.length;a<u;a++){var l=r.rings[a],h=r.windings[a],c=n.rings.indexOf(l);-1===c?(n.rings.push(l),n.windings.push(h)):n.windings[c]+=h}r.rings=null,r.windings=null,r.consumedBy=n,r.leftSE.consumedBy=n.leftSE,r.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var s=this.rings[i],a=this.windings[i],u=e.indexOf(s);-1===u?(e.push(s),n.push(a)):n[u]+=a}for(var l=[],h=[],c=0,f=e.length;c<f;c++)if(0!==n[c]){var v=e[c],g=v.poly;if(-1===h.indexOf(g))if(v.isExterior)l.push(g);else{-1===h.indexOf(g)&&h.push(g);var d=l.indexOf(v.poly);-1!==d&&l.splice(d,1)}}for(var p=0,y=l.length;p<y;p++){var m=l[p].multiPoly;-1===r.indexOf(m)&&r.push(m)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Js.type){case"union":var n=0===t.length,r=0===e.length;this._isInResult=n!==r;break;case"intersection":var i,o;t.length<e.length?(i=t.length,o=e.length):(i=e.length,o=t.length),this._isInResult=o===Js.numMultiPolys&&i<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e)}return this._isInResult}}],[{key:"compare",value:function(t,e){var n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o.isLessThan(n))return 1;if(i.isLessThan(r))return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n.isLessThan(r)){if(a.isLessThan(s)&&a.isLessThan(u))return 1;if(a.isGreaterThan(s)&&a.isGreaterThan(u))return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(n.isGreaterThan(r)){if(s.isLessThan(a)&&s.isLessThan(l))return-1;if(s.isGreaterThan(a)&&s.isGreaterThan(l))return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var v=t.comparePoint(e.rightSE.point);return v<0?1:v>0?-1:1}if(s.isLessThan(a))return-1;if(s.isGreaterThan(a))return 1;if(i.isLessThan(o)){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(i.isGreaterThan(o)){var d=t.comparePoint(e.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(!i.eq(o)){var p=u.minus(s),y=i.minus(n),m=l.minus(a),_=o.minus(r);if(p.isGreaterThan(y)&&m.isLessThan(_))return 1;if(p.isLessThan(y)&&m.isGreaterThan(_))return-1}return i.isGreaterThan(o)?1:i.isLessThan(o)||u.isLessThan(l)?-1:u.isGreaterThan(l)?1:t.id<e.id?-1:t.id>e.id?1:0}},{key:"fromRing",value:function(e,n,r){var i,o,s,a=Xs.comparePoints(e,n);if(a<0)i=e,o=n,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,s=-1}return new t(new Xs(i,!0),new Xs(o,!1),[r],[s])}}])}(),$s=function(){return s(function t(e,n,r){if(i(this,t),u(this,"poly",void 0),u(this,"isExterior",void 0),u(this,"segments",void 0),u(this,"bbox",void 0),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=As.snap({x:new ks(e[0][0]),y:new ks(e[0][1])});this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var s=o,a=1,l=e.length;a<l;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var h=As.snap({x:new ks(e[a][0]),y:new ks(e[a][1])});h.x.eq(s.x)&&h.y.eq(s.y)||(this.segments.push(Qs.fromRing(s,h,this)),h.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=h.x),h.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=h.y),h.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=h.x),h.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=h.y),s=h)}o.x.eq(s.x)&&o.y.eq(s.y)||this.segments.push(Qs.fromRing(s,o,this))},[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.segments.length;e<n;e++){var r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}}])}(),ta=function(){return s(function t(e,n){if(i(this,t),u(this,"multiPoly",void 0),u(this,"exteriorRing",void 0),u(this,"interiorRings",void 0),u(this,"bbox",void 0),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $s(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,o=e.length;r<o;r++){var s=new $s(e[r],this,!1);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=n},[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,n=this.interiorRings.length;e<n;e++)for(var r=this.interiorRings[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}])}(),ea=function(){return s(function t(e,n){if(i(this,t),u(this,"isSubject",void 0),u(this,"polys",void 0),u(this,"bbox",void 0),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(t){}this.polys=[],this.bbox={ll:{x:new ks(Number.POSITIVE_INFINITY),y:new ks(Number.POSITIVE_INFINITY)},ur:{x:new ks(Number.NEGATIVE_INFINITY),y:new ks(Number.NEGATIVE_INFINITY)}};for(var r=0,o=e.length;r<o;r++){var s=new ta(e[r],this);s.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=n},[{key:"getSweepEvents",value:function(){for(var t=[],e=0,n=this.polys.length;e<n;e++)for(var r=this.polys[e].getSweepEvents(),i=0,o=r.length;i<o;i++)t.push(r[i]);return t}}])}(),na=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("union",t,n)},ra=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("intersection",t,n)},ia=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("difference",t,n)},oa=As.set,sa=Object.freeze({__proto__:null,difference:ia,intersection:ra,setPrecision:oa,union:na,xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Js.run("xor",t,n)}});function aa(t){if(!t)throw new Error("geojson is required");var e=[];return bt(t,function(t){e.push(t)}),R(e)}function ua(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=et(t),i=et(e),o=r[0]-i[0],s=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(s):Math.pow(Math.pow(o,n)+Math.pow(s,n),1/n)}function la(t,e){var n,r,i=(e=e||{}).threshold||1e4,o=e.p||2,s=null!=(n=e.binary)&&n,a=e.alpha||-1,u=null!=(r=e.standardization)&&r,l=[];_t(t,function(t){l.push(Yi(t))});for(var h=[],c=0;c<l.length;c++)h[c]=[];for(var f=0;f<l.length;f++)for(var v=f;v<l.length;v++){f===v&&(h[f][v]=0);var g=ua(l[f],l[v],o);h[f][v]=g,h[v][f]=g}for(var d=0;d<l.length;d++)for(var p=0;p<l.length;p++){var y=h[d][p];0!==y&&(h[d][p]=s?y<=i?1:0:y<=i?Math.pow(y,a):0)}if(u)for(var m=0;m<l.length;m++)for(var _=h[m].reduce(function(t,e){return t+e},0),x=0;x<l.length;x++)h[m][x]=h[m][x]/_;return h}function ha(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=et(t),i=et(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var o=function(t,e,n){var r=n=void 0===n?w:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+l*l*a*a)*r}(r,i);return Z(o,"meters",n.units)}function ca(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e<0,o=Z(Math.abs(e),r.units,"meters");i&&(o=-Math.abs(o));var s=et(t),a=function(t,e,n,r){r=void 0===r?w:Number(r);var i=e/r,o=t[0]*Math.PI/180,s=V(t[1]),a=V(n),u=i*Math.cos(a),l=s+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var h=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),c=Math.abs(h)>1e-11?u/h:Math.cos(s),f=i*Math.sin(a)/c;return[(180*(o+f)/Math.PI+540)%360-180,180*l/Math.PI]}(s,o,n);return a[0]+=a[0]-s[0]>180?-360:s[0]-a[0]>180?360:0,M(a,r.properties)}function fa(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");if(0===e)return t;var o=null!=r?r:Yi(t);return!1!==i&&void 0!==i||(t=so(t)),dt(t,function(t){var n=vt(o,t)+e,r=ha(o,t),i=nt(ca(o,r,n));t[0]=i[0],t[1]=i[1]}),K(t),t}function va(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",s=r.angle||0,a=r.pivot||t,u=r.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!J(r))throw new Error("options must be an object");if(!W(i))throw new Error("steps must be a number");if(!W(s))throw new Error("angle must be a number");var l=et(fa(M(et(t)),s,{pivot:a}));s=-90+s,i=Math.ceil(i/4);for(var h=[],c=[],f=e,v=n,g=v,d=(f-v)/(Math.PI/2),p=(f+v)*Math.PI/4,y=i,m=0,_=0,x=0;x<i;x++)_+=m,m=0===d?p/y/g:(-(d*_+g)+Math.sqrt(Math.pow(d*_+g,2)-.5*d*4*(-p/y)))/(.5*d*2),0!=_&&h.push(_);c.push(0);for(var E=0;E<h.length;E++)c.push(h[E]);c.push(Math.PI/2);for(var k=0;k<h.length;k++)c.push(Math.PI-h[h.length-k-1]);c.push(Math.PI);for(var w=0;w<h.length;w++)c.push(Math.PI+h[w]);c.push(3*Math.PI/2);for(var b=0;b<h.length;b++)c.push(2*Math.PI-h[h.length-b-1]);c.push(0);for(var I=[],N=0,S=c;N<S.length;N++){var L=S[N],C=Math.atan2(v*Math.sin(L),f*Math.cos(L)),T=Math.sqrt(Math.pow(f,2)*Math.pow(v,2)/(Math.pow(f*Math.sin(C),2)+Math.pow(v*Math.cos(C),2)));I.push(ct(l,T,s+U(C),{units:o}).geometry.coordinates)}return P([I],u)}function ga(t){return jt(qt(t))}function da(t){var e=[];return"FeatureCollection"===t.type?_t(t,function(t){dt(t,function(n){e.push(M(n,t.properties))})}):"Feature"===t.type?dt(t,function(n){e.push(M(n,t.properties))}):dt(t,function(t){e.push(M(t))}),R(e)}function pa(t){for(var e=Math.pow(10,6),n=[],r=0;r<t.length;r++){var i=t[r];void 0!==i&&(n[r]=Math.round((i+Number.EPSILON)*e)/e)}return n}var ya=Math.PI/180,ma=180/Math.PI,_a=function(){function t(e,n){i(this,t),u(this,"lon",void 0),u(this,"lat",void 0),u(this,"x",void 0),u(this,"y",void 0),this.lon=e,this.lat=n,this.x=ya*e,this.y=ya*n}return s(t,[{key:"view",value:function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)}},{key:"antipode",value:function(){var e=-1*this.lat;return new t(this.lon<0?180+this.lon:-1*(180-this.lon),e)}}])}(),xa=function(){return s(function t(e){i(this,t),u(this,"properties",{}),u(this,"geometries",[]),e&&(this.properties=e)},[{key:"json",value:function(){if(0===this.geometries.length)return{type:"Feature",geometry:{type:"LineString",coordinates:null},properties:this.properties};if(1===this.geometries.length){var t=this.geometries[0];return t?{type:"Feature",geometry:{type:"LineString",coordinates:t.coords},properties:this.properties}:{type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:this.properties}}return{type:"Feature",geometry:{type:"MultiLineString",coordinates:this.geometries.filter(function(t){return void 0!==t}).map(function(t){return t.coords})},properties:this.properties}}},{key:"wkt",value:function(){if(0===this.geometries.length)return"";var t,e=[],n=a(this.geometries);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r&&0!==r.coords.length){var i=r.coords.filter(function(t){return void 0!==t}).map(function(t){var e,n,r=null!==(e=t[0])&&void 0!==e?e:0,i=null!==(n=t[1])&&void 0!==n?n:0;return"".concat(r," ").concat(i)});0===i.length?e.push("LINESTRING EMPTY"):e.push("LINESTRING(".concat(i.join(","),")"))}else e.push("LINESTRING EMPTY")}}catch(t){n.e(t)}finally{n.f()}return e.join("; ")}}])}(),Ea=function(){return s(function t(){i(this,t),u(this,"coords",[]),u(this,"length",0)},[{key:"move_to",value:function(t){this.length++,this.coords.push(t)}}])}(),ka=function(){return s(function t(e,n,r){if(i(this,t),u(this,"start",void 0),u(this,"end",void 0),u(this,"properties",void 0),u(this,"g",void 0),!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!n||void 0===n.x||void 0===n.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new _a(e.x,e.y),this.end=new _a(n.x,n.y),this.properties=r||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,a=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(a)),this.g===Math.PI)throw new Error("it appears "+this.start.view()+" and "+this.end.view()+" are \'antipodal\', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+n)},[{key:"interpolate",value:function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=ma*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[ma*Math.atan2(i,r),s]}},{key:"Arc",value:function(t,e){var n,r=[];if(!t||t<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var i=1/(t-1),o=0;o<t;++o){var s=i*o,a=this.interpolate(s);r.push(a)}for(var u=!1,l=0,h=null!==(n=null==e?void 0:e.offset)&&void 0!==n?n:10,c=180-h,f=-180+h,v=360-h,g=1;g<r.length;++g){var d,p,y,m,_=null!==(d=null===(p=r[g-1])||void 0===p?void 0:p[0])&&void 0!==d?d:0,x=null!==(y=null===(m=r[g])||void 0===m?void 0:m[0])&&void 0!==y?y:0,E=Math.abs(x-_);E>v&&(x>c&&_<f||_>c&&x<f)?u=!0:E>l&&(l=E)}var k=[];if(u&&l<h){var w=[];k.push(w);for(var b=0;b<r.length;++b){var I,N,S,M,L=parseFloat((null!==(I=null===(N=r[b])||void 0===N?void 0:N[0])&&void 0!==I?I:0).toString());if(b>0&&Math.abs(L-(null!==(S=null===(M=r[b-1])||void 0===M?void 0:M[0])&&void 0!==S?S:0))>v){var P,C,T,O,R,A,D,F,q,G,Y,B,z,j,X,U,V,Z,H=parseFloat((null!==(P=null===(C=r[b-1])||void 0===C?void 0:C[0])&&void 0!==P?P:0).toString()),W=parseFloat((null!==(T=null===(O=r[b-1])||void 0===O?void 0:O[1])&&void 0!==T?T:0).toString()),J=parseFloat((null!==(R=null===(A=r[b])||void 0===A?void 0:A[0])&&void 0!==R?R:0).toString()),K=parseFloat((null!==(D=null===(F=r[b])||void 0===F?void 0:F[1])&&void 0!==D?D:0).toString());if(H>-180&&H<f&&180===J&&b+1<r.length&&(null!==(q=null===(G=r[b-1])||void 0===G?void 0:G[0])&&void 0!==q?q:0)>-180&&(null!==(Y=null===(B=r[b-1])||void 0===B?void 0:B[0])&&void 0!==Y?Y:0)<f){var Q,$,tt,et,nt,rt;w.push([-180,null!==(Q=null===($=r[b])||void 0===$?void 0:$[1])&&void 0!==Q?Q:0]),b++,w.push([null!==(tt=null===(et=r[b])||void 0===et?void 0:et[0])&&void 0!==tt?tt:0,null!==(nt=null===(rt=r[b])||void 0===rt?void 0:rt[1])&&void 0!==nt?nt:0]);continue}if(H>c&&H<180&&-180===J&&b+1<r.length&&(null!==(z=null===(j=r[b-1])||void 0===j?void 0:j[0])&&void 0!==z?z:0)>c&&(null!==(X=null===(U=r[b-1])||void 0===U?void 0:U[0])&&void 0!==X?X:0)<180){var it,ot,st,at,ut,lt;w.push([180,null!==(it=null===(ot=r[b])||void 0===ot?void 0:ot[1])&&void 0!==it?it:0]),b++,w.push([null!==(st=null===(at=r[b])||void 0===at?void 0:at[0])&&void 0!==st?st:0,null!==(ut=null===(lt=r[b])||void 0===lt?void 0:lt[1])&&void 0!==ut?ut:0]);continue}if(H<=180&&J>=180&&H<J){var ht,ct,ft,vt,gt=(180-H)/(J-H),dt=gt*K+(1-gt)*W;w.push([(null!==(ht=null===(ct=r[b-1])||void 0===ct?void 0:ct[0])&&void 0!==ht?ht:0)>c?180:-180,dt]),(w=[]).push([(null!==(ft=null===(vt=r[b-1])||void 0===vt?void 0:vt[0])&&void 0!==ft?ft:0)>c?-180:180,dt]),k.push(w)}else w=[],k.push(w);w.push([L,null!==(V=null===(Z=r[b])||void 0===Z?void 0:Z[1])&&void 0!==V?V:0])}else{var pt,yt,mt,_t;w.push([null!==(pt=null===(yt=r[b])||void 0===yt?void 0:yt[0])&&void 0!==pt?pt:0,null!==(mt=null===(_t=r[b])||void 0===_t?void 0:_t[1])&&void 0!==mt?mt:0])}}}else{var xt=[];k.push(xt);for(var Et=0;Et<r.length;++Et){var kt,wt,bt,It;xt.push([null!==(kt=null===(wt=r[Et])||void 0===wt?void 0:wt[0])&&void 0!==kt?kt:0,null!==(bt=null===(It=r[Et])||void 0===It?void 0:It[1])&&void 0!==bt?bt:0])}}for(var Nt=new xa(this.properties),St=0;St<k.length;++St){var Mt=new Ea;Nt.geometries.push(Mt);var Lt=k[St];if(Lt)for(var Pt=0;Pt<Lt.length;++Pt){var Ct=Lt[Pt];Ct&&Mt.move_to(pa([Ct[0],Ct[1]]))}}return Nt}}])}();function wa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(kt(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must specify at least 2 geometries");var r=ra.apply(sa,[n[0]].concat(_(n.slice(1))));return 0===r.length?null:1===r.length?P(r[0],e.properties):F(r,e.properties)}function ba(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=JSON.stringify(n.properties||{}),i=m(t,4),o=i[0],s=i[1],a=i[2],u=i[3],l=(s+u)/2,h=(o+a)/2,c=2*e/ft([o,l],[a,l],n)*(a-o),f=2*e/ft([h,s],[h,u],n)*(u-s),v=c/2,g=2*v,d=Math.sqrt(3)/2*f,p=a-o,y=u-s,_=3/4*g,x=d,E=(p-g)/(g-v/2),k=Math.floor(E),w=(k*_-v/2-p)/2-v/2+_/2,b=Math.floor((y-d)/d),I=(y-b*d)/2,N=b*d-y>d/2;N&&(I-=d/4);for(var S=[],M=[],L=0;L<6;L++){var P=2*Math.PI/6*L;S.push(Math.cos(P)),M.push(Math.sin(P))}for(var C=[],T=0;T<=k;T++)for(var O=0;O<=b;O++){var A=T%2==1;if((0!==O||!A)&&(0!==O||!N)){var D=T*_+o-w,F=O*x+s+I;if(A&&(F-=d/2),!0===n.triangles)Na([D,F],c/2,f/2,JSON.parse(r),S,M).forEach(function(t){n.mask?wa(R([n.mask,t]))&&C.push(t):C.push(t)});else{var q=Ia([D,F],c/2,f/2,JSON.parse(r),S,M);n.mask?wa(R([n.mask,q]))&&C.push(q):C.push(q)}}}return R(C)}function Ia(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=t[0]+e*i[a],l=t[1]+n*o[a];s.push([u,l])}return s.push(s[0].slice()),P([s],r)}function Na(t,e,n,r,i,o){for(var s=[],a=0;a<6;a++){var u=[];u.push(t),u.push([t[0]+e*i[a],t[1]+n*o[a]]),u.push([t[0]+e*i[(a+1)%6],t[1]+n*o[(a+1)%6]]),u.push(t),s.push(P([u],r))}return s}function Sa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],s=t[2],a=t[3],u=e/ft([i,o],[s,o],n)*(s-i),l=e/ft([i,o],[i,a],n)*(a-o),h=s-i,c=a-o,f=Math.floor(h/u),v=(c-Math.floor(c/l)*l)/2,g=i+(h-f*u)/2;g<=s;){for(var d=o+v;d<=a;){var p=M([g,d],n.properties);n.mask?hr(p,n.mask)&&r.push(p):r.push(p),d+=l}g+=u}return R(r)}function Ma(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o=t[0],s=t[1],a=t[2],u=t[3],l=a-o,h=Z(e,r.units,"degrees"),c=u-s,f=Z(n,r.units,"degrees"),v=Math.floor(Math.abs(l)/h),g=Math.floor(Math.abs(c)/f),d=(c-g*f)/2,p=o+(l-v*h)/2,y=0;y<v;y++){for(var m=s+d,_=0;_<g;_++){var x=P([[[p,m],[p,m+f],[p+h,m+f],[p+h,m],[p,m]]],r.properties);r.mask?Wn(r.mask,x)&&i.push(x):i.push(x),m+=f}p+=h}return R(i)}function La(t,e){return Ma(t,e,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function Pa(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=e/ft([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/ft([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var u=0,l=t[1];l<=t[3];){var h=null,c=null;s%2==0&&u%2==0?(h=P([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)):s%2==0&&u%2==1?(h=P([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties)):u%2==0&&s%2==1?(h=P([[[a,l],[a,l+o],[a+i,l+o],[a,l]]],n.properties),c=P([[[a,l],[a+i,l+o],[a+i,l],[a,l]]],n.properties)):u%2==1&&s%2==1&&(h=P([[[a,l],[a,l+o],[a+i,l],[a,l]]],n.properties),c=P([[[a,l+o],[a+i,l+o],[a+i,l],[a,l+o]]],n.properties)),n.mask?(wa(R([n.mask,h]))&&r.push(h),wa(R([n.mask,c]))&&r.push(c)):(r.push(h),r.push(c)),l+=o,u++}s++,a+=i}return R(r)}var Ca=Object.defineProperty,Ta=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Aa=function(t,e,n){return e in t?Ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Da=function(t,e){for(var n in e||(e={}))Oa.call(e,n)&&Aa(t,n,e[n]);if(Ta){var r,i=a(Ta(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Ra.call(e,n)&&Aa(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Fa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e))throw new Error("options is invalid");var n=e.zProperty,r=void 0===n?"elevation":n,i=e.flip,o=void 0!==i&&i,s=e.flags,a=void 0!==s&&s;st(t,"Point","input must contain Points");for(var u=function(t,e){var n={};_t(t,function(t){var e=nt(t)[1];n[e]||(n[e]=[]),n[e].push(t)});for(var r=[],i=0,o=Object.values(n);i<o.length;i++){var s=o[i];r.push(s.sort(function(t,e){return nt(t)[0]-nt(e)[0]}))}return r.sort(e?function(t,e){return nt(t[0])[1]-nt(e[0])[1]}:function(t,e){return nt(e[0])[1]-nt(t[0])[1]}),r}(t,o),l=[],h=0;h<u.length;h++){for(var c=u[h],f=[],v=0;v<c.length;v++){var g=c[v];null==g.properties&&(g.properties={}),g.properties[r]?f.push(g.properties[r]):f.push(0),!0===a&&(g.properties.matrixPosition=[h,v])}l.push(f)}return l}function qa(t,e){for(var n=[],r=t[0].length,i=t.length,o=0;o<i-1;o++)for(var s=0;s<r-1;s++){var a=t[o+1][s+1],u=t[o][s+1],l=t[o][s],h=t[o+1][s];switch((h>=e?8:0)|(a>=e?4:0)|(u>=e?2:0)|(l>=e?1:0)){case 0:case 15:continue;case 1:n.push([[s+c(l,u),o],[s,o+c(l,h)]]);break;case 2:n.push([[s+1,o+c(u,a)],[s+c(l,u),o]]);break;case 3:n.push([[s+1,o+c(u,a)],[s,o+c(l,h)]]);break;case 4:n.push([[s+c(h,a),o+1],[s+1,o+c(u,a)]]);break;case 5:(h+a+u+l)/4>=e?n.push([[s+c(h,a),o+1],[s,o+c(l,h)]],[[s+c(l,u),o],[s+1,o+c(u,a)]]):n.push([[s+c(h,a),o+1],[s+1,o+c(u,a)]],[[s+c(l,u),o],[s,o+c(l,h)]]);break;case 6:n.push([[s+c(h,a),o+1],[s+c(l,u),o]]);break;case 7:n.push([[s+c(h,a),o+1],[s,o+c(l,h)]]);break;case 8:n.push([[s,o+c(l,h)],[s+c(h,a),o+1]]);break;case 9:n.push([[s+c(l,u),o],[s+c(h,a),o+1]]);break;case 10:(h+a+u+l)/4>=e?n.push([[s,o+c(l,h)],[s+c(l,u),o]],[[s+1,o+c(u,a)],[s+c(h,a),o+1]]):n.push([[s,o+c(l,h)],[s+c(h,a),o+1]],[[s+1,o+c(u,a)],[s+c(l,u),o]]);break;case 11:n.push([[s+1,o+c(u,a)],[s+c(h,a),o+1]]);break;case 12:n.push([[s,o+c(l,h)],[s+1,o+c(u,a)]]);break;case 13:n.push([[s+c(l,u),o],[s+1,o+c(u,a)]]);break;case 14:n.push([[s,o+c(l,h)],[s+c(l,u),o]])}}return n;function c(t,n){if(t===n)return.5;var r=(e-t)/(n-t);return r>1?1:r<0?0:r}}function Ga(t,e){for(var n=e.length,r=e[0].length,i=[],o=[];t.length>0;){var s=_(t.shift());i.push(s);var u=void 0;do{u=!1;for(var l=0;l<t.length;l++){var h=t[l];if(h[0][0]===s[s.length-1][0]&&h[0][1]===s[s.length-1][1]){u=!0,s.push(h[1]),t.splice(l,1);break}if(h[1][0]===s[0][0]&&h[1][1]===s[0][1]){u=!0,s.unshift(h[0]),t.splice(l,1);break}}}while(u)}for(var c=function(){var t=i[0];if(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1])return o.push(t),i.shift(),1;var e,s,u=t[t.length-1];if(0===u[0]&&0!==u[1])e=Xa(i,function(t){return 0===t[0][0]&&t[0][1]<u[1]},function(t,e){return e[0][1]-t[0][1]}),s=[0,0];else if(0===u[1]&&u[0]!==r-1)e=Xa(i,function(t){return 0===t[0][1]&&t[0][0]>u[0]},function(t,e){return t[0][0]-e[0][0]}),s=[r-1,0];else if(u[0]===r-1&&u[1]!==n-1)e=Xa(i,function(t){return t[0][0]===r-1&&t[0][1]>u[1]},function(t,e){return t[0][1]-e[0][1]}),s=[r-1,n-1];else{if(u[1]!==n-1||0===u[0])throw new Error("Contour not closed but is not along an edge");e=Xa(i,function(t){return t[0][1]===n-1&&t[0][0]<u[0]},function(t,e){return e[0][0]-t[0][0]}),s=[0,n-1]}if(-1===e)t.push(s);else if(0===e)t.push([t[0][0],t[0][1]]),o.push(t),i.shift();else{var l=i[e];i.splice(e,1);var h,c=a(l);try{for(c.s();!(h=c.n()).done;){var f=h.value;t.push(f)}}catch(t){c.e(t)}finally{c.f()}}};i.length>0;)c();for(var f=0;f<o.length;f++)o[f].length<4&&(o.splice(f,1),f--);return o}function Ya(t){var e=t.map(function(t){return{ring:t,area:Ot(P([t]))}});return e.sort(function(t,e){return e.area-t.area}),e.map(function(t){return t.ring})}function Ba(t){for(var e=t.map(function(t){return{lrCoordinates:t,grouped:!1}}),n=[];!ja(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;var o=P([e[r].lrCoordinates]);t:for(var s=r+1;s<e.length;s++)if(!e[s].grouped){var a=P([e[s].lrCoordinates]);if(za(a,o)){for(var u=1;u<i.length;u++)if(za(a,P([i[u]])))continue t;i.push(e[s].lrCoordinates),e[s].grouped=!0}}n.push(i)}return n}function za(t,e){for(var n=da(t),r=0;r<n.features.length;r++)if(!Zt(n.features[r],e))return!1;return!0}function ja(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}function Xa(t,e,n){for(var r=-1,i=0;i<t.length;i++)e(t[i])&&(-1===r||n(t[r],t[i])>0)&&(r=i);return r}var Ua=Object.defineProperty,Va=Object.getOwnPropertySymbols,Za=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Wa=function(t,e,n){return e in t?Ua(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ja=function(t,e){for(var n in e||(e={}))Za.call(e,n)&&Wa(t,n,e[n]);if(Va){var r,i=a(Va(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Ha.call(e,n)&&Wa(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Ka(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e))throw new Error("options is invalid");var n=e.zProperty,r=void 0===n?"elevation":n,i=e.flip,o=void 0!==i&&i,s=e.flags,a=void 0!==s&&s;st(t,"Point","input must contain Points");for(var u=function(t,e){var n={};_t(t,function(t){var e=nt(t)[1];n[e]||(n[e]=[]),n[e].push(t)});for(var r=[],i=0,o=Object.values(n);i<o.length;i++){var s=o[i];r.push(s.sort(function(t,e){return nt(t)[0]-nt(e)[0]}))}return r.sort(e?function(t,e){return nt(t[0])[1]-nt(e[0])[1]}:function(t,e){return nt(e[0])[1]-nt(t[0])[1]}),r}(t,o),l=[],h=0;h<u.length;h++){for(var c=u[h],f=[],v=0;v<c.length;v++){var g=c[v];null==g.properties&&(g.properties={}),g.properties[r]?f.push(g.properties[r]):f.push(0),!0===a&&(g.properties.matrixPosition=[h,v])}l.push(f)}return l}function Qa(t,e){for(var n=[],r=t.length,i=t[0].length,o=0;o<r-1;o++)for(var s=0;s<i-1;s++){var a=t[o+1][s+1],u=t[o][s+1],l=t[o][s],h=t[o+1][s];switch((h>=e?8:0)|(a>=e?4:0)|(u>=e?2:0)|(l>=e?1:0)){case 0:case 15:continue;case 1:n.push([[s+p(l,u),o],[s,o+p(l,h)]]);break;case 2:n.push([[s+1,o+p(u,a)],[s+p(l,u),o]]);break;case 3:n.push([[s+1,o+p(u,a)],[s,o+p(l,h)]]);break;case 4:n.push([[s+p(h,a),o+1],[s+1,o+p(u,a)]]);break;case 5:(h+a+u+l)/4>=e?n.push([[s+p(h,a),o+1],[s,o+p(l,h)]],[[s+p(l,u),o],[s+1,o+p(u,a)]]):n.push([[s+p(h,a),o+1],[s+1,o+p(u,a)]],[[s+p(l,u),o],[s,o+p(l,h)]]);break;case 6:n.push([[s+p(h,a),o+1],[s+p(l,u),o]]);break;case 7:n.push([[s+p(h,a),o+1],[s,o+p(l,h)]]);break;case 8:n.push([[s,o+p(l,h)],[s+p(h,a),o+1]]);break;case 9:n.push([[s+p(l,u),o],[s+p(h,a),o+1]]);break;case 10:(h+a+u+l)/4>=e?n.push([[s,o+p(l,h)],[s+p(l,u),o]],[[s+1,o+p(u,a)],[s+p(h,a),o+1]]):n.push([[s,o+p(l,h)],[s+p(h,a),o+1]],[[s+1,o+p(u,a)],[s+p(l,u),o]]);break;case 11:n.push([[s+1,o+p(u,a)],[s+p(h,a),o+1]]);break;case 12:n.push([[s,o+p(l,h)],[s+1,o+p(u,a)]]);break;case 13:n.push([[s+p(l,u),o],[s+1,o+p(u,a)]]);break;case 14:n.push([[s,o+p(l,h)],[s+p(l,u),o]])}}for(var c=[];n.length>0;){var f=_(n.shift());c.push(f);var v=void 0;do{v=!1;for(var g=0;g<n.length;g++){var d=n[g];if(d[0][0]===f[f.length-1][0]&&d[0][1]===f[f.length-1][1]){v=!0,f.push(d[1]),n.splice(g,1);break}if(d[1][0]===f[0][0]&&d[1][1]===f[0][1]){v=!0,f.unshift(d[0]),n.splice(g,1);break}}}while(v)}return c;function p(t,n){if(t===n)return.5;var r=(e-t)/(n-t);return r>1?1:r<0?0:r}}function $a(t,e,n,r,i,o,s,a){var u,l,h,c,f={x:null,y:null,onLine1:!1,onLine2:!1};return 0===(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==f.x&&null!==f.y&&f:(c=(n-t)*(l=e-o)-(r-e)*(h=t-i),l=((s-i)*l-(a-o)*h)/u,h=c/u,f.x=t+l*(n-t),f.y=e+l*(r-e),l>=0&&l<=1&&(f.onLine1=!0),h>=0&&h<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function tu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return St(t,function(t,n){var r=n.geometry.coordinates;return t+ft(r[0],r[1],e)},0)}function eu(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.steps||64,s=nu(n),a=nu(r),u=Array.isArray(t)||"Feature"!==t.type?{}:t.properties;if(s===a)return T(oo(t,e,i).geometry.coordinates[0],u);for(var l=s,h=s<a?a:a+360,c=[],f=(h-l)/o,v=0;v<=o;v++){var g=v===o?h:l+v*f;c.push(ct(t,e,g,i).geometry.coordinates)}return T(c,u)}function nu(t){var e=t%360;return e<0&&(e+=360),e}function ru(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!J(r))throw new Error("options is invalid");var i,o=r.units,s=void 0===o?"kilometers":o,a=[];if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}for(var u,l,h,c=i.length,f=0,v=0;v<i.length&&!(e>=f&&v===i.length-1);v++){if(f>e&&0===a.length){var g=e-f;if(!g)return a.push(i[v]),T(a);l=ht(i[v],i[v-1])-180,h=ct(i[v],g,l,{units:s}),a.push(h.geometry.coordinates)}if(f>=n)return(u=n-f)?(l=ht(i[v],i[v-1])-180,h=ct(i[v],u,l,{units:s}),a.push(h.geometry.coordinates),T(a)):(a.push(i[v]),T(a));if(f>=e&&a.push(i[v]),v===i.length-1)return T(a);f+=ft(i[v],i[v+1],{units:s})}if(f<e&&i.length===c)throw new Error("Start position is beyond line");var d=i[i.length-1];return T([d,d])}function iu(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function ou(t,e){return t[0]*e[1]-e[0]*t[1]}function su(t,e){return!function(t,e){return 0===ou(iu(t),iu(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=iu(t),s=e[0],a=iu(e),u=ou(o,a),l=function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(ou((r=i,[(n=s)[0]-r[0],n[1]-r[1]]),a)/u,o));return l}(t,e)}function au(t,e,n){var r=[],i=z(e,n),o=nt(t),s=[];return o.forEach(function(t,e){if(e!==o.length-1){var n=(l=t,h=o[e+1],c=i,f=Math.sqrt((l[0]-h[0])*(l[0]-h[0])+(l[1]-h[1])*(l[1]-h[1])),v=l[0]+c*(h[1]-l[1])/f,g=h[0]+c*(h[1]-l[1])/f,d=l[1]+c*(l[0]-h[0])/f,p=h[1]+c*(l[0]-h[0])/f,[[v,d],[g,p]]);if(r.push(n),e>0){var a=r[e-1],u=su(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}var l,h,c,f,v,g,d,p}),T(s,"Feature"===t.type?t.properties:{})}function uu(t,e){var n="Feature"===t.type?t.geometry:t;e.properties.segmentIndex>=n.coordinates.length-1&&(e.properties.segmentIndex=n.coordinates.length-2)}function lu(t,e,n,r){e=e||("Feature"===t.type?t.properties:{});var i=at(t),o=i.coordinates,s=i.type;if(!o.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(o=hu(o)),P([o],e);case"MultiLineString":var a=[],u=0;return o.forEach(function(t){if(n&&(t=hu(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(qt(T(t)));e>u?(a.unshift(t),u=e):a.push(t)}else a.push(t)}),P(a,e);default:throw new Error("geometry type "+s+" is not supported")}}function hu(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function cu(t){return F(t)}function fu(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return t&&(e="Feature"===t.type?t.geometry.coordinates:t.coordinates),P(e)}function vu(t){var e,n=0,r=a(t);try{for(r.s();!(e=r.n()).done;){n+=e.value}}catch(t){r.e(t)}finally{r.f()}return n/t.length}var gu=Object.defineProperty,du=Object.defineProperties,pu=Object.getOwnPropertyDescriptors,yu=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,xu=function(t,e,n){return e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Eu=function(t,e){for(var n in e||(e={}))mu.call(e,n)&&xu(t,n,e[n]);if(yu){var r,i=a(yu(e));try{for(i.s();!(r=i.n()).done;){n=r.value;_u.call(e,n)&&xu(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t},ku=function(t,e){return du(t,pu(e))};function wu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r=1/0,i=0;_t(e,function(e,o){var s=ft(t,e,n);s<r&&(i=o,r=s)});var o=so(e.features[i]);return ku(Eu({},o),{properties:ku(Eu({},o.properties),{featureIndex:i,distanceToPoint:r})})}function bu(t,e){var n,r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=null!=(n=i.method)?n:"geodesic",s=null!=(r=i.units)?r:"kilometers";if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=M(t):"Point"===t.type?t=N(t):ot(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=T(e):"LineString"===e.type?e=N(e):ot(e,"LineString","line");var a=1/0,u=t.geometry.coordinates;return Nt(e,function(t){if(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],r=function(t,e,n,r){if("geodesic"===r.method){return $e(T([e,n]).geometry,t,{units:"degrees"}).properties.pointDistance}var i=[n[0]-e[0],n[1]-e[1]],o=[t[0]-e[0],t[1]-e[1]],s=Iu(o,i);if(s<=0)return ha(t,e,{units:"degrees"});var a=Iu(i,i);if(a<=s)return ha(t,n,{units:"degrees"});var u=s/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return ha(t,l,{units:"degrees"})}(u,e,n,{method:o});r<a&&(a=r)}}),Z(a,"degrees",s)}function Iu(t,e){return t[0]*e[0]+t[1]*e[1]}var Nu=Object.defineProperty,Su=Object.getOwnPropertySymbols,Mu=Object.prototype.hasOwnProperty,Lu=Object.prototype.propertyIsEnumerable,Pu=function(t,e,n){return e in t?Nu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Cu=function(t,e){for(var n in e||(e={}))Mu.call(e,n)&&Pu(t,n,e[n]);if(Su){var r,i=a(Su(e));try{for(i.s();!(r=i.n()).done;){n=r.value;Lu.call(e,n)&&Pu(t,n,e[n])}}catch(t){i.e(t)}finally{i.f()}}return t};function Tu(t,e,n,r,i,o){return Math.sqrt((i-n)*(i-n)+(o-r)*(o-r))===Math.sqrt((t-n)*(t-n)+(e-r)*(e-r))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}function Ou(t,e){var n=[];return _t(t,function(t){var r=!1;if("Point"===t.geometry.type)kt(e,function(e){Zt(t,e)&&(r=!0)}),r&&n.push(t);else{if("MultiPoint"!==t.geometry.type)throw new Error("Input geometry must be a Point or MultiPoint");var i=[];kt(e,function(e){dt(t,function(t){Zt(t,e)&&(r=!0,i.push(t))})}),r&&n.push(D(i,t.properties))}}),R(n)}function Ru(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0];return function(t){return(t>0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function Au(t,e){return e.geometry.coordinates[0].every(function(e){return Zt(M(e),t)})}var Du=function(){return s(function t(e,n){i(this,t),this.id=e,this.coordinates=n,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1},[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]===0&&i.coordinates[0]-t.coordinates[0]===0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Ru(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))}),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}])}(),Fu=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return s(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}},{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { ".concat(this.from.id," -> ").concat(this.to.id," }")}},{key:"toLineString",value:function(){return T([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return Ru(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}])}(),qu=function(){return s(function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0},[{key:"push",value:function(t){this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"length",get:function(){return this.edges.length}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce(function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e},0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Ru(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0}},{key:"toMultiPoint",value:function(){return D(this.edges.map(function(t){return t.from.coordinates}))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(t){return t.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=P([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=ga(this.toPolygon())}},{key:"inside",value:function(t){return Zt(t,this.toPolygon())}}],[{key:"findEdgeRingContaining",value:function(t,e){var n,r,i=t.getEnvelope();return e.forEach(function(e){var o,s,u,l,h,c,f=e.getEnvelope();if((r&&(n=r.getEnvelope()),s=i,u=(o=f).geometry.coordinates[0].map(function(t){return t[0]}),l=o.geometry.coordinates[0].map(function(t){return t[1]}),h=s.geometry.coordinates[0].map(function(t){return t[0]}),c=s.geometry.coordinates[0].map(function(t){return t[1]}),Math.max.apply(null,u)!==Math.max.apply(null,h)||Math.max.apply(null,l)!==Math.max.apply(null,c)||Math.min.apply(null,u)!==Math.min.apply(null,h)||Math.min.apply(null,l)!==Math.min.apply(null,c))&&Au(f,i)){var v,g,d=a(t.map(function(t){return t.from.coordinates}));try{var p=function(){var t=g.value;e.some(function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r})||(v=t)};for(d.s();!(g=d.n()).done;)p()}catch(t){d.e(t)}finally{d.f()}v&&e.inside(M(v))&&(r&&!Au(n,f)||(r=e))}}),r}}])}();var Gu=function(){function t(){i(this,t),this.nodes=new Map,this.nodeId=0,this.edges=new Map}return s(t,[{key:"getNode",value:function(t){var e,n=null==(e=this.nodes.get(t[0]))?void 0:e.get(t[1]);if(null==n){var r=new Du(this.nodeId++,t),i=this.nodes.get(t[0]);return null==i&&(i=new Map,this.nodes.set(t[0],i)),i.set(t[1],r),r}return n}},{key:"addEdge",value:function(t,e){var n;if(!(null==(n=this.edges.get(t))?void 0:n.has(e))){var r=new Fu(t,e),i=r.getSymetric(),o=this.edges.get(t);null==o&&(o=new Map,this.edges.set(t,o)),o.set(e,r);var s=this.edges.get(e);null==s&&(s=new Map,this.edges.set(e,s)),s.set(t,i)}}},{key:"deleteDangles",value:function(){var t=this;this._forEachNode(function(e){return t._removeIfDangle(e)})}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(t){return t.to});this.removeNode(t),n.forEach(function(t){return e._removeIfDangle(t)})}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this._forEachEdge(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})}},{key:"_computeNextCWEdges",value:function(t){var e=this;null==t?this._forEachNode(function(t){return e._computeNextCWEdges(t)}):t.getOuterEdges().forEach(function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e})}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,l=void 0;s.label===e&&(u=s),a.label===e&&(l=a),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this._forEachEdge(function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}}),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this._forEachEdge(function(t){t.label=void 0}),this._findLabeledEdgeRings().forEach(function(e){t._findIntersectionNodes(e).forEach(function(n){t._computeNextCCWEdges(n,e.label)})});var e=[];return this._forEachEdge(function(n){n.ring||e.push(t._findEdgeRing(n))}),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach(function(e){e.label===t.label&&++r}),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new qu;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e,n=this;t.getOuterEdges().forEach(function(t){return n.removeEdge(t)}),t.innerEdges.forEach(function(t){return n.removeEdge(t)}),null==(e=this.nodes.get(t.coordinates[0]))||e.delete(t.coordinates[1])}},{key:"removeEdge",value:function(t){var e;null==(e=this.edges.get(t.from))||e.delete(t.to),t.deleteEdge()}},{key:"_forEachNode",value:function(t){var e,n=a(this.nodes.values());try{for(n.s();!(e=n.n()).done;){var r,i=a(e.value.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}}},{key:"_forEachEdge",value:function(t){var e,n=a(this.edges.values());try{for(n.s();!(e=n.n()).done;){var r,i=a(e.value.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}}}],[{key:"fromGeoJson",value:function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type \'".concat(t.type,"\'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature"))}(e);var n=new t;return bt(e,function(t){ot(t,"LineString","Graph::fromGeoJson"),pt(t,function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e})}),n}}])}();function Yu(t,e){var n,r;dt(t,function(t,i,o,s,a){if(r!==a)e.push([]);else{var u=n[0],l=n[1],h=t[0],c=t[1];e[a].push([.75*u+.25*h,.75*l+.25*c]),e[a].push([.25*u+.75*h,.25*l+.75*c])}n=t,r=a},!1),e.forEach(function(t){t.push(t[0])})}function Bu(t,e){var n,r,i;dt(t,function(t,o,s,a,u){if(r!==a)e.push([[]]);else if(i!==u)e[a].push([]);else{var l=n[0],h=n[1],c=t[0],f=t[1];e[a][u].push([.75*l+.25*c,.75*h+.25*f]),e[a][u].push([.25*l+.75*c,.25*h+.75*f])}n=t,r=a,i=u},!1),e.forEach(function(t){t.forEach(function(t){t.push(t[0])})})}function zu(t,e,n,r,i){for(var o=0;o<t.length;o++){var s=t[o],a=t[o+1];o===t.length-1&&(a=t[0]);var u=Uu(s,a,e);n<=0&&u>0?Xu(e,s,r)||(r=s):n>0&&u<=0&&(ju(e,s,i)||(i=s)),n=u}return[r,i]}function ju(t,e,n){return Uu(t,e,n)>0}function Xu(t,e,n){return Uu(t,e,n)<0}function Uu(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function Vu(t){return Hu(t,"mercator",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Zu(t){return Hu(t,"wgs84",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function Hu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&W(t[0])?t="mercator"===e?Wu(t):Ju(t):(!0!==r&&(t=so(t)),dt(t,function(t){var n="mercator"===e?Wu(t):Ju(t);t[0]=n[0],t[1]=n[1]})),t}function Wu(t){var e=Math.PI/180,n=6378137,r=20037508.342789244,i=Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]),o=[n*i*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return o[0]>r&&(o[0]=r),o[0]<-r&&(o[0]=-r),o[1]>r&&(o[1]=r),o[1]<-r&&(o[1]=-r),o}function Ju(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var Ku=Object.freeze({__proto__:null,toMercator:Vu,toWgs84:Zu});var Qu={20:1.07275,15:1.13795,10:1.22385,5:1.3581,2:1.51743,1:1.62762};function $u(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function tl(t){var e=[];return function t(n){return 0===n||1===n?1:e[n]>0?e[n]:e[n]=t(n-1)*n}(t)}function el(t){return rl(t),nl(t)}function nl(t){return Array.isArray(t)?ul(t):t&&t.bbox?ul(t.bbox):[360*al(),180*al()]}function rl(t){null!=t&&(Array.isArray(t)?Q(t):null!=t.bbox&&Q(t.bbox))}function il(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rl(e.bbox),null==t&&(t=1);for(var n=[],r=0;r<t;r++)n.push(M(nl(e.bbox)));return R(n)}function ol(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rl(e.bbox),null==t&&(t=1),void 0!==e.bbox&&null!==e.bbox||(e.bbox=[-180,-90,180,90]),W(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),W(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);var n=Math.abs(e.bbox[0]-e.bbox[2]),r=Math.abs(e.bbox[1]-e.bbox[3]),i=Math.min(n/2,r/2);if(e.max_radial_length>i)throw new Error("max_radial_length is greater than the radius of the bbox");for(var o=[e.bbox[0]+e.max_radial_length,e.bbox[1]+e.max_radial_length,e.bbox[2]-e.max_radial_length,e.bbox[3]-e.max_radial_length],s=[],a=function(){var t,n=[],r=_(Array(e.num_vertices+1)).map(Math.random);r.forEach(function(t,e,n){n[e]=e>0?t+n[e-1]:t}),r.forEach(function(t){t=2*t*Math.PI/r[r.length-1];var i=Math.random();n.push([i*(e.max_radial_length||10)*Math.sin(t),i*(e.max_radial_length||10)*Math.cos(t)])}),n[n.length-1]=n[0],n=n.reverse().map((t=nl(o),function(e){return[e[0]+t[0],e[1]+t[1]]})),s.push(P([n]))},u=0;u<t;u++)a();return R(s)}function sl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.bbox;rl(n);var r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!W(r)||void 0===r||r<2)&&(r=10),W(i)&&void 0!==i||(i=1e-4),W(o)&&void 0!==o||(o=Math.PI/8);for(var s=[],a=0;a<t;a++){for(var u=[nl(n)],l=0;l<r-1;l++){var h=(0===l?2*Math.random()*Math.PI:Math.tan((u[l][1]-u[l-1][1])/(u[l][0]-u[l-1][0])))+(Math.random()-.5)*o*2,c=Math.random()*i;u.push([u[l][0]+c*Math.cos(h),u[l][1]+c*Math.sin(h)])}s.push(T(u))}return R(s)}function al(){return Math.random()-.5}function ul(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}var ll=Object.freeze({__proto__:null,randomLineString:sl,randomPoint:il,randomPolygon:ol,randomPosition:el});function hl(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return kt(t,function(t){hl(t,e)}),t;case"LineString":return cl(nt(t),e),t;case"Polygon":return fl(nt(t),e),t;case"MultiLineString":return nt(t).forEach(function(t){cl(t,e)}),t;case"MultiPolygon":return nt(t).forEach(function(t){fl(t,e)}),t;case"Point":case"MultiPoint":return t}}function cl(t,e){Ut(t)===e&&t.reverse()}function fl(t,e){Ut(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)Ut(t[n])===e&&t[n].reverse()}function vl(t){var e=t%360;return e<0&&(e+=360),e}function gl(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.origin||"centroid",i=n.mutate||!1;if(!t)throw new Error("geojson required");if("number"!=typeof e||e<=0)throw new Error("invalid factor");var o=Array.isArray(r)||"object"===E(r);return!0!==i&&(t=so(t)),"FeatureCollection"!==t.type||o?dl(t,e,r):(_t(t,function(n,i){t.features[i]=dl(n,e,r)}),1!==e&&delete t.bbox,t)}function dl(t,e,n){var r="Point"===ut(t),i=function(t,e){null==e&&(e="centroid");if(Array.isArray(e)||"object"===E(e))return et(e);var n=t.bbox?t.bbox:qt(t,{recompute:!0}),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return M([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return M([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return M([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return M([o,s]);case"center":return cr(t);case void 0:case null:case"centroid":return Yi(t);default:throw new Error("invalid origin")}}(t,n);return 1===e||r||(dt(t,function(t){var n=ha(i,t),r=vt(i,t),o=nt(ca(i,n*e,r));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)}),K(t)),t}function pl(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}var yl={search:function(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.cleanDirty(),i=i||{};var o=yl.heuristics.manhattan,s=null!=(r=i.closest)&&r,a=new xl(function(t){return t.f}),u=e;for(e.h=o(e,n),a.push(e);a.size()>0;){var l=a.pop();if(l===n)return pl(l);l.closed=!0;for(var h=t.neighbors(l),c=0,f=h.length;c<f;++c){var v=h[c];if(!v.closed&&!v.isWall()){var g=l.g+v.getCost(l),d=v.visited;(!d||g<v.g)&&(v.visited=!0,v.parent=l,v.h=v.h||o(v,n),v.g=g,v.f=v.g+v.h,t.markDirty(v),s&&(v.h<u.h||v.h===u.h&&v.g<u.g)&&(u=v),d?a.rescoreElement(v):a.push(v))}}}return s?pl(u):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=void 0}},ml=function(){return s(function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.nodes=[],this.grid=[],this.dirtyNodes=[],this.diagonal=!!n.diagonal;for(var r=0;r<e.length;r++){this.grid[r]=[];for(var o=0,s=e[r];o<s.length;o++){var a=new _l(r,o,s[o]);this.grid[r][o]=a,this.nodes.push(a)}}this.init()},[{key:"init",value:function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)yl.cleanNode(this.nodes[t])}},{key:"cleanDirty",value:function(){for(var t=0;t<this.dirtyNodes.length;t++)yl.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]}},{key:"markDirty",value:function(t){this.dirtyNodes.push(t)}},{key:"neighbors",value:function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e}},{key:"toString",value:function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\\n")}}])}(),_l=function(){return s(function t(e,n,r){i(this,t),this.visited=!1,this.h=0,this.g=0,this.f=0,this.closed=!1,this.x=e,this.y=n,this.weight=r},[{key:"toString",value:function(){return"["+this.x+" "+this.y+"]"}},{key:"getCost",value:function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight}},{key:"isWall",value:function(){return 0===this.weight}}])}(),xl=function(){return s(function t(e){i(this,t),this.content=[],this.scoreFunction=e},[{key:"push",value:function(t){this.content.push(t),this.sinkDown(this.content.length-1)}},{key:"pop",value:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t}},{key:"remove",value:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))}},{key:"size",value:function(){return this.content.length}},{key:"rescoreElement",value:function(t){this.sinkDown(this.content.indexOf(t))}},{key:"sinkDown",value:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}}},{key:"bubbleUp",value:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var l=this.content[o];this.scoreFunction(l)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}}])}();function El(t,e){for(var n=0;n<e.features.length;n++)if(Zt(t,e.features[n]))return!0;return!1}function kl(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function wl(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function bl(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=wl(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&bl(t,e,o,r,i),i.push(t[o]),n-o>1&&bl(t,o,n,r,i))}function Il(t,e){var n=t.length-1,r=[t[0]];return bl(t,0,n,e,r),r.push(t[n]),r}function Nl(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;o<s;o++)kl(n=t[o],r)>e&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),t=Il(t,r)}function Sl(t,e,n){return t.map(function(t){if(t.length<4)throw new Error("invalid polygon");for(var r=e,i=Nl(t,r,n);!Ml(i)&&r>=Number.EPSILON;)i=Nl(t,r-=.01*r,n);return Ml(i)?(i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i):t})}function Ml(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}function Ll(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}var Pl,Cl={exports:{}};var Tl=function(){if(Pl)return Cl.exports;function t(t,n,i){i=i||2;var o,s,a,h,c,v,g,d=n&&n.length,p=d?n[0]*i:t.length,y=e(t,0,p,i,!0),m=[];if(!y||y.next===y.prev)return m;if(d&&(y=function(t,n,r,i){var o,s,a,h=[];for(o=0,s=n.length;o<s;o++)(a=e(t,n[o]*i,o<s-1?n[o+1]*i:t.length,i,!1))===a.next&&(a.steiner=!0),h.push(f(a));for(h.sort(u),o=0;o<h.length;o++)r=l(h[o],r);return r}(t,n,y,i)),t.length>80*i){o=a=t[0],s=h=t[1];for(var _=i;_<p;_+=i)(c=t[_])<o&&(o=c),(v=t[_+1])<s&&(s=v),c>a&&(a=c),v>h&&(h=v);g=0!==(g=Math.max(a-o,h-s))?32767/g:0}return r(y,m,i,o,s,g,0),m}function e(t,e,n,r,i){var o,s;if(i===I(t,e,n,r)>0)for(o=e;o<n;o+=r)s=k(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=k(o,t[o],t[o+1],s);return s&&p(s,s.next)&&(w(s),s=s.next),s}function n(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!p(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(w(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function r(t,e,u,l,h,f,v){if(t){!v&&f&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=c(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<l&&(a++,r=r.nextZ);e++);for(u=l;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(s>1)}(i)}(t,l,h,f);for(var g,d,p=t;t.prev!==t.next;)if(g=t.prev,d=t.next,f?o(t,l,h,f):i(t))e.push(g.i/u|0),e.push(t.i/u|0),e.push(d.i/u|0),w(t),t=d.next,p=d.next;else if((t=d)===p){v?1===v?r(t=s(n(t),e,u),e,u,l,h,f,2):2===v&&a(t,e,u,l,h,f):r(n(t),e,u,l,h,f,1);break}}}function i(t){var e=t.prev,n=t,r=t.next;if(d(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=i<o?i<s?i:s:o<s?o:s,c=a<u?a<l?a:l:u<l?u:l,f=i>o?i>s?i:s:o>s?o:s,g=a>u?a>l?a:l:u>l?u:l,p=r.next;p!==e;){if(p.x>=h&&p.x<=f&&p.y>=c&&p.y<=g&&v(i,a,o,u,s,l,p.x,p.y)&&d(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function o(t,e,n,r){var i=t.prev,o=t,s=t.next;if(d(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,f=o.y,g=s.y,p=a<u?a<l?a:l:u<l?u:l,y=h<f?h<g?h:g:f<g?f:g,m=a>u?a>l?a:l:u>l?u:l,_=h>f?h>g?h:g:f>g?f:g,x=c(p,y,e,n,r),E=c(m,_,e,n,r),k=t.prevZ,w=t.nextZ;k&&k.z>=x&&w&&w.z<=E;){if(k.x>=p&&k.x<=m&&k.y>=y&&k.y<=_&&k!==i&&k!==s&&v(a,h,u,f,l,g,k.x,k.y)&&d(k.prev,k,k.next)>=0)return!1;if(k=k.prevZ,w.x>=p&&w.x<=m&&w.y>=y&&w.y<=_&&w!==i&&w!==s&&v(a,h,u,f,l,g,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;k&&k.z>=x;){if(k.x>=p&&k.x<=m&&k.y>=y&&k.y<=_&&k!==i&&k!==s&&v(a,h,u,f,l,g,k.x,k.y)&&d(k.prev,k,k.next)>=0)return!1;k=k.prevZ}for(;w&&w.z<=E;){if(w.x>=p&&w.x<=m&&w.y>=y&&w.y<=_&&w!==i&&w!==s&&v(a,h,u,f,l,g,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,s=i.next.next;!p(o,s)&&y(o,i,i.next,s)&&x(o,s)&&x(s,o)&&(e.push(o.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),w(i),w(i.next),i=t=s),i=i.next}while(i!==t);return n(i)}function a(t,e,i,o,s,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var h=E(u,l);return u=n(u,u.next),h=n(h,h.next),r(u,e,i,o,s,a,0),void r(h,e,i,o,s,a,0)}l=l.next}u=u.next}while(u!==t)}function u(t,e){return t.x-e.x}function l(t,e){var r=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,c=n.x,f=n.y,g=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&v(o<f?i:s,o,c,f,o<f?s:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),x(r,t)&&(u<g||u===g&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,g=u)),r=r.next}while(r!==l);return n}(t,e);if(!r)return e;var i=E(r,t);return n(i,i.next),n(r,r.next)}function h(t,e){return d(t.prev,t,e.prev)<0&&d(e.next,t,t.next)<0}function c(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&y(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(x(t,e)&&x(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(d(t.prev,t,e.prev)||d(t,e.prev,e))||p(t,e)&&d(t.prev,t,t.next)>0&&d(e.prev,e,e.next)>0)}function d(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,n,r){var i=_(d(t,e,n)),o=_(d(t,e,r)),s=_(d(n,r,t)),a=_(d(n,r,e));return i!==o&&s!==a||(!(0!==i||!m(t,n,e))||(!(0!==o||!m(t,r,e))||(!(0!==s||!m(n,t,r))||!(0!==a||!m(n,e,r)))))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _(t){return t>0?1:t<0?-1:0}function x(t,e){return d(t.prev,t,t.next)<0?d(t,e,t.next)>=0&&d(t,t.prev,e)>=0:d(t,e,t.prev)<0||d(t,t.next,e)<0}function E(t,e){var n=new b(t.i,t.x,t.y),r=new b(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function k(t,e,n,r){var i=new b(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function b(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}return Pl=1,Cl.exports=t,Cl.exports.default=t,t.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(I(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(I(t,l,h,n))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*n,v=r[a+1]*n,g=r[a+2]*n;c+=Math.abs((t[f]-t[g])*(t[v+1]-t[f+1])-(t[f]-t[v])*(t[g+1]-t[f+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},t.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},Cl.exports}(),Ol=Jn(Tl);function Rl(t){var e=function(t){for(var e=3,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Ol(e.vertices,e.holes,3),r=[],i=[];n.forEach(function(t,r){var o=n[r];void 0!==e.vertices[3*o+2]?i.push([e.vertices[3*o],e.vertices[3*o+1],e.vertices[3*o+2]]):i.push([e.vertices[3*o],e.vertices[3*o+1]])});for(var o=0;o<i.length;o+=3){var s=i.slice(o,o+3);s.push(i[o]),r.push(P([s]))}return r}function Al(t,e){if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");for(var n=t.geometry.coordinates,r=[],i={},o=[],s=0;s<n.length;s++)for(var a=0;a<n[s].length-1;a++)o.push(f(s,a));var u=new te;u.load(o);for(var l=0;l<n.length;l++)for(var h=0;h<n[l].length-1;h++){u.search(f(l,h)).forEach(function(t){var e=t.ring,n=t.edge;c(l,h,e,n)})}return r;function c(t,o,s,a){var u,l,h=n[t][o],c=n[t][o+1],f=n[s][a],v=n[s][a+1],g=function(t,e,n,r){if(Dl(t,n)||Dl(t,r)||Dl(e,n)||Dl(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],l=n[1],h=r[0],c=r[1],f=(i-s)*(l-c)-(o-a)*(u-h);if(0===f)return null;var v=((i*a-o*s)*(u-h)-(i-s)*(u*c-l*h))/f,g=((i*a-o*s)*(l-c)-(o-a)*(u*c-l*h))/f;return[v,g]}(h,c,f,v);if(null!==g&&(u=c[0]!==h[0]?(g[0]-h[0])/(c[0]-h[0]):(g[1]-h[1])/(c[1]-h[1]),l=v[0]!==f[0]?(g[0]-f[0])/(v[0]-f[0]):(g[1]-f[1])/(v[1]-f[1]),!(u>=1||u<=0||l>=1||l<=0))){var d=g,p=!i[d.toString()];p&&(i[d.toString()]=!0),e&&r.push(e(g,t,o,h,c,u,s,a,f,v,l,p))}}function f(t,e){var r,i,o,s,a=n[t][e],u=n[t][e+1];return a[0]<u[0]?(r=a[0],i=u[0]):(r=u[0],i=a[0]),a[1]<u[1]?(o=a[1],s=u[1]):(o=u[1],s=a[1]),{minX:r,minY:o,maxX:i,maxY:s,ring:t,edge:e}}}function Dl(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!Dl(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function Fl(t){if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var e=t.geometry.coordinates.length,n=[],r=0;r<e;r++){var i=t.geometry.coordinates[r];zl(i[0],i[i.length-1])||i.push(i[0]);for(var o=0;o<i.length-1;o++)n.push(i[o])}if(!function(t){for(var e={},n=1,r=0,i=t.length;r<i;++r){if(Object.prototype.hasOwnProperty.call(e,t[r].toString())){n=0;break}e[t[r].toString()]=1}return n}(n))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var s=n.length,a=Al(t,function(t,e,n,r,i,o,s,a,u,l,h,c){return[t,e,n,r,i,o,s,a,u,l,h,c]}),u=a.length;if(0==u){var l=[];for(r=0;r<e;r++)l.push(P([t.geometry.coordinates[r]],{parent:-1,winding:Bl(t.geometry.coordinates[r])}));var h=R(l);return Y(h),B(h),h}var c=[],f=[];for(r=0;r<e;r++){c.push([]);for(o=0;o<t.geometry.coordinates[r].length-1;o++)c[r].push([new ql(t.geometry.coordinates[r][jl(o+1,t.geometry.coordinates[r].length-1)],1,[r,o],[r,jl(o+1,t.geometry.coordinates[r].length-1)],void 0)]),f.push(new Gl(t.geometry.coordinates[r][o],[r,jl(o-1,t.geometry.coordinates[r].length-1)],[r,o],void 0,void 0,!1,!0))}for(r=0;r<u;r++)c[a[r][1]][a[r][2]].push(new ql(a[r][0],a[r][5],[a[r][1],a[r][2]],[a[r][6],a[r][7]],void 0)),a[r][11]&&f.push(new Gl(a[r][0],[a[r][1],a[r][2]],[a[r][6],a[r][7]],void 0,void 0,!0,!0));var v=f.length;for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)c[r][o].sort(function(t,e){return t.param<e.param?-1:1});var g=[];for(r=0;r<v;r++)g.push({minX:f[r].coord[0],minY:f[r].coord[1],maxX:f[r].coord[0],maxY:f[r].coord[1],index:r});var d=new te;d.load(g);for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)for(var p=0;p<c[r][o].length;p++){var y=void 0;y=p==c[r][o].length-1?c[r][jl(o+1,t.geometry.coordinates[r].length-1)][0].coord:c[r][o][p+1].coord;var m=d.search({minX:y[0],minY:y[1],maxX:y[0],maxY:y[1]})[0];c[r][o][p].nxtIsectAlongEdgeIn=m.index}for(r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)for(p=0;p<c[r][o].length;p++){var _=c[r][o][p].coord,x=(m=d.search({minX:_[0],minY:_[1],maxX:_[0],maxY:_[1]})[0]).index;x<s?f[x].nxtIsectAlongRingAndEdge2=c[r][o][p].nxtIsectAlongEdgeIn:zl(f[x].ringAndEdge1,c[r][o][p].ringAndEdgeIn)?f[x].nxtIsectAlongRingAndEdge1=c[r][o][p].nxtIsectAlongEdgeIn:f[x].nxtIsectAlongRingAndEdge2=c[r][o][p].nxtIsectAlongEdgeIn}var E=[];for(r=0,o=0;o<e;o++){var k=r;for(p=0;p<t.geometry.coordinates[o].length-1;p++)f[r].coord[0]<f[k].coord[0]&&(k=r),r++;var w=f[k].nxtIsectAlongRingAndEdge2;for(p=0;p<f.length;p++)if(f[p].nxtIsectAlongRingAndEdge1==k||f[p].nxtIsectAlongRingAndEdge2==k){var b=p;break}var I=Yl([f[b].coord,f[k].coord,f[w].coord],!0)?1:-1;E.push({isect:k,parent:-1,winding:I})}E.sort(function(t,e){return f[t.isect].coord>f[e.isect].coord?-1:1});for(l=[];E.length>0;){var N=E.pop(),S=N.isect,M=N.parent,L=N.winding,C=l.length,T=[f[S].coord],O=S;if(f[S].ringAndEdge1Walkable)var A=f[S].ringAndEdge1,D=f[S].nxtIsectAlongRingAndEdge1;else A=f[S].ringAndEdge2,D=f[S].nxtIsectAlongRingAndEdge2;for(;!zl(f[S].coord,f[D].coord);){T.push(f[D].coord);var F=void 0;for(r=0;r<E.length;r++)if(E[r].isect==D){F=r;break}if(null!=F&&E.splice(F,1),zl(A,f[D].ringAndEdge1)){if(A=f[D].ringAndEdge2,f[D].ringAndEdge2Walkable=!1,f[D].ringAndEdge1Walkable){var q={isect:D};Yl([f[O].coord,f[D].coord,f[f[D].nxtIsectAlongRingAndEdge2].coord],1==L)?(q.parent=M,q.winding=-L):(q.parent=C,q.winding=L),E.push(q)}O=D,D=f[D].nxtIsectAlongRingAndEdge2}else{if(A=f[D].ringAndEdge1,f[D].ringAndEdge1Walkable=!1,f[D].ringAndEdge2Walkable){q={isect:D};Yl([f[O].coord,f[D].coord,f[f[D].nxtIsectAlongRingAndEdge1].coord],1==L)?(q.parent=M,q.winding=-L):(q.parent=C,q.winding=L),E.push(q)}O=D,D=f[D].nxtIsectAlongRingAndEdge1}}T.push(f[D].coord),l.push(P([T],{index:C,parent:M,winding:L,netWinding:void 0}))}var G=R(l);function Y(t){for(var e=[],n=0;n<t.features.length;n++)-1==t.features[n].properties.parent&&e.push(n);if(e.length>1)for(n=0;n<e.length;n++){for(var r=-1,i=1/0,o=0;o<t.features.length;o++)e[n]!=o&&Zt(t.features[e[n]].geometry.coordinates[0][0],t.features[o],{ignoreBoundary:!0})&&Ot(t.features[o])<i&&(r=o);t.features[e[n]].properties.parent=r}}function B(t){for(var e=0;e<t.features.length;e++)if(-1==t.features[e].properties.parent){var n=t.features[e].properties.winding;t.features[e].properties.netWinding=n,z(t,e,n)}}function z(t,e,n){for(var r=0;r<t.features.length;r++)if(t.features[r].properties.parent==e){var i=n+t.features[r].properties.winding;t.features[r].properties.netWinding=i,z(t,r,i)}}return Y(G),B(G),G}var ql=s(function t(e,n,r,o,s){i(this,t),this.coord=e,this.param=n,this.ringAndEdgeIn=r,this.ringAndEdgeOut=o,this.nxtIsectAlongEdgeIn=s}),Gl=s(function t(e,n,r,o,s,a,u){i(this,t),this.coord=e,this.ringAndEdge1=n,this.ringAndEdge2=r,this.nxtIsectAlongRingAndEdge1=o,this.nxtIsectAlongRingAndEdge2=s,this.ringAndEdge1Walkable=a,this.ringAndEdge2Walkable=u});function Yl(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function Bl(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(Yl([t[jl(e-1,t.length-1)],t[e],t[jl(e+1,t.length-1)]],!0))var r=1;else r=-1;return r}function zl(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!zl(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function jl(t,e){return(t%e+e)%e}function Xl(t){return function(){return t}}function Ul(t){return t[0]}function Vl(t){return t[1]}function Zl(){this._=null}function Hl(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Wl(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Jl(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Kl(t){for(;t.L;)t=t.L;return t}function Ql(t,e,n,r){var i=[null,null],o=kh.push(i)-1;return i.left=t,i.right=e,n&&th(i,t,e,n),r&&th(i,e,t,r),xh[t.index].halfedges.push(o),xh[e.index].halfedges.push(o),i}function $l(t,e,n){var r=[e,n];return r.left=t,r}function th(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function eh(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],l=s[1],h=0,c=1,f=a[0]-u,v=a[1]-l;if(o=e-u,f||!(o>0)){if(o/=f,f<0){if(o<h)return;o<c&&(c=o)}else if(f>0){if(o>c)return;o>h&&(h=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>c)return;o>h&&(h=o)}else if(f>0){if(o<h)return;o<c&&(c=o)}if(o=n-l,v||!(o>0)){if(o/=v,v<0){if(o<h)return;o<c&&(c=o)}else if(v>0){if(o>c)return;o>h&&(h=o)}if(o=i-l,v||!(o<0)){if(o/=v,v<0){if(o>c)return;o>h&&(h=o)}else if(v>0){if(o<h)return;o<c&&(c=o)}return!(h>0||c<1)||(h>0&&(t[0]=[u+h*f,l+h*v]),c<1&&(t[1]=[u+c*f,l+c*v]),!0)}}}}}function nh(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],l=t.left,h=t.right,c=l[0],f=l[1],v=h[0],g=h[1],d=(c+v)/2,p=(f+g)/2;if(g===f){if(d<e||d>=r)return;if(c>v){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]<n)return}else u=[d,i];o=[d,n]}}else if(a=p-(s=(c-v)/(g-f))*d,s<-1||s>1)if(c>v){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(f<g){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function rh(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function ih(t,e){return e[+(e.left!==t.site)]}function oh(t,e){return e[+(e.left===t.site)]}Zl.prototype={constructor:Zl,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Kl(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Wl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Jl(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Jl(this,n),n=(t=n).U),n.C=!1,r.C=!0,Wl(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Kl(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Wl(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Jl(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Wl(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Jl(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Wl(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Jl(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var sh,ah=[];function uh(){Hl(this),this.x=this.y=this.arc=this.site=this.cy=null}function lh(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,l=r[1]-a,h=o[0]-s,c=o[1]-a,f=2*(u*c-l*h);if(!(f>=-1e-12)){var v=u*u+l*l,g=h*h+c*c,d=(c*v-l*g)/f,p=(u*g-h*v)/f,y=ah.pop()||new uh;y.arc=t,y.site=i,y.x=d+s,y.y=(y.cy=p+a)+Math.sqrt(d*d+p*p),t.circle=y;for(var m=null,_=Eh._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Eh.insert(m,y),m||(sh=y)}}}}function hh(t){var e=t.circle;e&&(e.P||(sh=e.N),Eh.remove(e),ah.push(e),Hl(e),t.circle=null)}var ch=[];function fh(){Hl(this),this.edge=this.site=this.circle=null}function vh(t){var e=ch.pop()||new fh;return e.site=t,e}function gh(t){hh(t),_h.remove(t),ch.push(t),Hl(t)}function dh(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];gh(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<wh&&Math.abs(r-u.circle.cy)<wh;)o=u.P,a.unshift(u),gh(u),u=o;a.unshift(u),hh(u);for(var l=s;l.circle&&Math.abs(n-l.circle.x)<wh&&Math.abs(r-l.circle.cy)<wh;)s=l.N,a.push(l),gh(l),l=s;a.push(l),hh(l);var h,c=a.length;for(h=1;h<c;++h)l=a[h],u=a[h-1],th(l.edge,u.site,l.site,i);u=a[0],(l=a[c-1]).edge=Ql(u.site,l.site,null,i),lh(u),lh(l)}function ph(t){for(var e,n,r,i,o=t[0],s=t[1],a=_h._;a;)if((r=yh(a,s)-o)>wh)a=a.L;else{if(!((i=o-mh(a,s))>wh)){r>-wh?(e=a.P,n=a):i>-wh?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){xh[t.index]={site:t,halfedges:[]}}(t);var u=vh(t);if(_h.insert(e,u),e||n){if(e===n)return hh(e),n=vh(e.site),_h.insert(u,n),u.edge=n.edge=Ql(e.site,u.site),lh(e),void lh(n);if(n){hh(e),hh(n);var l=e.site,h=l[0],c=l[1],f=t[0]-h,v=t[1]-c,g=n.site,d=g[0]-h,p=g[1]-c,y=2*(f*p-v*d),m=f*f+v*v,_=d*d+p*p,x=[(p*m-v*_)/y+h,(f*_-d*m)/y+c];th(n.edge,l,g,x),u.edge=Ql(l,t,null,x),n.edge=Ql(t,g,null,x),lh(e),lh(n)}else u.edge=Ql(e.site,u.site)}}function yh(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],l=u-e;if(!l)return a;var h=a-r,c=1/o-1/l,f=h/l;return c?(-f+Math.sqrt(f*f-2*c*(h*h/(-2*l)-u+l/2+i-o/2)))/c+r:(r+a)/2}function mh(t,e){var n=t.N;if(n)return yh(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var _h,xh,Eh,kh,wh=1e-6;function bh(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Ih(t,e){return e[1]-t[1]||e[0]-t[0]}function Nh(t,e){var n,r,i,o=t.sort(Ih).pop();for(kh=[],xh=new Array(t.length),_h=new Zl,Eh=new Zl;;)if(i=sh,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(ph(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;dh(i.arc)}if(function(){for(var t,e,n,r,i=0,o=xh.length;i<o;++i)if((t=xh[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=rh(t,kh[e[n]]);for(s.sort(function(t,e){return a[e]-a[t]}),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var i,o=kh.length;o--;)nh(i=kh[o],t,e,n,r)&&eh(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>wh||Math.abs(i[0][1]-i[1][1])>wh)||delete kh[o]}(s,a,u,l),function(t,e,n,r){var i,o,s,a,u,l,h,c,f,v,g,d,p=xh.length,y=!0;for(i=0;i<p;++i)if(o=xh[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)kh[u[a]]||u.splice(a,1);for(a=0,l=u.length;a<l;)g=(v=oh(o,kh[u[a]]))[0],d=v[1],c=(h=ih(o,kh[u[++a%l]]))[0],f=h[1],(Math.abs(g-c)>wh||Math.abs(d-f)>wh)&&(u.splice(a,0,kh.push($l(s,v,Math.abs(g-t)<wh&&r-d>wh?[t,Math.abs(c-t)<wh?f:r]:Math.abs(d-r)<wh&&n-g>wh?[Math.abs(f-r)<wh?c:n,r]:Math.abs(g-n)<wh&&d-e>wh?[n,Math.abs(c-n)<wh?f:e]:Math.abs(d-e)<wh&&g-t>wh?[Math.abs(f-e)<wh?c:t,e]:null))-1),++l);l&&(y=!1)}if(y){var m,_,x,E=1/0;for(i=0,y=null;i<p;++i)(o=xh[i])&&(x=(m=(s=o.site)[0]-t)*m+(_=s[1]-e)*_)<E&&(E=x,y=o);if(y){var k=[t,e],w=[t,r],b=[n,r],I=[n,e];y.halfedges.push(kh.push($l(s=y.site,k,w))-1,kh.push($l(s,w,b))-1,kh.push($l(s,b,I))-1,kh.push($l(s,I,k))-1)}}for(i=0;i<p;++i)(o=xh[i])&&(o.halfedges.length||delete xh[i])}(s,a,u,l)}this.edges=kh,this.cells=xh,_h=Eh=kh=xh=null}function Sh(t,e){return e?St(t,function(t,e){return t+function(t){var e=m(t[0],2),n=e[0],r=e[1],i=m(t[1],2),o=i[0]-n,s=i[1]-r;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}(e.geometry.coordinates)},0):tu(t,{units:"meters"})}function Mh(t){var e=90-t;return e>180&&(e-=360),e}function Lh(t,e){var n=t[0],r=t[t.length-1];if(e){var i=m(n,2),o=i[0],s=i[1],a=m(r,2),u=a[0]-o,l=a[1]-s,h=Math.sqrt(Math.pow(u,2)+Math.pow(l,2));return h<1e-9?[NaN,NaN]:[l/h,u/h]}var c=Mh(ht(n,r))*Math.PI/180;return[Math.sin(c),Math.cos(c)]}function Ph(t,e,n,r){if(r){var i=m(t,2),o=i[0],s=i[1],a=e*Math.PI/180,u=Math.sin(a),l=Math.cos(a);return[[o-n/2*l,s-n/2*u],[o+n/2*l,s+n/2*u]]}var h=ct(M(t),n/2,e,{units:"meters"});return[et(ct(M(t),-n/2,e,{units:"meters"})),et(h)]}Nh.prototype={constructor:Nh,polygons:function(){var t=this.edges;return this.cells.map(function(e){var n=e.halfedges.map(function(n){return ih(e,t[n])});return n.data=e.site.data,n})},triangles:function(){var t=[],e=this.edges;return this.cells.forEach(function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,l=e[i[o-1]],h=l.left===a?l.right:l.left;++u<o;)s=h,h=(l=e[i[u]]).left===a?l.right:l.left,s&&h&&r<s.index&&r<h.index&&bh(a,s,h)<0&&t.push([a.data,s.data,h.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],l=e-i.site[1],h=u*u+l*l;do{i=o.cells[r=s],s=null,i.halfedges.forEach(function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],l=e-a[1],c=u*u+l*l;c<h&&(h=c,s=a.index)}})}while(null!==s);return o._found=r,null==n||h<=n*n?i.site:null}},t.along=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=at(t).coordinates,i=0,o=0;o<r.length&&!(e>=i&&o===r.length-1);o++){if(i>=e){var s=e-i;if(s){var a=ht(r[o],r[o-1])-180;return ct(r[o],s,a,n)}return M(r[o])}i+=ft(r[o],r[o+1],n)}return M(r[r.length-1])},t.angle=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!J(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,s=n,a=j(!0!==r.mercator?ht(o,i):vt(o,i)),u=j(!0!==r.mercator?ht(o,s):vt(o,s));u<a&&(u+=360);var l=u-a;return!0===r.explementary?360-l:l},t.applyFilter=po,t.area=Ot,t.areaFactors=I,t.azimuthToBearing=X,t.bbox=qt,t.bboxClip=function(t,e){var n=at(t),r=n.type,i="Feature"===t.type?t.properties:{},o=n.coordinates;switch(r){case"LineString":case"MultiLineString":var s=[];return"LineString"===r&&(o=[o]),o.forEach(function(t){!function(t,e,n){var r,i,o,s,a,u=t.length,l=Bt(t[0],e),h=[];for(n||(n=[]),r=1;r<u;r++){for(s=t[r-1],i=o=Bt(a=t[r],e);;){if(!(l|i)){h.push(s),i!==o?(h.push(a),r<u-1&&(n.push(h),h=[])):r===u-1&&h.push(a);break}if(l&i)break;l?l=Bt(s=Yt(s,a,l,e),e):i=Bt(a=Yt(s,a,i,e),e)}l=o}h.length&&n.push(h)}(t,e,s)}),1===s.length?T(s[0],i):A(s,i);case"Polygon":return P(zt(o,e),i);case"MultiPolygon":return F(o.map(function(t){return zt(t,e)}),i);default:throw new Error("geometry "+r+" not supported")}},t.bboxPolygon=jt,t.bearing=ht,t.bearingToAzimuth=j,t.bezierSpline=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.resolution||1e4,r=e.sharpness||.85,i=[],o=at(t).coordinates.map(function(t){return{x:t[0],y:t[1]}}),s=new Xt({duration:n,points:o,sharpness:r}),a=function(t){var e=s.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u<s.duration;u+=10)a(u);return a(s.duration),T(i,e.properties)},t.booleanClockwise=Ut,t.booleanConcave=function(t){var e=at(t).coordinates;if(e[0].length<=4)return!1;for(var n=!1,r=e[0].length-1,i=0;i<r;i++){var o=e[0][(i+2)%r][0]-e[0][(i+1)%r][0],s=e[0][(i+2)%r][1]-e[0][(i+1)%r][1],a=e[0][i][0]-e[0][(i+1)%r][0],u=o*(e[0][i][1]-e[0][(i+1)%r][1])-s*a;if(0===i)n=u>0;else if(n!==u>0)return!0}return!1},t.booleanContains=fn,t.booleanCrosses=Yn,t.booleanDisjoint=Un,t.booleanEqual=Gn,t.booleanIntersects=Wn,t.booleanOverlap=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(Cn(t,e,{precision:6}))return!1;var s=0;switch(i){case"MultiPoint":for(var a=0;a<n.coordinates.length;a++)for(var u=0;u<r.coordinates.length;u++){var l=n.coordinates[a],h=r.coordinates[u];if(l[0]===h[0]&&l[1]===h[1])return!0}return!1;case"LineString":case"MultiLineString":Nt(t,function(t){Nt(e,function(e){tr(t,e).features.length&&s++})});break;case"Polygon":case"MultiPolygon":Nt(t,function(t){Nt(e,function(e){je(t,e).features.length&&s++})})}return s>0},t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==rr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==rr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=xe(Dn(t)).features,r=xe(Dn(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!nr(o,r[i].geometry.coordinates))return!1}return!0},t.booleanPointInPolygon=Zt,t.booleanPointOnLine=Ht,t.booleanTouches=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"Point":switch(o){case"LineString":return ir(n,r);case"MultiLineString":for(var s=!1,a=0;a<r.coordinates.length;a++)ir(n,{coordinates:r.coordinates[a]})&&(s=!0);return s;case"Polygon":for(var u=0;u<r.coordinates.length;u++)if(Ht(n,{type:"LineString",coordinates:r.coordinates[u]}))return!0;return!1;case"MultiPolygon":for(u=0;u<r.coordinates.length;u++)for(a=0;a<r.coordinates[u].length;a++)if(Ht(n,{type:"LineString",coordinates:r.coordinates[u][a]}))return!0;return!1;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"LineString":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||ir({coordinates:n.coordinates[u]},r)&&(s=!0),Ht({type:"Point",coordinates:n.coordinates[u]},r,{ignoreEndVertices:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||ir({coordinates:n.coordinates[u]},{coordinates:r.coordinates[a]})&&(s=!0),Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a]},{ignoreEndVertices:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a][0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},{type:"Polygon",coordinates:r.coordinates[a]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return ir(r,n);case"MultiPoint":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||ir({coordinates:r.coordinates[u]},n)&&(s=!0),Ht({type:"Point",coordinates:r.coordinates[u]},n,{ignoreEndVertices:!0}))return!1;return s;case"LineString":var l=!1;if(ir({coordinates:n.coordinates[0]},r)&&(l=!0),ir({coordinates:n.coordinates[n.coordinates.length-1]},r)&&(l=!0),!1===l)return!1;for(u=0;u<n.coordinates.length;u++)if(Ht({type:"Point",coordinates:n.coordinates[u]},r,{ignoreEndVertices:!0}))return!1;return l;case"MultiLineString":for(l=!1,u=0;u<r.coordinates.length;u++){ir({coordinates:n.coordinates[0]},{coordinates:r.coordinates[u]})&&(l=!0),ir({coordinates:n.coordinates[n.coordinates.length-1]},{coordinates:r.coordinates[u]})&&(l=!0);for(a=0;a<n.coordinates[u].length;a++)if(Ht({type:"Point",coordinates:n.coordinates[a]},{type:"LineString",coordinates:r.coordinates[u]},{ignoreEndVertices:!0}))return!1}return l;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates.length;u++){for(a=0;a<r.coordinates.length;a++)s||Ht({type:"Point",coordinates:n.coordinates[u]},{type:"LineString",coordinates:r.coordinates[a][0]})&&(s=!0);if(Zt({type:"Point",coordinates:n.coordinates[u]},r,{ignoreBoundary:!0}))return!1}return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiLineString":switch(o){case"Point":for(u=0;u<n.coordinates.length;u++)if(ir(r,{coordinates:n.coordinates[u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)if(s||ir({coordinates:r.coordinates[a]},{coordinates:n.coordinates[a]})&&(s=!0),Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[a]},{ignoreEndVertices:!0}))return!1;return s;case"LineString":for(l=!1,u=0;u<n.coordinates.length;u++){ir({coordinates:n.coordinates[u][0]},r)&&(l=!0),ir({coordinates:n.coordinates[u][n.coordinates[u].length-1]},r)&&(l=!0);for(a=0;a<r.coordinates.length;a++)if(Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[u]},{ignoreEndVertices:!0}))return!1}return l;case"MultiLineString":for(l=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++){ir({coordinates:n.coordinates[u][0]},{coordinates:r.coordinates[a]})&&(l=!0),ir({coordinates:n.coordinates[u][n.coordinates[u].length-1]},{coordinates:r.coordinates[a]})&&(l=!0);for(var h=0;h<n.coordinates[u].length;h++)if(Ht({type:"Point",coordinates:n.coordinates[u][h]},{type:"LineString",coordinates:r.coordinates[a]},{ignoreEndVertices:!0}))return!1}return l;case"Polygon":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<n.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[u][a]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[u][a]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<r.coordinates[0].length;u++)for(a=0;a<n.coordinates.length;a++)for(h=0;h<n.coordinates[a].length;h++)if(s||Ht({type:"Point",coordinates:n.coordinates[a][h]},{type:"LineString",coordinates:r.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[a][h]},{type:"Polygon",coordinates:[r.coordinates[0][u]]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":for(u=0;u<n.coordinates.length;u++)if(Ht(r,{type:"LineString",coordinates:n.coordinates[u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:r.coordinates[u]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u]},n,{ignoreBoundary:!0}))return!1;return s;case"LineString":for(s=!1,u=0;u<r.coordinates.length;u++)if(s||Ht({type:"Point",coordinates:r.coordinates[u]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u]},n,{ignoreBoundary:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<r.coordinates.length;u++)for(a=0;a<r.coordinates[u].length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[u][a]},{type:"LineString",coordinates:n.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[u][a]},n,{ignoreBoundary:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<r.coordinates[0].length;u++)for(a=0;a<n.coordinates[0].length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][a]},{type:"LineString",coordinates:r.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][a]},{type:"Polygon",coordinates:r.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPolygon":switch(o){case"Point":for(u=0;u<n.coordinates[0].length;u++)if(Ht(r,{type:"LineString",coordinates:n.coordinates[0][u]}))return!0;return!1;case"MultiPoint":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a]},{type:"Polygon",coordinates:n.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;case"LineString":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates.length;a++)if(s||Ht({type:"Point",coordinates:r.coordinates[a]},{type:"LineString",coordinates:n.coordinates[0][u]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a]},{type:"Polygon",coordinates:n.coordinates[0][u]},{ignoreBoundary:!0}))return!1;return s;case"MultiLineString":for(s=!1,u=0;u<n.coordinates.length;u++)for(a=0;a<r.coordinates.length;a++)for(h=0;h<r.coordinates[a].length;h++)if(s||Ht({type:"Point",coordinates:r.coordinates[a][h]},{type:"LineString",coordinates:n.coordinates[u][0]})&&(s=!0),Zt({type:"Point",coordinates:r.coordinates[a][h]},{type:"Polygon",coordinates:[n.coordinates[u][0]]},{ignoreBoundary:!0}))return!1;return s;case"Polygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<n.coordinates[0][u].length;a++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u][a]},{type:"LineString",coordinates:r.coordinates[0]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u][a]},r,{ignoreBoundary:!0}))return!1;return s;case"MultiPolygon":for(s=!1,u=0;u<n.coordinates[0].length;u++)for(a=0;a<r.coordinates[0].length;a++)for(h=0;h<n.coordinates[0].length;h++)if(s||Ht({type:"Point",coordinates:n.coordinates[0][u][h]},{type:"LineString",coordinates:r.coordinates[0][a]})&&(s=!0),Zt({type:"Point",coordinates:n.coordinates[0][u][h]},{type:"Polygon",coordinates:r.coordinates[0][a]},{ignoreBoundary:!0}))return!1;return s;default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},t.booleanValid=function t(e){if(!e.type)return!1;var n=at(e),r=n.type,i=n.coordinates;switch(r){case"Point":return i.length>1;case"MultiPoint":for(var o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"LineString":if(i.length<2)return!1;for(o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"MultiLineString":if(i.length<1)return!1;for(o=0;o<i.length;o++)if(i[o].length<2)return!1;return!0;case"Polygon":for(o=0;o<n.coordinates.length;o++){if(i[o].length<4)return!1;if(!ar(i[o]))return!1;if(ur(i[o]))return!1;if(o>0&&je(P([i[0]]),P([i[o]])).features.length>1)return!1}return!0;case"MultiPolygon":for(o=0;o<n.coordinates.length;o++)for(var s=n.coordinates[o],a=0;a<s.length;a++){if(s[a].length<4)return!1;if(!ar(s[a]))return!1;if(ur(s[a]))return!1;if(0===a&&!lr(s,n.coordinates,o))return!1;if(a>0&&je(P([s[0]]),P([s[a]])).features.length>1)return!1}return!0;case"GeometryCollection":return!!n.geometries&&(Array.isArray(n.geometries)&&n.geometries.length>0&&n.geometries.every(function(e){return sr.has(e.type)&&t(e)}));default:return!1}},t.booleanWithin=hr,t.buffer=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!==E(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");var o=[];switch(t.type){case"GeometryCollection":return kt(t,function(t){var n=Ai(t,e,r,i);n&&o.push(n)}),R(o);case"FeatureCollection":return _t(t,function(t){var n=Ai(t,e,r,i);n&&_t(n,function(t){t&&o.push(t)})}),R(o)}return Ai(t,e,r,i)},t.center=cr,t.centerMean=Gi,t.centerMedian=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!W(n))throw new Error("counter must be a number");var r=e.weight,i=Gi(t,{weight:e.weight}),o=R([]);_t(t,function(t){var e;o.features.push(Yi(t,{properties:{weight:null==(e=t.properties)?void 0:e[r]}}))});var s={tolerance:e.tolerance,medianCandidates:[]};return Bi(i.geometry.coordinates,[0,0],o,s,n)},t.centerOfMass=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(ut(e)){case"Point":return M(et(e),n.properties);case"Polygon":var r=[];dt(e,function(t){r.push(t)});var i,o,s,a,u,l,h,c,f=Yi(e,{properties:n.properties}),v=f.geometry.coordinates,g=0,d=0,p=0,y=r.map(function(t){return[t[0]-v[0],t[1]-v[1]]});for(i=0;i<r.length-1;i++)a=(o=y[i])[0],l=o[1],u=(s=y[i+1])[0],p+=c=a*(h=s[1])-u*l,g+=(a+u)*c,d+=(l+h)*c;if(0===p)return f;var m=1/(6*(.5*p));return M([v[0]+m*g,v[1]+m*d],n.properties);default:var _=io(e);return _?t(_,{properties:n.properties}):Yi(e,{properties:n.properties})}},t.centroid=Yi,t.circle=oo,t.cleanCoords=Dn,t.clone=so,t.cloneProperties=uo,t.clusterEach=fo,t.clusterReduce=vo,t.clusters=Io,t.clustersDbscan=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!0!==n.mutate&&(t=so(t));var r=n.minPoints||3,i=z(e,n.units),o=new te(t.features.length),s=t.features.map(function(t){return!1}),a=t.features.map(function(t){return!1}),u=t.features.map(function(t){return!1}),l=t.features.map(function(t){return-1});o.load(t.features.map(function(t,e){var n=m(t.geometry.coordinates,2),r=n[0],i=n[1];return{minX:r,minY:i,maxX:r,maxY:i,index:e}}));var h=function(r){var s=t.features[r],a=m(s.geometry.coordinates,2),u=a[0],l=a[1],h=Math.max(l-i,-90),c=Math.min(l+i,90),f=h<0&&c>0?i:Math.abs(h)<Math.abs(c)?i/Math.cos(V(c)):i/Math.cos(V(h)),v=Math.max(u-f,-360),g=Math.min(u+f,360),d={minX:v,minY:h,maxX:g,maxY:c};return o.search(d).filter(function(r){var i=r.index,o=t.features[i];return ft(s,o,{units:n.units})<=e})},c=0;return t.features.forEach(function(t,e){if(!s[e]){var n=h(e);if(n.length>=r){var i=c;c++,s[e]=!0,function(t,e){for(var n=0;n<e.length;n++){var i=e[n].index;if(!s[i]){s[i]=!0;var o=h(i);o.length>=r&&e.push.apply(e,_(o))}a[i]||(a[i]=!0,l[i]=t)}}(i,n)}else u[e]=!0}}),t.features.forEach(function(e,n){var r=t.features[n];r.properties||(r.properties={}),l[n]>=0?(r.properties.dbscan=u[n]?"edge":"core",r.properties.cluster=l[n]):r.properties.dbscan="noise"}),t},t.clustersKmeans=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=so(t));var r=Et(t),i=r.slice(0,e.numberOfClusters),o=Mo(r,e.numberOfClusters,i),s={};return o.centroids.forEach(function(t,e){s[e]=t}),_t(t,function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=s[n]}),t},t.collect=function(t,e,n,r){var i=new te(6),o=e.features.map(function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null==(e=t.properties)?void 0:e[n]}});return i.load(o),t.features.forEach(function(t){t.properties||(t.properties={});var e=qt(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach(function(e){Zt([e.minX,e.minY],t)&&o.push(e.property)}),t.properties[r]=o}),t},t.collectionOf=st,t.combine=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return _t(t,function(t){var n,r,i,o;switch(null==(o=t.geometry)?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,_(t.geometry.coordinates)),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,_(t.geometry.coordinates)),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,_(t.geometry.coordinates)),e.MultiPolygon.properties.push(t.properties)}}),R(Object.keys(e).filter(function(t){return e[t].coordinates.length}).sort().map(function(t){return N({type:t,coordinates:e[t].coordinates},{collectedProperties:e[t].properties})}))},t.concave=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxEdge||1/0,r=function(t){var e=[],n={};return _t(t,function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}}),R(e)}(t),i=Lo(r);if(i.features=i.features.filter(function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=ft(r,i,e),a=ft(i,o,e),u=ft(r,o,e);return s<=n&&a<=n&&u<=n}),i.features.length<1)return null;var o=rs(i);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),N(o)},t.containsNumber=rt,t.convertArea=H,t.convertLength=Z,t.convex=io,t.coordAll=Et,t.coordEach=dt,t.coordReduce=pt,t.createBins=go,t.degreesToRadians=V,t.destination=ct,t.difference=function(t){var e=[];if(kt(t,function(t){e.push(t.coordinates)}),e.length<2)throw new Error("Must have at least two features");var n=t.features[0].properties||{},r=ia.apply(sa,[e[0]].concat(_(e.slice(1))));return 0===r.length?null:1===r.length?P(r[0],n):F(r,n)},t.directionalMean=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!!n.planar,i=null!=(e=n.segment)&&e,o=0,s=0,a=0,u=0,l=[];i?Nt(t,function(t){var e=m(Lh(t.geometry.coordinates,r),2),n=e[0],i=e[1],h=Sh(t,r);isNaN(n)||isNaN(i)||(o+=n,s+=i,a+=1,u+=h,l.push(Yi(t)))}):_t(t,function(t){if("LineString"!==t.geometry.type)throw new Error("shold to support MultiLineString?");var e=m(Lh(t.geometry.coordinates,r),2),n=e[0],i=e[1],h=Sh(t,r);isNaN(n)||isNaN(i)||(o+=n,s+=i,a+=1,u+=h,l.push(Yi(t)))});var h=function(t,e){var n=0;n=Math.abs(e)<1e-9?90:180*Math.atan2(t,e)/Math.PI;t>=0?e<0&&(n+=180):e<0&&(n-=180);return n}(o,s),c=Mh(h),f=function(t,e,n){if(0===n)throw new Error("the size of the features set must be greater than 0");return 1-Math.sqrt(Math.pow(t,2)+Math.pow(e,2))/n}(o,s,a),v=u/a,g=m(et(Yi(R(l))),2),d=g[0],p=g[1];return T(Ph([d,p],r?h:c,v,r),{averageLength:v,averageX:d,averageY:p,bearingAngle:c,cartesianAngle:h,circularVariance:f,countOfLines:a})},t.dissolve=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;st(t,"Polygon","dissolve");var r=[];if(!n)return aa(F(na.apply(null,t.features.map(function(t){return t.geometry.coordinates}))));var i={};_t(t,function(t){t.properties&&(Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t))});for(var o=Object.keys(i),s=0;s<o.length;s++){var a=F(na.apply(null,i[o[s]].map(function(t){return t.geometry.coordinates})));a&&a.properties&&(a.properties[n]=o[s],r.push(a))}return aa(R(r))},t.distance=ft,t.distanceWeight=la,t.earthRadius=w,t.ellipse=va,t.envelope=ga,t.explode=da,t.factors=b,t.feature=N,t.featureCollection=R,t.featureEach=_t,t.featureOf=ot,t.featureReduce=xt,t.filterProperties=mo,t.findPoint=Ct,t.findSegment=Pt,t.flatten=aa,t.flattenEach=bt,t.flattenReduce=It,t.flip=function(t,e){var n;if(!J(e=e||{}))throw new Error("options is invalid");var r=null!=(n=e.mutate)&&n;if(!t)throw new Error("geojson is required");return!1!==r&&void 0!==r||(t=so(t)),dt(t,function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e}),t},t.geojsonRbush=me,t.geojsonType=it,t.geomEach=kt,t.geomReduce=wt,t.geometry=S,t.geometryCollection=q,t.getCluster=co,t.getCoord=et,t.getCoords=nt,t.getGeom=at,t.getType=ut,t.greatCircle=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==E(n))throw new Error("options is invalid");var r=n.properties,i=void 0===r?{}:r,o=n.npoints,s=void 0===o?100:o,a=n.offset,u=void 0===a?10:a,l=et(t),h=et(e);return l[0]===h[0]&&l[1]===h[1]?T(Array(s).fill([l[0],l[1]]),i):new ka({x:l[0],y:l[1]},{x:h[0],y:h[1]},i||{}).Arc(s,{offset:u}).json()},t.helpers=tt,t.hexGrid=ba,t.interpolate=function(t,e,n){var r,i,o,s;if("object"!==E(n=n||{}))throw new Error("options is invalid");if(!t)throw new Error("points is required");if(st(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");var a,u=null!=(r=n.gridType)?r:"square",l=null!=(i=n.property)?i:"elevation",h=null!=(o=n.weight)?o:1,c=null!=(s=n.bbox)?s:qt(t);if(void 0!==h&&"number"!=typeof h)throw new Error("weight must be a number");switch(Q(c),u){case"point":case"points":a=Sa(c,e,n);break;case"square":case"squares":a=La(c,e,n);break;case"hex":case"hexes":a=ba(c,e,n);break;case"triangle":case"triangles":a=Pa(c,e,n);break;default:throw new Error("invalid gridType")}var f=[];return _t(a,function(e){var r=0,i=0;_t(t,function(t){var o,s,a=ft("point"===u?e:Yi(e),t,n);if(void 0!==l&&(s=null==(o=t.properties)?void 0:o[l]),void 0===s&&(s=t.geometry.coordinates[2]),void 0===s)throw new Error("zValue is missing");0===a&&(r=s);var c=1/Math.pow(a,h);i+=c,r+=c*s});var o=so(e);null!=o.properties||(o.properties={}),o.properties[l]=r/i,f.push(o)}),R(f)},t.intersect=wa,t.invariant=lt,t.isNumber=W,t.isObject=J,t.isobands=function(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(st(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!J(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s=Fa(t,{zProperty:r,flip:!0}),a=s[0].length;if(s.length<2||a<2)throw new Error("Matrix of points must be at least 2x2");for(var l=1;l<s.length;l++)if(s[l].length!==a)throw new Error("Matrix of points is not uniform in the x dimension");var h=function(t,e,n){for(var r,i=[],o=1;o<e.length;o++){1===o&&(r=qa(t,+e[0]));var s=+e[o],a=+e[o-1],l=qa(t,s),h=l.map(function(t){return t.map(function(t){return[t[0],t[1]]}).reverse()}),c=Ba(Ya(Ga(r.concat(h),t)));if(0===c.length&&t[0][0]<s&&t[0][0]>=a){var f=t[0].length,v=t.length;c.push([[[0,0],[f-1,0],[f-1,v-1],[0,v-1],[0,0]]])}i.push(u({groupedRings:c},n,a+"-"+s)),r=l}return i}(s,e,r);h=function(t,e,n){var r=qt(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,h=i/u,c=o/l;return t.map(function(t){return t.groupedRings=t.groupedRings.map(function(t){return t.map(function(t){return t.map(function(t){return[t[0]*h+s,t[1]*c+a]})})}),t})}(h,s,t);var c=h.map(function(t,e){if(o[e]&&!J(o[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Da(Da({},i),o[e]);return n[r]=t[r],F(t.groupedRings,n)});return R(c)},t.isolines=function(t,e,n){if(!J(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(st(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!J(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=Ka(t,{zProperty:r,flip:!0}),a=s[0].length;if(s.length<2||a<2)throw new Error("Matrix of points must be at least 2x2");for(var u=1;u<s.length;u++)if(s[u].length!==a)throw new Error("Matrix of points is not uniform in the x dimension");var l=function(t,e,n){var r=qt(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,l=e.length-1,h=i/u,c=o/l,f=function(t){t[0]=t[0]*h+s,t[1]=t[1]*c+a};return t.forEach(function(t){dt(t,f)}),t}(function(t,e,n,r,i){for(var o=[],s=0;s<e.length;s++){var a=+e[s],u=Ja(Ja({},r),i[s]);u[n]=a;var l=A(Qa(t,a),u);o.push(l)}return o}(s,e,r,i,o),s,t);return R(l)},t.kinks=function(t){var e,n,r={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type){var i;e=(i=[]).concat.apply(i,_(n.coordinates))}else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n<t.length-1;n++)for(var i=n;i<e.length-1;i++){if(t===e){if(1===Math.abs(n-i))continue;if(0===n&&i===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var o=$a(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[i][0],e[i][1],e[i+1][0],e[i+1][1]);o&&r.features.push(M([o[0],o[1]]))}})}),r},t.length=tu,t.lengthToDegrees=z,t.lengthToRadians=B,t.lineArc=eu,t.lineChunk=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n))throw new Error("options is invalid");var r=n.units,i=void 0===r?"kilometers":r,o=n.reverse,s=void 0!==o&&o;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var a=[];return bt(t,function(t){s&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,r){var i=tu(t,{units:n});if(i<=e)return r(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++){r(ru(t,e*s,e*(s+1),{units:n}))}}(t,e,i,function(t){a.push(t)})}),R(a)},t.lineEach=Mt,t.lineIntersect=je,t.lineOffset=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r=n.units,i=void 0===r?"kilometers":r;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var o=ut(t),s="Feature"===t.type?t.properties:{};switch(o){case"LineString":return au(t,e,i);case"MultiLineString":var a=[];return bt(t,function(t){a.push(au(t,e,i).geometry.coordinates)}),A(a,s);default:throw new Error("geometry "+o+" is not supported")}},t.lineOverlap=tr,t.lineReduce=Lt,t.lineSegment=xe,t.lineSlice=function(t,e,n){var r=nt(n);if("LineString"!==ut(n))throw new Error("line must be a LineString");var i=$e(n,t),o=$e(n,e);uu(n,i),uu(n,o);for(var s=i.properties.segmentIndex<=o.properties.segmentIndex?[i,o]:[o,i],a=[s[0].geometry.coordinates],u=s[0].properties.segmentIndex+1;u<s[1].properties.segmentIndex+1;u++)a.push(r[u]);return a.push(s[1].geometry.coordinates),T(a,"Feature"===n.type?n.properties:{})},t.lineSliceAlong=ru,t.lineSplit=an,t.lineString=T,t.lineStrings=O,t.lineToPolygon=function(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.properties,s=null==(e=i.autoComplete)||e,a=null==(n=i.orderCoords)||n;if(null!=(r=i.mutate)&&r||(t=so(t)),"FeatureCollection"===t.type){var u=[];return t.features.forEach(function(t){u.push(nt(lu(t,{},s,a)))}),F(u,o)}return lu(t,o,s,a)},t.mask=function(t,e,n){var r,i=null!=(r=null==n?void 0:n.mutate)&&r,o=e;e&&!1===i&&(o=so(e));var s,a=fu(o);return("FeatureCollection"===t.type?cu(2===(s=t).features.length?na(s.features[0].geometry.coordinates,s.features[1].geometry.coordinates):na.apply(sa,s.features.map(function(t){return t.geometry.coordinates}))):"Feature"===t.type?cu(na(t.geometry.coordinates)):cu(na(t.coordinates))).geometry.coordinates.forEach(function(t){a.geometry.coordinates.push(t[0])}),a},t.meta=Tt,t.midpoint=function(t,e){return ct(t,ft(t,e)/2,ht(t,e))},t.moranIndex=function(t,e){var n,r,i=e.inputField,o=e.threshold||1e5,s=e.p||2,u=null!=(n=e.binary)&&n,l=la(t,{alpha:e.alpha||-1,binary:u,p:s,standardization:null==(r=e.standardization)||r,threshold:o}),h=[];_t(t,function(t){var e=t.properties||{};h.push(e[i])});for(var c=vu(h),f=function(t){var e,n=vu(t),r=0,i=a(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r+=Math.pow(o-n,2)}}catch(t){i.e(t)}finally{i.f()}return r/t.length}(h),v=0,g=0,d=0,p=0,y=l.length,m=0;m<y;m++){for(var _=0,x=0;x<y;x++)v+=l[m][x]*(h[m]-c)*(h[x]-c),g+=l[m][x],d+=Math.pow(l[m][x]+l[x][m],2),_+=l[m][x]+l[x][m];p+=Math.pow(_,2)}var E=v/g/f,k=-1/(y-1),w=(y*y*(d*=.5)-y*p+g*g*3)/((y-1)*(y+1)*(g*g))-k*k,b=Math.sqrt(w);return{expectedMoranIndex:k,moranIndex:E,stdNorm:b,zNorm:(E-k)/b}},t.multiLineString=A,t.multiPoint=D,t.multiPolygon=F,t.nearestNeighborAnalysis=function(t,e){var n=(e=e||{}).studyArea||jt(qt(t)),r=e.properties||{},i=e.units||"kilometers",o=[];_t(t,function(t){o.push(Yi(t))});var s=o.length,a=o.map(function(t,e){return ft(t,wu(t,R(o.filter(function(t,n){return n!==e}))).geometry.coordinates,{units:i})}).reduce(function(t,e){return t+e},0)/s,u=s/H(Ot(n),"meters",i),l=1/(2*Math.sqrt(u)),h=.26136/Math.sqrt(s*u);return r.nearestNeighborAnalysis={units:i,arealUnits:i+"²",observedMeanDistance:a,expectedMeanDistance:l,nearestNeighborIndex:a/l,numberOfPoints:s,zScore:(a-l)/h},n.properties=r,n},t.nearestPoint=wu,t.nearestPointOnLine=$e,t.nearestPointToLine=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.units,i=n.properties||{},o=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return kt(t,function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})}),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter(function(t){return"Point"===t.geometry.type}),t;default:throw new Error("points must be a Point Collection")}}(t);if(!o.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==ut(e))throw new Error("line must be a LineString");var s=1/0,a=null;return _t(o,function(t){var n=bu(t,e,{units:r});n<s&&(s=n,a=t)}),a&&(a.properties=Cu(Cu(Cu({},{dist:s}),a.properties),i)),a},t.planepoint=function(t,e){var n=et(t),r=at(e).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var i="Feature"===e.type&&e.properties||{},o=i.a,s=i.b,a=i.c,u=n[0],l=n[1],h=r[0][0],c=r[0][1],f=void 0!==o?o:r[0][2],v=r[1][0],g=r[1][1],d=void 0!==s?s:r[1][2],p=r[2][0],y=r[2][1],m=void 0!==a?a:r[2][2];return(m*(u-h)*(l-g)+f*(u-v)*(l-y)+d*(u-p)*(l-c)-d*(u-h)*(l-y)-m*(u-v)*(l-c)-f*(u-p)*(l-g))/((u-h)*(l-g)+(u-v)*(l-y)+(u-p)*(l-c)-(u-h)*(l-y)-(u-v)*(l-c)-(u-p)*(l-g))},t.point=M,t.pointGrid=Sa,t.pointOnFeature=function(t){for(var e=function(t){if("FeatureCollection"!==t.type)return"Feature"!==t.type?R([N(t)]):R([t]);return t}(t),n=cr(e),r=!1,i=0;!r&&i<e.features.length;){var o=e.features[i].geometry,s=!1;if("Point"===o.type)n.geometry.coordinates[0]===o.coordinates[0]&&n.geometry.coordinates[1]===o.coordinates[1]&&(r=!0);else if("MultiPoint"===o.type)for(var a=!1,u=0;!a&&u<o.coordinates.length;)n.geometry.coordinates[0]===o.coordinates[u][0]&&n.geometry.coordinates[1]===o.coordinates[u][1]&&(r=!0,a=!0),u++;else if("LineString"===o.type)for(var l=0;!s&&l<o.coordinates.length-1;)Tu(n.geometry.coordinates[0],n.geometry.coordinates[1],o.coordinates[l][0],o.coordinates[l][1],o.coordinates[l+1][0],o.coordinates[l+1][1])&&(s=!0,r=!0),l++;else if("MultiLineString"===o.type)for(var h=0;h<o.coordinates.length;){s=!1;for(var c=0,f=o.coordinates[h];!s&&c<f.length-1;)Tu(n.geometry.coordinates[0],n.geometry.coordinates[1],f[c][0],f[c][1],f[c+1][0],f[c+1][1])&&(s=!0,r=!0),c++;h++}else"Polygon"!==o.type&&"MultiPolygon"!==o.type||Zt(n,o)&&(r=!0);i++}if(r)return n;for(var v=R([]),g=0;g<e.features.length;g++)v.features=v.features.concat(da(e.features[g]).features);return M(wu(n,v).geometry.coordinates)},t.pointToLineDistance=bu,t.pointToPolygonDistance=function t(r,i){var o,s,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null!=(o=a.method)?o:"geodesic",l=null!=(s=a.units)?s:"kilometers";if(!r)throw new Error("point is required");if(!i)throw new Error("polygon or multi-polygon is required");var h,c=at(i);if("MultiPolygon"===c.type){var g=c.coordinates.map(function(e){return t(r,P(e),{method:u,units:l})});return Math.min.apply(Math,_(g.map(Math.abs)))*(Zt(r,i)?-1:1)}if(c.coordinates.length>1){var d=c.coordinates.map(function(e){return t(r,P([e]),{method:u,units:l})}),p=n(h=d)||f(h)||k(h)||v(),y=p[0],m=e(p).slice(1);if(y>=0)return y;var x=Math.min.apply(Math,_(m));return x<0?Math.abs(x):Math.max(-1*x,y)}var E=wn(c),w=1/0;return bt(E,function(t){w=Math.min(w,bu(r,t,{method:u,units:l}))}),Zt(r,c)?-w:w},t.points=L,t.pointsWithinPolygon=Ou,t.polygon=P,t.polygonSmooth=function(t,e){(e=e||{}).iterations=e.iterations||1;var n=e.iterations,r=[];if(!t)throw new Error("inputPolys is required");return kt(t,function(t,e,i){if("Polygon"===t.type){for(var o=[[]],s=0;s<n;s++){var a=[],u=t;s>0&&(u=P(o).geometry),Yu(u,a),o=a.slice(0)}r.push(P(o,i))}else{if("MultiPolygon"!==t.type)throw new Error("geometry is invalid, must be Polygon or MultiPolygon");for(var l=[[[]]],h=0;h<n;h++){var c=[],f=t;h>0&&(f=F(l).geometry),Bu(f,c),l=c.slice(0)}r.push(F(l,i))}}),R(r)},t.polygonTangents=function(t,e){var n,r=nt(t),i=nt(e),o=[],s=[],a=qt(e),u=0,l=null;switch(r[0]>a[0]&&r[0]<a[2]&&r[1]>a[1]&&r[1]<a[3]&&(u=(l=wu(t,da(e))).properties.featureIndex),ut(e)){case"Polygon":o=i[0][u],s=i[0][0],null!==l&&l.geometry.coordinates[1]<r[1]&&(s=i[0][u]),n=Uu(i[0][0],i[0][i[0].length-1],r);var h=m(zu(i[0],r,n,o,s),2);o=h[0],s=h[1];break;case"MultiPolygon":for(var c=0,f=0,v=0,g=0;g<i[0].length;g++){c=g;for(var d=!1,p=0;p<i[0][g].length;p++){if(f=p,v===u){d=!0;break}v++}if(d)break}o=i[0][c][f],s=i[0][c][f],n=Uu(i[0][0][0],i[0][0][i[0][0].length-1],r),i.forEach(function(t){var e=m(zu(t[0],r,n,o,s),2);o=e[0],s=e[1]})}return R([M(o),M(s)])},t.polygonToLine=wn,t.polygonize=function(t){var e=Gu.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter(function(t){return t.isValid()}).forEach(function(t){t.isHole()?n.push(t):r.push(t)}),n.forEach(function(t){qu.findEdgeRingContaining(t,r)&&r.push(t)}),R(r.map(function(t){return t.toPolygon()}))},t.polygons=C,t.projection=Ku,t.propEach=yt,t.propReduce=mt,t.propertiesContainsFilter=yo,t.quadratAnalysis=function(t,e){for(var n=(e=e||{}).studyBbox||qt(t),r=e.confidenceLevel||20,i=t.features,o=i.length,s=Ot(jt(n)),u=La(n,Math.sqrt(s/o*2),{units:"meters"}).features,l={},h=0;h<u.length;h++)l[h]={box:qt(u[h]),cnt:0};var c,f=0,v=a(i);try{for(v.s();!(c=v.n()).done;)for(var g=c.value,d=0,p=Object.keys(l);d<p.length;d++){var y=p[d],m=l[y].box;if($u(et(g),m)){l[y].cnt+=1,f+=1;break}}}catch(t){v.e(t)}finally{v.f()}for(var _=0,x=0,E=Object.keys(l);x<E.length;x++){var k=l[E[x]].cnt;k>_&&(_=k)}for(var w=[],b=Object.keys(l).length,I=f/b,N=0,S=0;S<_+1;S++)N+=Math.exp(-I)*Math.pow(I,S)/tl(S),w.push(N);for(var M=[],L=0,P=0;P<_+1;P++){for(var C=0,T=Object.keys(l);C<T.length;C++){l[T[C]].cnt===P&&(L+=1)}var O=L/b;M.push(O)}for(var R=0,A=0;A<_+1;A++){var D=Math.abs(w[A]-M[A]);D>R&&(R=D)}var F=Qu[r]/Math.sqrt(b),q={criticalValue:F,isRandom:!0,maxAbsoluteDifference:R,observedDistribution:M};return R>F&&(q.isRandom=!1),q},t.radiansToDegrees=U,t.radiansToLength=Y,t.random=ll,t.randomLineString=sl,t.randomPoint=il,t.randomPolygon=ol,t.randomPosition=el,t.rectangleGrid=Ma,t.removeBbox=K,t.rewind=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(r=r||{}))throw new Error("options is invalid");var i=null!=(e=r.mutate)&&e,o=null!=(n=r.reverse)&&n;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof o)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof i)throw new Error("<mutate> must be a boolean");i||"Point"===t.type||"MultiPoint"===t.type||(t=so(t));var s=[];switch(t.type){case"GeometryCollection":return kt(t,function(t){hl(t,o)}),t;case"FeatureCollection":return _t(t,function(t){_t(hl(t,o),function(t){s.push(t)})}),R(s)}return hl(t,o)},t.rhumbBearing=vt,t.rhumbDestination=ca,t.rhumbDistance=ha,t.round=G,t.sample=function(t,e){if(!t)throw new Error("fc is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");var n=R(function(t,e){var n,r,i=t.slice(0),o=t.length,s=o-e;for(;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e));return n},t.sector=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!J(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!==E(i))throw new Error("options must be an object");if(vl(n)===vl(r))return oo(t,e,i);var s=nt(t),a=eu(t,e,n,r,i),u=[[s]];return dt(a,function(t){u[0].push(t)}),u[0].push(s),P(u,o)},t.segmentEach=Nt,t.segmentReduce=St,t.shortestPath=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!J(n=n||{}))throw new Error("options is invalid");var r=n.obstacles||R([]),i=n.resolution||100;if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(!W(i)||i<=0)throw new Error("options.resolution must be a number, greater than 0");var o=et(t),s=et(e);if(t=M(o),e=M(s),"FeatureCollection"===r.type){if(0===r.features.length)return T([o,s])}else if("Feature"===r.type&&"Polygon"===r.geometry.type)r=R([r]);else{if("Polygon"!==r.type)throw new Error("invalid obstacles");r=R([N(at(r))])}var a=r;a.features.push(t),a.features.push(e);var u=m(qt(gl(jt(qt(a)),1.15)),4),l=u[0],h=u[1],c=u[2],f=u[3];a.features.pop(),a.features.pop();for(var v,g,d=ft([l,h],[c,h],n)/i,p=(c-l)/d,y=ft([l,h],[l,f],n)/i,_=(f-h)/y,x=d%1*p/2,E=[],k=[],w=1/0,b=1/0,I=f-y%1*_/2,S=0;I>=h;){for(var L=[],P=[],C=l+x,O=0;C<=c;){var A=M([C,I]),D=El(A,r);L.push(D?0:1),P.push(C+"|"+I);var F=ft(A,t);!D&&F<w&&(w=F,v={x:O,y:S});var q=ft(A,e);!D&&q<b&&(b=q,g={x:O,y:S}),C+=p,O++}k.push(L),E.push(P),I-=_,S++}var G=new ml(k,{diagonal:!0}),Y=G.grid[v.y][v.x],B=G.grid[g.y][g.x],z=yl.search(G,Y,B),j=[o];return z.forEach(function(t){var e=E[t.x][t.y].split("|");j.push([+e[0],+e[1]])}),j.push(s),Dn(T(j))},t.simplify=function(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!J(i=null!=i?i:{}))throw new Error("options is invalid");var o=null!=(e=i.tolerance)?e:1,s=null!=(n=i.highQuality)&&n,a=null!=(r=i.mutate)&&r;if(!t)throw new Error("geojson is required");if(o&&o<0)throw new Error("invalid tolerance");return!0!==a&&(t=so(t)),kt(t,function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;if(Dn(t,{mutate:!0}),"GeometryCollection"!==r)switch(r){case"LineString":t.coordinates=Nl(t.coordinates,e,n);break;case"MultiLineString":t.coordinates=t.coordinates.map(function(t){return Nl(t,e,n)});break;case"Polygon":t.coordinates=Sl(t.coordinates,e,n);break;case"MultiPolygon":t.coordinates=t.coordinates.map(function(t){return Sl(t,e,n)})}}(t,o,s)}),t},t.square=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(ft(t.slice(0,2),[r,n])>=ft(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]},t.squareGrid=La,t.standardDeviationalEllipse=function(t,e){var n;if(!J(e=e||{}))throw new Error("options is invalid");var r=e.steps||64,i=e.weight,o=e.properties||{};if(!W(r))throw new Error("steps must be a number");if(!J(o))throw new Error("properties must be a number");var s=Et(t).length,a=Gi(t,{weight:i}),u=0,l=0,h=0;_t(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Ll(nt(t),nt(a));u+=Math.pow(r.x,2)*n,l+=Math.pow(r.y,2)*n,h+=r.x*r.y*n});var c=u-l,f=Math.sqrt(Math.pow(c,2)+4*Math.pow(h,2)),v=2*h,g=Math.atan((c+f)/v),d=180*g/Math.PI,p=0,y=0,m=0;_t(t,function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Ll(nt(t),nt(a));p+=Math.pow(r.x*Math.cos(g)-r.y*Math.sin(g),2)*n,y+=Math.pow(r.x*Math.sin(g)+r.y*Math.cos(g),2)*n,m+=n});var _=Math.sqrt(2*p/m),x=Math.sqrt(2*y/m),E=va(a,_,x,{units:"degrees",angle:d,steps:r,properties:o}),k=Ou(t,R([E])),w={meanCenterCoordinates:nt(a),semiMajorAxis:_,semiMinorAxis:x,numberOfFeatures:s,angle:d,percentageWithinEllipse:100*Et(k).length/s};return E.properties=null!=(n=E.properties)?n:{},E.properties.standardDeviationalEllipse=w,E},t.tag=function(t,e,n,r){return t=so(t),e=so(e),_t(t,function(t){t.properties||(t.properties={}),_t(e,function(e){t.properties&&e.properties&&void 0===t.properties[r]&&Zt(t,e)&&(t.properties[r]=e.properties[n])})}),t},t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=Rl(t.geometry.coordinates):t.geometry.coordinates.forEach(function(t){e.features=e.features.concat(Rl(t))}),e},t.tin=Lo,t.toMercator=Vu,t.toWgs84=Zu,t.transformRotate=fa,t.transformScale=gl,t.transformTranslate=function(t,e,n,r){if(!J(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==s&&void 0!==s||(t=so(t)),dt(t,function(t){var r=nt(ca(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}),K(t),t},t.triangleGrid=Pa,t.truncate=_e,t.union=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(kt(t,function(t){n.push(t.coordinates)}),n.length<2)throw new Error("Must have at least 2 geometries");var r=na.apply(sa,[n[0]].concat(_(n.slice(1))));return 0===r.length?null:1===r.length?P(r[0],e.properties):F(r,e.properties)},t.unkinkPolygon=function(t){var e=[];return bt(t,function(t){"Polygon"===t.geometry.type&&_t(Fl(t),function(n){e.push(P(n.geometry.coordinates,t.properties))})}),R(e)},t.validateBBox=Q,t.validateId=$,t.voronoi=function(t,e){if(!J(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return st(t,"Point","points"),R(function(){var t=Ul,e=Vl,n=null;function r(r){return new Nh(r.map(function(n,i){var o=[Math.round(t(n,i,r)/wh)*wh,Math.round(e(n,i,r)/wh)*wh];return o.index=i,o.data=n,o}),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:Xl(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:Xl(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x(function(t){return t.geometry.coordinates[0]}).y(function(t){return t.geometry.coordinates[1]}).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(function(e,n){return Object.assign(function(t){return(t=t.slice()).push(t[0]),P([t])}(e),{properties:uo(t.features[n].properties)})}))}});\n\n;!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(A.h3={})}(this,function(A){var e=function(A){var e,r=void 0!==(A=A||{})?A:{},i={};for(e in r)r.hasOwnProperty(e)&&(i[e]=r[e]);var n,a,t,f,o=[],l=!1;n="object"==typeof window,a="function"==typeof importScripts,t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,l=t&&!n&&!a,f=!n&&!l&&!a;var u,c,s,b,d,g="";l?(g="undefined"!=typeof __dirname?__dirname+"/":"",u=function(A,e){var r;return(r=nA(A))||(b||(b=require("fs")),d||(d=require("path")),A=d.normalize(A),r=b.readFileSync(A)),e?r:r.toString()},s=function(A){var e=u(A,!0);return e.buffer||(e=new Uint8Array(e)),m(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\\\/g,"/"),o=process.argv.slice(2),r.inspect=function(){return"[Emscripten Module object]"}):f?("undefined"!=typeof read&&(u=function(A){var e=nA(A);return e?rA(e):read(A)}),s=function(A){var e;return(e=nA(A))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(m("object"==typeof(e=read(A,"binary"))),e)},"undefined"!=typeof scriptArgs?o=scriptArgs:void 0!==arguments&&(o=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(n||a)&&(a?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),g=0!==g.indexOf("blob:")?g.substr(0,g.lastIndexOf("/")+1):"",u=function(A){try{var e=new XMLHttpRequest;return e.open("GET",A,!1),e.send(null),e.responseText}catch(e){var r=nA(A);if(r)return rA(r);throw e}},a&&(s=function(A){try{var e=new XMLHttpRequest;return e.open("GET",A,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var r=nA(A);if(r)return r;throw e}}),c=function(A,e,r){var i=new XMLHttpRequest;i.open("GET",A,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var n=nA(A);n?e(n.buffer):r()}},i.onerror=r,i.send(null)});var w=r.print||console.log.bind(console),k=r.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e]);i=null,r.arguments&&(o=r.arguments);var B=0,h=!1;function m(A,e){A||BA("Assertion failed: "+e)}function v(A){var e=r["_"+A];return m(e,"Cannot call unknown function "+A+", make sure it is exported"),e}var Q,E,D,C,_,y,M,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(A,e){return A?function(A,e,r){for(var i=e+r,n=e;A[n]&&!(n>=i);)++n;if(n-e>16&&A.subarray&&P)return P.decode(A.subarray(e,n));for(var a="";e<n;){var t=A[e++];if(128&t){var f=63&A[e++];if(192!=(224&t)){var o=63&A[e++];if((t=224==(240&t)?(15&t)<<12|f<<6|o:(7&t)<<18|f<<12|o<<6|63&A[e++])<65536)a+=String.fromCharCode(t);else{var l=t-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&t)<<6|f)}else a+=String.fromCharCode(t)}return a}(D,A,e):""}function p(A,e){return A%e>0&&(A+=e-A%e),A}function T(A){Q=A,r.HEAP8=E=new Int8Array(A),r.HEAP16=C=new Int16Array(A),r.HEAP32=_=new Int32Array(A),r.HEAPU8=D=new Uint8Array(A),r.HEAPU16=new Uint16Array(A),r.HEAPU32=new Uint32Array(A),r.HEAPF32=y=new Float32Array(A),r.HEAPF64=M=new Float64Array(A)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var F=r.TOTAL_MEMORY||33554432;function L(A){for(;A.length>0;){var e=A.shift();if("function"!=typeof e){var i=e.func;"number"==typeof i?void 0===e.arg?r.dynCall_v(i):r.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}F=(Q=r.buffer?r.buffer:new ArrayBuffer(F)).byteLength,T(Q),_[7096]=5271296;var G=[],U=[],z=[],x=[],V=Math.abs,S=Math.ceil,H=Math.floor,R=Math.min,Y=0,j=null,O=null;r.preloadedImages={},r.preloadedAudios={};var N,W,Z=null,J="data:application/octet-stream;base64,";function K(A){return String.prototype.startsWith?A.startsWith(J):0===A.indexOf(J)}function X(A){return A}function q(A){return A.replace(/\\b__Z[\\w\\d_]+/g,function(A){var e=X(A);return A===e?A:e+" ["+A+"]"})}function $(){var A=new Error;if(!A.stack){try{throw new Error(0)}catch(e){A=e}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function AA(){return E.length}function eA(A){try{var e=new ArrayBuffer(A);if(e.byteLength!=A)return;return new Int8Array(e).set(E),oA(e),T(e),1}catch(A){}}function rA(A){for(var e=[],r=0;r<A.length;r++){var i=A[r];i>255&&(i&=255),e.push(String.fromCharCode(i))}return e.join("")}Z="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAABgtRFT7IQlAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCUAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgtRFT7Ifm/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+b8AAAAAAAAAABgtRFT7IQnAGC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPshCcAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8AAAAAAAAAAAAAAAAAAAAAGC1EVPsh+T8AAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAMpi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAABAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP6phvycGBZRAJbod0OgwfkCp+L8jatBmQCjl3pGrPlFAfMWm114SOkButwtqS7UjQHQwbcjXyw1A8jnLuuyA9j9KwjL0VwHhPyotk0lcs8k/Q5PvEs9rsz+SfsOQEVqdPzUAKDojLoY/WJz/kcjCcD8YFu070FRZPyoLC2BdJEM/YOXQAuiMM0HIBz1bw3sdQdV46aaHRwZByatzjDPX8EDb3Jie8HXZQCJxj6ULP8NAUaG6uRAZrUCWdmou5/mVQLb9huRPm4BAhvoCHygZaUCuX/I3SPdSQC9/bC/1qTxAfKxsYQ6pJUCuslH+N14QQMS/cv7SvPg/Ol8maYKx4j8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAKriWFiWZfg/Y2nmTbY/8z8MHSPSqmnjv6hnn18HR3c/quJYWJZl+D/jq5TzDdzyPwwdI9KqaeO/u0kC1eFSBECq4lhYlmX4P69pJmt7c/E/NnkJi6jSBsDESFlzKkr6P33ArMz7sfY/o2q2uqM08D+oZ59fB0d3PzEqCi3qrvK/kmm4ANp49D+4wS2wzhzvP9WJvyAnx+E/upcY75RVx7+95t+9y0T1P9L18g1caO0/k6CkRyVzAEBf99+e/GjxP6QMsuuLQ/U/PlP4Qr8q7j8Mb/GO2GMCwLl2K/DQIghAePiwytEp9D9UHrsuI/nqPzjMedJ+yuy/k6xgf58n/L+XoQtn22DzP2lzCnsYk+s/JhUSDI4P8z+8lFcBhgTcPxOqKRxEX/M/89MEdoPQ6j8OKQaXDob7vzWwNvblgAPAzGkxMcl88j9Nm4okPkbpP0vI89vxSgRAdac2Z6W2/T+6UFOMC3zyP/+2XEF3hug/QqhELwGKCMAwdlQerEoEQFcr/B+VnvE/hB1hfFzT5j8wdsE/Da64P0hIvnF/sOC/KH/hrXUg8T9bI5OQHaLlP+mYzla7td6/CtKG6iOm8b8FW3TV8oXwP8ORhtNuJ+c/q8JrTMz/AcC8PaUl+PUFwAXv9rkMT/A/m+sAswr15D+7hk/O3yvkP6c/yVsOHKI/qqAX9idJ8D/8hNz1KNPiP7xSXh3Ggvg/epbkiKr57T/23/LB1GLvP4GTTeNZi+M/W4TqlTheBcDupZgIdYUIQGwlcW3YZO8/tQvDXQ3H4j8Bt+sf9DkAQMdFie+nNvg/Z5Uh1wDX7j9h5X2d4KjhPxMJ1ZVT4Pa/evqB8xB//7+W183U9QLsPwzNxsC7AOA/af/LqCnK/r/lPceQ0FQDwHoY0nYIW+w/bHNSHrTg4D/DFcMAdabuv2sz5Ojhnve/FvLf01HN6z/tEDL2Hz/gP0bBv0KUhPA/pd7sEnMc4D8EGon4Lo7sP5NVbYtSON8/DAMC50odBkB+Z2J8MGYCQIhlM1gubOo/FssiPwWy4D8OIlGqRnkCQAd1vopp6f4/QS1keLLK6T9rfoBuT7LZP3KQbH5ugwjAjqVPXTmbBUBL/JxcqR3qP3oSeovuktg/Y6pRhJmqy7+0kwuU0Yjmv2wvsfFmQ+g/R98lJFqQ2T/IGb5gjLkCwK3mNff3kQbAqDznPFM86T+iiP0FfsvYP7fzKG6Mls0/h7+at2btzL8tsUTgk+LmP/YEIrTDINU/WmwKoVjA5L9aC02r6FHxvzzFCT/Qg+Y/nx0V97en0j8+1toJOm77P1kZ7h8KjfQ/GBbbqxgk5j9RGXM79G/SP+beHsWmweQ/9REi4eX0xD/V9s+kmMHkP+pb9yNs09A/c5ERjVDTAECqEr3OBCH7P14ILfMECOU/piRx4P8P0j+JYU//bfL0Pw62fw28B+w/l5YW2Ga45D9+CyKRbenOP5cH6fHy1/S/o/egk03++r91nTYRL/bjP3fHN6OJVdA/7xXQh1XLBcAB3g6tBdUIQKW2KnGYjeQ/SqIpagclyz8F9P3YgNL6v9H6NBsZ8QDAW2k5L5Qs4z/0axa1l6zLP1GE65Mu4wNAwfX+BYmWAEBBgJP90M3hP6/03qhPLdA/zqo5bJz2778/ESlPCTn1v7JkhGyvzuE/DM7sj5twwz/6xbXLavYGQH29RFRGkgNA7bOXVSJ54T9fEhTHO/TDP+8t+HMOiwDAxa0SbGTtA8Atii7y0mLgP4cecHFB3sM/uPUpyv+K7j8nktD1/WvhP2cWmi772d8/Fj7uU9kEvD8oKOESLzKmvwSdCqrHdNu/XCluGsvI3T929OW5md+uP9dP6rXcZNq/gXM+ggzL6b+eKjsPgJncP6i1e9aVu7E/2CnPNJyD1D/DnyGgSe+xvy8k7g9bp9s/nYmLvHn1sz9cFOwApH8IwGa6Mjy9cgZAJr95SiSW2z8rCkhOFvqdP3SIKmO/UwPAEy0zkN7bBsCds8Hg/13YP1zv413hVGi/FVtqixSn6L9XAPQGul3yv7SGu2BoCNk/n94bv7Maj79p13T6X9z3P45MPCW3WvI/rU/8/LRj1T9cgR6SXd+ZPymL2DstbPI/8s/pAkIz6z/fmoB+8efYPz2XyfWgYaa/6wys72AW/j8LZImhgrf3P729Zla/n9U/ySB8B3PBqL8O2nhevvbxv17+5A+n6fe/YrGIqEGB1T+wCEGbkhaxv989QHVE5wFAzd12PTu3/T9AHUPZY2DUP3SQDST0zq2/JCxAlIoj5T+Mhe1IJkrQP/cRpl8QhtU/amc4seFts79khiUSVaz3vxYfWtjPwf2/CHscxQqD0j/ctUBQ9my3v0POnFiyXv2/pjjn2Ju/AcDk45DwBhPRP/GjwlCrv7m/aT2ciwolBsAQOzHr/wUJQCzpq5UYvtI/gDCf3SlCwb+4i7S+mukEQBDA1f8mowFA2utnRN3KyT9T+9EYAVG6v9/IVZ0enrE/7NbRtdGfzr/8y8GpRz7LP3U0vTSk18e/JzHEcwiBB0AGm8Q7AJkEQNLciyt4Esk/gLou5zoQxr+RrOfM91oBwEzd36KybgTAgLou5zoQxj/S3IsreBLJv1gCch0OHO8/FD+RxSLN4j91NL00pNfHP/zLwalHPsu/nL7/By4Pyr8tSP5h7CPiv1P70RgBUbo/2utnRN3Kyb/KfllfCpUIwLkP5zj+NwdAgDCf3SlCwT8s6auVGL7Sv2aFPlaC4eC/XrS5UVH77b/xo8JQq7+5P+TjkPAGE9G/Q30/RYbn1z8FF/ISafuLv9y1QFD2bLc/CHscxQqD0r/fi+tPROX0P6vRc+19ie0/amc4seFtsz/3EaZfEIbVv77TYpahl/o/DDsu0CaC9D90kA0k9M6tP0AdQ9ljYNS/CCI0rxjZA8BgfCaLthgHwLAIQZuSFrE/YrGIqEGB1b8kvQ982+rsv4J8EWu7jPS/ySB8B3PBqD+9vWZWv5/VvwrAByWcJgBAxFujmE9a+j89l8n1oGGmP9+agH7x59i/N03cuJUt9L8X9v4GdIz6v1yBHpJd35m/rU/8/LRj1b8mz69sydf/vyu5idMqVQLAn94bv7Majz8AhrtgaAjZv+aCE66WZ/q/lA1Mgz/p/79c7+Nd4VRoP52zweD/Xdi/TJZpMTb4AkDLWZShPOb/PysKSE4W+p2/Jr95SiSW27/PkmbE7zjnP6UAiCDmMNI/nYmLvHn1s78vJO4PW6fbv5MWA2vqSrQ/V5WLwPB51b+otXvWlbuxv54qOw+Amdy/1keqzYeRBsApIEMHgZIIQHb05bmZ366/XCluGsvI3b8W44a9X9UFQEeQtDM4rwJAFj7uU9kEvL9nFpou+9nfv3Co+JcyyQhAcdkCX2KzBUCHHnBxQd7Dvy2KLvLSYuC/o6+5YTt/AcCHCNDW+8YEwF8SFMc79MO/7bOXVSJ54b9E/pfA2S3xPzD9xaBb0uQ/DM7sj5tww7+yZIRsr87hv7c4c0SEXNG/Tr79/9M+5r+v9N6oTy3Qv5uAk/3QzeG/XcI1OVQkAUAQSV9Z7Qr9P/RrFrWXrMu/W2k5L5Qs479Zo2IBM/vkv6FuipzkFvG/SqIpagcly7+ltipxmI3kv0pmis91cfc/gWQecsRh8D93xzejiVXQv3WdNhEv9uO/D7mgYy612j+PyVPNaT2jv34LIpFt6c6/l5YW2Ga45L+LUp+2A2z9P39i5xSpRfc/piRx4P8P0r9eCC3zBAjlv5n4OKmIUf2/jj/kUAwgAsDqW/cjbNPQv9X2z6SYweS/aTdljlWd8L94R8vZ8SL3v1EZczv0b9K/GBbbqxgk5r9XdfyikfEDwPILMvas0gfAnx0V97en0r88xQk/0IPmvxGErZ681fa/9kCaiOy2/b/2BCK0wyDVvy2xROCT4ua/+5EBLOXxA0B7p53+BnkAQKKI/QV+y9i/qDznPFM86b/snWGNkkgHwC+ByugkUwdAR98lJFqQ2b9sL7HxZkPovyJNGM67oek/HzNy6BqA1D96EnqL7pLYv0v8nFypHeq/axL/u1FnB0AkSEHvxn8DQGt+gG5Pstm/QS1keLLK6b/Sk/O6mtGzPxU8pLcPNty/FssiPwWy4L+IZTNYLmzqvw4szKfSouq/G+XJHY1a87+TVW2LUjjfvwQaifgujuy/3VARaoMl2L9NFodfK+/qv+0QMvYfP+C/FvLf01HN67+ETOQysd8AwH71iI/eGgXAbHNSHrTg4L96GNJ2CFvsv6BnExReeAFA5CakvxSl+j8MzcbAuwDgv5bXzdT1Auy/uVq8/8x58z+uvPMNqzTnP2HlfZ3gqOG/Z5Uh1wDX7r8PUbMSo2P7P9VfBrXlxPI/tQvDXQ3H4r9sJXFt2GTvvyDssGgO0PG/WxT/uE4N+r+Bk03jWYvjv/bf8sHUYu+/rUXN8hUe3j9m5HB1yZCzv/yE3PUo0+K/qqAX9idJ8L9mByqLMMH5v4kHC7KQowHAm+sAswr15L8F7/a5DE/wv2JLsGADFwTAKQjVGovZCMDDkYbTbifnvwVbdNXyhfC/malhH7yI7D+oevd0GWDZP1sjk5AdouW/KH/hrXUg8b8KWmrpQ0sFQAzEAF/pTgBAhB1hfFzT5r9XK/wflZ7xv18hRuqKXAjA/5rUd9v1BED/tlxBd4bov7pQU4wLfPK/4pnwn0T/sj/c277XPF3jv02biiQ+Rum/zGkxMcl88r8Yk0HhJVzjv62yUUFRjfS/89MEdoPQ6r8TqikcRF/zvxQxghHovfY/cfM1eFWE5j9pcwp7GJPrv5ehC2fbYPO/KUV2nGg0/795OhmUaqEFwFQeuy4j+eq/ePiwytEp9L8DuqWfW+8BQLytJylXHPY/PlP4Qr8q7r+kDLLri0P1vxT4ShWL+Oo/DMsWg0zlv7/S9fINXGjtv73m373LRPW/+xg/Gaxd8b94MdQEfW0AwLjBLbDOHO+/kmm4ANp49L+cShSMMbAEwKyjUgWirAdAo2q2uqM08L99wKzM+7H2v3RdlNBXFgnA8S9+ewyV/z+vaSZre3Pxv6riWFiWZfi/2J7VSZZ60j+LES81zPn3v+OrlPMN3PK/quJYWJZl+L/OZbufkEcEQLCNB/1lPOO/Y2nmTbY/87+q4lhYlmX4v7CNB/1lPOO/zmW7n5BHBEBwKD1Aa57LP/XsSsw7RbU/PMDPJGsfoD/TqningGKIPzFtCLYmb3I/qYfrJr7eWz9pQmleXRFFP0rWlJkA2i8/pCvcttgTGD9Dt8IWbjMCPyCG4GRlhOs+1JI2GhDN1D7ns8cGvXK/Pi8m8UTJxac+hNTfA2z4kT7GI8kjLyt7Pv//////HwAI//////8zEAj/////fzIgCP////9vMjAI/////2MyQAj///8/YjJQCP///zdiMmAI////M2IycAj//78zYjKACP//qzNiMpAI/3+rM2IyoAj/D6szYjKwCP8DqzNiMsAIvwOrM2Iy0AifA6szYjLgCJkDqzNiMvAI//////8/Dwj//////ysfCP////9/KS8I/////z8pPwj/////OSlPCP///z84KV8I////Dzgpbwj///8OOCl/CP//Hw44KY8I//8PDjgpnwj/fw0OOCmvCP8PDQ44Kb8I/w0NDjgpzwj/DA0OOCnfCMcMDQ44Ke8IxAwNDjgp/wgHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAgAAAAEAAAADAAAADgAAAAYAAAALAAAAAgAAAAcAAAABAAAAGAAAAAUAAAAKAAAAAQAAAAYAAAAAAAAAJgAAAAcAAAAMAAAAAwAAAAgAAAACAAAAMQAAAAkAAAAOAAAAAAAAAAUAAAAEAAAAOgAAAAgAAAANAAAABAAAAAkAAAADAAAAPwAAAAsAAAAGAAAADwAAAAoAAAAQAAAASAAAAAwAAAAHAAAAEAAAAAsAAAARAAAAUwAAAAoAAAAFAAAAEwAAAA4AAAAPAAAAYQAAAA0AAAAIAAAAEQAAAAwAAAASAAAAawAAAA4AAAAJAAAAEgAAAA0AAAATAAAAdQAAAA8AAAATAAAAEQAAABIAAAAQAAAABgAAAAIAAAADAAAABQAAAAQAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAMAAAABAAAABQAAAAQAAAAAAAAAAAAAAAcAAAAFAAAAAwAAAAQAAAABAAAAAAAAAAIAAAAAAAAAAgAAAAMAAAABAAAABQAAAAQAAAAGAAAAAAAAAAAAAAAYLURU+yH5PxgtRFT7Ifm/GC1EVPshCUAYLURU+yEJwGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjZWxsc1RvTXVsdGlQb2x5LmMAY2VsbFRvRWRnZUFyY3MAAAEDAgQABAMFAQJjYW5jZWxBcmNQYWlycwBjcmVhdGVTb3J0YWJsZUxvb3AAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAdmVjM1RvQ2VsbABjZWxsVG9DaGlsZFBvcwB2YWxpZGF0ZUNoaWxkUG9zAHJldkRpciAhPSBJTlZBTElEX0RJR0lUAGxvY2FsaWouYwBjZWxsVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAYmFzZUNlbGwgPT0gb3JpZ2luQmFzZUNlbGwALi4vaW5jbHVkZS9jb29yZGlqay5oAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAYmFzZUNlbGwgIT0gSU5WQUxJRF9CQVNFX0NFTEwAbG9jYWxJamtUb0NlbGwAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAZ3JpZFBhdGhDZWxsc0ludGVycG9sYXRlAHBvbHlmaWxsLmMAaXRlclN0ZXBQb2x5Z29uQ29tcGFjdAAwAHZlcnRleC5jAHZlcnRleFJvdGF0aW9ucwBjZWxsVG9WZXJ0ZXg=";var iA="function"==typeof atob?atob:function(A){var e,r,i,n,a,t,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="",l=0;A=A.replace(/[^A-Za-z0-9\\+\\/\\=]/g,"");do{i=f.indexOf(A.charAt(l++)),e=(15&(n=f.indexOf(A.charAt(l++))))<<4|(a=f.indexOf(A.charAt(l++)))>>2,r=(3&a)<<6|(t=f.indexOf(A.charAt(l++))),o+=String.fromCharCode(i<<2|n>>4),64!==a&&(o+=String.fromCharCode(e)),64!==t&&(o+=String.fromCharCode(r))}while(l<A.length);return o};function nA(A){if(K(A))return function(A){if("boolean"==typeof l&&l){var e;try{e=Buffer.from(A,"base64")}catch(r){e=new Buffer(A,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var r=iA(A),i=new Uint8Array(r.length),n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}catch(A){throw new Error("Converting base64 string to bytes failed.")}}(A.slice(J.length))}var aA,tA,fA=function(A,e,r){var i=new A.Int8Array(r),n=new A.Int32Array(r),a=(new A.Uint8Array(r),new A.Float32Array(r),new A.Float64Array(r)),t=0|e.o,f=0|e.p,o=A.Math.floor,l=A.Math.abs,u=A.Math.sqrt,c=A.Math.cos,s=A.Math.sin,b=A.Math.tan,d=A.Math.acos,g=A.Math.asin,w=A.Math.atan,k=A.Math.atan2,B=A.Math.ceil,h=A.Math.imul,m=A.Math.min,v=A.Math.max,Q=A.Math.clz32,E=e.a,D=e.b,C=e.c,_=e.d,y=e.e,M=e.f,P=e.g,I=e.h,p=e.i,T=28416;function F(A,e,r,i){return 0|L(A|=0,e|=0,r|=0,i|=0,0)}function L(A,e,r,i,a){var t,f=0,o=0,l=0,u=0;if(t=T,T=T+16|0,o=t,!(0|G(A|=0,e|=0,r|=0,i|=0,a|=0)))return T=t,0;do{if((0|r)>=0){if((0|r)>13780509){if(0|(f=0|ZA(15,o)))break;o=0|n[(l=o)>>2],l=0|n[l+4>>2]}else u=0|Ue(0|r,0|(f=((0|r)<0)<<31>>31),3,0),l=0|C(),f=0|pe(0|r,0|f,1,0),f=0|pe(0|(f=0|Ue(0|u,0|l,0|f,0|C())),0|C(),1,0),l=0|C(),n[o>>2]=f,n[o+4>>2]=l,o=f;if(Ze(0|i,0,o<<3|0),0|a){Ze(0|a,0,o<<2|0),f=0|U(A,e,r,i,a,o,l,0);break}(f=0|Me(o,4))?(u=0|U(A,e,r,i,f,o,l,0),ye(f),f=u):f=13}else f=2}while(0);return T=t,0|f}function G(A,e,r,i,a){e|=0,r|=0,i|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(f=T,T=T+16|0,o=f+8|0,n[(w=t=f)>>2]=A|=0,n[w+4>>2]=e,(0|r)<0)return T=f,2;if(n[(l=i)>>2]=A,n[l+4>>2]=e,(l=0!=(0|a))&&(n[a>>2]=0),0|CA(A,e))return T=f,9;n[o>>2]=0;A:do{if((0|r)>=1)if(l)for(d=1,b=0,g=0,w=1,l=A;;){if(!(b|g)){if(0|(l=0|z(l,e,4,o,t)))break A;if(0|CA(l=0|n[(e=t)>>2],e=0|n[e+4>>2])){l=9;break A}}if(0|(l=0|z(l,e,0|n[26864+(g<<2)>>2],o,t)))break A;if(l=0|n[(e=t)>>2],e=0|n[e+4>>2],n[(A=i+(d<<3)|0)>>2]=l,n[A+4>>2]=e,n[a+(d<<2)>>2]=w,u=(0|(A=b+1|0))==(0|w),s=6==(0|(c=g+1|0)),0|CA(l,e)){l=9;break A}if((0|(w=w+(s&u&1)|0))>(0|r)){l=0;break}d=d+1|0,b=u?0:A,g=u?s?0:c:g}else for(d=1,b=0,g=0,w=1,l=A;;){if(!(b|g)){if(0|(l=0|z(l,e,4,o,t)))break A;if(0|CA(l=0|n[(e=t)>>2],e=0|n[e+4>>2])){l=9;break A}}if(0|(l=0|z(l,e,0|n[26864+(g<<2)>>2],o,t)))break A;if(l=0|n[(e=t)>>2],e=0|n[e+4>>2],n[(A=i+(d<<3)|0)>>2]=l,n[A+4>>2]=e,u=(0|(A=b+1|0))==(0|w),s=6==(0|(c=g+1|0)),0|CA(l,e)){l=9;break A}if((0|(w=w+(s&u&1)|0))>(0|r)){l=0;break}d=d+1|0,b=u?0:A,g=u?s?0:c:g}else l=0}while(0);return T=f,0|l}function U(A,e,r,i,a,t,f,o){r|=0,i|=0,a|=0,o|=0;var l,u,c,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(c=T,T=T+16|0,l=c+8|0,u=c,s=0|xe(0|(A|=0),0|(e|=0),0|(t|=0),0|(f|=0)),d=0|C(),!(0==(0|(B=0|n[(k=g=i+(s<<3)|0)>>2]))&0==(0|(k=0|n[k+4>>2]))|(b=(0|B)==(0|A)&(0|k)==(0|e))))do{s=0|ze(0|(s=0|pe(0|s,0|d,1,0)),0|C(),0|t,0|f),d=0|C(),b=(0|(k=0|n[(B=g=i+(s<<3)|0)>>2]))==(0|A)&(0|(B=0|n[B+4>>2]))==(0|e)}while(!(0==(0|k)&0==(0|B)|b));if(s=a+(s<<2)|0,b&&(0|n[s>>2])<=(0|o))return T=c,0;if(n[(B=g)>>2]=A,n[B+4>>2]=e,n[s>>2]=o,(0|o)>=(0|r))return T=c,0;switch(b=o+1|0,n[l>>2]=0,0|(s=0|z(A,e,2,l,u))){case 9:w=9;break;case 0:(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b))||(w=9)}A:do{if(9==(0|w)){switch(n[l>>2]=0,0|(s=0|z(A,e,3,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,1,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,5,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,4,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}switch(n[l>>2]=0,0|(s=0|z(A,e,6,l,u))){case 9:break;case 0:if(0|(s=0|U(0|n[(s=u)>>2],0|n[s+4>>2],r,i,a,t,f,b)))break A;break;default:break A}return T=c,0}}while(0);return T=c,0|s}function z(A,e,r,i,a){A|=0,e|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0,b=0,d=0;if((r|=0)>>>0>6)return 1;n[(i|=0)>>2]=u=(0|n[i>>2])%6|0;A:do{if((0|u)>0)for(l=0;;){switch(0|r){case 1:r=5;break;case 5:r=4;break;case 4:r=6;break;case 6:r=2;break;case 2:r=3;break;case 3:r=1}if((0|(l=l+1|0))==(0|u))break A}}while(0);if(o=0|Se(0|A,0|e,45),C(),(f=127&o)>>>0>121)return 5;t=0|MA(A,e),l=0|Se(0|A,0|e,52),C(),l&=15;A:do{if(l){for(;;){if(c=0|Se(0|A,0|e,0|(u=3*(15-l|0)|0)),C(),7==(0|(c&=7))){e=5;break}if(d=0==(0|LA(l)),l=l+-1|0,b=0|He(7,0,0|u),e&=~(0|C()),A=0|He(0|n[(d?432:16)+(28*c|0)+(r<<2)>>2],0,0|u)|A&~b,e|=u=0|C(),!(r=0|n[(d?640:224)+(28*c|0)+(r<<2)>>2])){r=0;break A}if(!l){s=15;break A}}return 0|e}s=15}while(0);15==(0|s)&&(A|=0|He(0|(d=0|n[848+(28*f|0)+(r<<2)>>2]),0,45),e=0|C()|-1040385&e,r=0|n[4272+(28*f|0)+(r<<2)>>2],127==(127&d|0)&&(d=0|He(0|n[848+(28*f|0)+20>>2],0,45),e=0|C()|-1040385&e,r=0|n[4272+(28*f|0)+20>>2],A=0|IA(d|A,e),e=0|C(),n[i>>2]=1+(0|n[i>>2]))),c=0|Se(0|A,0|e,45),C(),c&=127;A:do{if(0|Y(c)){e:do{if(1==(0|MA(A,e))){if((0|f)!=(0|c)){if(0|W(c,0|n[7696+(28*f|0)>>2])){A=0|TA(A,e),u=1,e=0|C();break}_(27634,26928,533,26936)}switch(0|t){case 3:A=0|IA(A,e),e=0|C(),n[i>>2]=1+(0|n[i>>2]),u=0;break e;case 5:A=0|TA(A,e),e=0|C(),n[i>>2]=5+(0|n[i>>2]),u=0;break e;case 0:return 9;default:return 1}}else u=0}while(0);if((0|r)>0){l=0;do{A=0|PA(A,e),e=0|C(),l=l+1|0}while((0|l)!=(0|r))}if((0|f)!=(0|c)){if(!(0|j(c))){if(0!=(0|u)|5!=(0|MA(A,e)))break;n[i>>2]=1+(0|n[i>>2]);break}switch(127&o){case 8:case 118:break A}3!=(0|MA(A,e))&&(n[i>>2]=1+(0|n[i>>2]))}}else if((0|r)>0){l=0;do{A=0|IA(A,e),e=0|C(),l=l+1|0}while((0|l)!=(0|r))}}while(0);return n[i>>2]=((0|n[i>>2])+r|0)%6|0,n[(d=a)>>2]=A,n[d+4>>2]=e,0}function x(A,e,r,i){e|=0,r|=0,i|=0;var a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(t=T,T=T+16|0,g=t+8|0,n[(d=a=t)>>2]=A|=0,n[d+4>>2]=e,(0|r)<0)return T=t,2;if(!r)return n[(g=i)>>2]=A,n[g+4>>2]=e,T=t,0;n[g>>2]=0;A:do{if(0|CA(A,e))A=9;else{f=0,d=A;do{if(0|(A=0|z(d,e,4,g,a)))break A;if(f=f+1|0,0|CA(d=0|n[(e=a)>>2],e=0|n[e+4>>2])){A=9;break A}}while((0|f)<(0|r));n[(b=i)>>2]=d,n[b+4>>2]=e,b=r+-1|0,s=0,A=1;do{if(f=26864+(s<<2)|0,5==(0|s))for(l=0|n[f>>2],o=0,f=A;;){if(0|(A=0|z(0|n[(A=a)>>2],0|n[A+4>>2],l,g,a)))break A;if((0|o)!=(0|b)){if(u=0|n[(c=a)>>2],c=0|n[c+4>>2],n[(A=i+(f<<3)|0)>>2]=u,n[A+4>>2]=c,0|CA(u,c)){A=9;break A}A=f+1|0}else A=f;if((0|(o=o+1|0))>=(0|r))break;f=A}else for(c=0|n[f>>2],u=0,f=A,o=0|n[(l=a)>>2],l=0|n[l+4>>2];;){if(0|(A=0|z(o,l,c,g,a)))break A;if(o=0|n[(l=a)>>2],l=0|n[l+4>>2],n[(A=i+(f<<3)|0)>>2]=o,n[A+4>>2]=l,A=f+1|0,0|CA(o,l)){A=9;break A}if((0|(u=u+1|0))>=(0|r))break;f=A}s=s+1|0}while(s>>>0<6);A=(0|d)==(0|n[(A=a)>>2])&&(0|e)==(0|n[A+4>>2])?0:9}}while(0);return T=t,0|A}function V(A,e,r,i){A|=0,e|=0,i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0;if(a=T,T=T+16|0,o=a,!(r|=0))return n[i>>2]=A,n[i+4>>2]=e,T=a,0;do{if((0|r)>=0){if((0|r)>13780509){if(0|(t=0|ZA(15,o)))break;t=0|n[(f=o)>>2],f=0|n[f+4>>2]}else s=0|Ue(0|r,0|(t=((0|r)<0)<<31>>31),3,0),f=0|C(),t=0|pe(0|r,0|t,1,0),t=0|pe(0|(t=0|Ue(0|s,0|f,0|t,0|C())),0|C(),1,0),f=0|C(),n[(s=o)>>2]=t,n[s+4>>2]=f;if(c=0|Me(t,8)){if(!(s=0|Me(t,4))){ye(c),t=13;break}if(0|(t=0|U(A,e,r,c,s,t,f,0))){ye(c),ye(s);break}if(e=0|n[o>>2],(0|(o=0|n[o+4>>2]))>0|0==(0|o)&e>>>0>0){t=0,l=0,u=0;do{0==(0|(f=0|n[(A=c+(l<<3)|0)>>2]))&0==(0|(A=0|n[A+4>>2]))||(0|n[s+(l<<2)>>2])!=(0|r)||(n[(b=i+(t<<3)|0)>>2]=f,n[b+4>>2]=A,t=t+1|0),l=0|pe(0|l,0|u,1,0),u=0|C()}while((0|u)<(0|o)|(0|u)==(0|o)&l>>>0<e>>>0)}ye(c),ye(s),t=0}else t=13}else t=2}while(0);return T=a,0|t}function S(A,e,r,i){r|=0,i|=0;var a,t,f,o=0,l=0;for(f=T,T=T+16|0,a=f,t=f+8|0,o=(o=0==(0|CA(A|=0,e|=0)))?1:2;;){if(n[t>>2]=0,0==(0|z(A,e,o,t,a))&((0|n[(l=a)>>2])==(0|r)?(0|n[l+4>>2])==(0|i):0)){A=4;break}if((o=o+1|0)>>>0>=7){o=7,A=4;break}}return 4==(0|A)?(T=f,0|o):0}function H(A,e,r,i,t,f,o){e|=0,r|=0,i|=0,t|=0,f|=0,o|=0;var l,u,c,s,b,d,g,w,k,B,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,G=0,U=0,z=0,x=0,V=0;if(B=T,T=T+64|0,k=B+24|0,u=B,(0|(m=0|n[(A|=0)>>2]))<=0)return T=B,0;for(c=A+4|0,s=8+(g=B+48|0)|0,b=8+(w=B+32|0)|0,d=8+(l=B+8|0)|0,h=0,F=0;;){n[g>>2]=n[(p=(v=0|n[c>>2])+(F<<4)|0)>>2],n[g+4>>2]=n[p+4>>2],n[g+8>>2]=n[p+8>>2],n[g+12>>2]=n[p+12>>2],(0|F)==(m+-1|0)?(n[w>>2]=n[v>>2],n[w+4>>2]=n[v+4>>2],n[w+8>>2]=n[v+8>>2],n[w+12>>2]=n[v+12>>2]):(n[w>>2]=n[(p=v+(F+1<<4)|0)>>2],n[w+4>>2]=n[p+4>>2],n[w+8>>2]=n[p+8>>2],n[w+12>>2]=n[p+12>>2]),m=0|iA(g,w,i,k);A:do{if(m)v=0,h=m;else if(v=0|n[(m=k)>>2],(0|(m=0|n[m+4>>2]))>0|0==(0|m)&v>>>0>0){I=0,p=0;e:for(;;){if(z=1/(+(v>>>0)+4294967296*+(0|m)),V=+a[g>>3],x=+((m=0|Te(0|v,0|m,0|I,0|p))>>>0)+4294967296*+(0|C()),a[l>>3]=z*(V*x)+z*(+a[w>>3]*(U=+(I>>>0)+4294967296*+(0|p))),a[d>>3]=z*(+a[s>>3]*x)+z*(+a[b>>3]*U),0|(m=0|GA(l,i,u))){h=m;break}D=0|xe(0|(M=0|n[(P=u)>>2]),0|(P=0|n[P+4>>2]),0|e,0|r),Q=0|C(),v=0|n[(E=m=o+(D<<3)|0)>>2],E=0|n[E+4>>2];r:do{if(0==(0|v)&0==(0|E))L=m,G=16;else for(_=0,y=0;;){if((0|_)>(0|r)|(0|_)==(0|r)&y>>>0>e>>>0){h=1;break e}if((0|v)==(0|M)&(0|E)==(0|P))break r;if(D=0|ze(0|(m=0|pe(0|D,0|Q,1,0)),0|C(),0|e,0|r),Q=0|C(),y=0|pe(0|y,0|_,1,0),_=0|C(),0==(0|(v=0|n[(E=m=o+(D<<3)|0)>>2]))&0==(0|(E=0|n[E+4>>2]))){L=m,G=16;break}}}while(0);if(16!=(0|G)||(G=0,0==(0|M)&0==(0|P))||(n[(y=L)>>2]=M,n[y+4>>2]=P,n[(y=f+(n[t>>2]<<3)|0)>>2]=M,n[y+4>>2]=P,y=0|pe(0|n[(y=t)>>2],0|n[y+4>>2],1,0),M=0|C(),n[(P=t)>>2]=y,n[P+4>>2]=M),I=0|pe(0|I,0|p,1,0),p=0|C(),v=0|n[(m=k)>>2],!((0|(m=0|n[m+4>>2]))>(0|p)|(0|m)==(0|p)&v>>>0>I>>>0)){v=1;break A}}v=0}else v=1}while(0);if(F=F+1|0,!v){G=21;break}if((0|F)>=(0|(m=0|n[A>>2]))){h=0,G=21;break}}return 21==(0|G)?(T=B,0|h):0}function R(A,e){e|=0;var r,i=0,t=0,f=0,o=0,l=0,u=0,b=0,d=0,g=0;if((0|(o=0|n[(A|=0)>>2]))<=0)return t=(f=0)+(t=12.566370614359172-(t=0)),a[e>>3]=f=(o=f<0)?t:f,0;if(f=.5*+a[(r=0|n[A+4>>2])+((A=1!=(0|o)&1)<<4)>>3]+.7853981633974483,i=+s(+(l=.5*+a[r>>3]+.7853981633974483))*+s(+f),i=(t=0+(i=-2*+k(+ +s(+(t=+a[r+(A<<4)+8>>3]-+a[r+8>>3]))*i,+(+c(+l)*+c(+f)+ +c(+t)*i))))-i,1==(0|o))return f=(l=t)+(f=12.566370614359172-(f=i)),a[e>>3]=l=(o=l<0)?f:l,0;for(A=1,f=t;d=A,u=.5*+a[r+((g=(0|(A=A+1|0))%(0|o)|0)<<4)>>3]+.7853981633974483,t=+s(+(b=.5*+a[r+(d<<4)>>3]+.7853981633974483))*+s(+u),i=(t=f+(i=-2*+k(+ +s(+(l=+a[r+(g<<4)+8>>3]-+a[r+(d<<4)+8>>3]))*t,+(+c(+b)*+c(+u)+ +c(+l)*t))-i))-f-i,!((0|A)>=(0|o));)f=t;return b=t+(b=12.566370614359172-i),a[e>>3]=b=(g=t<0)?b:t,0}function Y(A){return(A|=0)>>>0>121?0|(A=0):0|(A=0|n[7696+(28*A|0)+16>>2])}function j(A){return 4==(0|(A|=0))|117==(0|A)|0}function O(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)>>2]}function N(A){return 0|n[11120+(216*(0|n[(A|=0)>>2])|0)+(72*(0|n[A+4>>2])|0)+(24*(0|n[A+8>>2])|0)+(n[A+12>>2]<<3)+4>>2]}function W(A,e){return(0|n[7696+(28*(A|=0)|0)+20>>2])==(0|(e|=0))?0|(e=1):0|(e=(0|n[7696+(28*A|0)+24>>2])==(0|e))}function Z(A,e){return 0|n[848+(28*(A|=0)|0)+((e|=0)<<2)>>2]}function J(A,e){return(0|n[848+(28*(A|=0)|0)>>2])==(0|(e|=0))?0|(e=0):(0|n[848+(28*A|0)+4>>2])==(0|e)?0|(e=1):(0|n[848+(28*A|0)+8>>2])==(0|e)?0|(e=2):(0|n[848+(28*A|0)+12>>2])==(0|e)?0|(e=3):(0|n[848+(28*A|0)+16>>2])==(0|e)?0|(e=4):(0|n[848+(28*A|0)+20>>2])==(0|e)?0|(e=5):0|((0|n[848+(28*A|0)+24>>2])==(0|e)?6:7)}function K(A){var e,r,i;return e=(i=+a[16+(A|=0)>>3])-(r=+a[A+24>>3]),+(i<r?e+6.283185307179586:e)}function X(A){return+(+a[(A|=0)>>3]-+a[A+8>>3])}function q(A,e){var r,i,n=0;return(n=+a[(e|=0)>>3])>=+a[8+(A|=0)>>3]&&n<=+a[A>>3]?(e=(i=+a[e+8>>3])>=(n=+a[A+24>>3]),A=i<=(r=+a[A+16>>3])&1,r<n?e&&(A=1):e||(A=0),0|(e=0!=(0|A))):0|(e=0)}function $(A,e){var r,i,n,t,f,o=0,l=0,u=0,c=0;return+a[(A|=0)>>3]<+a[8+(e|=0)>>3]?0|(o=0):+a[A+8>>3]>+a[e>>3]?0|(o=0):(u=(f=+a[(o=e+16|0)>>3])<(t=+a[(i=e+24|0)>>3]),e=(c=+a[(r=A+24|0)>>3])-f<t-(l=+a[A+16>>3]),A=(n=l<c)?u|e?1:2:0,e=u?n?1:e?2:1:0,(l=+OA(l,A))<+OA(+a[i>>3],e)?0|(u=0):(c=+OA(+a[r>>3],A))>+OA(+a[o>>3],e)?0|(u=0):0|(u=1))}function AA(A,e){var r,i,n,t,f,o=0,l=0,u=0,c=0;return+a[(A|=0)>>3]<+a[(e|=0)>>3]?0|(o=0):+a[A+8>>3]>+a[e+8>>3]?0|(o=0):(u=(c=+a[(r=e+16|0)>>3])<(f=+a[(i=e+24|0)>>3]),e=(l=+a[A+24>>3])-c<f-(t=+a[(o=A+16|0)>>3]),A=(n=t<l)?u|e?1:2:0,e=u?n?1:e?2:1:0,(l=+OA(l,A))<=+OA(+a[i>>3],e)?0|(u=(c=+OA(+a[o>>3],A))>=+OA(+a[r>>3],e)):0|(u=0))}function eA(A,e){A|=0,e|=0;var r,i,t,f,o,l=0;t=T,T=T+176|0,n[(i=t)>>2]=4,a[i+8>>3]=l=+a[e>>3],a[i+16>>3]=f=+a[e+16>>3],a[i+24>>3]=l,a[i+32>>3]=l=+a[e+24>>3],a[i+40>>3]=o=+a[e+8>>3],a[i+48>>3]=l,a[i+56>>3]=o,a[i+64>>3]=f,r=96+(e=i+72|0)|0;do{n[e>>2]=0,e=e+4|0}while((0|e)<(0|r));Ne(0|A,0|i,168),T=t}function rA(A,e,r){A|=0,e|=0,r|=0;var i,f,u,c,s,b,d,g=0,w=0,k=0,h=0,v=0,Q=0,E=0;b=T,T=T+288|0,s=b+264|0,h=b+96|0,w=(g=k=b)+96|0;do{n[g>>2]=0,g=g+4|0}while((0|g)<(0|w));return 0|(e=0|SA(e,k))?(T=b,0|(Q=e)):(xA(k=0|n[(w=k)>>2],w=0|n[w+4>>2],s),VA(k,w,h),c=+NA(s,h+8|0),a[s>>3]=+a[A>>3],a[(w=s+8|0)>>3]=+a[A+16>>3],a[h>>3]=+a[A+8>>3],a[(k=h+8|0)>>3]=+a[A+24>>3],f=+NA(s,h),u=+l(+(E=+a[w>>3]-+a[k>>3])),i=+l(+(d=+a[s>>3]-+a[h>>3])),0==E|0==d||(E=+Ye(+u,+i),E=+B(+f*f/+je(+E/+je(+u,+i),3)/(c*(2.59807621135*c)*.8)),a[t>>3]=E,v=~~E>>>0,Q=+l(E)>=1?E>0?~~+m(+o(E/4294967296),4294967295)>>>0:~~+B((E-+(~~E>>>0))/4294967296)>>>0:0,2146435072==(2146435072&n[t+4>>2]|0))?e=1:(n[(e=r)>>2]=(h=0==(0|v)&0==(0|Q))?1:v,n[e+4>>2]=h?0:Q,e=0),T=b,0|(Q=e))}function iA(A,e,r,i){A|=0,e|=0,r|=0,i|=0;var f,u,c,s,b=0,d=0,g=0;s=T,T=T+288|0,u=s+264|0,c=s+96|0,f=(b=d=s)+96|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|f));return 0|(r=0|SA(r,d))?(T=s,0|(i=r)):(xA(b=0|n[(r=d)>>2],r=0|n[r+4>>2],u),VA(b,r,c),g=+NA(u,c+8|0),g=+B(+ +NA(A,e)/(2*g)),a[t>>3]=g,r=~~g>>>0,b=+l(g)>=1?g>0?~~+m(+o(g/4294967296),4294967295)>>>0:~~+B((g-+(~~g>>>0))/4294967296)>>>0:0,2146435072==(2146435072&n[t+4>>2]|0)?(T=s,0|(i=1)):(n[i>>2]=(d=0==(0|r)&0==(0|b))?1:r,n[i+4>>2]=d?0:b,T=s,0|(i=0)))}function nA(A,e,r,t){A|=0,t|=0;var f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,G=0;if(f=T,T=T+224|0,p=f,y=f+48|0,(s=(0|(r|=0))>0|0==(0|r)&(e|=0)>>>0>0)&(r>>>0>0|0==(0|r)&e>>>0>17895697))return T=f,14;if((0|r)<0)return T=f,2;if(0==(0|e)&0==(0|r))return n[t>>2]=0,n[t+4>>2]=0,T=f,0;for(o=0|hA(0|n[(o=A)>>2],0|n[o+4>>2]),u=0,c=0;;){if(!(0|vA(0|n[(G=l=A+(u<<3)|0)>>2],0|n[G+4>>2]))){o=5,F=159;break}if(G=(0|hA(0|n[(G=l)>>2],0|n[G+4>>2]))==(0|o),u=0|pe(0|u,0|c,1,0),c=0|C(),!G){o=12,F=159;break}if(!((0|c)<(0|r)|(0|c)==(0|r)&u>>>0<e>>>0)){F=8;break}}if(8==(0|F)){do{if((0|r)>0|0==(0|r)&e>>>0>1){if(!(u=0|_e(o=e<<3)))return T=f,13;for(Ne(0|u,0|A,0|o),ke(u,e,8,1),o=1,l=0;G=(0|n[(L=u+(o<<3)|0)>>2])==(0|n[(G=u+(o+-1<<3)|0)>>2])?(0|n[L+4>>2])==(0|n[G+4>>2]):0,o=0|pe(0|o,0|l,1,0),l=0|C(),!G;)if(!((0|l)<(0|r)|(0|l)==(0|r)&o>>>0<e>>>0)){F=14;break}if(14==(0|F)){ye(u);break}return ye(u),T=f,10}}while(0);if(o=0|Ue(0|e,0|r,6,0),l=0|C(),s){u=0,c=0;do{o=0|pe(0|o,0|l,0|(G=(0!=(0|CA(0|n[(G=A+(c<<3)|0)>>2],0|n[G+4>>2])))<<31>>31),((0|G)<0)<<31>>31|0),l=0|C(),c=0|pe(0|c,0|u,1,0),u=0|C()}while((0|u)<(0|r)|(0|u)==(0|r)&c>>>0<e>>>0);D=o,E=l}else D=o,E=l;if(v=0|Ue(0|D,0|E,10,0),Q=0|C(),!(L=0|_e(D<<5)))return T=f,13;if(!(G=0|Me(v,4)))return ye(L),T=f,13;A:do{if(s){for(fA(0|n[(I=A)>>2],0|n[I+4>>2],p),k=L,B=0,h=0,o=0,m=0;;){l=(s=0==(0|n[(s=p)>>2])&0==(0|n[s+4>>2]))?26990:26995,u=s?5:6,s=p+((1&s)<<3)|0,b=0|pe(0|u,0|(c=0),-1,-1),d=0|C(),g=0,w=0;do{M=0|n[4+(P=s+(g<<3)|0)>>2],n[(I=k+(g<<5)|0)>>2]=n[P>>2],n[I+4>>2]=M,i[k+(g<<5)+9>>0]=0,i[k+(g<<5)+8>>0]=0,n[k+(g<<5)+20>>2]=k,n[(I=k+(g<<5)+24|0)>>2]=1,n[I+4>>2]=0,I=0|i[l+g>>0],M=0|xe(0|(M=0|pe(0|b,0|d,0|g,0|w)),0|C(),0|u,0|c),C(),M=0|i[l+M>>0],g=0|pe(0|g,0|w,1,0),w=0|C(),P=0|i[l+((0|g)==(0|u)&(0|w)==(0|c)?0:g)>>0],n[k+((I&=255)<<5)+16>>2]=k+((255&M)<<5),n[k+(I<<5)+12>>2]=k+((255&P)<<5)}while(w>>>0<c>>>0|(0|w)==(0|c)&g>>>0<u>>>0);if(B=0|pe(0|B,0|h,1,0),h=0|C(),o=0|pe(0|u,0|c,0|o,0|m),m=0|C(),!((0|h)<(0|r)|(0|h)==(0|r)&B>>>0<e>>>0))break A;0|fA(0|n[(I=A+(B<<3)|0)>>2],0|n[I+4>>2],p)||(k=L+(o<<5)|0)}_(27634,26956,108,26975)}}while(0);if((0|E)>0|0==(0|E)&D>>>0>0){c=0,s=0;do{if(o=0|Se(0|(u=0|n[(l=L+(c<<5)|0)>>2]),0|(l=0|n[l+4>>2]),30),o=0|Se(0|(l=0|Ue(o^u|0,(0|C())^l|0,484763065,-1084733587)),0|(u=0|C()),27),l=0|xe((o=0|Se(0|(u=0|Ue(o^l|0,(0|C())^u|0,321982955,-1798288965)),0|(l=0|C()),31))^u|0,(0|C())^l|0,0|v,0|Q),u=0|C(),0|n[(o=G+(l<<2)|0)>>2])do{l=0|ze(0|(o=0|pe(0|l,0|u,1,0)),0|C(),0|v,0|Q),u=0|C(),o=G+(l<<2)|0}while(0!=(0|n[o>>2]));n[o>>2]=L+(c<<5),c=0|pe(0|c,0|s,1,0),s=0|C()}while((0|s)<(0|E)|(0|s)==(0|E)&c>>>0<D>>>0);g=0,w=0;do{if(c=L+(g<<5)|0,!(0|i[(s=L+(g<<5)+9|0)>>0])){if(0|lA(0|n[(I=c)>>2],0|n[I+4>>2],p)){F=39;break}l=0|Se(0|(b=0|n[(d=p)>>2]),0|(d=0|n[d+4>>2]),30),o=0|Se(0|(l=0|Ue(l^b|0,(0|C())^d|0,484763065,-1084733587)),0|(u=0|C()),27),l=0|xe((o=0|Se(0|(u=0|Ue(o^l|0,(0|C())^u|0,321982955,-1798288965)),0|(l=0|C()),31))^u|0,(0|C())^l|0,0|v,0|Q),u=0|C(),o=0|n[G+(l<<2)>>2];A:do{if(0|o){for(;(0|n[(I=o)>>2])!=(0|b)||(0|n[I+4>>2])!=(0|d);)if(l=0|ze(0|(o=0|pe(0|l,0|u,1,0)),0|C(),0|v,0|Q),u=0|C(),!(o=0|n[G+(l<<2)>>2]))break A;i[s>>0]=1,i[o+9>>0]=1,n[16+(0|n[(I=L+(g<<5)+12|0)>>2])>>2]=n[(l=o+16|0)>>2],n[12+(P=0|n[L+(g<<5)+16>>2])>>2]=n[(r=o+12|0)>>2],n[16+(0|n[r>>2])>>2]=P,n[12+(0|n[l>>2])>>2]=n[I>>2],l=0|aA(c),I=0|aA(o),o=(P=(0|(r=0|n[4+(o=l+24|0)>>2]))<(0|(M=0|n[4+(P=I+24|0)>>2]))|((0|r)==(0|M)?(0|n[o>>2])>>>0<(0|n[P>>2])>>>0:0))?l:I,(0|(l=P?I:l))!=(0|o)&&(M=0|pe(0|n[(P=I=l+24|0)>>2],0|n[P+4>>2],0|n[(M=o+24|0)>>2],0|n[M+4>>2]),P=0|C(),n[I>>2]=M,n[I+4>>2]=P,n[o+20>>2]=l)}}while(0)}g=0|pe(0|g,0|w,1,0),w=0|C()}while((0|w)<(0|E)|(0|w)==(0|E)&g>>>0<D>>>0);39==(0|F)&&_(27634,26956,258,27001),o=0,l=0;do{i[L+(o<<5)+8>>0]=0,o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|E)|(0|l)==(0|E)&o>>>0<D>>>0);for(b=0,u=0,s=0,d=0;;){if(o=L+(b<<5)|0,0==(0|i[L+(b<<5)+8>>0])&&0==(0|i[L+(b<<5)+9>>0])){l=0|n[(c=o)>>2],c=0|n[c+4>>2];do{i[o+8>>0]=1,I=o=0|n[o+12>>2]}while((0|n[I>>2])!=(0|l)||(0|n[I+4>>2])!=(0|c));u=0|pe(0|u,0|s,1,0),c=0|C()}else c=s;if(b=0|pe(0|b,0|d,1,0),!((0|(d=0|C()))<(0|E)|(0|d)==(0|E)&b>>>0<D>>>0))break;s=c}o=0,l=0;do{i[L+(o<<5)+8>>0]=0,o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|E)|(0|l)==(0|E)&o>>>0<D>>>0);P=u,M=c,o=1}else P=0,M=0,o=0;I=0|_e(24*P|0);A:do{if(0|I){e:do{if(o){A=0,v=0,r=0,e=0;r:for(;;){if(o=L+(A<<5)|0,0==(0|i[L+(A<<5)+8>>0])&&0==(0|i[L+(A<<5)+9>>0])){h=0|n[(m=o)>>2],m=0|n[m+4>>2],l=0,u=0;do{l=0|pe(0|l,0|u,2,0),u=0|C(),Q=o=0|n[o+12>>2]}while((0|n[Q>>2])!=(0|h)||(0|n[Q+4>>2])!=(0|m));if(!(B=0|_e(l<<4)))break;l=h,u=m,k=0,w=0,c=0,s=0;do{if(0|oA(l,u,y)){F=69;break r}if(g=((0|(d=(Q=0|n[y>>2])-1|0))<0)<<31>>31,(0|Q)>1){u=c,b=0,l=s,c=0;do{n[(Q=B+(u<<4)|0)>>2]=n[(s=y+8+(b<<4)|0)>>2],n[Q+4>>2]=n[s+4>>2],n[Q+8>>2]=n[s+8>>2],n[Q+12>>2]=n[s+12>>2],u=0|pe(0|u,0|l,1,0),l=0|C(),b=0|pe(0|b,0|c,1,0),c=0|C()}while((0|c)<(0|g)|(0|c)==(0|g)&b>>>0<d>>>0);c=u,s=l}k=0|pe(0|k,0|w,0|d,0|g),w=0|C(),i[o+8>>0]=1,l=0|n[(u=o=0|n[o+12>>2])>>2],u=0|n[u+4>>2]}while(!((0|l)==(0|h)&(0|u)==(0|m)));if(!(l=0|Pe(B,k<<4))){F=75;break}m=0|aA(o),Q=0|n[m+4>>2],n[(o=I+(24*r|0)|0)>>2]=n[m>>2],n[o+4>>2]=Q,n[(o=I+(24*r|0)+16|0)>>2]=k,n[I+(24*r|0)+20>>2]=l,n[p>>2]=n[o>>2],n[p+4>>2]=n[o+4>>2],R(p,I+(24*r|0)+8|0),l=0|pe(0|r,0|v,1,0),o=0|C()}else l=r,o=v;if(A=0|pe(0|A,0|e,1,0),!((0|(e=0|C()))<(0|E)|(0|e)==(0|E)&A>>>0<D>>>0))break e;v=o,r=l}if(69==(0|F)?_(27634,26956,351,27016):75==(0|F)&&ye(B),(0|v)>0|0==(0|v)&r>>>0>0)for(c=0,s=0,o=r,u=v;(l=0|n[I+(24*c|0)+20>>2])?(ye(l),l=v,o=r):l=u,c=0|pe(0|c,0|s,1,0),(0|(s=0|C()))<(0|l)|(0|s)==(0|l)&c>>>0<o>>>0;)u=l;ye(I);break A}}while(0);ke(I,P,24,2);e:do{if(0==(0|P)&0==(0|M)){if(0|(Q=0|_e(192))){if(n[Q+16>>2]=0,n[Q+20>>2]=0,n[(w=Q+8|0)>>2]=3,o=0|_e(48),n[(k=Q+12|0)>>2]=o,0|o){n[o>>2]=n[3860],n[o+4>>2]=n[3861],n[o+8>>2]=n[3862],n[o+12>>2]=n[3863],n[(g=o+16|0)>>2]=n[3864],n[g+4>>2]=n[3865],n[g+8>>2]=n[3866],n[g+12>>2]=n[3867],n[(g=o+32|0)>>2]=n[3868],n[g+4>>2]=n[3869],n[g+8>>2]=n[3870],n[g+12>>2]=n[3871],n[p>>2]=n[w>>2],n[p+4>>2]=n[w+4>>2],R(p,Q),n[Q+40>>2]=0,n[Q+44>>2]=0,n[(g=Q+32|0)>>2]=3,o=0|_e(48),n[(B=Q+36|0)>>2]=o;do{if(o){if(n[o>>2]=n[3872],n[o+4>>2]=n[3873],n[o+8>>2]=n[3874],n[o+12>>2]=n[3875],n[(d=o+16|0)>>2]=n[3876],n[d+4>>2]=n[3877],n[d+8>>2]=n[3878],n[d+12>>2]=n[3879],n[(d=o+32|0)>>2]=n[3880],n[d+4>>2]=n[3881],n[d+8>>2]=n[3882],n[d+12>>2]=n[3883],n[p>>2]=n[g>>2],n[p+4>>2]=n[g+4>>2],R(p,Q+24|0),n[Q+64>>2]=0,n[Q+68>>2]=0,n[(d=Q+56|0)>>2]=3,o=0|_e(48),n[(h=Q+60|0)>>2]=o,!o){c=0,s=2;break}if(n[o>>2]=n[3884],n[o+4>>2]=n[3885],n[o+8>>2]=n[3886],n[o+12>>2]=n[3887],n[(b=o+16|0)>>2]=n[3888],n[b+4>>2]=n[3889],n[b+8>>2]=n[3890],n[b+12>>2]=n[3891],n[(b=o+32|0)>>2]=n[3892],n[b+4>>2]=n[3893],n[b+8>>2]=n[3894],n[b+12>>2]=n[3895],n[p>>2]=n[d>>2],n[p+4>>2]=n[d+4>>2],R(p,Q+48|0),n[Q+88>>2]=0,n[Q+92>>2]=0,n[(b=Q+80|0)>>2]=3,o=0|_e(48),n[(m=Q+84|0)>>2]=o,!o){c=0,s=3;break}if(n[o>>2]=n[3896],n[o+4>>2]=n[3897],n[o+8>>2]=n[3898],n[o+12>>2]=n[3899],n[(s=o+16|0)>>2]=n[3900],n[s+4>>2]=n[3901],n[s+8>>2]=n[3902],n[s+12>>2]=n[3903],n[(s=o+32|0)>>2]=n[3904],n[s+4>>2]=n[3905],n[s+8>>2]=n[3906],n[s+12>>2]=n[3907],n[p>>2]=n[b>>2],n[p+4>>2]=n[b+4>>2],R(p,Q+72|0),n[Q+112>>2]=0,n[Q+116>>2]=0,n[(s=Q+104|0)>>2]=3,o=0|_e(48),n[(A=Q+108|0)>>2]=o,!o){c=0,s=4;break}if(n[o>>2]=n[3908],n[o+4>>2]=n[3909],n[o+8>>2]=n[3910],n[o+12>>2]=n[3911],n[(c=o+16|0)>>2]=n[3912],n[c+4>>2]=n[3913],n[c+8>>2]=n[3914],n[c+12>>2]=n[3915],n[(c=o+32|0)>>2]=n[3916],n[c+4>>2]=n[3917],n[c+8>>2]=n[3918],n[c+12>>2]=n[3919],n[p>>2]=n[s>>2],n[p+4>>2]=n[s+4>>2],R(p,Q+96|0),n[Q+136>>2]=0,n[Q+140>>2]=0,n[(c=Q+128|0)>>2]=3,o=0|_e(48),n[(e=Q+132|0)>>2]=o,!o){c=0,s=5;break}if(n[o>>2]=n[3920],n[o+4>>2]=n[3921],n[o+8>>2]=n[3922],n[o+12>>2]=n[3923],n[(u=o+16|0)>>2]=n[3924],n[u+4>>2]=n[3925],n[u+8>>2]=n[3926],n[u+12>>2]=n[3927],n[(u=o+32|0)>>2]=n[3928],n[u+4>>2]=n[3929],n[u+8>>2]=n[3930],n[u+12>>2]=n[3931],n[p>>2]=n[c>>2],n[p+4>>2]=n[c+4>>2],R(p,Q+120|0),n[Q+160>>2]=0,n[Q+164>>2]=0,n[(u=Q+152|0)>>2]=3,o=0|_e(48),n[(r=Q+156|0)>>2]=o,!o){c=0,s=6;break}if(n[o>>2]=n[3932],n[o+4>>2]=n[3933],n[o+8>>2]=n[3934],n[o+12>>2]=n[3935],n[(l=o+16|0)>>2]=n[3936],n[l+4>>2]=n[3937],n[l+8>>2]=n[3938],n[l+12>>2]=n[3939],n[(l=o+32|0)>>2]=n[3940],n[l+4>>2]=n[3941],n[l+8>>2]=n[3942],n[l+12>>2]=n[3943],n[p>>2]=n[u>>2],n[p+4>>2]=n[u+4>>2],R(p,Q+144|0),n[Q+184>>2]=0,n[Q+188>>2]=0,n[(l=Q+176|0)>>2]=3,o=0|_e(48),n[(v=Q+180|0)>>2]=o,!o){c=0,s=7;break}if(n[o>>2]=n[3944],n[o+4>>2]=n[3945],n[o+8>>2]=n[3946],n[o+12>>2]=n[3947],n[(y=o+16|0)>>2]=n[3948],n[y+4>>2]=n[3949],n[y+8>>2]=n[3950],n[y+12>>2]=n[3951],n[(o=o+32|0)>>2]=n[3952],n[o+4>>2]=n[3953],n[o+8>>2]=n[3954],n[o+12>>2]=n[3955],n[p>>2]=n[l>>2],n[p+4>>2]=n[l+4>>2],R(p,Q+168|0),ke(Q,8,24,3),o=0|_e(128),n[t+4>>2]=o,0|o){n[t>>2]=8,n[o>>2]=n[w>>2],n[o+4>>2]=n[w+4>>2],n[o+8>>2]=n[w+8>>2],n[o+12>>2]=n[w+12>>2],n[(F=o+16|0)>>2]=n[g>>2],n[F+4>>2]=n[g+4>>2],n[F+8>>2]=n[g+8>>2],n[F+12>>2]=n[g+12>>2],n[(F=o+32|0)>>2]=n[d>>2],n[F+4>>2]=n[d+4>>2],n[F+8>>2]=n[d+8>>2],n[F+12>>2]=n[d+12>>2],n[(F=o+48|0)>>2]=n[b>>2],n[F+4>>2]=n[b+4>>2],n[F+8>>2]=n[b+8>>2],n[F+12>>2]=n[b+12>>2],n[(F=o+64|0)>>2]=n[s>>2],n[F+4>>2]=n[s+4>>2],n[F+8>>2]=n[s+8>>2],n[F+12>>2]=n[s+12>>2],n[(F=o+80|0)>>2]=n[c>>2],n[F+4>>2]=n[c+4>>2],n[F+8>>2]=n[c+8>>2],n[F+12>>2]=n[c+12>>2],n[(F=o+96|0)>>2]=n[u>>2],n[F+4>>2]=n[u+4>>2],n[F+8>>2]=n[u+8>>2],n[F+12>>2]=n[u+12>>2],n[(F=o+112|0)>>2]=n[l>>2],n[F+4>>2]=n[l+4>>2],n[F+8>>2]=n[l+8>>2],n[F+12>>2]=n[l+12>>2],ye(Q),F=158;break e}0|(o=0|n[k>>2])&&ye(o),0|(o=0|n[B>>2])&&ye(o),0|(o=0|n[h>>2])&&ye(o),0|(o=0|n[m>>2])&&ye(o),0|(o=0|n[A>>2])&&ye(o),0|(o=0|n[e>>2])&&ye(o),0|(o=0|n[r>>2])&&ye(o),0|(o=0|n[v>>2])&&ye(o),ye(Q);break e}c=0,s=1}while(0);o=0,u=0;do{0|(l=0|n[Q+(24*o|0)+12>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while(u>>>0<c>>>0|(0|u)==(0|c)&o>>>0<s>>>0)}ye(Q),F=152}}else{if((0|M)>0|0==(0|M)&P>>>0>0){u=0,c=0,s=0,l=0,o=0,b=0;do{p=c,F=s,l=0|pe(0|l,0|o,1&((0|(c=0|n[(y=I+(24*u|0)|0)>>2]))!=(0|p)|(0|(s=0|n[y+4>>2]))!=(0|F))|0,0),o=0|C(),u=0|pe(0|u,0|b,1,0),b=0|C()}while((0|b)<(0|M)|(0|b)==(0|M)&u>>>0<P>>>0);m=l,h=o}else m=0,h=0;if(A=0|_e(24*m|0)){r:do{if((0|M)>=0){for(w=0,k=0,l=0,u=0,B=0,c=0;;){if((0|w)==(0|P)&(0|k)==(0|M)||(0|n[(p=I+(24*l|0)|0)>>2])!=(0|n[(F=I+(24*w|0)|0)>>2])||(0|n[p+4>>2])!=(0|n[F+4>>2])){if(d=I+(24*l|0)|0,g=0|pe(0|(F=0|Te(0|w,0|k,0|l,0|u)),0|(p=0|C()),-1,-1),u=0|C(),(0|p)>0|0==(0|p)&F>>>0>1){if(!(o=0|_e(g<<3)))break;s=0,b=0;do{F=s,s=0|pe(0|s,0|b,1,0),b=0|C(),p=0|n[4+(y=d+(24*s|0)+16|0)>>2],n[(F=o+(F<<3)|0)>>2]=n[y>>2],n[F+4>>2]=p}while((0|b)<(0|u)|(0|b)==(0|u)&s>>>0<g>>>0)}else o=0;F=0|n[4+(p=I+(24*l|0)+16|0)>>2],n[(u=A+(24*c|0)+8|0)>>2]=n[p>>2],n[u+4>>2]=F,n[A+(24*c|0)+16>>2]=g,n[A+(24*c|0)+20>>2]=o,a[A+(24*c|0)>>3]=+a[I+(24*l|0)+8>>3],c=0|pe(0|c,0|B,1,0),l=w,u=k,o=0|C()}else o=B;if(F=w,w=0|pe(0|w,0|k,1,0),p=k,k=0|C(),!((0|p)<(0|M)|(0|p)==(0|M)&F>>>0<P>>>0))break r;B=o}if((0|B)>0|0==(0|B)&c>>>0>0){o=0,u=0;do{0|(l=0|n[A+(24*o|0)+20>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while((0|u)<(0|B)|(0|u)==(0|B)&o>>>0<c>>>0)}ye(A),F=152;break e}}while(0);if(ke(A,m,24,3),o=0|_e(m<<4),n[(u=t+4|0)>>2]=o,o){n[t>>2]=m;do{if((0|h)>0|0==(0|h)&m>>>0>0){if(n[o>>2]=n[(t=A+8|0)>>2],n[o+4>>2]=n[t+4>>2],n[o+8>>2]=n[t+8>>2],n[o+12>>2]=n[t+12>>2],1==(0|m)&0==(0|h))break;if(n[(t=o+16|0)>>2]=n[(F=A+32|0)>>2],n[t+4>>2]=n[F+4>>2],n[t+8>>2]=n[F+8>>2],n[t+12>>2]=n[F+12>>2],!((0|h)>0|0==(0|h)&m>>>0>2))break;o=2,l=0;do{n[(t=(0|n[u>>2])+(o<<4)|0)>>2]=n[(F=A+(24*o|0)+8|0)>>2],n[t+4>>2]=n[F+4>>2],n[t+8>>2]=n[F+8>>2],n[t+12>>2]=n[F+12>>2],o=0|pe(0|o,0|l,1,0),l=0|C()}while((0|l)<(0|h)|(0|l)==(0|h)&o>>>0<m>>>0)}}while(0);ye(A),F=158;break}if((0|h)>0|0==(0|h)&m>>>0>0){o=0,u=0;do{0|(l=0|n[A+(24*o|0)+20>>2])&&ye(l),o=0|pe(0|o,0|u,1,0),u=0|C()}while((0|u)<(0|h)|(0|u)==(0|h)&o>>>0<m>>>0)}ye(A),F=152;break}F=152}}while(0);if(158==(0|F))return ye(L),ye(G),ye(I),T=f,0;if(152==(0|F)&&(0|M)>0|0==(0|M)&P>>>0>0)for(c=0,s=0,o=P,u=M;(l=0|n[I+(24*c|0)+20>>2])?(ye(l),l=M,o=P):l=u,c=0|pe(0|c,0|s,1,0),(0|(s=0|C()))<(0|l)|(0|s)==(0|l)&c>>>0<o>>>0;)u=l;return ye(I),ye(L),ye(G),T=f,13}}while(0);return ye(L),ye(G),T=f,13}return 159==(0|F)?(T=f,0|o):0}function aA(A){var e,r=0;return(0|(r=0|n[(e=20+(A|=0)|0)>>2]))==(0|A)?0|A:(r=0|aA(r),n[e>>2]=r,0|r)}function tA(A,e){var r=0;switch(r=0|Se(0|(A|=0),0|(e|=0),56),C(),7&r){case 0:case 7:return 0}return r=-2130706433&e|134217728,!0&268435456==(2013265920&e|0)?!0&16777216==(117440512&e|0)&0!=(0|CA(A,r))?0|(r=0):0|(r=0|vA(A,r)):0|(r=0)}function fA(A,e,r){r|=0;var i,a=0;return i=0==(0|CA(A|=0,e|=0)),e&=-2130706433,n[(a=r)>>2]=i?A:0,n[a+4>>2]=i?285212672|e:0,n[(a=r+8|0)>>2]=A,n[a+4>>2]=301989888|e,n[(a=r+16|0)>>2]=A,n[a+4>>2]=318767104|e,n[(a=r+24|0)>>2]=A,n[a+4>>2]=335544320|e,n[(a=r+32|0)>>2]=A,n[a+4>>2]=352321536|e,n[(r=r+40|0)>>2]=A,n[r+4>>2]=369098752|e,0}function oA(A,e,r){r|=0;var i,a,t=0,f=0;return a=T,T=T+16|0,i=a,f=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e|0)?(t=0|Se(0|(A|=0),0|e,56),C(),-1==(0|(t=0|function(A,e,r){r|=0;var i,a,t=0;if(i=T,T=T+16|0,a=i,t=0|CA(A|=0,e|=0),(r+-1|0)>>>0>5)return T=i,-1;if(1==(0|r)&(t=0!=(0|t)))return T=i,-1;do{if(!(0|de(A,e,a))){if(t){t=(5+(0|n[26416+(r<<2)>>2])-(0|n[a>>2])|0)%5|0;break}t=(6+(0|n[26448+(r<<2)>>2])-(0|n[a>>2])|0)%6|0;break}t=-1}while(0);return T=i,0|t}(A,f,7&t)))?(n[r>>2]=0,T=a,0|(f=6)):(0|zA(A,f,i)&&_(27634,27035,282,27050),e=0|Se(0|A,0|e,52),C(),e&=15,0|CA(A,f)?bA(i,e,t,2,r):kA(i,e,t,2,r),T=a,0|(f=0))):(T=a,0|(f=6))}function lA(A,e,r){A|=0,r|=0;var i,a=0,t=0,f=0;return i=T,T=T+16|0,t=i,f=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e|0)?(n[(a=i+8|0)>>2]=0,e=0|Se(0|A,0|e,56),C(),0|(e=0|z(A,f,7&e,a,t))?(T=i,0|(r=e)):7==(0|(e=0|S(a=0|n[t>>2],t=0|n[t+4>>2],A,f)))?(T=i,0|(r=11)):(A=0|He(0|e,0,56),f=-2130706433&t|0|C()|268435456,n[r>>2]=a|A,n[r+4>>2]=f,T=i,0|(r=0))):(T=i,0|(r=6))}function uA(A,e,r){A|=0,e|=0;var i,t,f=0,o=0,g=0,w=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0;n[(r|=0)>>2]=0,m=+a[A>>3],v=+a[A+8>>3],h=+a[A+16>>3],o=0,g=5,f=5,A=0;do{(w=(D=+a[15888+(24*o|0)>>3]-m)*D+(E=+a[15888+(24*o|0)+8>>3]-v)*E+(w=+a[15888+(24*o|0)+16>>3]-h)*w)<f&&(n[r>>2]=o,g=w,A=o,f=w),o=o+1|0}while(20!=(0|o));if((g=+d(+(1-.5*g)))<1e-16)h=0,w=0;else{if(I=+a[16368+(24*A|0)>>3],w=(M=+a[15888+(24*A|0)>>3])*(p=-((y=+a[15888+(24*A|0)+16>>3])+(0*M+0*(P=+a[15888+(24*A|0)+8>>3]))))+0,D=P*p+0,w*=_=(_=+u(+((p=y*p+1)*p+(w*w+D*D))))>0?1/_:0,D*=_,_*=p,E=m+M*(p=-(m*M+v*P+h*y)),E*=v=(v=+u(+((m=h+y*p)*m+(E*E+(f=v+P*p)*f))))>0?1/v:0,f*=v,f=+jA(I-+jA(+k(+((v*=m)*(P*w-M*D)+(E*(y*D-P*_)+f*(M*_-y*w))),+(_*v+(w*E+D*f))))),w=0|LA(e)?+jA(f+-.3334731722518321):f,f=2.618033988749896*+b(+g),(0|e)>0){A=0;do{f*=2.6457513110645907,A=A+1|0}while((0|A)!=(0|e))}h=+c(+w)*f,w=+s(+w)*f}e=r+4|0,n[(t=r+12|0)>>2]=0,g=1.1547005383792515*+l(+w),f=+l(+h)+.5*g,f-=+(0|(A=~~f)),g-=+(0|(o=~~g));do{if(f<.5){if(f<.3333333333333333){if(n[e>>2]=A,g<.5*(f+1)){n[r+8>>2]=o;break}n[r+8>>2]=o=o+1|0;break}if(n[r+8>>2]=o=(1&!(g<(p=1-f)))+o|0,p<=g&g<2*f){n[e>>2]=A=A+1|0;break}n[e>>2]=A;break}if(!(f<.6666666666666666)){if(n[e>>2]=A=A+1|0,g<.5*f){n[r+8>>2]=o;break}n[r+8>>2]=o=o+1|0;break}if(g<1-f){if(n[r+8>>2]=o,2*f-1<g){n[e>>2]=A;break}}else n[r+8>>2]=o=o+1|0;n[e>>2]=A=A+1|0}while(0);do{if(h<0){if(1&o){A=~~(+(0|A)-(2*(+((Q=0|Te(0|A,((0|A)<0)<<31>>31|0,0|(Q=(o+1|0)/2|0),((0|Q)<0)<<31>>31|0))>>>0)+4294967296*+(0|C()))+1)),n[e>>2]=A,Q=e;break}A=~~(+(0|A)-2*(+((Q=0|Te(0|A,((0|A)<0)<<31>>31|0,0|(Q=(0|o)/2|0),((0|Q)<0)<<31>>31|0))>>>0)+4294967296*+(0|C()))),n[e>>2]=A,Q=e;break}Q=e}while(0);i=r+8|0,e=0-o|0,w<0?(n[Q>>2]=r=A-((1|o<<1)/2|0)|0,n[i>>2]=e,o=e):r=A,A=o-r|0,e=0-r|0,(0|r)<0?(n[i>>2]=A,n[t>>2]=e,n[Q>>2]=0,B=0):(A=o,B=r,e=0),r=B-A|0,o=e-A|0,(0|A)<0?(n[Q>>2]=r,n[t>>2]=o,n[i>>2]=0,B=r,A=0):o=e,r=B-o|0,e=A-o|0,(0|o)<0?(n[Q>>2]=r,n[i>>2]=e,n[t>>2]=0,o=0):(e=A,r=B),(0|(A=(0|o)<(0|(A=(0|e)<(0|r)?e:r))?o:A))<=0||(n[Q>>2]=r-A,n[i>>2]=e-A,n[t>>2]=o-A)}function cA(A,e,r){var i,t,f,o;e|=0,r|=0,i=T,T=T+16|0,a[(t=i)>>3]=+((0|n[4+(A|=0)>>2])-(o=0|n[A+12>>2])|0)-.5*(f=+((0|n[A+8>>2])-o|0)),a[t+8>>3]=.8660254037844386*f,sA(t,0|n[A>>2],e,0,r),T=i}function sA(A,e,r,i,t){e|=0,r|=0,i|=0,t|=0;var f,o,l,b,d,g=0,B=0,h=0,m=0,v=0,Q=0,E=0;if((g=+function(A){var e,r;return+ +u(+((r=+a[(A|=0)>>3])*r+(e=+a[A+8>>3])*e))}(A|=0))<1e-16)return n[t>>2]=n[(e=15888+(24*e|0)|0)>>2],n[t+4>>2]=n[e+4>>2],n[t+8>>2]=n[e+8>>2],n[t+12>>2]=n[e+12>>2],n[t+16>>2]=n[e+16>>2],void(n[t+20>>2]=n[e+20>>2]);if(B=+k(+ +a[A+8>>3],+ +a[A>>3]),(0|r)>0){A=0;do{g*=.37796447300922725,A=A+1|0}while((0|A)!=(0|r))}h=.3333333333333333*g,i?(r=0==(0|LA(r)),g=+w(.381966011250105*(r?h:.37796447300922725*h))):(g=+w(.381966011250105*g),0|LA(r)&&(B=+jA(B+.3334731722518321))),v=+jA(+a[16368+(24*e|0)>>3]-B),m=(h=+a[15888+(24*e|0)>>3])*(E=-((b=+a[15888+(24*e|0)+16>>3])+(0*h+0*(o=+a[15888+(24*e|0)+8>>3]))))+0,B=o*E+0,m*=Q=(Q=+u(+((E=b*E+1)*E+(m*m+B*B))))>0?1/Q:0,B*=Q,Q*=E,E=+c(+v),v=+s(+v),f=(d=+c(+g))*h+(l=+s(+g))*(E*m+v*(b*B-o*Q)),g=d*o+l*(E*B+v*(h*Q-b*m)),h=+u(+((B=d*b+l*(E*Q+v*(o*m-h*B)))*B+(f*f+g*g))),a[t>>3]=f*(h=h>0?1/h:0),a[t+8>>3]=g*h,a[t+16>>3]=B*h}function bA(A,e,r,i,t){A|=0,r|=0,i|=0,t|=0;var f,o,l,u,c,s,b,d,w,B,m,v,Q,E,D,C,y,M,P,I,p,F,L,G,U,z,x,V=0,S=0,H=0,R=0,Y=0,j=0,O=0,N=0,W=0,Z=0,J=0,K=0,X=0,q=0,$=0;if(x=T,T=T+256|0,W=x+224|0,G=x,U=x+208|0,z=x+192|0,M=x+168|0,P=x+152|0,I=x+136|0,p=x+120|0,F=x+104|0,L=x+80|0,n[(V=x+240|0)>>2]=e|=0,n[W>>2]=n[A>>2],n[W+4>>2]=n[A+4>>2],n[W+8>>2]=n[A+8>>2],n[W+12>>2]=n[A+12>>2],dA(W,V,G),n[t>>2]=0,(0|(W=i+r+(5==(0|i)&1)|0))<=(0|r))T=x;else{b=U+4|0,c=U+8|0,s=U+12|0,w=z+8|0,B=r+5|0,m=16848+((d=0|n[V>>2])<<2)|0,v=M+8|0,Q=16928+(d<<2)|0,E=P+8|0,D=I+8|0,C=p+8|0,y=z+8|0,f=M+8|0,l=M+16|0,o=L+8|0,u=L+16|0,N=r,i=0,S=0,H=0,R=0;A:for(;;){n[U>>2]=n[(O=G+(((0|N)%5|0)<<4)|0)>>2],n[U+4>>2]=n[O+4>>2],n[U+8>>2]=n[O+8>>2],n[U+12>>2]=n[O+12>>2];do{}while(2==(0|gA(U,d,0,1)));if((0|N)>(0|r)&0!=(0|LA(e))){if(O=0|n[U>>2],A=0|n[b>>2],Y=0|n[c>>2],V=0|n[s>>2],a[z>>3]=+(S-R|0)-.5*(Z=+(H-R|0)),a[w>>3]=.8660254037844386*Z,j=0|n[18608+(80*O|0)+(20*(R=0|n[17008+(80*O|0)+(i<<2)>>2])|0)>>2],(0|(H=0|n[18608+(80*O|0)+(20*R|0)+16>>2]))>0){S=0,i=Y;do{i=((K=(0|(Y=i+A-((q=(0|(X=V+A|0))<0)?X:0)|0))<0)?0:Y)-((V=(0|(J=V+i-(q?X:0)-(K?Y:0)|0))<0)?J:0)|0,A=(A=(q?0:X)-(K?Y:0)-(V?J:0)|0)-((Y=(0|(V=(0|(J=V?0:J))<(0|(V=(0|i)<(0|A)?i:A))?J:V))>0)?V:0)|0,i=i-(Y?V:0)|0,V=J-(Y?V:0)|0,S=S+1|0}while((0|S)<(0|H))}else i=Y;switch(J=(0|h(q=3*(0|n[m>>2])|0,0|n[18608+(80*O|0)+(20*R|0)+4>>2]))+A|0,Y=(0|h(q,0|n[18608+(80*O|0)+(20*R|0)+8>>2]))+i|0,q=(0|h(q,0|n[18608+(80*O|0)+(20*R|0)+12>>2]))+V|0,J=((R=(0|J)<0)?0:J)-((K=(0|(Y=Y-(R?J:0)|0))<0)?Y:0)-((X=(0|(q=q+(R?0-J|0:0)+(K?0-Y|0:0)|0))<0)?q:0)|0,Y=(K?0:Y)-(X?q:0)|0,a[M>>3]=+(J-((K=(0|(X=(0|(q=X?0:q))<(0|(X=(0|Y)<(0|J)?Y:J))?q:X))>0)?X:0)-(q=q-(K?X:0)|0)|0)-.5*(Z=+(Y-(K?X:0)-q|0)),a[v>>3]=.8660254037844386*Z,a[P>>3]=3*(Z=+(0|n[Q>>2])),a[E>>3]=0,a[I>>3]=$=-1.5*Z,a[D>>3]=2.598076211353316*Z,a[p>>3]=$,a[C>>3]=-2.598076211353316*Z,0|n[17008+(80*j|0)+(O<<2)>>2]){case 1:A=I,i=P;break;case 3:A=p,i=I;break;case 2:A=P,i=p;break;default:A=12;break A}se(z,M,i,A,F),sA(F,j,d,1,L),q=0|n[t>>2],Z=+g(+ +a[u>>3]),$=+k(+ +a[o>>3],+ +a[L>>3]),a[t+8+(q<<4)>>3]=Z,a[t+8+(q<<4)+8>>3]=$,n[t>>2]=1+(0|n[t>>2])}if((0|N)<(0|B)&&(a[z>>3]=+((0|n[b>>2])-(q=0|n[s>>2])|0)-.5*(Z=+((0|n[c>>2])-q|0)),a[y>>3]=.8660254037844386*Z,sA(z,0|n[U>>2],d,1,M),q=0|n[t>>2],Z=+g(+ +a[l>>3]),$=+k(+ +a[f>>3],+ +a[M>>3]),a[t+8+(q<<4)>>3]=Z,a[t+8+(q<<4)+8>>3]=$,n[t>>2]=1+(0|n[t>>2])),(0|(N=N+1|0))>=(0|W)){A=3;break}i=0|n[U>>2],S=0|n[b>>2],H=0|n[c>>2],R=0|n[s>>2]}3!=(0|A)?12==(0|A)&&_(27073,27120,599,27130):T=x}}function dA(A,e,r){A|=0,e|=0,r|=0;var i,a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;f=T,T=T+128|0,l=f,c=20208,s=60+(u=o=f+64|0)|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));c=20272,s=(u=l)+60|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));g=(g=0==(0|LA(0|n[e>>2])))?o:l,l=0|n[(a=A+12|0)>>2],n[(t=A+4|0)>>2]=c=(o=0|n[(i=A+8|0)>>2])+((u=0|n[t>>2])<<1)|0,n[i>>2]=o=l+(o<<1)|0,n[a>>2]=u=(l<<1)+u|0,l=o-c|0,s=u-c|0,(0|c)<0&&(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,c=0,u=s),s=c-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=s,n[a>>2]=l,n[i>>2]=0,o=0):(l=u,s=c),c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(l=l-o|0,u=u-o|0,n[t>>2]=c=c-o|0,n[i>>2]=u,n[a>>2]=l),b=(u<<1)+c|0,n[t>>2]=s=l+(c<<1)|0,n[i>>2]=b,n[a>>2]=u=(l<<1)+u|0,o=b-s|0,l=u-s|0,(0|s)<0?(n[i>>2]=o,n[a>>2]=l,n[t>>2]=0,s=0,u=l):o=b,c=s-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=c,n[a>>2]=l,n[i>>2]=0,s=c,o=0):l=u,c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(n[t>>2]=c-o,n[i>>2]=u-o,n[a>>2]=l-o),0|LA(0|n[e>>2])&&(o=(3*(c=0|n[i>>2])|0)+(u=0|n[t>>2])|0,n[t>>2]=u=(l=0|n[a>>2])+(3*u|0)|0,n[i>>2]=o,n[a>>2]=c=(3*l|0)+c|0,l=o-u|0,s=c-u|0,(0|u)<0?(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,b=0):(b=u,s=c),u=b-o|0,l=s-o|0,(0|o)<0?(n[t>>2]=u,n[a>>2]=l,n[i>>2]=0,b=u,c=0):(c=o,l=s),u=b-l|0,o=c-l|0,(0|l)<0?(n[t>>2]=u,n[i>>2]=o,n[a>>2]=0,c=o,l=0):u=b,(0|(o=(0|l)<(0|(o=(0|c)<(0|u)?c:u))?l:o))>0&&(n[t>>2]=u-o,n[i>>2]=c-o,n[a>>2]=l-o),n[e>>2]=1+(0|n[e>>2])),n[r>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+4>>2],d=0|n[g+8>>2],n[(b=r+4|0)>>2]=c=(0|n[g>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+8|0)>>2]=l,o=d+o|0,n[(d=r+12|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+16>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+16>>2],d=0|n[g+20>>2],n[(b=r+20|0)>>2]=c=(0|n[g+12>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+24|0)>>2]=l,o=d+o|0,n[(d=r+28|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+32>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+28>>2],d=0|n[g+32>>2],n[(b=r+36|0)>>2]=c=(0|n[g+24>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+40|0)>>2]=l,o=d+o|0,n[(d=r+44|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+48>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],e=0|n[g+40>>2],d=0|n[g+44>>2],n[(b=r+52|0)>>2]=c=(0|n[g+36>>2])+(0|n[t>>2])|0,l=e+l|0,n[(e=r+56|0)>>2]=l,o=d+o|0,n[(d=r+60|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[e>>2]=u,n[d>>2]=o,n[b>>2]=0,l=u,c=0),(0|l)<0&&(n[b>>2]=c=c-l|0,n[d>>2]=o=o-l|0,n[e>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[b>>2]=s,n[e>>2]=u,n[d>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[b>>2]=c-l,n[e>>2]=u-l,n[d>>2]=o-l),n[r+64>>2]=n[A>>2],u=0|n[i>>2],o=0|n[a>>2],d=0|n[g+52>>2],b=0|n[g+56>>2],n[(e=r+68|0)>>2]=c=(0|n[g+48>>2])+(0|n[t>>2])|0,u=d+u|0,n[(d=r+72|0)>>2]=u,o=b+o|0,n[(b=r+76|0)>>2]=o,l=u-c|0,(0|c)<0?(o=o-c|0,n[d>>2]=l,n[b>>2]=o,n[e>>2]=0,u=0):(l=u,u=c),(0|l)<0&&(n[e>>2]=u=u-l|0,n[b>>2]=o=o-l|0,n[d>>2]=0,l=0),s=u-o|0,c=l-o|0,(0|o)<0?(n[e>>2]=s,n[d>>2]=c,n[b>>2]=0,u=s,o=0):c=l,(0|(l=(0|o)<(0|(l=(0|c)<(0|u)?c:u))?o:l))<=0?T=f:(n[e>>2]=u-l,n[d>>2]=c-l,n[b>>2]=o-l,T=f)}function gA(A,e,r,i){r|=0;var a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(b=0|n[16928+((e|=0)<<2)>>2],b=(f=0!=(0|(i|=0)))?3*b|0:b,c=0|n[(t=4+(A|=0)|0)>>2],l=0|n[(a=A+8|0)>>2],f){if((0|(o=l+c+(i=0|n[(u=A+12|0)>>2])|0))==(0|b))return 1;s=u}else i=o=0|n[(s=A+12|0)>>2],o=l+c+o|0;if((0|o)<=(0|b))return 0;do{if((0|i)>0){if(o=0|n[A>>2],(0|l)>0){o=18608+(80*o|0)+60|0,u=c;break}o=18608+(80*o|0)+40|0,r?(r=((d=(0|(r=l+(u=c-b|0)|0))<0)?0:r)-((c=(0|(l=i+l-(d?r:0)|0))<0)?l:0)-((u=(0|(i=i+u-(d?r:0)-(c?l:0)|0))<0)?i:0)|0,l=(l=(c?0:l)-(u?i:0)|0)-((c=(0|(u=(0|(i=u?0:i))<(0|(u=(0|l)<(0|r)?l:r))?i:u))>0)?u:0)|0,i=i-(c?u:0)|0,n[t>>2]=u=r-(c?u:0)+b|0,n[a>>2]=l,n[s>>2]=i):u=c}else o=18608+(80*(0|n[A>>2])|0)+20|0,u=c}while(0);if(n[A>>2]=n[o>>2],(0|(c=0|n[o+16>>2]))>0){r=0;do{(0|(A=(0|(i=(l=(0|(u=i+l-(B=(g=(0|(d=i+u|0))<0)?d:0)-(A=(k=(0|(w=l+u-B|0))<0)?w:0)|0))<0)?0:u))<(0|(A=(0|(l=(k?0:w)-(u=l?u:0)|0))<(0|(u=(g?0:d)-A-u|0))?l:u))?i:A))>0&&(u=u-A|0,l=l-A|0,i=i-A|0),r=r+1|0}while((0|r)<(0|c));n[t>>2]=u,n[a>>2]=l,n[s>>2]=i}return w=0|n[16848+(e<<2)>>2],k=0|h(w=f?3*w|0:w,0|n[o+8>>2]),B=0|h(w,0|n[o+12>>2]),u=(0|h(w,0|n[o+4>>2]))+u|0,n[t>>2]=u,n[a>>2]=l=k+l|0,n[s>>2]=i=B+i|0,o=l-u|0,(0|u)<0?(i=i-u|0,n[a>>2]=o,n[s>>2]=i,n[t>>2]=0,l=0):(o=l,l=u),(0|o)<0?(n[t>>2]=A=l-o|0,n[s>>2]=i=i-o|0,n[a>>2]=0,u=0):(A=l,u=o),l=A-i|0,o=u-i|0,(0|i)<0?(n[t>>2]=l,n[a>>2]=o,n[s>>2]=0,i=0):(o=u,l=A),(0|(u=(0|i)<(0|(u=(0|o)<(0|l)?o:l))?i:u))>0&&(o=o-u|0,i=i-u|0,n[t>>2]=l=l-u|0,n[a>>2]=o,n[s>>2]=i),f?0|(B=(o+l+i|0)==(0|b)?1:2):0|(B=2)}function wA(A,e){A|=0,e|=0;var r=0;do{r=0|gA(A,e,0,1)}while(2==(0|r));return 0|r}function kA(A,e,r,i,t){A|=0,r|=0,i|=0,t|=0;var f,o,l,u,c,s,b,d,w,B,h,m,v,Q,E,D,C,y,M,P,I,p,F,L,G,U,z,x,V=0,S=0,H=0,R=0,Y=0,j=0,O=0;if(x=T,T=T+272|0,S=x+240|0,G=x,U=x+224|0,z=x+208|0,M=x+184|0,P=x+168|0,I=x+152|0,p=x+136|0,F=x+120|0,L=x+96|0,n[(V=x+256|0)>>2]=e|=0,n[S>>2]=n[A>>2],n[S+4>>2]=n[A+4>>2],n[S+8>>2]=n[A+8>>2],n[S+12>>2]=n[A+12>>2],BA(S,V,G),n[t>>2]=0,(0|(y=i+r+(6==(0|i)&1)|0))<=(0|r))T=x;else{h=r+6|0,m=z+8|0,v=M+8|0,Q=16928+((B=0|n[V>>2])<<2)|0,E=P+8|0,D=I+8|0,C=p+8|0,d=0|n[S>>2],c=U+4|0,s=U+8|0,b=U+12|0,w=z+8|0,f=M+8|0,l=M+16|0,o=L+8|0,u=L+16|0,S=0,H=r,i=-1;A:for(;;){if(n[U>>2]=n[(A=G+((V=(0|H)%6|0)<<4)|0)>>2],n[U+4>>2]=n[A+4>>2],n[U+8>>2]=n[A+8>>2],n[U+12>>2]=n[A+12>>2],A=S,S=0|gA(U,B,0,1),(0|H)>(0|r)&0!=(0|LA(e))&&1!=(0|A)&(0|(R=0|n[U>>2]))!=(0|i)){switch(a[z>>3]=+((0|n[G+((O=(V+5|0)%6|0)<<4)+4>>2])-(A=0|n[G+(O<<4)+12>>2])|0)-.5*(Y=+((0|n[G+(O<<4)+8>>2])-A|0)),a[m>>3]=.8660254037844386*Y,a[M>>3]=+((0|n[G+(V<<4)+4>>2])-(A=0|n[G+(V<<4)+12>>2])|0)-.5*(Y=+((0|n[G+(V<<4)+8>>2])-A|0)),a[v>>3]=.8660254037844386*Y,a[P>>3]=3*(Y=+(0|n[Q>>2])),a[E>>3]=0,a[I>>3]=j=-1.5*Y,a[D>>3]=2.598076211353316*Y,a[p>>3]=j,a[C>>3]=-2.598076211353316*Y,0|n[17008+(80*d|0)+(((0|i)==(0|d)?R:i)<<2)>>2]){case 1:A=I,i=P;break;case 3:A=p,i=I;break;case 2:A=P,i=p;break;default:A=8;break A}se(z,M,i,A,F),0|be(z,F)||0|be(M,F)||(sA(F,d,B,1,L),O=0|n[t>>2],Y=+g(+ +a[u>>3]),j=+k(+ +a[o>>3],+ +a[L>>3]),a[t+8+(O<<4)>>3]=Y,a[t+8+(O<<4)+8>>3]=j,n[t>>2]=1+(0|n[t>>2]))}if((0|H)<(0|h)&&(a[z>>3]=+((0|n[c>>2])-(O=0|n[b>>2])|0)-.5*(Y=+((0|n[s>>2])-O|0)),a[w>>3]=.8660254037844386*Y,sA(z,0|n[U>>2],B,1,M),O=0|n[t>>2],Y=+g(+ +a[l>>3]),j=+k(+ +a[f>>3],+ +a[M>>3]),a[t+8+(O<<4)>>3]=Y,a[t+8+(O<<4)+8>>3]=j,n[t>>2]=1+(0|n[t>>2])),(0|(H=H+1|0))>=(0|y)){A=3;break}i=0|n[U>>2]}3!=(0|A)?8==(0|A)&&_(27157,27120,766,27202):T=x}}function BA(A,e,r){A|=0,e|=0,r|=0;var i,a,t,f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;f=T,T=T+160|0,l=f,c=20336,s=72+(u=o=f+80|0)|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));c=20416,s=(u=l)+72|0;do{n[u>>2]=n[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|s));w=(w=0==(0|LA(0|n[e>>2])))?o:l,l=0|n[(a=A+12|0)>>2],n[(t=A+4|0)>>2]=c=(o=0|n[(i=A+8|0)>>2])+((u=0|n[t>>2])<<1)|0,n[i>>2]=o=l+(o<<1)|0,n[a>>2]=u=(l<<1)+u|0,l=o-c|0,s=u-c|0,(0|c)<0&&(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,c=0,u=s),s=c-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=s,n[a>>2]=l,n[i>>2]=0,o=0):(l=u,s=c),c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(l=l-o|0,u=u-o|0,n[t>>2]=c=c-o|0,n[i>>2]=u,n[a>>2]=l),b=(u<<1)+c|0,n[t>>2]=s=l+(c<<1)|0,n[i>>2]=b,n[a>>2]=u=(l<<1)+u|0,o=b-s|0,l=u-s|0,(0|s)<0?(n[i>>2]=o,n[a>>2]=l,n[t>>2]=0,s=0,u=l):o=b,c=s-o|0,l=u-o|0,(0|o)<0?(n[t>>2]=c,n[a>>2]=l,n[i>>2]=0,s=c,o=0):l=u,c=s-l|0,u=o-l|0,(0|l)<0?(n[t>>2]=c,n[i>>2]=u,n[a>>2]=0,l=0):(u=o,c=s),(0|(o=(0|l)<(0|(o=(0|u)<(0|c)?u:c))?l:o))>0&&(n[t>>2]=c-o,n[i>>2]=u-o,n[a>>2]=l-o),0|LA(0|n[e>>2])&&(o=(3*(c=0|n[i>>2])|0)+(u=0|n[t>>2])|0,n[t>>2]=u=(l=0|n[a>>2])+(3*u|0)|0,n[i>>2]=o,n[a>>2]=c=(3*l|0)+c|0,l=o-u|0,s=c-u|0,(0|u)<0?(n[i>>2]=l,n[a>>2]=s,n[t>>2]=0,o=l,b=0):(b=u,s=c),u=b-o|0,l=s-o|0,(0|o)<0?(n[t>>2]=u,n[a>>2]=l,n[i>>2]=0,b=u,c=0):(c=o,l=s),u=b-l|0,o=c-l|0,(0|l)<0?(n[t>>2]=u,n[i>>2]=o,n[a>>2]=0,c=o,l=0):u=b,(0|(o=(0|l)<(0|(o=(0|c)<(0|u)?c:u))?l:o))>0&&(n[t>>2]=u-o,n[i>>2]=c-o,n[a>>2]=l-o),n[e>>2]=1+(0|n[e>>2])),b=0;do{n[r+(b<<4)>>2]=n[A>>2],l=0|n[i>>2],o=0|n[a>>2],d=0|n[w+(12*b|0)+4>>2],g=0|n[w+(12*b|0)+8>>2],n[(e=r+(b<<4)+4|0)>>2]=c=(0|n[w+(12*b|0)>>2])+(0|n[t>>2])|0,l=d+l|0,n[(d=r+(b<<4)+8|0)>>2]=l,o=g+o|0,n[(g=r+(b<<4)+12|0)>>2]=o,u=l-c|0,(0|c)<0&&(o=o-c|0,n[d>>2]=u,n[g>>2]=o,n[e>>2]=0,l=u,c=0),(0|l)<0&&(n[e>>2]=c=c-l|0,n[g>>2]=o=o-l|0,n[d>>2]=0,l=0),s=c-o|0,u=l-o|0,(0|o)<0?(n[e>>2]=s,n[d>>2]=u,n[g>>2]=0,c=s,o=0):u=l,(0|(l=(0|o)<(0|(l=(0|u)<(0|c)?u:c))?o:l))>0&&(n[e>>2]=c-l,n[d>>2]=u-l,n[g>>2]=o-l),b=b+1|0}while(6!=(0|b));T=f}function hA(A,e){return e=0|Se(0|(A|=0),0|(e|=0),52),C(),15&e|0}function mA(A,e){return e=0|Se(0|(A|=0),0|(e|=0),45),C(),127&e|0}function vA(A,e){A|=0;var r=0,n=0,a=0,t=0;return!0&134217728==(-16777216&(e|=0)|0)?(n=0|Se(0|A,0|e,52),C(),n&=15,r=0|Se(0|A,0|e,45),C(),(r&=127)>>>0>121?0|(A=0):0==(613566756&(t=0|He(0|(a=0|Se(0|A,0|e,0|(t=3*(15^n)|0))),0|C(),0|t))&(0|Te(-1227133514,-1171,0|t,0|(a=0|C())))|0)&0==(4681&a&(0|C())|0)&&15==(0|n)|0==(0|(t=0|Se(0|He(0|~A,0|~e,0|(t=19+(3*n|0)|0)),0|C(),0|t)))&0==(0|C())?0|i[20496+r>>0]?0==(0|A)&0==(0|(e&=8191))?0|(t=1):(t=0|Re(0|A,0|e),C(),0!=(0|(63-t|0)%3)|0):0|(t=1):0|(t=0)):0|(A=0)}function QA(A,e,r,i){A|=0,r|=0,i|=0;var a=0,t=0,f=0,o=0;if(a=0|He(0|(e|=0),0,52),t=0|C(),r=0|He(0|r,0,45),r=0|t|C()|134225919,(0|e)<1)return i=r,n[(e=A)>>2]=t=-1,void(n[(A=A+4|0)>>2]=i);for(t=1,a=-1;o=0|He(7,0,0|(f=3*(15-t|0)|0)),r&=~(0|C()),a=a&~o|(f=0|He(0|i,0,0|f)),r=0|r|C(),(0|t)!=(0|e);)t=t+1|0;n[(f=o=A)>>2]=a,n[(o=o+4|0)>>2]=r}function EA(A,e,r,i){r|=0,i|=0;var a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),r>>>0>15)return 4;if((0|(t&=15))<(0|r))return 12;if((0|t)==(0|r))return n[i>>2]=A,n[i+4>>2]=e,0;if(a=0|He(0|r,0,52),a|=A,A=0|C()|-15728641&e,(0|t)>(0|r))do{e=0|He(7,0,3*(14-r|0)|0),r=r+1|0,a|=e,A=0|C()|A}while((0|r)<(0|t));return n[i>>2]=a,n[i+4>>2]=A,0}function DA(A,e,r,i){r|=0,i|=0;var a=0,t=0,f=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!((0|r)<16&(0|(t&=15))<=(0|r)))return 4;a=r-t|0,r=0|Se(0|A,0|e,45),C();A:do{if(0|Y(127&r)){e:do{if(0|t){for(r=1;0==((f=0|He(7,0,3*(15-r|0)|0))&A|0)&0==((0|C())&e|0);){if(!(r>>>0<t>>>0))break e;r=r+1|0}r=0|$A(7,0,a,((0|a)<0)<<31>>31),a=0|C();break A}}while(0);r=0|pe(0|(r=0|Ue(0|(r=0|$A(7,0,a,((0|a)<0)<<31>>31)),0|C(),5,0)),0|C(),-5,-1),r=0|pe(0|(r=0|Ge(0|r,0|C(),6,0)),0|C(),1,0),a=0|C()}else r=0|$A(7,0,a,((0|a)<0)<<31>>31),a=0|C()}while(0);return n[(f=i)>>2]=r,n[f+4>>2]=a,0}function CA(A,e){var r=0,i=0,n=0;if(n=0|Se(0|(A|=0),0|(e|=0),45),C(),!(0|Y(127&n)))return 0;n=0|Se(0|A,0|e,52),C(),n&=15;A:do{if(n)for(i=1;;){if(r=0|Se(0|A,0|e,3*(15-i|0)|0),C(),0|(r&=7))break A;if(!(i>>>0<n>>>0)){r=0;break}i=i+1|0}else r=0}while(0);return 0|0==(0|r)&1}function _A(A,e,r,i){return A|=0,e|=0,(0|(i|=0))<(0|(r|=0))?(i=A,D(0|(r=e)),0|i):(r=0|He(-1,-1,3+(3*(i-r|0)|0)|0),i=0|He(0|~r,0|~(0|C()),3*(15-i|0)|0),r=~(0|C())&e,i=~i&A,D(0|r),0|i)}function yA(A,e,r,i){r|=0,i|=0;var a=0;return a=0|Se(0|(A|=0),0|(e|=0),52),C(),(0|r)<16&(0|(a&=15))<=(0|r)?((0|a)<(0|r)&&(a=0|He(-1,-1,3+(3*(r+-1-a|0)|0)|0),a=0|He(0|~a,0|~(0|C()),3*(15-r|0)|0),e=~(0|C())&e,A&=~a),a=0|He(0|r,0,52),r=-15728641&e|0|C(),n[i>>2]=A|a,n[i+4>>2]=r,0|(i=0)):0|(i=4)}function MA(A,e){var r=0,i=0,n=0;if(n=0|Se(0|(A|=0),0|(e|=0),52),C(),!(n&=15))return 0;for(i=1;;){if(r=0|Se(0|A,0|e,3*(15-i|0)|0),C(),0|(r&=7)){i=5;break}if(!(i>>>0<n>>>0)){r=0,i=5;break}i=i+1|0}return 5==(0|i)?0|r:0}function PA(A,e){var r=0,i=0,n=0,a=0,t=0,f=0,o=0,l=0,u=0;if(u=0|Se(0|(A|=0),0|(e|=0),52),C(),!(u&=15))return u=A,D(0|(l=e)),0|u;for(l=1,r=0;;){switch(a=A&~(f=0|He(7,0,0|(i=3*(15-l|0)|0))),t=e&~(o=0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A&=7}A=(i=0|He(0|A,0,0|i))|a,e=(n=0|C())|t;A:do{if(!r)if(0==(i&f|0)&0==(n&o|0))r=0;else if(t=0|Se(0|A,0|e,52),C(),t&=15){r=1;e:for(;;){switch(o=0|Se(0|A,0|e,3*(15-r|0)|0),C(),7&o){case 1:break e;case 0:break;default:r=1;break A}if(!(r>>>0<t>>>0)){r=1;break A}r=r+1|0}for(a=1;;){switch(r=0|Se(0|A,0|e,0|(n=3*(15-a|0)|0)),C(),i=A&~(i=0|He(7,0,0|n)),e&=~(0|C()),7&r){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&r}if(A=0|He(0|A,0,0|n),A|=i,e=0|C()|e,!(a>>>0<t>>>0)){r=1;break A}a=a+1|0}}else r=1}while(0);if(!(l>>>0<u>>>0))break;l=l+1|0}return D(0|e),0|A}function IA(A,e){var r=0,i=0,n=0,a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!(t&=15))return t=A,D(0|(a=e)),0|t;for(a=1;;){switch(r=0|Se(0|A,0|e,0|(n=3*(15-a|0)|0)),C(),i=A&~(i=0|He(7,0,0|n)),e&=~(0|C()),7&r){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&r}if(A=0|He(0|A,0,0|n),A|=i,e=0|C()|e,!(a>>>0<t>>>0))break;a=a+1|0}return D(0|e),0|A}function pA(A,e){var r=0,i=0,n=0,a=0,t=0,f=0,o=0,l=0,u=0;if(u=0|Se(0|(A|=0),0|(e|=0),52),C(),!(u&=15))return u=A,D(0|(l=e)),0|u;for(l=1,r=0;;){switch(a=A&~(f=0|He(7,0,0|(i=3*(15-l|0)|0))),t=e&~(o=0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}A=(i=0|He(0|A,0,0|i))|a,e=(n=0|C())|t;A:do{if(!r)if(0==(i&f|0)&0==(n&o|0))r=0;else if(t=0|Se(0|A,0|e,52),C(),t&=15){r=1;e:for(;;){switch(o=0|Se(0|A,0|e,3*(15-r|0)|0),C(),7&o){case 1:break e;case 0:break;default:r=1;break A}if(!(r>>>0<t>>>0)){r=1;break A}r=r+1|0}for(a=1;;){switch(i=A&~(i=0|He(7,0,0|(r=3*(15-a|0)|0))),n=e&~(0|C()),A=0|Se(0|A,0|e,0|r),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(A=0|He(0|A,0,0|r),A|=i,e=0|C()|n,!(a>>>0<t>>>0)){r=1;break A}a=a+1|0}}else r=1}while(0);if(!(l>>>0<u>>>0))break;l=l+1|0}return D(0|e),0|A}function TA(A,e){var r=0,i=0,n=0,a=0,t=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),!(t&=15))return t=A,D(0|(a=e)),0|t;for(a=1;;){switch(r=A&~(r=0|He(7,0,0|(i=3*(15-a|0)|0))),n=e&~(0|C()),A=0|Se(0|A,0|e,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(A=0|He(0|A,0,0|i),A|=r,e=0|C()|n,!(a>>>0<t>>>0))break;a=a+1|0}return D(0|e),0|A}function FA(A,e){A|=0;var r,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,_=0;if(r=T,T=T+16|0,v=r,He(0|(e|=0),0,52),i=134225919|C(),!e)return(0|n[A+4>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(0|n[A+8>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(0|n[A+12>>2])>2?(v=0,D(0|(m=0)),T=r,0|v):(He(0|O(A),0,45),m=0|C()|i,v=-1,D(0|m),T=r,0|v);n[v>>2]=n[A>>2],n[v+4>>2]=n[A+4>>2],n[v+8>>2]=n[A+8>>2],n[v+12>>2]=n[A+12>>2],m=v+4|0;A:do{if((0|e)>0)for(w=e,b=0|n[(k=v+8|0)>>2],d=0|n[(B=v+12|0)>>2],e=-1,s=0|n[v+4>>2];;){g=w,w=w+-1|0,A=s-d|0,a=b-d|0,1&g?(f=0|Ce(.14285714285714285*+((3*A|0)-a|0)),n[m>>2]=f,A=0|Ce(.14285714285714285*+((a<<1)+A|0)),n[k>>2]=A,n[B>>2]=0,a=A-f|0,t=0-f|0,(0|f)<0?(n[k>>2]=a,n[B>>2]=t,n[m>>2]=0,A=a,o=0):(o=f,t=0),f=o-A|0,a=t-A|0,(0|A)<0?(n[m>>2]=f,n[B>>2]=a,n[k>>2]=0,o=f,f=0):(a=t,f=A),A=o-a|0,t=f-a|0,(0|a)<0?(n[m>>2]=A,n[k>>2]=t,n[B>>2]=0,f=0):(t=f,A=o,f=a),(0|(a=(0|f)<(0|(a=(0|t)<(0|A)?t:A))?f:a))>0&&(f=f-a|0,t=t-a|0,n[m>>2]=A=A-a|0,n[k>>2]=t,n[B>>2]=f),u=(c=(0|(l=(0|(_=(l=(0|(a=(3*f|0)+A-((Q=(0|(E=t+(3*A|0)|0))<0)?E:0)-((u=(0|(c=f+(3*t|0)-(Q?E:0)|0))<0)?c:0)|0))<0)?0:a))<(0|(l=(0|(o=(u?0:c)-(l?a:0)|0))<(0|(a=(Q?0:E)-(u?c:0)-(l?a:0)|0))?o:a))?_:l))>0)?l:0,o=o-(c?l:0)|0,l=_-(c?l:0)|0,c=f):(l=0|Ce(.14285714285714285*+((A<<1)+a|0)),n[m>>2]=l,t=0|Ce(.14285714285714285*+((3*a|0)-A|0)),n[k>>2]=t,n[B>>2]=0,a=t-l|0,A=0-l|0,(0|l)<0?(n[k>>2]=a,n[B>>2]=A,n[m>>2]=0,t=a,l=0):A=0,o=l-t|0,a=A-t|0,(0|t)<0?(n[m>>2]=o,n[B>>2]=a,n[k>>2]=0,f=a,t=0):(f=A,o=l),A=o-f|0,a=t-f|0,(0|f)<0?(n[m>>2]=A,n[k>>2]=a,n[B>>2]=0,t=a,f=0):A=o,(0|(a=(0|f)<(0|(a=(0|t)<(0|A)?t:A))?f:a))>0&&(f=f-a|0,t=t-a|0,n[m>>2]=A=A-a|0,n[k>>2]=t,n[B>>2]=f),u=(c=(0|(l=(0|(Q=(l=(0|(a=(3*f|0)+t-((_=(0|(E=f+(3*A|0)|0))<0)?E:0)-((u=(0|(c=(3*t|0)+A-(_?E:0)|0))<0)?c:0)|0))<0)?0:a))<(0|(l=(0|(o=(u?0:c)-(l?a:0)|0))<(0|(a=(_?0:E)-(u?c:0)-(l?a:0)|0))?o:a))?Q:l))>0)?l:0,o=o-(c?l:0)|0,l=Q-(c?l:0)|0,c=f),l=(s=(0|(d=d-l+((f=(0|(a=s+(u-a)|0))<0)?0-a|0:0)+((o=(0|(u=b-o-(f?a:0)|0))<0)?0-u|0:0)|0))<0)?0:d,_=(o?0:u)-(s?d:0)|0,d=(d=(f?0:a)-(o?u:0)-(s?d:0)|0)-((u=(0|(s=(0|l)<(0|(s=(0|_)<(0|d)?_:d))?l:s))>0)?s:0)|0,a=e&~(a=0|He(7,0,0|(o=3*(15-g|0)|0))),f=i&~(0|C()),e=(e=(i=(0|(E=l-(u?s:0)-(E=(b=(0|d)<0)?d:0)+((Q=(0|(_=_-(u?s:0)-E|0))<0)?0-_|0:0)|0))<0)?0:E)-(_=(0|(_=(0|e)<(0|(_=(0|(i=(Q?0:_)-(E=i?E:0)|0))<(0|(E=(b?0:d)-(Q?_:0)-E|0))?i:E))?e:_))>0?_:0)|0,i=i-_|0;e:do{switch(E-_|0){case 0:switch(0|i){case 0:e=0==(0|e)?0:1==(0|e)?1:7;break e;case 1:e=0==(0|e)?2:1==(0|e)?3:7;break e;default:h=36;break e}case 1:switch(0|i){case 0:e=0==(0|e)?4:1==(0|e)?5:7;break e;case 1:if(e){h=36;break e}e=6;break e;default:h=36;break e}default:h=36}}while(0);if(36==(0|h)&&(h=0,e=7),e=0|He(0|e,0,0|o),e|=a,i=0|C()|f,(0|g)<=1)break A;b=t,d=c,s=A}else e=-1,A=0|n[m>>2]}while(0);A:do{if((0|A)<=2&&(0|n[v+8>>2])<=2&&(0|n[v+12>>2])<=2){if(e|=A=0|He(0|(a=0|O(v)),0,45),A=0|C()|-1040385&i,u=0|N(v),!(0|Y(a))){if((0|u)<=0)break;for(l=0;;){o=0|Se(0|e,0|A,52),C(),o&=15;e:do{if(o)for(f=1;;){switch(i=0|Se(0|e,0|A,0|(t=3*(15-f|0)|0)),C(),e&=~(a=0|He(7,0,0|t)),a=A&~(0|C()),7&i){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&i}if(e|=A=0|He(0|A,0,0|t),A=0|C()|a,!(f>>>0<o>>>0))break e;f=f+1|0}}while(0);if((0|(l=l+1|0))==(0|u))break A}}o=0|Se(0|e,0|A,52),C(),o&=15;e:do{if(o){i=1;r:for(;;){switch(_=0|Se(0|e,0|A,3*(15-i|0)|0),C(),7&_){case 1:break r;case 0:break;default:break e}if(!(i>>>0<o>>>0))break e;i=i+1|0}if(0|W(a,0|n[v>>2]))for(f=1;;){switch(a=e&~(a=0|He(7,0,0|(i=3*(15-f|0)|0))),t=A&~(0|C()),A=0|Se(0|e,0|A,0|i),C(),7&A){case 1:A=3;break;case 3:A=2;break;case 2:A=6;break;case 6:A=4;break;case 4:A=5;break;case 5:A=1;break;default:A&=7}if(e=0|He(0|A,0,0|i),e|=a,A=0|C()|t,!(f>>>0<o>>>0))break e;f=f+1|0}else for(f=1;;){switch(i=0|Se(0|e,0|A,0|(t=3*(15-f|0)|0)),C(),e&=~(a=0|He(7,0,0|t)),a=A&~(0|C()),7&i){case 1:A=5;break;case 5:A=4;break;case 4:A=6;break;case 6:A=2;break;case 2:A=3;break;case 3:A=1;break;default:A=7&i}if(e|=A=0|He(0|A,0,0|t),A=0|C()|a,!(f>>>0<o>>>0))break e;f=f+1|0}}}while(0);if((0|u)>0){i=0;do{e=0|PA(e,A),A=0|C(),i=i+1|0}while((0|i)!=(0|u))}}else e=0,A=0}while(0);return _=e,D(0|(E=A)),T=r,0|_}function LA(A){return 0|(0|(A|=0))%2}function GA(A,e,r){r|=0;var i,f,o,l,u=0,b=0,d=0,g=0,w=0;if(o=T,T=T+64|0,f=o+24|0,g=o+48|0,w=o,(e|=0)>>>0>15)return T=o,4;if(a[t>>3]=i=+a[(A|=0)>>3],2146435072==(2146435072&n[t+4>>2]|0))return T=o,3;if(a[t>>3]=u=+a[A+8>>3],2146435072==(2146435072&n[t+4>>2]|0))return T=o,3;l=(b=+c(+i))*+c(+u),b*=+s(+u),u=+s(+i),a[w>>3]=l,a[w+8>>3]=b,a[w+16>>3]=u,a[t>>3]=l;do{if(2146435072==(2146435072&n[t+4>>2]|0)||(a[t>>3]=u,A=0|n[t+4>>2],a[t>>3]=b,2146435072==(2146435072&n[t+4>>2]|0)|!0&2146435072==(2146435072&A|0)))d=2;else{if(n[f>>2]=n[w>>2],n[f+4>>2]=n[w+4>>2],n[f+8>>2]=n[w+8>>2],n[f+12>>2]=n[w+12>>2],n[f+16>>2]=n[w+16>>2],n[f+20>>2]=n[w+20>>2],uA(f,e,g),g=0|FA(g,e),w=0|C(),n[r>>2]=g,n[r+4>>2]=w,!(0==(0|g)&0==(0|w))){d=0;break}_(27634,27225,1073,27248)}}while(0);return T=o,0|d}function UA(A,e,r){var i,a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(a=4+(r|=0)|0,g=0|Se(0|(A|=0),0|(e|=0),52),C(),g&=15,d=0|Se(0|A,0|e,45),C(),t=0==(0|g),0|Y(127&d)){if(t)return 1;t=1}else{if(t)return 0;t=0==(0|n[a>>2])&&0==(0|n[r+8>>2])?0!=(0|n[r+12>>2])&1:1}for(d=r+8|0,i=r+12|0,b=1,r=0|n[a>>2],l=0|n[d>>2],o=0|n[i>>2];f=3*r|0,u=3*l|0,s=3*o|0,1&b?(n[a>>2]=c=l+f|0,n[d>>2]=o=o+u|0,n[i>>2]=f=s+r|0,r=o-c|0,l=f-c|0,(0|c)<0?(n[d>>2]=r,n[i>>2]=l,n[a>>2]=0,u=0,f=l):(r=o,u=c),l=u-r|0,o=f-r|0,(0|r)<0?(n[a>>2]=l,n[i>>2]=o,n[d>>2]=0,u=l,f=0):(o=f,f=r),r=u-o|0,l=f-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=l,n[i>>2]=0,o=0):(l=f,r=u),(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)):(c=u+r|0,n[a>>2]=u=o+f|0,n[d>>2]=c,n[i>>2]=f=s+l|0,r=c-u|0,o=f-u|0,(0|u)<0?(n[d>>2]=r,n[i>>2]=o,n[a>>2]=0,u=0,f=o):r=c,l=u-r|0,o=f-r|0,(0|r)<0?(n[a>>2]=l,n[i>>2]=o,n[d>>2]=0,u=l,f=0):(o=f,f=r),r=u-o|0,l=f-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=l,n[i>>2]=0,o=0):(l=f,r=u),(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)),f=0|Se(0|A,0|e,3*(15-b|0)|0),C(),((f&=7)-1|0)>>>0<6&&(c=0|n[22032+(12*f|0)+4>>2],s=0|n[22032+(12*f|0)+8>>2],n[a>>2]=u=(0|n[22032+(12*f|0)>>2])+r|0,n[d>>2]=l=c+l|0,n[i>>2]=r=s+o|0,o=l-u|0,f=r-u|0,(0|u)<0&&(n[d>>2]=o,n[i>>2]=f,n[a>>2]=0,u=0,r=f,l=o),f=u-l|0,o=r-l|0,(0|l)<0?(n[a>>2]=f,n[i>>2]=o,n[d>>2]=0,u=f,l=0):o=r,r=u-o|0,f=l-o|0,(0|o)<0?(n[a>>2]=r,n[d>>2]=f,n[i>>2]=0,l=f,o=0):r=u,(0|(f=(0|o)<(0|(f=(0|l)<(0|r)?l:r))?o:f))>0&&(o=o-f|0,l=l-f|0,n[a>>2]=r=r-f|0,n[d>>2]=l,n[i>>2]=o)),b>>>0<g>>>0;)b=b+1|0;return 0|t}function zA(A,e,r){r|=0;var i,a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(t=T,T=T+16|0,a=t,d=0|Se(0|(A|=0),0|(e|=0),45),C(),(d&=127)>>>0>121)return n[r>>2]=0,n[r+4>>2]=0,n[r+8>>2]=0,n[r+12>>2]=0,T=t,5;A:do{if(0!=(0|Y(d))&&(c=0|Se(0|A,0|e,52),C(),0!=(0|(c&=15)))){f=1;e:for(;;){switch(g=0|Se(0|A,0|e,3*(15-f|0)|0),C(),7&g){case 5:break e;case 0:break;default:b=e;break A}if(!(f>>>0<c>>>0)){b=e;break A}f=f+1|0}for(u=1,f=e;;){switch(o=A&~(o=0|He(7,0,0|(e=3*(15-u|0)|0))),l=f&~(0|C()),f=0|Se(0|A,0|f,0|e),C(),7&f){case 1:f=3;break;case 3:f=2;break;case 2:f=6;break;case 6:f=4;break;case 4:f=5;break;case 5:f=1;break;default:f&=7}if(A=0|He(0|f,0,0|e),A|=o,f=0|C()|l,!(u>>>0<c>>>0)){b=f;break A}u=u+1|0}}else b=e}while(0);if(n[r>>2]=n[(g=7696+(28*d|0)|0)>>2],n[r+4>>2]=n[g+4>>2],n[r+8>>2]=n[g+8>>2],n[r+12>>2]=n[g+12>>2],!(0|UA(A,b,r)))return T=t,0;if(n[a>>2]=n[(g=r+4|0)>>2],n[a+4>>2]=n[g+4>>2],n[a+8>>2]=n[g+8>>2],s=0|Se(0|A,0|b,52),C(),i=15&s,1&s?(f=(3*(o=0|n[(c=r+8|0)>>2])|0)+(l=0|n[g>>2])|0,n[g>>2]=l=(e=0|n[(s=r+12|0)>>2])+(3*l|0)|0,n[c>>2]=f,n[s>>2]=o=(3*e|0)+o|0,e=f-l|0,u=o-l|0,(0|l)<0&&(n[c>>2]=e,n[s>>2]=u,n[g>>2]=0,f=e,l=0,o=u),u=l-f|0,e=o-f|0,(0|f)<0?(n[g>>2]=u,n[s>>2]=e,n[c>>2]=0,f=0):(e=o,u=l),l=u-e|0,o=f-e|0,(0|e)<0?(n[g>>2]=l,n[c>>2]=o,n[s>>2]=0,e=0):(o=f,l=u),(0|(f=(0|e)<(0|(f=(0|o)<(0|l)?o:l))?e:f))>0&&(n[g>>2]=l-f,n[c>>2]=o-f,n[s>>2]=e-f),o=i+1|0):o=i,0|Y(d)){A:do{if(i)for(e=1;;){if(f=0|Se(0|A,0|b,3*(15-e|0)|0),C(),0|(f&=7))break A;if(!(e>>>0<i>>>0)){f=0;break}e=e+1|0}else f=0}while(0);f=4==(0|f)&1}else f=0;if(0|gA(r,o,f,0)){if(0|Y(d))do{}while(0!=(0|gA(r,o,0,0)));(0|o)!=(0|i)&&(e=0|Ce(.14285714285714285*+(((f=(0|n[g>>2])-(A=0|n[(c=r+12|0)>>2])|0)<<1)+(A=(0|n[(u=r+8|0)>>2])-A|0)|0)),n[g>>2]=e,f=0|Ce(.14285714285714285*+((3*A|0)-f|0)),n[u>>2]=f,n[c>>2]=0,A=f-e|0,o=0-e|0,(0|e)<0?(n[u>>2]=A,n[c>>2]=o,n[g>>2]=0,f=A,e=0):o=0,l=e-f|0,A=o-f|0,(0|f)<0?(n[g>>2]=l,n[c>>2]=A,n[u>>2]=0,e=l,f=0):A=o,l=e-A|0,o=f-A|0,(0|A)<0?(n[g>>2]=l,n[u>>2]=o,n[c>>2]=0,e=l,A=0):o=f,(0|(f=(0|A)<(0|(f=(0|o)<(0|e)?o:e))?A:f))>0&&(n[g>>2]=e-f,n[u>>2]=o-f,n[c>>2]=A-f))}else(0|o)!=(0|i)&&(n[g>>2]=n[a>>2],n[g+4>>2]=n[a+4>>2],n[g+8>>2]=n[a+8>>2]);return T=t,0}function xA(A,e,r){r|=0;var i,n,t,f=0,o=0,l=0;return t=T,T=T+48|0,n=t,(f=0|zA(A|=0,e|=0,i=t+24|0))?(T=t,0|f):(f=0|Se(0|A,0|e,52),C(),cA(i,15&f,n),l=+g(+ +a[n+16>>3]),o=+k(+ +a[n+8>>3],+ +a[n>>3]),a[r>>3]=l,a[r+8>>3]=o,T=t,0|(f=0))}function VA(A,e,r){r|=0;var i,n,a=0,t=0;if(i=T,T=T+16|0,0|(a=0|zA(A|=0,e|=0,n=i)))return T=i,0|a;a=0|Se(0|A,0|e,45),C(),a=0==(0|Y(127&a)),t=0|Se(0|A,0|e,52),C(),t&=15;A:do{if(!a){if(0|t)for(a=1;;){if(!(0==((0|He(7,0,3*(15-a|0)|0))&A|0)&0==((0|C())&e|0)))break A;if(!(a>>>0<t>>>0))break;a=a+1|0}return bA(n,t,0,5,r),T=i,0}}while(0);return kA(n,t,0,6,r),T=i,0}function SA(A,e){e|=0;var r,i=0,a=0,t=0,f=0,o=0,l=0;if((A|=0)>>>0>15)return 4;if(He(0|A,0,52),r=134225919|C(),!A){i=0,a=0;do{0|Y(a)&&(He(0|a,0,45),o=0|r|C(),n[(A=e+(i<<3)|0)>>2]=-1,n[A+4>>2]=o,i=i+1|0),a=a+1|0}while(122!=(0|a));return 0}i=0,o=0;do{if(0|Y(o)){for(He(0|o,0,45),a=1,t=-1,f=0|r|C();t&=~(l=0|He(7,0,3*(15-a|0)|0)),f&=~(0|C()),(0|a)!=(0|A);)a=a+1|0;n[(l=e+(i<<3)|0)>>2]=t,n[l+4>>2]=f,i=i+1|0}o=o+1|0}while(122!=(0|o));return 0}function HA(A,e,r,i){A|=0,i|=0;var a=0,t=0,f=0;a=0|Se(0|(e|=0),0|(r|=0),52),C(),0==(0|e)&0==(0|r)|(0|i)>15|(0|(a&=15))>(0|i)?(t=-1,e=-1,r=0,a=0):(e=0|_A(e,r,a+1|0,i),f=-15728641&(0|C()),r=0|He(0|i,0,52),t=a,e=(e=0==(0|CA(r|=e,f=0|f|C())))?-1:i,a=f),n[(f=A)>>2]=r,n[f+4>>2]=a,n[A+8>>2]=t,n[A+12>>2]=e}function RA(A,e,r,i){r|=0,i|=0;var a=0,t=0;return a=0|Se(0|(A|=0),0|(e|=0),52),C(),n[(t=i+8|0)>>2]=a&=15,0==(0|A)&0==(0|e)|(0|r)>15|(0|a)>(0|r)?(n[(r=i)>>2]=0,n[r+4>>2]=0,n[t>>2]=-1,void(n[i+12>>2]=-1)):(A=0|_A(A,e,a+1|0,r),t=-15728641&(0|C()),a=0|He(0|r,0,52),a|=A,t=0|t|C(),n[(A=i)>>2]=a,n[A+4>>2]=t,A=i+12|0,0|CA(a,t)?void(n[A>>2]=r):void(n[A>>2]=-1))}function YA(A){var e,r=0,i=0,a=0,t=0,f=0,o=0,l=0,u=0;if(!(0==(0|(r=0|n[(i=A|=0)>>2]))&0==(0|(i=0|n[i+4>>2]))||(a=0|Se(0|r,0|i,52),C(),r=0|pe(0|(l=0|He(1,0,3*(15^(a&=15))|0)),0|C(),0|r,0|i),i=0|C(),n[(l=A)>>2]=r,n[l+4>>2]=i,(0|a)<(0|(o=0|n[(l=A+8|0)>>2]))))){for(e=A+12|0,f=a;;){if((0|f)==(0|o)){a=5;break}if(u=(0|f)==(0|n[e>>2]),a=0|Se(0|r,0|i,0|(t=3*(15-f|0)|0)),C(),u&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(r=0|pe(0|r,0|i,0|(u=0|He(1,0,0|t)),0|C()),i=0|C(),n[(u=A)>>2]=r,n[u+4>>2]=i,!((0|f)>(0|o))){a=10;break}f=f+-1|0}if(5==(0|a))return n[(u=A)>>2]=0,n[u+4>>2]=0,n[l>>2]=-1,void(n[e>>2]=-1);if(7==(0|a))return o=0|pe(0|r,0|i,0|(o=0|He(1,0,0|t)),0|C()),l=0|C(),n[(u=A)>>2]=o,n[u+4>>2]=l,void(n[e>>2]=f+-1)}}function jA(A){var e;return e=(A=+A)<0?A+6.283185307179586:A,+(A>=6.283185307179586?e+-6.283185307179586:e)}function OA(A,e){switch(A=+A,0|(e|=0)){case 1:A=A<0?A+6.283185307179586:A;break;case 2:A=A>0?A+-6.283185307179586:A}return+A}function NA(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))*6371.007180918475}function WA(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20624+(A<<3)>>3],0|(e=0))}function ZA(A,e){e|=0;var r=0;return(A|=0)>>>0>15?0|(e=4):(r=0|Ue(0|(r=0|$A(7,0,A,((0|A)<0)<<31>>31)),0|C(),120,0),A=0|C(),n[e>>2]=2|r,n[e+4>>2]=A,0|(e=0))}function JA(A,e,r,a,t){r|=0,a|=0,t|=0;var f,o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0;if(f=T,T=T+16|0,o=f,d=0|Se(0|(A|=0),0|(e|=0),52),C(),d&=15,k=0|Se(0|r,0|a,52),C(),(0|d)!=(15&k|0))return T=f,12;if(s=0|Se(0|A,0|e,45),C(),s&=127,b=0|Se(0|r,0|a,45),C(),s>>>0>121|(b&=127)>>>0>121)return T=f,5;if(k=(0|s)!=(0|b)){if(7==(0|(u=0|J(s,b))))return T=f,1;7==(0|(c=0|J(b,s)))?_(27291,27315,164,27325):(h=u,l=c)}else h=0,l=0;g=0|Y(s),w=0|Y(b),n[o>>2]=0,n[o+4>>2]=0,n[o+8>>2]=0,n[o+12>>2]=0;do{if(h){u=(0|(b=0|n[4272+(28*s|0)+(h<<2)>>2]))>0;A:do{if(w)if(u)for(s=0,c=r,u=a;;){switch(c=0|pA(c,u),u=0|C(),0|l){case 5:case 1:l=3;break;case 3:l=2;break;case 2:l=6;break;case 6:l=4;break;case 4:l=5}if((0|(s=s+1|0))==(0|b)){b=l,s=c,c=u;break A}}else b=l,s=r,c=a;else if(u)for(s=0,c=r,u=a;;){switch(c=0|TA(c,u),u=0|C(),0|l){case 1:l=3;break;case 3:l=2;break;case 2:l=6;break;case 6:l=4;break;case 4:l=5;break;case 5:l=1}if((0|(s=s+1|0))==(0|b)){b=l,s=c,c=u;break A}}else b=l,s=r,c=a}while(0);if(UA(s,c,o),k||_(27340,27315,194,27325),(u=0!=(0|g))&(l=0!=(0|w))&&_(27367,27315,195,27325),u){if(7==(0|(l=0|MA(A,e)))){l=5;break}if(0|i[21968+(7*l|0)+h>>0]){l=1;break}k=w=0|n[21136+(28*l|0)+(h<<2)>>2]}else if(l){if(7==(0|(l=0|MA(s,c)))){l=5;break}if(0|i[21968+(7*l|0)+b>>0]){l=1;break}k=0,w=0|n[21136+(28*b|0)+(l<<2)>>2]}else k=0,w=0;if((k|w|0)>=0){if((0|w)>0){b=0,c=0|n[(r=o+4|0)>>2],u=0|n[(a=o+8|0)>>2],l=0|n[(g=o+12|0)>>2];do{(0|(s=(0|(l=(m=(0|(c=l+c-(m=(e=(0|(B=u+c|0))<0)?B:0)-(s=(A=(0|(u=l+u-m|0))<0)?u:0)|0))<0)?0:c))<(0|(s=(0|(u=(A?0:u)-(c=m?c:0)|0))<(0|(c=(e?0:B)-s-c|0))?u:c))?l:s))>0&&(c=c-s|0,u=u-s|0,l=l-s|0),b=b+1|0}while((0|b)!=(0|w));n[r>>2]=c,n[a>>2]=u,n[g>>2]=l}if((h+-1|0)>>>0<6?(l=(l=0|n[22032+(12*h|0)>>2])-(u=(0|(u=(0|(m=0|n[22032+(12*h|0)+8>>2]))<(0|(u=(0|(c=0|n[22032+(12*h|0)+4>>2]))<(0|l)?c:l))?m:u))>0?u:0)|0,c=c-u|0,u=m-u|0):(l=0,c=0,u=0),d)for(;;){if(s=3*l|0,b=3*c|0,r=3*u|0,0|LA(d)?(l=(m=(0|(u=(0|(h=(u=(0|(c=l+r-((A=(0|(e=s+c|0))<0)?e:0)-((B=(0|(m=b+u-(A?e:0)|0))<0)?m:0)|0))<0)?0:c))<(0|(u=(0|(s=(B?0:m)-(u?c:0)|0))<(0|(c=(A?0:e)-(B?m:0)-(u?c:0)|0))?s:c))?h:u))>0)?u:0,s=s-(m?u:0)|0,u=h-(m?u:0)|0):(l=(m=(0|(u=(0|(h=(u=(0|(c=r+c-((e=(0|(B=s+u|0))<0)?B:0)-((l=(0|(m=b+l-(e?B:0)|0))<0)?m:0)|0))<0)?0:c))<(0|(u=(0|(s=(l?0:m)-(u?c:0)|0))<(0|(c=(e?0:B)-(l?m:0)-(u?c:0)|0))?s:c))?h:u))>0)?u:0,s=s-(m?u:0)|0,u=h-(m?u:0)|0),l=c-l|0,!((0|d)>1)){c=s;break}d=d+-1|0,c=s}if((0|k)>0){s=0;do{u=(u=(l=(0|(h=l+u-((A=(0|(e=l+c|0))<0)?e:0)-((B=(0|(m=c+u-(A?e:0)|0))<0)?m:0)|0))<0)?0:h)-((m=(0|(l=(0|u)<(0|(l=(0|(c=(B?0:m)-(l?h:0)|0))<(0|(h=(A?0:e)-(B?m:0)-(l?h:0)|0))?c:h))?u:l))>0)?l:0)|0,c=c-(m?l:0)|0,l=h-(m?l:0)|0,s=s+1|0}while((0|s)!=(0|k))}h=0|n[(d=o+8|0)>>2],m=0|n[(a=o+12|0)>>2],n[(r=o+4|0)>>2]=s=(0|n[r>>2])+l|0,n[d>>2]=c=h+c|0,n[a>>2]=l=m+u|0,u=c-s|0,(0|s)<0?(l=l-s|0,n[d>>2]=u,n[a>>2]=l,n[r>>2]=0,c=0):(u=c,c=s),(0|u)<0&&(n[r>>2]=c=c-u|0,n[a>>2]=l=l-u|0,n[d>>2]=0,u=0),b=c-l|0,s=u-l|0,(0|l)<0?(n[r>>2]=b,n[d>>2]=s,n[a>>2]=0,c=b,l=0):s=u,(0|(u=(0|l)<(0|(u=(0|s)<(0|c)?s:c))?l:u))>0?(n[r>>2]=c-u,n[d>>2]=s-u,n[a>>2]=l-u,B=77):B=77}else l=5}else if(UA(r,a,o),0!=(0|g)&0!=(0|w))if((0|b)!=(0|s)&&_(27398,27315,264,27325),7==(0|(u=0|MA(A,e)))|7==(0|(l=0|MA(r,a))))l=5;else if(0|i[21968+(7*u|0)+l>>0])l=1;else if((0|(r=0|n[21136+(28*u|0)+(l<<2)>>2]))>0){b=0,c=0|n[(d=o+4|0)>>2],u=0|n[(a=o+8|0)>>2],l=0|n[(g=o+12|0)>>2];do{(0|(s=(0|(l=(A=(0|(c=l+c-(A=(B=(0|(h=u+c|0))<0)?h:0)-(s=(e=(0|(u=l+u-A|0))<0)?u:0)|0))<0)?0:c))<(0|(s=(0|(u=(e?0:u)-(c=A?c:0)|0))<(0|(c=(B?0:h)-s-c|0))?u:c))?l:s))>0&&(c=c-s|0,u=u-s|0,l=l-s|0),b=b+1|0}while((0|b)!=(0|r));n[d>>2]=c,n[a>>2]=u,n[g>>2]=l,B=77}else B=77;else B=77}while(0);return 77==(0|B)&&(n[t>>2]=n[(l=o+4|0)>>2],n[t+4>>2]=n[l+4>>2],n[t+8>>2]=n[l+8>>2],l=0),T=f,0|l}function KA(A,e,r,i){r|=0,i|=0;var a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0;if(t=0|Se(0|(A|=0),0|(e|=0),52),C(),t&=15,v=0|Se(0|A,0|e,45),C(),(v&=127)>>>0>121)return 5;if(k=0|Y(v),He(0|t,0,52),o=134225919|C(),n[(f=i)>>2]=-1,n[f+4>>2]=o,f=0|n[r>>2],o=0|n[r+4>>2],r=0|n[r+8>>2],!t){a=(a=(r=(0|(B=r-(B=(e=(0|f)<0)?f:0)+((k=(0|(m=o-B|0))<0)?0-m|0:0)|0))<0)?0:B)-(m=(0|(m=(0|a)<(0|(m=(0|(r=(k?0:m)-(B=r?B:0)|0))<(0|(B=(e?0:f)-(k?m:0)-B|0))?r:B))?a:m))>0?m:0)|0,r=r-m|0;A:do{switch(B-m|0){case 0:switch(0|r){case 0:if(a){a=1==(0|a)?1:7,h=11;break A}a=0;break A;case 1:if(a){a=1==(0|a)?3:7,h=11;break A}a=2;break A;default:return 1}case 1:switch(0|r){case 0:if(a){a=1==(0|a)?5:7,h=11;break A}a=4;break A;case 1:if(!a){a=6;break A}return 1;default:return 1}default:return 1}}while(0);return 11==(0|h)&&7==(0|a)?0|(i=1):127==(0|(a=0|Z(v,a)))?0|(i=1):(m=0|He(0|a,0,45),v=0|C(),v|=-1040385&n[(h=i)+4>>2],n[i>>2]=n[h>>2]|m,n[i+4>>2]=v,0|(i=0))}for(;;){if(w=t,t=t+-1|0,l=(g=f-r|0)>>>0>715827881|(d=o-r|0)>>>0>715827881,0|LA(w)){if(l){if(s=2147483647-g|0,b=-2147483648-g|0,(c=(0|g)>0)?(0|s)<(0|g):(0|b)>(0|g)){a=1,h=107;break}if(y=g<<1,c?(2147483647-y|0)<(0|g):(-2147483648-y|0)>(0|g)){a=1,h=107;break}if((0|d)>0?(2147483647-d|0)<(0|d):(-2147483648-d|0)>(0|d)){a=1,h=107;break}if(l=3*g|0,u=d<<1,(c?(0|s)<(0|u):(0|b)>(0|u))||((0|g)>-1?(-2147483648|l|0)>=(0|d):(-2147483648^l|0)<(0|d))){a=1,h=107;break}}else l=3*g|0,u=d<<1;if(s=0|Ce(.14285714285714285*+(l-d|0)),l=(u=(0|(c=0|Ce(.14285714285714285*+(u+g|0))))<(0|s))?s:c,(0|(u=u?c:s))<0){if(-2147483648==(0|u)||((0|l)>0?(2147483647-l|0)<(0|u):(-2147483648-l|0)>(0|u))){h=24;break}if((0|l)>-1?(-2147483648|l|0)>=(0|u):(-2147483648^l|0)<(0|u)){h=24;break}}b=((b=(0|s)<0)?0:s)-((E=(0|(d=c-(b?s:0)|0))<0)?d:0)-((g=(0|(Q=(b?0-s|0:0)-(E?d:0)|0))<0)?Q:0)|0,d=(E?0:d)-(g?Q:0)|0,b=b-((E=(0|(g=(0|(Q=g?0:Q))<(0|(g=(0|d)<(0|b)?d:b))?Q:g))>0)?g:0)|0,d=d-(E?g:0)|0,l=(y=(0|(c=(0|(D=(c=(0|(s=(3*(g=Q-(E?g:0)|0)|0)+b-((Q=(0|(E=(3*b|0)+d|0))<0)?E:0)-((l=(0|(y=(3*d|0)+g-(Q?E:0)|0))<0)?y:0)|0))<0)?0:s))<(0|(c=(0|(u=(l?0:y)-(c?s:0)|0))<(0|(s=(Q?0:E)-(l?y:0)-(c?s:0)|0))?u:s))?D:c))>0)?c:0,u=u-(y?c:0)|0,c=D-(y?c:0)|0}else{if(l){if((u=(0|g)>0)?(2147483647-g|0)<(0|g):(-2147483648-g|0)>(0|g)){a=1,h=107;break}if(l=g<<1,(c=(0|d)>0)?(2147483647-d|0)<(0|d):(-2147483648-d|0)>(0|d)){a=1,h=107;break}if(b=d<<1,c?(2147483647-b|0)<(0|d):(-2147483648-b|0)>(0|d)){a=1,h=107;break}if(u?(2147483647-l|0)<(0|d):(-2147483648-l|0)>(0|d)){a=1,h=107;break}if(u=3*d|0,(0|d)>-1?(-2147483648|u|0)>=(0|g):(-2147483648^u|0)<(0|g)){a=1,h=107;break}}else l=g<<1,u=3*d|0;if(s=0|Ce(.14285714285714285*+(l+d|0)),l=(u=(0|(c=0|Ce(.14285714285714285*+(u-g|0))))<(0|s))?s:c,(0|(u=u?c:s))<0){if(-2147483648==(0|u)||((0|l)>0?(2147483647-l|0)<(0|u):(-2147483648-l|0)>(0|u))){h=36;break}if((0|l)>-1?(-2147483648|l|0)>=(0|u):(-2147483648^l|0)<(0|u)){h=36;break}}b=((b=(0|s)<0)?0:s)-((D=(0|(d=c-(b?s:0)|0))<0)?d:0)-((g=(0|(y=(b?0-s|0:0)-(D?d:0)|0))<0)?y:0)|0,d=(D?0:d)-(g?y:0)|0,b=b-((D=(0|(g=(0|(y=g?0:y))<(0|(g=(0|d)<(0|b)?d:b))?y:g))>0)?g:0)|0,d=d-(D?g:0)|0,l=(Q=(0|(c=(0|(E=(c=(0|(s=(3*(g=y-(D?g:0)|0)|0)+d-((y=(0|(D=(3*b|0)+g|0))<0)?D:0)-((l=(0|(Q=(3*d|0)+b-(y?D:0)|0))<0)?Q:0)|0))<0)?0:s))<(0|(c=(0|(u=(l?0:Q)-(c?s:0)|0))<(0|(s=(y?0:D)-(l?Q:0)-(c?s:0)|0))?u:s))?E:c))>0)?c:0,u=u-(Q?c:0)|0,c=E-(Q?c:0)|0}c=(f=(0|(Q=r-c+((D=(0|(l=f+(l-s)|0))<0)?0-l|0:0)+((s=(0|(u=o-u-(D?l:0)|0))<0)?0-u|0:0)|0))<0)?0:Q,y=(s?0:u)-(f?Q:0)|0,Q=(Q=(D?0:l)-(s?u:0)-(f?Q:0)|0)-((r=(0|(f=(0|c)<(0|(f=(0|y)<(0|Q)?y:Q))?c:f))>0)?f:0)|0,s=0|n[(u=i)>>2],u=0|n[u+4>>2],l=s&~(l=0|He(7,0,0|(o=3*(15-w|0)|0))),u&=~(0|C()),r=(r=(f=(0|(D=c-(r?f:0)-(D=(s=(0|Q)<0)?Q:0)+((E=(0|(y=y-(r?f:0)-D|0))<0)?0-y|0:0)|0))<0)?0:D)-(y=(0|(y=(0|r)<(0|(y=(0|(f=(E?0:y)-(D=f?D:0)|0))<(0|(D=(s?0:Q)-(E?y:0)-D|0))?f:D))?r:y))>0?y:0)|0,f=f-y|0;A:do{switch(D-y|0){case 0:switch(0|f){case 0:r=0==(0|r)?0:1==(0|r)?1:7;break A;case 1:r=0==(0|r)?2:1==(0|r)?3:7;break A;default:h=45;break A}case 1:switch(0|f){case 0:r=0==(0|r)?4:1==(0|r)?5:7;break A;case 1:if(r){h=45;break A}r=6;break A;default:h=45;break A}default:h=45}}while(0);if(45==(0|h)&&(h=0,r=7),E=0|He(0|r,0,0|o),D=0|C()|u,n[(y=i)>>2]=E|l,n[y+4>>2]=D,(0|w)<=1){h=47;break}f=b,o=d,r=g}if(24==(0|h))_(27634,27425,416,27447);else if(36==(0|h))_(27634,27425,464,27461);else{if(47==(0|h)){if((0|b)>1|(0|d)>1|(0|g)>1)return 1;r=(r=(t=(0|(D=g-(D=(Q=(0|b)<0)?b:0)+((E=(0|(y=d-D|0))<0)?0-y|0:0)|0))<0)?0:D)-(y=(0|(y=(0|r)<(0|(y=(0|(t=(E?0:y)-(D=t?D:0)|0))<(0|(D=(Q?0:b)-(E?y:0)-D|0))?t:D))?r:y))>0?y:0)|0,t=t-y|0;A:do{switch(D-y|0){case 0:switch(0|t){case 0:t=0==(0|r)?0:1==(0|r)?1:7;break A;case 1:t=0==(0|r)?2:1==(0|r)?3:7;break A;default:h=55;break A}case 1:switch(0|t){case 0:t=0==(0|r)?4:1==(0|r)?5:7;break A;case 1:if(r){h=55;break A}t=6;break A;default:h=55;break A}default:h=55}}while(0);55==(0|h)&&(t=7),u=127==(0|(o=0|Z(v,t)))?0:0|Y(o);A:do{if(t){if(k){if(7==(0|(r=0|MA(A,e))))return 5;f=0|n[21344+(28*r|0)+(t<<2)>>2];e:do{if((0|f)>0)for(r=t,t=0;;){switch(0|r){case 1:r=5;break;case 5:r=4;break;case 4:r=6;break;case 6:r=2;break;case 2:r=3;break;case 3:r=1}if((0|(t=t+1|0))==(0|f))break e}else r=t}while(0);if(1==(0|r))return 9;127==(0|(t=0|Z(v,r)))&&_(27476,27315,415,27506),0|Y(t)?_(27521,27315,416,27506):(a=t,m=f,B=r)}else a=o,m=0,B=t;if((0|(l=0|n[4272+(28*v|0)+(B<<2)>>2]))<=-1&&_(27552,27315,423,27506),!u){if((0|m)<0)return 5;if(0|m){r=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];do{t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,r=r+1|0}while((0|r)<(0|m))}if((0|l)<=0){h=104;break}for(r=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];;)if(t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,(0|(r=r+1|0))==(0|l)){h=104;break A}}if(7==(0|(o=0|J(a,v)))&&_(27291,27315,432,27506),t=0|n[(r=i)>>2],r=0|n[r+4>>2],(0|l)>0){f=0;do{t=0|IA(t,r),r=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=r,f=f+1|0}while((0|f)!=(0|l))}if(7==(0|(r=0|MA(t,r)))&&_(27634,27315,444,27506),t=0|j(a),(0|(t=0|n[(t?21760:21552)+(28*o|0)+(r<<2)>>2]))<0&&_(27634,27315,458,27506),t){r=0,f=0|n[(o=i)>>2],o=0|n[o+4>>2];do{f=0|PA(f,o),o=0|C(),n[(y=i)>>2]=f,n[y+4>>2]=o,r=r+1|0}while((0|r)<(0|t));h=104}else h=104}else if(0!=(0|k)&0!=(0|u)){if(7==(0|(a=0|MA(A,e)))|7==(0|(r=0|MA(0|n[(r=i)>>2],0|n[r+4>>2]))))return 5;if((0|(r=0|n[21344+(28*a|0)+(r<<2)>>2]))<0)return 5;if(r){a=0,t=0|n[(f=i)>>2],f=0|n[f+4>>2];do{t=0|IA(t,f),f=0|C(),n[(y=i)>>2]=t,n[y+4>>2]=f,a=a+1|0}while((0|a)<(0|r));a=o,h=104}else a=o,h=105}else a=o,h=104}while(0);return 104==(0|h)&&u&&(h=105),105==(0|h)&&1==(0|MA(0|n[(y=i)>>2],0|n[y+4>>2]))?0|(y=9):(Q=0|n[(D=i)>>2],D=-1040385&n[D+4>>2],E=0|He(0|a,0,45),D=0|D|C(),n[(y=i)>>2]=Q|E,n[y+4>>2]=D,0|(y=0))}if(107==(0|h))return 0|a}return 0}function XA(A,e,r,i,a){r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0;return t=T,T=T+32|0,u=t,0|(o=0|JA(A|=0,e|=0,A,e,l=t+12|0))?(T=t,0|(u=o)):0|(A=0|JA(A,e,r,i,u))?(T=t,0|(u=A)):(l=(l=(o=(0|(i=(0|n[l+8>>2])-(0|n[u+8>>2])+(i=(f=(0|(A=(0|n[l>>2])-(0|n[u>>2])|0))<0)?0-A|0:0)+((e=(0|(r=i+((0|n[l+4>>2])-(0|n[u+4>>2]))|0))<0)?0-r|0:0)|0))<0)?0:i)-(u=(0|(u=(0|l)<(0|(u=(0|(o=(e?0:r)-(i=o?i:0)|0))<(0|(i=(f?0:A)-(e?r:0)-i|0))?o:i))?l:u))>0?u:0)|0,o=o-u|0,l=(0|(u=(0|(u=i-u|0))>-1?u:0-u|0))>(0|(l=(0|(o=(0|o)>-1?o:0-o|0))>(0|(l=(0|l)>-1?l:0-l|0))?o:l))?u:l,n[(u=a)>>2]=l,n[u+4>>2]=((0|l)<0)<<31>>31,T=t,0|(u=0))}function qA(A,e,r,i,a,t,f,o,u,c,s){A|=0,e|=0,r|=0,i|=0,a|=0,t|=0,f|=0,o|=0,u|=0,c|=0,s|=0;var b,d,g,w,k,B,h,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,F=0;if(h=T,T=T+48|0,v=h+12|0,B=h,n[(m=h+24|0)>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,n[v>>2]=0,n[v+4>>2]=0,n[v+8>>2]=0,0|JA(A,e,A,e,m)&&_(27634,27315,696,27575),0|JA(A,e,r,i,v)&&_(27634,27315,701,27575),n[m>>2]=r=(i=0|n[(D=m+8|0)>>2])-(0|n[m>>2])|0,n[(p=m+4|0)>>2]=i=(0|n[p>>2])-i|0,n[D>>2]=m=0-(p=i+r|0)|0,n[v>>2]=y=(M=0|n[(D=v+8|0)>>2])-(0|n[v>>2])|0,n[(I=v+4|0)>>2]=M=(0|n[I>>2])-M|0,n[D>>2]=0-(I=M+y|0),w=(P=1/(+(a>>>0)+4294967296*+(0|t)))*+(y-r|0),k=P*+(M-i|0),P*=+(p-I|0),n[B>>2]=r,n[(I=B+4|0)>>2]=i,n[(p=B+8|0)>>2]=m,(0|t)<0)return T=h,0;for(g=+(0|r),d=+(0|i),b=+(0|m),y=0,M=0;;){if(F=w*(E=+(y>>>0)+4294967296*+(0|M))+g,Q=k*E+d,E=P*E+b,i=~~+Oe(+F),m=~~+Oe(+Q),r=~~+Oe(+E),(F=+l(+(+(0|i)-F)))>(Q=+l(+(+(0|m)-Q)))&F>(E=+l(+(+(0|r)-E)))?i=0-(v=r+m|0)|0:(v=0-i|0,Q>E&&(m=v-r|0)),n[I>>2]=m,n[B>>2]=v,n[p>>2]=0,r=i+m|0,(0|i)>0?(n[I>>2]=r,n[p>>2]=i,n[B>>2]=0,v=0):(r=m,i=0),(0|r)<0?(n[B>>2]=m=v-r|0,n[p>>2]=i=i-r|0,n[I>>2]=0,v=m-i|0,r=0-i|0,(0|i)<0?(n[B>>2]=v,n[I>>2]=r,n[p>>2]=0,D=r,i=0):(D=0,v=m)):D=r,(0|(r=(0|i)<(0|(r=(0|D)<(0|v)?D:v))?i:r))>0&&(n[B>>2]=v-r,n[I>>2]=D-r,n[p>>2]=i-r),r=0|pe(0|(r=0|Ue(0|y,0|M,0|c,0|s)),0|C(),0|o,0|u),C(),0|(r=0|KA(A,e,B,f+(r<<3)|0))){i=20;break}if(D=y,y=0|pe(0|y,0|M,1,0),v=M,M=0|C(),!((0|v)<(0|t)|(0|v)==(0|t)&D>>>0<a>>>0)){r=0,i=20;break}}return 20==(0|i)?(T=h,0|r):0}function $A(A,e,r,i){A|=0,e|=0;var n=0,a=0,t=0;if(0==(0|(r|=0))&0==(0|(i|=0)))return a=1,D(0|(n=0)),0|a;a=A,n=e,A=1,e=0;do{A=0|Ue(0|((t=0==(1&r|0)&!0)?1:a),0|(t?0:n),0|A,0|e),e=0|C(),r=0|Ve(0|r,0|i,1),i=0|C(),a=0|Ue(0|a,0|n,0|a,0|n),n=0|C()}while(!(0==(0|r)&0==(0|i)));return D(0|e),0|A}function Ae(A,e,r,i){r|=0,i|=0;var t,f=0,o=0,l=0,u=0,s=0,b=0;t=T,T=T+16|0,o=t,l=0|Se(0|(A|=0),0|(e|=0),52),C(),l&=15;do{if(l){if(!(f=0|xA(A,e,o))){u=1/+c(+(s=+a[o>>3])),a[r>>3]=s+(b=+a[26032+(l<<3)>>3]),a[r+8>>3]=s-b,a[r+16>>3]=(u*=b)+(s=+a[o+8>>3]),a[r+24>>3]=s-u;break}return T=t,0|f}if(f=0|Se(0|A,0|e,45),C(),(f&=127)>>>0>121)return T=t,5;n[r>>2]=n[(o=22128+(f<<5)|0)>>2],n[r+4>>2]=n[o+4>>2],n[r+8>>2]=n[o+8>>2],n[r+12>>2]=n[o+12>>2],n[r+16>>2]=n[o+16>>2],n[r+20>>2]=n[o+20>>2],n[r+24>>2]=n[o+24>>2],n[r+28>>2]=n[o+28>>2];break}while(0);return function(A,e){var r,i,n,t,f,o,l,u=0,c=0;u=(t=+a[(n=16+(A|=0)|0)>>3])-(i=+a[(r=A+24|0)>>3]),c=+a[A>>3],u=.5*((u=t<i?u+6.283185307179586:u)*(e=+e)-u),a[A>>3]=(c+=e=.5*((l=c-(o=+a[(f=A+8|0)>>3]))*e-l))>1.5707963267948966?1.5707963267948966:c,a[f>>3]=(e=o-e)<-1.5707963267948966?-1.5707963267948966:e,a[n>>3]=(e=(e=t+u)>3.141592653589793?e+-6.283185307179586:e)<-3.141592653589793?e+6.283185307179586:e,a[r>>3]=(e=(e=i-u)>3.141592653589793?e+-6.283185307179586:e)<-3.141592653589793?e+6.283185307179586:e}(r,i?1.4:1.1),(0|n[(i=26160+(l<<3)|0)>>2])==(0|A)&&(0|n[i+4>>2])==(0|e)&&(a[r>>3]=1.5707963267948966),(0|n[(l=26288+(l<<3)|0)>>2])==(0|A)&&(0|n[l+4>>2])==(0|e)&&(a[r+8>>3]=-1.5707963267948966),1.5707963267948966!=+a[r>>3]&&-1.5707963267948966!=+a[r+8>>3]?(T=t,0|(l=0)):(a[r+16>>3]=3.141592653589793,a[r+24>>3]=-3.141592653589793,T=t,0|(l=0))}function ee(A,e,r,a){A|=0,e|=0,r|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0;o=T,T=T+48|0,t=o+40|0,f=o,QA(u=o+32|0,0,0,0),c=0|n[u>>2],u=0|n[u+4>>2];do{if(r>>>0<=15){if(0|(l=0|te(a))){n[(a=f)>>2]=0,n[a+4>>2]=0,n[f+8>>2]=l,n[f+12>>2]=-1,c=f+29|0,n[(a=f+16|0)>>2]=0,n[a+4>>2]=0,n[a+8>>2]=0,i[a+12>>0]=0,i[c>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}if(l=0|Me(1+(0|n[e+8>>2])|0,32)){fe(e,l),n[(s=f)>>2]=c,n[s+4>>2]=u,n[f+8>>2]=0,n[f+12>>2]=r,n[f+16>>2]=a,n[f+20>>2]=e,n[f+24>>2]=l,i[f+28>>0]=0,i[(c=f+29|0)>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}n[(a=f)>>2]=0,n[a+4>>2]=0,n[f+8>>2]=13,n[f+12>>2]=-1,c=f+29|0,n[(a=f+16|0)>>2]=0,n[a+4>>2]=0,n[a+8>>2]=0,i[a+12>>0]=0,i[c>>0]=0|i[t>>0],i[c+1>>0]=0|i[t+1>>0],i[c+2>>0]=0|i[t+2>>0];break}n[(c=f)>>2]=0,n[c+4>>2]=0,n[f+8>>2]=4,n[f+12>>2]=-1,s=f+29|0,n[(c=f+16|0)>>2]=0,n[c+4>>2]=0,n[c+8>>2]=0,i[c+12>>0]=0,i[s>>0]=0|i[t>>0],i[s+1>>0]=0|i[t+1>>0],i[s+2>>0]=0|i[t+2>>0]}while(0);re(f),n[A>>2]=n[f>>2],n[A+4>>2]=n[f+4>>2],n[A+8>>2]=n[f+8>>2],n[A+12>>2]=n[f+12>>2],n[A+16>>2]=n[f+16>>2],n[A+20>>2]=n[f+20>>2],n[A+24>>2]=n[f+24>>2],n[A+28>>2]=n[f+28>>2],T=o}function re(A){var e,r,a,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0;if(t=T,T=T+336|0,e=t+168|0,r=t,0==(0|(o=0|n[(l=A|=0)>>2]))&0==(0|(l=0|n[l+4>>2])))T=t;else{if(0|i[(f=A+28|0)>>0]?(o=0|ie(o,l),l=0|C()):i[f>>0]=1,!(0|n[n[(a=A+20|0)>>2]>>2]))return 0|(o=0|n[(f=A+24|0)>>2])&&ye(o),n[(Q=A)>>2]=0,n[Q+4>>2]=0,n[A+8>>2]=0,n[a>>2]=0,n[A+12>>2]=-1,n[A+16>>2]=0,n[f>>2]=0,void(T=t);u=15&(f=0|n[(Q=A+16|0)>>2]);A:do{if(0==(0|o)&0==(0|l))v=A+24|0;else{h=A+12|0,k=3==(0|u),w=255&f,d=3==(1|u),B=A+24|0,g=(u+-1|0)>>>0<3,s=3==(2|u),b=r+8|0;e:for(;;){if(c=0|Se(0|o,0|l,52),C(),(0|(c&=15))==(0|n[h>>2])){switch(15&w){case 0:case 2:case 3:if(0|(u=0|xA(o,l,e))){m=15;break e}if(0|oe(0|n[a>>2],0|n[B>>2],e)){m=19;break e}}if(d&&(n[e>>2]=n[(u=0|n[4+(0|n[a>>2])>>2])>>2],n[e+4>>2]=n[u+4>>2],n[e+8>>2]=n[u+8>>2],n[e+12>>2]=n[u+12>>2],0|q(26896,e))){if(0|GA(0|n[4+(0|n[a>>2])>>2],c,r)){m=25;break}if((0|n[(u=r)>>2])==(0|o)&&(0|n[u+4>>2])==(0|l)){m=29;break}}if(g){if(0|(u=0|VA(o,l,e))){m=32;break}if(0|Ae(o,l,r,0)){m=36;break}if(s&&0|le(0|n[a>>2],0|n[B>>2],e,r)){m=42;break}if(d&&0|ce(0|n[a>>2],0|n[B>>2],e,r)){m=42;break}}if(k){if(f=0|Ae(o,l,e,1),u=0|n[B>>2],0|f){m=45;break}if(0|$(u,e)){if(eA(r,e),0|AA(e,0|n[B>>2])){m=53;break}if(0|oe(0|n[a>>2],0|n[B>>2],b)){m=53;break}if(0|ce(0|n[a>>2],0|n[B>>2],r,e)){m=53;break}}}}do{if((0|c)<(0|n[h>>2])){if(f=0|Ae(o,l,e,1),u=0|n[B>>2],0|f){m=58;break e}if(!(0|$(u,e))){m=73;break}if(0|AA(0|n[B>>2],e)&&(eA(r,e),0|le(0|n[a>>2],0|n[B>>2],r,e))){m=65;break e}if(0|(o=0|yA(o,l,c+1|0,r))){m=67;break e}o=0|n[(l=r)>>2],l=0|n[l+4>>2]}else m=73}while(0);if(73==(0|m)&&(m=0,o=0|ie(o,l),l=0|C()),0==(0|o)&0==(0|l)){v=B;break A}}switch(0|m){case 15:0|(f=0|n[B>>2])&&ye(f),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=u,m=20;break;case 19:n[A>>2]=o,n[A+4>>2]=l,m=20;break;case 25:_(27634,27600,470,27611);break;case 29:return n[A>>2]=o,n[A+4>>2]=l,void(T=t);case 32:return 0|(f=0|n[B>>2])&&ye(f),n[(v=A)>>2]=0,n[v+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=u,void(T=t);case 36:_(27634,27600,493,27611);break;case 42:return n[A>>2]=o,n[A+4>>2]=l,void(T=t);case 45:0|u&&ye(u),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=f,m=55;break;case 53:n[A>>2]=o,n[A+4>>2]=l,m=55;break;case 58:0|u&&ye(u),n[(m=A)>>2]=0,n[m+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=f,m=71;break;case 65:n[A>>2]=o,n[A+4>>2]=l,m=71;break;case 67:return 0|(f=0|n[B>>2])&&ye(f),n[(v=A)>>2]=0,n[v+4>>2]=0,n[a>>2]=0,n[h>>2]=-1,n[Q>>2]=0,n[B>>2]=0,n[A+8>>2]=o,void(T=t)}if(20==(0|m))return void(T=t);if(55==(0|m))return void(T=t);if(71==(0|m))return void(T=t)}}while(0);0|(f=0|n[v>>2])&&ye(f),n[(m=A)>>2]=0,n[m+4>>2]=0,n[A+8>>2]=0,n[a>>2]=0,n[A+12>>2]=-1,n[Q>>2]=0,n[v>>2]=0,T=t}}function ie(A,e){var r,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0;r=T,T=T+16|0,s=r,a=0|Se(0|(A|=0),0|(e|=0),52),C(),a&=15,i=0|Se(0|A,0|e,45),C();do{if(a){for(;i=0|He(a+4095|0,0,52),t=0|C()|-15728641&e,i=i|A|(o=0|He(7,0,0|(f=3*(15-a|0)|0))),t|=l=0|C(),u=0|Se(0|A,0|e,0|f),C(),a=a+-1|0,!((u&=7)>>>0<6);){if(!a){c=4;break}e=t,A=i}if(4==(0|c)){i=0|Se(0|i,0|t,45),C();break}return s=0|He(((s=0==(0|u)&0!=(0|CA(i,t)))?2:1)+u|0,0,0|f),c=0|C()|e&~l,s|=A&~o,D(0|c),T=r,0|s}}while(0);return(i&=127)>>>0>120?(s=0,D(0|(c=0)),T=r,0|s):(QA(s,0,i+1|0,0),c=0|n[s+4>>2],s=0|n[s>>2],D(0|c),T=r,0|s)}function ne(A,e,r){A|=0;var i,t,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0;if(!(0|q(e|=0,r|=0)))return 0;if(e=0|function(A){return+a[16+(A|=0)>>3]<+a[A+24>>3]|0}(e),f=+a[r>>3],o=e&(o=+a[r+8>>3])<0?o+6.283185307179586:o,(0|(t=0|n[A>>2]))<=0)return 0;if(i=0|n[A+4>>2],e){e=0,d=o,r=-1,A=0;A:for(;;){for(b=A;o=+a[i+(b<<4)+8>>3],c=+a[i+((A=(r+2|0)%(0|t)|0)<<4)+8>>3],(u=+a[i+(b<<4)>>3])>(l=+a[i+(A<<4)>>3])?(s=u,u=c):(s=l,l=u,u=o,o=c),(f=f==l|f==s?f+2.220446049250313e-16:f)<l|f>s;){if((0|(r=b+1|0))>=(0|t)){r=22;break A}A=b,b=r,r=A}if(((s=(c=u<0?u+6.283185307179586:u)+(f-l)/(s-l)*((u=o<0?o+6.283185307179586:o)-c))<0?s+6.283185307179586:s)>(d=c==d|u==d?d+-2.220446049250313e-16:d)&&(e^=1),(0|(A=b+1|0))>=(0|t)){r=22;break}r=b}if(22==(0|r))return 0|e}else{e=0,d=o,r=-1,A=0;A:for(;;){for(b=A;o=+a[i+(b<<4)+8>>3],c=+a[i+((A=(r+2|0)%(0|t)|0)<<4)+8>>3],(u=+a[i+(b<<4)>>3])>(l=+a[i+(A<<4)>>3])?(s=u,u=c):(s=l,l=u,u=o,o=c),(f=f==l|f==s?f+2.220446049250313e-16:f)<l|f>s;){if((0|(r=b+1|0))>=(0|t)){r=22;break A}A=b,b=r,r=A}if(u+(f-l)/(s-l)*(o-u)>(d=u==d|o==d?d+-2.220446049250313e-16:d)&&(e^=1),(0|(A=b+1|0))>=(0|t)){r=22;break}r=b}if(22==(0|r))return 0|e}return 0}function ae(A,e){e|=0;var r,i,t,f,o,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0;if(!(i=0|n[(A|=0)>>2]))return n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,void(n[e+28>>2]=0);if(a[(t=e+8|0)>>3]=1.7976931348623157e308,a[(f=e+24|0)>>3]=1.7976931348623157e308,a[e>>3]=-1.7976931348623157e308,a[(o=e+16|0)>>3]=-1.7976931348623157e308,!((0|i)<=0)){for(r=0|n[A+4>>2],k=1.7976931348623157e308,B=-1.7976931348623157e308,h=0,A=-1,b=1.7976931348623157e308,d=1.7976931348623157e308,w=-1.7976931348623157e308,c=-1.7976931348623157e308,m=0;g=+a[r+(m<<4)+8>>3],s=+a[r+(((0|(A=A+2|0))==(0|i)?0:A)<<4)+8>>3],(u=+a[r+(m<<4)>>3])<b&&(a[t>>3]=u,b=u),g<d&&(a[f>>3]=g,d=g),u>w?a[e>>3]=u:u=w,g>c&&(a[o>>3]=g,c=g),k=g>0&g<k?g:k,B=g<0&g>B?g:B,h|=+l(+(g-s))>3.141592653589793,(0|(A=m+1|0))!=(0|i);)v=m,w=u,m=A,A=v;h&&(a[o>>3]=B,a[f>>3]=k)}}function te(A){return 0|((A|=0)>>>0<4?0:15)}function fe(A,e){e|=0;var r,i=0,t=0,f=0,o=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,C=0,_=0;if(B=0|n[(A|=0)>>2]){if(a[(h=e+8|0)>>3]=1.7976931348623157e308,a[(m=e+24|0)>>3]=1.7976931348623157e308,a[e>>3]=-1.7976931348623157e308,a[(v=e+16|0)>>3]=-1.7976931348623157e308,(0|B)>0){for(f=0|n[A+4>>2],w=1.7976931348623157e308,k=-1.7976931348623157e308,t=0,i=-1,s=1.7976931348623157e308,b=1.7976931348623157e308,g=-1.7976931348623157e308,u=-1.7976931348623157e308,Q=0;d=+a[f+(Q<<4)+8>>3],c=+a[f+(((0|(C=i+2|0))==(0|B)?0:C)<<4)+8>>3],(o=+a[f+(Q<<4)>>3])<s&&(a[h>>3]=o,s=o),d<b&&(a[m>>3]=d,b=d),o>g?a[e>>3]=o:o=g,d>u&&(a[v>>3]=d,u=d),w=d>0&d<w?d:w,k=d<0&d>k?d:k,t|=+l(+(d-c))>3.141592653589793,(0|(i=Q+1|0))!=(0|B);)C=Q,g=o,Q=i,i=C;t&&(a[v>>3]=k,a[m>>3]=w)}}else n[e>>2]=0,n[e+4>>2]=0,n[e+8>>2]=0,n[e+12>>2]=0,n[e+16>>2]=0,n[e+20>>2]=0,n[e+24>>2]=0,n[e+28>>2]=0;if(!((0|(i=0|n[(C=A+8|0)>>2]))<=0)){r=A+12|0,D=0;do{if(t=D,m=e+((D=D+1|0)<<5)|0,v=0|n[(f=0|n[r>>2])+(t<<3)>>2]){if(a[(Q=e+(D<<5)+8|0)>>3]=1.7976931348623157e308,a[(A=e+(D<<5)+24|0)>>3]=1.7976931348623157e308,a[m>>3]=-1.7976931348623157e308,a[(E=e+(D<<5)+16|0)>>3]=-1.7976931348623157e308,(0|v)>0){for(B=0|n[f+(t<<3)+4>>2],w=1.7976931348623157e308,k=-1.7976931348623157e308,f=0,t=-1,h=0,s=1.7976931348623157e308,b=1.7976931348623157e308,d=-1.7976931348623157e308,u=-1.7976931348623157e308;g=+a[B+(h<<4)+8>>3],c=+a[B+(((0|(t=t+2|0))==(0|v)?0:t)<<4)+8>>3],(o=+a[B+(h<<4)>>3])<s&&(a[Q>>3]=o,s=o),g<b&&(a[A>>3]=g,b=g),o>d?a[m>>3]=o:o=d,g>u&&(a[E>>3]=g,u=g),w=g>0&g<w?g:w,k=g<0&g>k?g:k,f|=+l(+(g-c))>3.141592653589793,(0|(t=h+1|0))!=(0|v);)_=h,h=t,d=o,t=_;f&&(a[E>>3]=k,a[A>>3]=w)}}else n[m>>2]=0,n[m+4>>2]=0,n[m+8>>2]=0,n[m+12>>2]=0,n[m+16>>2]=0,n[m+20>>2]=0,n[m+24>>2]=0,n[m+28>>2]=0,i=0|n[C>>2]}while((0|D)<(0|i))}}function oe(A,e,r){var i,a=0;if(!(0|ne(A|=0,e|=0,r|=0)))return 0;if((0|n[(i=A+8|0)>>2])<=0)return 1;for(a=A+12|0,A=0;;){if(0|ne((0|n[a>>2])+(A<<3)|0,e+((A=A+1|0)<<5)|0,r)){A=0,a=6;break}if((0|A)>=(0|n[i>>2])){A=1,a=6;break}}return 6==(0|a)?0|A:0}function le(A,e,r,i){i|=0;var a,t,f,o=0,l=0,u=0;if(t=T,T=T+16|0,a=t,!(0|ne(A|=0,e|=0,u=8+(r|=0)|0)))return T=t,0;f=A+8|0;A:do{if((0|n[f>>2])>0){for(l=A+12|0,o=0;;){if(0|ne((0|n[l>>2])+(o<<3)|0,e+((o=o+1|0)<<5)|0,u)){o=0;break}if((0|o)>=(0|n[f>>2]))break A}return T=t,0|o}}while(0);if(0|ue(A,e,r,i))return T=t,0;n[a>>2]=n[r>>2],n[a+4>>2]=u,o=0|n[f>>2];A:do{if((0|o)>0)for(A=A+12|0,u=0,l=o;;){if((0|n[(o=0|n[A>>2])+(u<<3)>>2])>0){if(0|ne(a,i,0|n[o+(u<<3)+4>>2])){o=0;break A}if(0|ue((0|n[A>>2])+(u<<3)|0,e+((o=u+1|0)<<5)|0,r,i)){o=0;break A}l=0|n[f>>2]}else o=u+1|0;if(!((0|o)<(0|l))){o=1;break}u=o}else o=1}while(0);return T=t,0|o}function ue(A,e,r,i){A|=0,r|=0;var t,f,o,l,u,c,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,C=0,_=0;if(c=T,T=T+176|0,l=c+172|0,s=c+168|0,u=c,!(0|$(e|=0,i|=0)))return T=c,0;if(function(A,e,r,i){var t,f,o,l,u;i|=0,t=(l=+a[16+(e|=0)>>3])<(o=+a[e+24>>3]),e=(u=+a[24+(A|=0)>>3])-l<o-(f=+a[A+16>>3]),n[(r|=0)>>2]=(A=f<u)?t|e?1:2:0,n[i>>2]=t?A?1:e?2:1:0}(e,i,l,s),Ne(0|u,0|r,168),(0|n[r>>2])>0){e=0;do{Q=+OA(+a[(C=u+8+(e<<4)+8|0)>>3],0|n[s>>2]),a[C>>3]=Q,e=e+1|0}while((0|e)<(0|n[r>>2]))}f=+a[i>>3],o=+a[i+8>>3],Q=+OA(+a[i+16>>3],0|n[s>>2]),t=+OA(+a[i+24>>3],0|n[s>>2]);A:do{if((0|n[A>>2])>0){if(i=A+4|0,(0|(s=0|n[u>>2]))<=0)for(e=0;;)if((0|(e=e+1|0))>=(0|n[A>>2])){e=0;break A}for(r=0;;){if(m=+a[(e=0|n[i>>2])+(r<<4)>>3],v=+OA(+a[e+(r<<4)+8>>3],0|n[l>>2]),b=+a[(e=0|n[i>>2])+((C=(0|(r=r+1|0))%(0|n[A>>2])|0)<<4)>>3],d=+OA(+a[e+(C<<4)+8>>3],0|n[l>>2]),!(m>=f)|!(b>=f)&&!(m<=o)|!(b<=o)&&!(v<=t)|!(d<=t)&&!(v>=Q)|!(d>=Q)){h=b-m,k=d-v,e=0;do{if(_=e,!(0==(B=h*(d=+a[u+8+((C=(0|(e=e+1|0))==(0|s)?0:e)<<4)+8>>3]-(b=+a[u+8+(_<<4)+8>>3]))-k*(w=+a[u+8+(C<<4)>>3]-(g=+a[u+8+(_<<4)>>3])))||(E=v-b,D=m-g,w=(E*w-d*D)/B,w<0|w>1))&&(B=(h*E-k*D)/B)>=0&B<=1){e=1;break A}}while((0|e)<(0|s))}if((0|r)>=(0|n[A>>2])){e=0;break}}}else e=0}while(0);return T=c,0|e}function ce(A,e,r,i){var a,t=0;if(0|ue(A|=0,e|=0,r|=0,i|=0))return 1;if((0|n[(a=A+8|0)>>2])<=0)return 0;for(t=A+12|0,A=0;;){if(0|ue((0|n[t>>2])+(A<<3)|0,e+((A=A+1|0)<<5)|0,r,i)){A=1,t=6;break}if((0|A)>=(0|n[a>>2])){A=0,t=6;break}}return 6==(0|t)?0|A:0}function se(A,e,r,i,n){var t,f,o,l,u,c,s,b=0;a[(n|=0)>>3]=(l=+a[(A|=0)>>3])+(o=+a[(e|=0)>>3]-l)*(b=((b=+a[(i|=0)>>3]-(c=+a[(r|=0)>>3]))*((f=+a[A+8>>3])-(s=+a[r+8>>3]))-(l-c)*(u=+a[i+8>>3]-s))/(o*u-(t=+a[e+8>>3]-f)*b)),a[n+8>>3]=f+t*b}function be(A,e){return+l(+(+a[(A|=0)>>3]-+a[(e|=0)>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[A+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function de(A,e,r){r|=0;var i,a,t,f,o=0,l=0,u=0,c=0;if(f=T,T=T+32|0,c=f,0|(o=0|zA(A|=0,e|=0,a=f+16|0)))return T=f,0|o;i=0|mA(A,e),t=0|MA(A,e),function(A,e){n[(e|=0)>>2]=n[(A=7696+(28*(A|=0)|0)|0)>>2],n[e+4>>2]=n[A+4>>2],n[e+8>>2]=n[A+8>>2],n[e+12>>2]=n[A+12>>2]}(i,c),o=0|function(A,e){A|=0;var r=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|n[11120+(216*e|0)>>2])!=(0|A))if((0|n[11120+(216*e|0)+8>>2])!=(0|A))if((0|n[11120+(216*e|0)+16>>2])!=(0|A))if((0|n[11120+(216*e|0)+24>>2])!=(0|A))if((0|n[11120+(216*e|0)+32>>2])!=(0|A))if((0|n[11120+(216*e|0)+40>>2])!=(0|A))if((0|n[11120+(216*e|0)+48>>2])!=(0|A))if((0|n[11120+(216*e|0)+56>>2])!=(0|A))if((0|n[11120+(216*e|0)+64>>2])!=(0|A))if((0|n[11120+(216*e|0)+72>>2])!=(0|A))if((0|n[11120+(216*e|0)+80>>2])!=(0|A))if((0|n[11120+(216*e|0)+88>>2])!=(0|A))if((0|n[11120+(216*e|0)+96>>2])!=(0|A))if((0|n[11120+(216*e|0)+104>>2])!=(0|A))if((0|n[11120+(216*e|0)+112>>2])!=(0|A))if((0|n[11120+(216*e|0)+120>>2])!=(0|A))if((0|n[11120+(216*e|0)+128>>2])!=(0|A)){if((0|n[11120+(216*e|0)+136>>2])!=(0|A)){if((0|n[11120+(216*e|0)+144>>2])==(0|A)){A=0,r=2,i=0;break}if((0|n[11120+(216*e|0)+152>>2])==(0|A)){A=0,r=2,i=1;break}if((0|n[11120+(216*e|0)+160>>2])==(0|A)){A=0,r=2,i=2;break}if((0|n[11120+(216*e|0)+168>>2])==(0|A)){A=1,r=2,i=0;break}if((0|n[11120+(216*e|0)+176>>2])==(0|A)){A=1,r=2,i=1;break}if((0|n[11120+(216*e|0)+184>>2])==(0|A)){A=1,r=2,i=2;break}if((0|n[11120+(216*e|0)+192>>2])==(0|A)){A=2,r=2,i=0;break}if((0|n[11120+(216*e|0)+200>>2])==(0|A)){A=2,r=2,i=1;break}if((0|n[11120+(216*e|0)+208>>2])==(0|A)){A=2,r=2,i=2;break}return-1}A=2,r=1,i=2}else A=2,r=1,i=1;else A=2,r=1,i=0;else A=1,r=1,i=2;else A=1,r=1,i=1;else A=1,r=1,i=0;else A=0,r=1,i=2;else A=0,r=1,i=1;else A=0,r=1,i=0;else A=2,r=0,i=2;else A=2,r=0,i=1;else A=2,r=0,i=0;else A=1,r=0,i=2;else A=1,r=0,i=1;else A=1,r=0,i=0;else A=0,r=0,i=2;else A=0,r=0,i=1;else A=0,r=0,i=0}while(0);return 0|n[11120+(216*e|0)+(72*r|0)+(24*A|0)+(i<<3)+4>>2]}(i,0|n[a>>2]);do{if(0|Y(i)){switch(0|i){case 4:l=0;break;case 14:l=1;break;case 24:l=2;break;case 38:l=3;break;case 49:l=4;break;case 58:l=5;break;case 63:l=6;break;case 72:l=7;break;case 83:l=8;break;case 97:l=9;break;case 107:l=10;break;case 117:l=11;break;default:_(27634,27636,75,27645)}if(u=0|n[26480+(24*l|0)+8>>2],e=0|n[26480+(24*l|0)+16>>2],(0|(A=0|n[a>>2]))!=(0|n[c>>2])&&(c=0|j(i))|(0|(A=0|n[a>>2]))==(0|e)&&(o=(o+1|0)%6|0),3==(0|t)&(0|A)==(0|e)){o=(o+5|0)%6|0;break}5==(0|t)&(0|A)==(0|u)&&(o=(o+1|0)%6|0)}}while(0);return n[r>>2]=o,T=f,0}function ge(A,e,r,i){r|=0,i|=0;var a,t,f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0;if(l=T,T=T+32|0,m=l+24|0,o=l+20|0,f=l+8|0,t=l+16|0,a=l,d=(d=0==(0|CA(A|=0,e|=0)))?6:5,w=0|Se(0|A,0|e,52),C(),d>>>0<=r>>>0)return T=l,2;!(k=0==(0|(w&=15)))&&0==((B=0|He(7,0,3*(15^w)|0))&A|0)&0==((0|C())&e|0)?u=r:c=4;A:do{if(4==(0|c)){if((0|((u=0!=(0|CA(A,e)))?4:5))<(0|r))return T=l,1;if(0|de(A,e,m))return T=l,1;if(c=(0|n[m>>2])+r|0,7==(0|(B=0|n[(u=u?26768+(((0|c)%5|0)<<2)|0:26800+(((0|c)%6|0)<<2)|0)>>2])))return T=l,1;n[o>>2]=0,u=0|z(A,e,B,o,f);do{if(!u){if(g=0|n[(b=f)>>2],c=(s=(b=0|n[b+4>>2])>>>0<e>>>0|(0|b)==(0|e)&g>>>0<A>>>0)?g:A,s=s?b:e,!k&&0==(g&(k=0|He(7,0,3*(15^w)|0))|0)&0==(b&(0|C())|0))u=r;else{if(b=(r+-1+d|0)%(0|d)|0,u=0|CA(A,e),(0|b)<0&&_(27634,27636,248,27661),(0|((d=0!=(0|u))?4:5))<(0|b)&&_(27634,27636,248,27661),0|de(A,e,m)&&_(27634,27636,248,27661),u=(0|n[m>>2])+b|0,7==(0|(b=0|n[(u=d?26768+(((0|u)%5|0)<<2)|0:26800+(((0|u)%6|0)<<2)|0)>>2]))&&_(27634,27636,248,27661),n[t>>2]=0,0|(u=0|z(A,e,b,t,a)))break;d=0|n[(g=a)>>2],g=0|n[g+4>>2];do{if(g>>>0<s>>>0|(0|g)==(0|s)&d>>>0<c>>>0){if(c=0|CA(d,g)?0|S(d,g,A,e):0|n[26864+((((0|n[t>>2])+(0|n[26832+(b<<2)>>2])|0)%6|0)<<2)>>2],u=0|CA(d,g),(c+-1|0)>>>0>5){u=-1,c=d,s=g;break}if(1==(0|c)&(u=0!=(0|u))){u=-1,c=d,s=g;break}do{if(!(0|de(d,g,m))){if(u){u=(5+(0|n[26416+(c<<2)>>2])-(0|n[m>>2])|0)%5|0;break}u=(6+(0|n[26448+(c<<2)>>2])-(0|n[m>>2])|0)%6|0;break}u=-1}while(0);c=d,s=g}else u=r}while(0);g=0|n[(b=f)>>2],b=0|n[b+4>>2]}if((0|c)==(0|g)&(0|s)==(0|b)){if(A=(d=0!=(0|CA(g,b)))?0|S(g,b,A,e):0|n[26864+((((0|n[o>>2])+(0|n[26832+(B<<2)>>2])|0)%6|0)<<2)>>2],u=0|CA(g,b),(A+-1|0)>>>0<=5&&!(1==(0|A)&(h=0!=(0|u))))do{if(!(0|de(g,b,m))){if(h){u=(5+(0|n[26416+(A<<2)>>2])-(0|n[m>>2])|0)%5|0;break}u=(6+(0|n[26448+(A<<2)>>2])-(0|n[m>>2])|0)%6|0;break}u=-1}while(0);else u=-1;u=6==(0|(u=u+1|0))|d&5==(0|u)?0:u}e=s,A=c;break A}}while(0);return T=l,0|u}}while(0);return h=0|He(0|u,0,56),m=0|C()|-2130706433&e|536870912,n[i>>2]=h|A,n[i+4>>2]=m,T=l,0}function we(A,e){A|=0;var r,i,a=0,t=0;return i=T,T=T+16|0,r=i,!0&536870912==(2013265920&(e|=0)|0)&&0|vA(A,a=-2130706433&e|134217728)?(t=0|Se(0|A,0|e,56),C(),t=0==(0|ge(A,a,7&t,r)),T=i,0|(a=t&((0|n[(a=r)>>2])==(0|A)?(0|n[a+4>>2])==(0|e):0)&1)):(T=i,0|(a=0))}function ke(A,e,r,i){A|=0,i|=0;var a,t,f,o=0,l=0,u=0,c=0,s=0,b=0;f=T,T=T+208|0,a=f,t=f+192|0,u=0|h(r|=0,e|=0),n[(c=t)>>2]=1,n[c+4>>2]=0;A:do{if(0|u){for(c=0-r|0,n[a+4>>2]=r,n[a>>2]=r,o=2,e=r,l=r;n[a+(o<<2)>>2]=e=e+r+l|0,e>>>0<u>>>0;)b=l,o=o+1|0,l=e,e=b;if((l=A+u+c|0)>>>0>A>>>0){u=l,o=1,e=1;do{do{if(3!=(3&e|0)){if((0|n[a+((e=o+-1|0)<<2)>>2])>>>0<(u-A|0)>>>0?Be(A,r,i,o,a):me(A,r,i,t,o,0,a),1==(0|o)){ve(t,1),o=0;break}ve(t,e),o=1;break}Be(A,r,i,o,a),he(t,2),o=o+2|0}while(0);n[t>>2]=e=1|n[t>>2],A=A+r|0}while(A>>>0<l>>>0)}else o=1,e=1;for(me(A,r,i,t,o,0,a),l=t+4|0;;){if(1==(0|o)&1==(0|e)){if(!(0|n[l>>2]))break A;s=19}else(0|o)<2?s=19:(ve(t,2),b=o+-2|0,n[t>>2]=7^n[t>>2],he(t,1),me(A+(0-(0|n[a+(b<<2)>>2]))+c|0,r,i,t,o+-1|0,1,a),ve(t,1),n[t>>2]=e=1|n[t>>2],me(A=A+c|0,r,i,t,b,1,a),o=b);19==(0|s)&&(s=0,he(t,e=0|Qe(t)),A=A+c|0,o=e+o|0,e=0|n[t>>2])}}}while(0);T=f}function Be(A,e,r,i,a){e|=0,r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0,c=0,s=0;f=T,T=T+240|0,n[(t=f)>>2]=A|=0;A:do{if((0|i)>1)for(s=0-e|0,u=A,o=i,i=1,l=A;;){if((0|Xe[3&r](l,A=(u=u+s|0)+(0-(0|n[a+((c=o+-2|0)<<2)>>2]))|0))>-1&&(0|Xe[3&r](l,u))>-1)break A;if(l=t+(i<<2)|0,(0|Xe[3&r](A,u))>-1?(n[l>>2]=A,o=o+-1|0):(n[l>>2]=u,A=u,o=c),i=i+1|0,(0|o)<=1)break A;u=A,l=0|n[t>>2]}else i=1}while(0);De(e,t,i),T=f}function he(A,e){var r,i=0,a=0;r=4+(A|=0)|0,(e|=0)>>>0>31?(n[A>>2]=a=0|n[r>>2],n[r>>2]=0,e=e+-32|0,i=0):(i=0|n[r>>2],a=0|n[A>>2]),n[A>>2]=i<<32-e|a>>>e,n[r>>2]=i>>>e}function me(A,e,r,i,a,t,f){A|=0,e|=0,r|=0,a|=0,t|=0,f|=0;var o,l,u,c,s=0,b=0,d=0,g=0;c=T,T=T+240|0,u=c,n[(l=c+232|0)>>2]=g=0|n[(i|=0)>>2],n[(o=l+4|0)>>2]=b=0|n[i+4>>2],n[u>>2]=A;A:do{if(1!=(0|g)|0!=(0|b)&&(d=0-e|0,(0|Xe[3&r](s=A+(0-(0|n[f+(a<<2)>>2]))|0,A))>=1))for(i=1,t=0==(0|t),b=s;;){if(t&(0|a)>1){if(s=0|n[f+(a+-2<<2)>>2],(0|Xe[3&r](t=A+d|0,b))>-1){s=10;break A}if((0|Xe[3&r](t+(0-s)|0,b))>-1){s=10;break A}}if(t=i+1|0,n[u+(i<<2)>>2]=b,he(l,g=0|Qe(l)),a=g+a|0,!(1!=(0|n[l>>2])|0!=(0|n[o>>2]))){i=t,A=b,s=10;break A}if((0|Xe[3&r](A=b+(0-(0|n[f+(a<<2)>>2]))|0,0|n[u>>2]))<1){A=b,i=t,t=0,s=9;break}g=b,i=t,t=1,b=A,A=g}else i=1,s=9}while(0);9==(0|s)&&0==(0|t)&&(s=10),10==(0|s)&&(De(e,u,i),Be(A,e,r,a,f)),T=c}function ve(A,e){var r,i=0,a=0;r=4+(A|=0)|0,(e|=0)>>>0>31?(n[r>>2]=a=0|n[A>>2],n[A>>2]=0,e=e+-32|0,i=0):(i=0|n[A>>2],a=0|n[r>>2]),n[r>>2]=i>>>(32-e|0)|a<<e,n[A>>2]=i<<e}function Qe(A){var e=0;return(e=0|Ee((0|n[(A|=0)>>2])-1|0))?0|e:0|(0==(0|(e=0|Ee(0|n[A+4>>2])))?0:e+32|0)}function Ee(A){var e=0;if(A|=0)if(1&A)A=0;else for(e=A,A=0;A=A+1|0,!(2&e);)e>>>=1;else A=32;return 0|A}function De(A,e,r){A|=0,e|=0,r|=0;var i,a=0,t=0,f=0,o=0;i=T,T=T+256|0,a=i;A:do{if((0|r)>=2&&(n[(f=e+(r<<2)|0)>>2]=a,0|A))for(;;){Ne(0|a,0|n[e>>2],0|(t=A>>>0<256?A:256)),a=0;do{Ne(0|n[(o=e+(a<<2)|0)>>2],0|n[e+((a=a+1|0)<<2)>>2],0|t),n[o>>2]=(0|n[o>>2])+t}while((0|a)!=(0|r));if(!(A=A-t|0))break A;a=0|n[f>>2]}}while(0);T=i}function Ce(A){return 0|~~+Je(+(A=+A))}function _e(A){A|=0;var e,r=0,i=0,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0;e=T,T=T+16|0,d=e;do{if(A>>>0<245){if(3&(i=(b=0|n[6921])>>>(A=(c=A>>>0<11?16:A+11&-8)>>>3))|0)return(0|(f=0|n[(t=8+(a=0|n[(i=8+(A=27724+((r=(1&i^1)+A|0)<<1<<2)|0)|0)>>2])|0)>>2]))==(0|A)?n[6921]=b&~(1<<r):(n[f+12>>2]=A,n[i>>2]=f),n[a+4>>2]=3|(Q=r<<3),n[(Q=a+Q+4|0)>>2]=1|n[Q>>2],T=e,0|t;if(c>>>0>(s=0|n[6923])>>>0){if(0|i)return r=((r=i<<A&((r=2<<A)|0-r))&0-r)-1|0,(0|(i=0|n[(l=8+(f=0|n[(A=8+(r=27724+((a=((i=(r>>>=l=r>>>12&16)>>>5&8)|l|(f=(r>>>=i)>>>2&4)|(A=(r>>>=f)>>>1&2)|(a=(r>>>=A)>>>1&1))+(r>>>a)|0)<<1<<2)|0)|0)>>2])|0)>>2]))==(0|r)?n[6921]=A=b&~(1<<a):(n[i+12>>2]=r,n[A>>2]=i,A=b),o=(Q=a<<3)-c|0,n[f+4>>2]=3|c,n[4+(t=f+c|0)>>2]=1|o,n[f+Q>>2]=o,0|s&&(a=0|n[6926],i=27724+((r=s>>>3)<<1<<2)|0,A&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=a,n[r+12>>2]=a,n[a+8>>2]=r,n[a+12>>2]=i),n[6923]=o,n[6926]=t,T=e,0|l;if(f=0|n[6922]){for(i=(f&0-f)-1|0,i=u=0|n[27988+(((a=(i>>>=t=i>>>12&16)>>>5&8)|t|(o=(i>>>=a)>>>2&4)|(l=(i>>>=o)>>>1&2)|(u=(i>>>=l)>>>1&1))+(i>>>u)<<2)>>2],l=u,u=(-8&n[u+4>>2])-c|0;(A=0|n[i+16>>2])||(A=0|n[i+20>>2]);)i=A,l=(t=(o=(-8&n[A+4>>2])-c|0)>>>0<u>>>0)?A:l,u=t?o:u;if((o=l+c|0)>>>0>l>>>0){t=0|n[l+24>>2],r=0|n[l+12>>2];do{if((0|r)==(0|l)){if(!(r=0|n[(A=l+20|0)>>2])&&!(r=0|n[(A=l+16|0)>>2])){i=0;break}for(;;)if(i=0|n[(a=r+20|0)>>2])r=i,A=a;else{if(!(i=0|n[(a=r+16|0)>>2]))break;r=i,A=a}n[A>>2]=0,i=r}else n[12+(i=0|n[l+8>>2])>>2]=r,n[r+8>>2]=i,i=r}while(0);do{if(0|t){if((0|l)==(0|n[(A=27988+((r=0|n[l+28>>2])<<2)|0)>>2])){if(n[A>>2]=i,!i){n[6922]=f&~(1<<r);break}}else if(n[((0|n[(Q=t+16|0)>>2])==(0|l)?Q:t+20|0)>>2]=i,!i)break;n[i+24>>2]=t,0|(r=0|n[l+16>>2])&&(n[i+16>>2]=r,n[r+24>>2]=i),0|(r=0|n[l+20>>2])&&(n[i+20>>2]=r,n[r+24>>2]=i)}}while(0);return u>>>0<16?(n[l+4>>2]=3|(Q=u+c|0),n[(Q=l+Q+4|0)>>2]=1|n[Q>>2]):(n[l+4>>2]=3|c,n[o+4>>2]=1|u,n[o+u>>2]=u,0|s&&(a=0|n[6926],i=27724+((r=s>>>3)<<1<<2)|0,(r=1<<r)&b?r=0|n[(A=i+8|0)>>2]:(n[6921]=r|b,r=i,A=i+8|0),n[A>>2]=a,n[r+12>>2]=a,n[a+8>>2]=r,n[a+12>>2]=i),n[6923]=u,n[6926]=o),T=e,0|l+8}b=c}else b=c}else b=c}else if(A>>>0<=4294967231)if(c=-8&(A=A+11|0),a=0|n[6922]){t=0-c|0,u=(A>>>=8)?c>>>0>16777215?31:c>>>(7+(u=14-((l=(520192+(k=A<<(b=(A+1048320|0)>>>16&8))|0)>>>16&4)|b|(u=(245760+(k<<=l)|0)>>>16&2))+(k<<u>>>15)|0)|0)&1|u<<1:0,i=0|n[27988+(u<<2)>>2];A:do{if(i)for(A=0,l=c<<(31==(0|u)?0:25-(u>>>1)|0),f=0;;){if((o=(-8&n[i+4>>2])-c|0)>>>0<t>>>0){if(!o){A=i,t=0,k=65;break A}A=i,t=o}if(f=0==(0|(k=0|n[i+20>>2]))|(0|k)==(0|(i=0|n[i+16+(l>>>31<<2)>>2]))?f:k,!i){i=f,k=61;break}l<<=1}else i=0,A=0,k=61}while(0);if(61==(0|k)){if(0==(0|i)&0==(0|A)){if(!(A=((A=2<<u)|0-A)&a)){b=c;break}b=(A&0-A)-1|0,A=0,i=0|n[27988+(((f=(b>>>=o=b>>>12&16)>>>5&8)|o|(l=(b>>>=f)>>>2&4)|(u=(b>>>=l)>>>1&2)|(i=(b>>>=u)>>>1&1))+(b>>>i)<<2)>>2]}i?k=65:(l=A,o=t)}if(65==(0|k))for(f=i;;){if(t=(i=(b=(-8&n[f+4>>2])-c|0)>>>0<t>>>0)?b:t,A=i?f:A,(i=0|n[f+16>>2])||(i=0|n[f+20>>2]),!i){l=A,o=t;break}f=i}if(0!=(0|l)&&o>>>0<((0|n[6923])-c|0)>>>0&&(s=l+c|0)>>>0>l>>>0){f=0|n[l+24>>2],r=0|n[l+12>>2];do{if((0|r)==(0|l)){if(!(r=0|n[(A=l+20|0)>>2])&&!(r=0|n[(A=l+16|0)>>2])){r=0;break}for(;;)if(i=0|n[(t=r+20|0)>>2])r=i,A=t;else{if(!(i=0|n[(t=r+16|0)>>2]))break;r=i,A=t}n[A>>2]=0}else n[12+(Q=0|n[l+8>>2])>>2]=r,n[r+8>>2]=Q}while(0);do{if(f){if((0|l)==(0|n[(i=27988+((A=0|n[l+28>>2])<<2)|0)>>2])){if(n[i>>2]=r,!r){n[6922]=a&=~(1<<A);break}}else if(n[((0|n[(Q=f+16|0)>>2])==(0|l)?Q:f+20|0)>>2]=r,!r)break;n[r+24>>2]=f,0|(A=0|n[l+16>>2])&&(n[r+16>>2]=A,n[A+24>>2]=r),(A=0|n[l+20>>2])&&(n[r+20>>2]=A,n[A+24>>2]=r)}}while(0);A:do{if(o>>>0<16)n[l+4>>2]=3|(Q=o+c|0),n[(Q=l+Q+4|0)>>2]=1|n[Q>>2];else{if(n[l+4>>2]=3|c,n[s+4>>2]=1|o,n[s+o>>2]=o,r=o>>>3,o>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=s,n[r+12>>2]=s,n[s+8>>2]=r,n[s+12>>2]=i;break}if(r=27988+((i=(r=o>>>8)?o>>>0>16777215?31:o>>>(7+(i=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(i=(245760+(Q<<=m)|0)>>>16&2))+(Q<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[s+28>>2]=i,n[4+(A=s+16|0)>>2]=0,n[A>>2]=0,!(a&(A=1<<i))){n[6922]=a|A,n[r>>2]=s,n[s+24>>2]=r,n[s+12>>2]=s,n[s+8>>2]=s;break}r=0|n[r>>2];e:do{if((-8&n[r+4>>2]|0)!=(0|o)){for(a=o<<(31==(0|i)?0:25-(i>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|o)){r=A;break e}a<<=1,r=A}n[i>>2]=s,n[s+24>>2]=r,n[s+12>>2]=s,n[s+8>>2]=s;break A}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=s,n[v>>2]=s,n[s+8>>2]=Q,n[s+12>>2]=r,n[s+24>>2]=0}}while(0);return T=e,0|l+8}b=c}else b=c;else b=-1}while(0);if((i=0|n[6923])>>>0>=b>>>0)return A=0|n[6926],(r=i-b|0)>>>0>15?(n[6926]=Q=A+b|0,n[6923]=r,n[Q+4>>2]=1|r,n[A+i>>2]=r,n[A+4>>2]=3|b):(n[6923]=0,n[6926]=0,n[A+4>>2]=3|i,n[(Q=A+i+4|0)>>2]=1|n[Q>>2]),T=e,0|A+8;if((o=0|n[6924])>>>0>b>>>0)return n[6924]=m=o-b|0,n[6927]=v=(Q=0|n[6927])+b|0,n[v+4>>2]=1|m,n[Q+4>>2]=3|b,T=e,0|Q+8;if(0|n[7039]?A=0|n[7041]:(n[7041]=4096,n[7040]=4096,n[7042]=-1,n[7043]=-1,n[7044]=0,n[7032]=0,n[7039]=-16&d^1431655768,A=4096),l=b+48|0,(c=(f=A+(u=b+47|0)|0)&(t=0-A|0))>>>0<=b>>>0)return T=e,0;if(0|(A=0|n[7031])&&(d=(s=0|n[7029])+c|0)>>>0<=s>>>0|d>>>0>A>>>0)return T=e,0;A:do{if(4&n[7032])r=0,k=143;else{i=0|n[6927];e:do{if(i){for(a=28132;!((d=0|n[a>>2])>>>0<=i>>>0&&(d+(0|n[a+4>>2])|0)>>>0>i>>>0);){if(!(A=0|n[a+8>>2])){k=128;break e}a=A}if((r=f-o&t)>>>0<2147483647)if((0|(A=0|Ke(0|r)))==((0|n[a>>2])+(0|n[a+4>>2])|0)){if(-1!=(0|A)){o=r,f=A,k=145;break A}}else a=A,k=136;else r=0}else k=128}while(0);do{if(128==(0|k))if(-1!=(0|(i=0|Ke(0)))&&(w=(r=(0==((w=(g=0|n[7040])-1|0)&(r=i)|0)?0:(w+r&0-g)-r|0)+c|0)+(g=0|n[7029])|0,r>>>0>b>>>0&r>>>0<2147483647)){if(0|(d=0|n[7031])&&w>>>0<=g>>>0|w>>>0>d>>>0){r=0;break}if((0|(A=0|Ke(0|r)))==(0|i)){o=r,f=i,k=145;break A}a=A,k=136}else r=0}while(0);do{if(136==(0|k)){if(i=0-r|0,!(l>>>0>r>>>0&r>>>0<2147483647&-1!=(0|a))){if(-1==(0|a)){r=0;break}o=r,f=a,k=145;break A}if((A=u-r+(A=0|n[7041])&0-A)>>>0>=2147483647){o=r,f=a,k=145;break A}if(-1==(0|Ke(0|A))){Ke(0|i),r=0;break}o=A+r|0,f=a,k=145;break A}}while(0);n[7032]=4|n[7032],k=143}}while(0);if(143==(0|k)&&c>>>0<2147483647&&!(-1==(0|(m=0|Ke(0|c)))|1^(h=(B=(w=0|Ke(0))-m|0)>>>0>(b+40|0)>>>0)|m>>>0<w>>>0&-1!=(0|m)&-1!=(0|w)^1)&&(o=h?B:r,f=m,k=145),145==(0|k)){n[7029]=r=(0|n[7029])+o|0,r>>>0>(0|n[7030])>>>0&&(n[7030]=r),u=0|n[6927];A:do{if(u){for(r=28132;;){if((0|f)==((A=0|n[r>>2])+(i=0|n[r+4>>2])|0)){k=154;break}if(!(a=0|n[r+8>>2]))break;r=a}if(154==(0|k)&&(v=r+4|0,0==(8&n[r+12>>2]|0))&&f>>>0>u>>>0&A>>>0<=u>>>0){n[v>>2]=i+o,v=u+(m=0==(7&(m=u+8|0)|0)?0:0-m&7)|0,m=(Q=(0|n[6924])+o|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[u+Q+4>>2]=40,n[6928]=n[7043];break}for(f>>>0<(0|n[6925])>>>0&&(n[6925]=f),i=f+o|0,r=28132;;){if((0|n[r>>2])==(0|i)){k=162;break}if(!(A=0|n[r+8>>2]))break;r=A}if(162==(0|k)&&0==(8&n[r+12>>2]|0)){n[r>>2]=f,n[(s=r+4|0)>>2]=(0|n[s>>2])+o,c=(s=f+(0==(7&(s=f+8|0)|0)?0:0-s&7)|0)+b|0,l=(r=i+(0==(7&(r=i+8|0)|0)?0:0-r&7)|0)-s-b|0,n[s+4>>2]=3|b;e:do{if((0|u)==(0|r))n[6924]=Q=(0|n[6924])+l|0,n[6927]=c,n[c+4>>2]=1|Q;else{if((0|n[6926])==(0|r)){n[6923]=Q=(0|n[6923])+l|0,n[6926]=c,n[c+4>>2]=1|Q,n[c+Q>>2]=Q;break}if(1==(3&(A=0|n[r+4>>2])|0)){o=-8&A,a=A>>>3;r:do{if(A>>>0<256){if((0|(i=0|n[r+12>>2]))==(0|(A=0|n[r+8>>2]))){n[6921]=n[6921]&~(1<<a);break}n[A+12>>2]=i,n[i+8>>2]=A;break}f=0|n[r+24>>2],A=0|n[r+12>>2];do{if((0|A)==(0|r)){if(A=0|n[(a=4+(i=r+16|0)|0)>>2])i=a;else if(!(A=0|n[i>>2])){A=0;break}for(;;)if(a=0|n[(t=A+20|0)>>2])A=a,i=t;else{if(!(a=0|n[(t=A+16|0)>>2]))break;A=a,i=t}n[i>>2]=0}else n[12+(Q=0|n[r+8>>2])>>2]=A,n[A+8>>2]=Q}while(0);if(!f)break;a=27988+((i=0|n[r+28>>2])<<2)|0;do{if((0|n[a>>2])==(0|r)){if(n[a>>2]=A,0|A)break;n[6922]=n[6922]&~(1<<i);break r}if(n[((0|n[(Q=f+16|0)>>2])==(0|r)?Q:f+20|0)>>2]=A,!A)break r}while(0);if(n[A+24>>2]=f,0|(a=0|n[(i=r+16|0)>>2])&&(n[A+16>>2]=a,n[a+24>>2]=A),!(i=0|n[i+4>>2]))break;n[A+20>>2]=i,n[i+24>>2]=A}while(0);r=r+o|0,t=o+l|0}else t=l;if(n[(r=r+4|0)>>2]=-2&n[r>>2],n[c+4>>2]=1|t,n[c+t>>2]=t,r=t>>>3,t>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=c,n[r+12>>2]=c,n[c+8>>2]=r,n[c+12>>2]=i;break}r=t>>>8;do{if(r){if(t>>>0>16777215){a=31;break}a=t>>>(7+(a=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(a=(245760+(Q<<=m)|0)>>>16&2))+(Q<<a>>>15)|0)|0)&1|a<<1}else a=0}while(0);if(r=27988+(a<<2)|0,n[c+28>>2]=a,n[4+(A=c+16|0)>>2]=0,n[A>>2]=0,!((A=0|n[6922])&(i=1<<a))){n[6922]=A|i,n[r>>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break}r=0|n[r>>2];r:do{if((-8&n[r+4>>2]|0)!=(0|t)){for(a=t<<(31==(0|a)?0:25-(a>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|t)){r=A;break r}a<<=1,r=A}n[i>>2]=c,n[c+24>>2]=r,n[c+12>>2]=c,n[c+8>>2]=c;break e}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=c,n[v>>2]=c,n[c+8>>2]=Q,n[c+12>>2]=r,n[c+24>>2]=0}}while(0);return T=e,0|s+8}for(r=28132;!((A=0|n[r>>2])>>>0<=u>>>0&&(Q=A+(0|n[r+4>>2])|0)>>>0>u>>>0);)r=0|n[r+8>>2];r=(A=(A=(t=Q+-47|0)+(0==(7&(A=t+8|0)|0)?0:0-A&7)|0)>>>0<(t=u+16|0)>>>0?u:A)+8|0,v=f+(m=0==(7&(m=f+8|0)|0)?0:0-m&7)|0,m=(i=o+-40|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[f+i+4>>2]=40,n[6928]=n[7043],n[(i=A+4|0)>>2]=27,n[r>>2]=n[7033],n[r+4>>2]=n[7034],n[r+8>>2]=n[7035],n[r+12>>2]=n[7036],n[7033]=f,n[7034]=o,n[7036]=0,n[7035]=r,r=A+24|0;do{v=r,n[(r=r+4|0)>>2]=7}while((v+8|0)>>>0<Q>>>0);if((0|A)!=(0|u)){if(f=A-u|0,n[i>>2]=-2&n[i>>2],n[u+4>>2]=1|f,n[A>>2]=f,r=f>>>3,f>>>0<256){i=27724+(r<<1<<2)|0,(A=0|n[6921])&(r=1<<r)?r=0|n[(A=i+8|0)>>2]:(n[6921]=A|r,r=i,A=i+8|0),n[A>>2]=u,n[r+12>>2]=u,n[u+8>>2]=r,n[u+12>>2]=i;break}if(i=27988+((a=(r=f>>>8)?f>>>0>16777215?31:f>>>(7+(a=14-((m=(520192+(Q=r<<(v=(r+1048320|0)>>>16&8))|0)>>>16&4)|v|(a=(245760+(Q<<=m)|0)>>>16&2))+(Q<<a>>>15)|0)|0)&1|a<<1:0)<<2)|0,n[u+28>>2]=a,n[u+20>>2]=0,n[t>>2]=0,!((r=0|n[6922])&(A=1<<a))){n[6922]=r|A,n[i>>2]=u,n[u+24>>2]=i,n[u+12>>2]=u,n[u+8>>2]=u;break}r=0|n[i>>2];e:do{if((-8&n[r+4>>2]|0)!=(0|f)){for(a=f<<(31==(0|a)?0:25-(a>>>1)|0);A=0|n[(i=r+16+(a>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|f)){r=A;break e}a<<=1,r=A}n[i>>2]=u,n[u+24>>2]=r,n[u+12>>2]=u,n[u+8>>2]=u;break A}}while(0);n[12+(Q=0|n[(v=r+8|0)>>2])>>2]=u,n[v>>2]=u,n[u+8>>2]=Q,n[u+12>>2]=r,n[u+24>>2]=0}}else 0==(0|(Q=0|n[6925]))|f>>>0<Q>>>0&&(n[6925]=f),n[7033]=f,n[7034]=o,n[7036]=0,n[6930]=n[7039],n[6929]=-1,n[6934]=27724,n[6933]=27724,n[6936]=27732,n[6935]=27732,n[6938]=27740,n[6937]=27740,n[6940]=27748,n[6939]=27748,n[6942]=27756,n[6941]=27756,n[6944]=27764,n[6943]=27764,n[6946]=27772,n[6945]=27772,n[6948]=27780,n[6947]=27780,n[6950]=27788,n[6949]=27788,n[6952]=27796,n[6951]=27796,n[6954]=27804,n[6953]=27804,n[6956]=27812,n[6955]=27812,n[6958]=27820,n[6957]=27820,n[6960]=27828,n[6959]=27828,n[6962]=27836,n[6961]=27836,n[6964]=27844,n[6963]=27844,n[6966]=27852,n[6965]=27852,n[6968]=27860,n[6967]=27860,n[6970]=27868,n[6969]=27868,n[6972]=27876,n[6971]=27876,n[6974]=27884,n[6973]=27884,n[6976]=27892,n[6975]=27892,n[6978]=27900,n[6977]=27900,n[6980]=27908,n[6979]=27908,n[6982]=27916,n[6981]=27916,n[6984]=27924,n[6983]=27924,n[6986]=27932,n[6985]=27932,n[6988]=27940,n[6987]=27940,n[6990]=27948,n[6989]=27948,n[6992]=27956,n[6991]=27956,n[6994]=27964,n[6993]=27964,n[6996]=27972,n[6995]=27972,v=f+(m=0==(7&(m=f+8|0)|0)?0:0-m&7)|0,m=(Q=o+-40|0)-m|0,n[6927]=v,n[6924]=m,n[v+4>>2]=1|m,n[f+Q+4>>2]=40,n[6928]=n[7043]}while(0);if((r=0|n[6924])>>>0>b>>>0)return n[6924]=m=r-b|0,n[6927]=v=(Q=0|n[6927])+b|0,n[v+4>>2]=1|m,n[Q+4>>2]=3|b,T=e,0|Q+8}return n[(Q=27680)>>2]=12,T=e,0}function ye(A){var e=0,r=0,i=0,a=0,t=0,f=0,o=0,l=0;if(A|=0){a=0|n[6925],l=(r=A+-8|0)+(e=-8&(A=0|n[A+-4>>2]))|0;do{if(1&A)o=r,f=r;else{if(!(3&A))return;if(t=(i=0|n[r>>2])+e|0,(f=r+(0-i)|0)>>>0<a>>>0)return;if((0|n[6926])==(0|f)){if(3!=(3&(e=0|n[(A=l+4|0)>>2])|0)){o=f,e=t;break}return n[6923]=t,n[A>>2]=-2&e,n[f+4>>2]=1|t,void(n[f+t>>2]=t)}if(r=i>>>3,i>>>0<256){if((0|(e=0|n[f+12>>2]))==(0|(A=0|n[f+8>>2]))){n[6921]=n[6921]&~(1<<r),o=f,e=t;break}n[A+12>>2]=e,n[e+8>>2]=A,o=f,e=t;break}a=0|n[f+24>>2],A=0|n[f+12>>2];do{if((0|A)==(0|f)){if(A=0|n[(r=4+(e=f+16|0)|0)>>2])e=r;else if(!(A=0|n[e>>2])){A=0;break}for(;;)if(r=0|n[(i=A+20|0)>>2])A=r,e=i;else{if(!(r=0|n[(i=A+16|0)>>2]))break;A=r,e=i}n[e>>2]=0}else n[12+(o=0|n[f+8>>2])>>2]=A,n[A+8>>2]=o}while(0);if(a){if((0|n[(r=27988+((e=0|n[f+28>>2])<<2)|0)>>2])==(0|f)){if(n[r>>2]=A,!A){n[6922]=n[6922]&~(1<<e),o=f,e=t;break}}else if(n[((0|n[(o=a+16|0)>>2])==(0|f)?o:a+20|0)>>2]=A,!A){o=f,e=t;break}n[A+24>>2]=a,0|(r=0|n[(e=f+16|0)>>2])&&(n[A+16>>2]=r,n[r+24>>2]=A),(e=0|n[e+4>>2])?(n[A+20>>2]=e,n[e+24>>2]=A,o=f,e=t):(o=f,e=t)}else o=f,e=t}}while(0);if(!(f>>>0>=l>>>0)&&1&(i=0|n[(A=l+4|0)>>2])){if(2&i)n[A>>2]=-2&i,n[o+4>>2]=1|e,n[f+e>>2]=e,a=e;else{if((0|n[6927])==(0|l)){if(n[6924]=l=(0|n[6924])+e|0,n[6927]=o,n[o+4>>2]=1|l,(0|o)!=(0|n[6926]))return;return n[6926]=0,void(n[6923]=0)}if((0|n[6926])==(0|l))return n[6923]=l=(0|n[6923])+e|0,n[6926]=f,n[o+4>>2]=1|l,void(n[f+l>>2]=l);a=(-8&i)+e|0,r=i>>>3;do{if(i>>>0<256){if((0|(A=0|n[l+12>>2]))==(0|(e=0|n[l+8>>2]))){n[6921]=n[6921]&~(1<<r);break}n[e+12>>2]=A,n[A+8>>2]=e;break}t=0|n[l+24>>2],A=0|n[l+12>>2];do{if((0|A)==(0|l)){if(A=0|n[(r=4+(e=l+16|0)|0)>>2])e=r;else if(!(A=0|n[e>>2])){r=0;break}for(;;)if(r=0|n[(i=A+20|0)>>2])A=r,e=i;else{if(!(r=0|n[(i=A+16|0)>>2]))break;A=r,e=i}n[e>>2]=0,r=A}else n[12+(r=0|n[l+8>>2])>>2]=A,n[A+8>>2]=r,r=A}while(0);if(0|t){if((0|n[(e=27988+((A=0|n[l+28>>2])<<2)|0)>>2])==(0|l)){if(n[e>>2]=r,!r){n[6922]=n[6922]&~(1<<A);break}}else if(n[((0|n[(i=t+16|0)>>2])==(0|l)?i:t+20|0)>>2]=r,!r)break;n[r+24>>2]=t,0|(e=0|n[(A=l+16|0)>>2])&&(n[r+16>>2]=e,n[e+24>>2]=r),0|(A=0|n[A+4>>2])&&(n[r+20>>2]=A,n[A+24>>2]=r)}}while(0);if(n[o+4>>2]=1|a,n[f+a>>2]=a,(0|o)==(0|n[6926]))return void(n[6923]=a)}if(A=a>>>3,a>>>0<256)return r=27724+(A<<1<<2)|0,(e=0|n[6921])&(A=1<<A)?A=0|n[(e=r+8|0)>>2]:(n[6921]=e|A,A=r,e=r+8|0),n[e>>2]=o,n[A+12>>2]=o,n[o+8>>2]=A,void(n[o+12>>2]=r);A=27988+((i=(A=a>>>8)?a>>>0>16777215?31:a>>>(7+(i=14-((t=(520192+(l=A<<(f=(A+1048320|0)>>>16&8))|0)>>>16&4)|f|(i=(245760+(l<<=t)|0)>>>16&2))+(l<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[o+28>>2]=i,n[o+20>>2]=0,n[o+16>>2]=0,e=0|n[6922],r=1<<i;A:do{if(e&r){A=0|n[A>>2];e:do{if((-8&n[A+4>>2]|0)!=(0|a)){for(i=a<<(31==(0|i)?0:25-(i>>>1)|0);e=0|n[(r=A+16+(i>>>31<<2)|0)>>2];){if((-8&n[e+4>>2]|0)==(0|a)){A=e;break e}i<<=1,A=e}n[r>>2]=o,n[o+24>>2]=A,n[o+12>>2]=o,n[o+8>>2]=o;break A}}while(0);n[12+(l=0|n[(f=A+8|0)>>2])>>2]=o,n[f>>2]=o,n[o+8>>2]=l,n[o+12>>2]=A,n[o+24>>2]=0}else n[6922]=e|r,n[A>>2]=o,n[o+24>>2]=A,n[o+12>>2]=o,n[o+8>>2]=o}while(0);if(n[6929]=l=(0|n[6929])-1|0,!(0|l)){for(A=28140;A=0|n[A>>2];)A=A+8|0;n[6929]=-1}}}}function Me(A,e){e|=0;var r=0;return(A|=0)?(r=0|h(e,A),(e|A)>>>0>65535&&(r=(0|(r>>>0)/(A>>>0))==(0|e)?r:-1)):r=0,(A=0|_e(r))&&3&n[A+-4>>2]?(Ze(0|A,0,0|r),0|A):0|A}function Pe(A,e){e|=0;var r=0,i=0;return(A|=0)?e>>>0>4294967231?(n[(e=27680)>>2]=12,0|(e=0)):0|(r=0|function(A,e){e|=0;var r,i,a=0,t=0,f=0,o=0,l=0,u=0,c=0,s=0;if(u=(A|=0)+(a=-8&(s=0|n[(i=A+4|0)>>2]))|0,!(3&s))return e>>>0<256?0|(A=0):a>>>0>=(e+4|0)>>>0&&(a-e|0)>>>0<=n[7041]<<1>>>0?0|A:0|(A=0);if(a>>>0>=e>>>0)return(a=a-e|0)>>>0<=15?0|A:(c=A+e|0,n[i>>2]=1&s|e|2,n[c+4>>2]=3|a,n[(s=u+4|0)>>2]=1|n[s>>2],Ie(c,a),0|A);if((0|n[6927])==(0|u))return a=(c=(0|n[6924])+a|0)-e|0,t=A+e|0,c>>>0<=e>>>0?0|(A=0):(n[i>>2]=1&s|e|2,n[t+4>>2]=1|a,n[6927]=t,n[6924]=a,0|A);if((0|n[6926])==(0|u))return(t=(0|n[6923])+a|0)>>>0<e>>>0?0|(A=0):((a=t-e|0)>>>0>15?(c=A+e|0,t=A+t|0,n[i>>2]=1&s|e|2,n[c+4>>2]=1|a,n[t>>2]=a,n[(t=t+4|0)>>2]=-2&n[t>>2],t=c):(n[i>>2]=1&s|t|2,n[(t=A+t+4|0)>>2]=1|n[t>>2],t=0,a=0),n[6923]=a,n[6926]=t,0|A);if(2&(t=0|n[u+4>>2])|0)return 0;if((r=(-8&t)+a|0)>>>0<e>>>0)return 0;c=r-e|0,f=t>>>3;do{if(t>>>0<256){if((0|(a=0|n[u+12>>2]))==(0|(t=0|n[u+8>>2]))){n[6921]=n[6921]&~(1<<f);break}n[t+12>>2]=a,n[a+8>>2]=t;break}l=0|n[u+24>>2],a=0|n[u+12>>2];do{if((0|a)==(0|u)){if(a=0|n[(f=4+(t=u+16|0)|0)>>2])t=f;else if(!(a=0|n[t>>2])){f=0;break}for(;;)if(f=0|n[(o=a+20|0)>>2])a=f,t=o;else{if(!(f=0|n[(o=a+16|0)>>2]))break;a=f,t=o}n[t>>2]=0,f=a}else n[12+(f=0|n[u+8>>2])>>2]=a,n[a+8>>2]=f,f=a}while(0);if(0|l){if((0|n[(t=27988+((a=0|n[u+28>>2])<<2)|0)>>2])==(0|u)){if(n[t>>2]=f,!f){n[6922]=n[6922]&~(1<<a);break}}else if(n[((0|n[(o=l+16|0)>>2])==(0|u)?o:l+20|0)>>2]=f,!f)break;n[f+24>>2]=l,0|(t=0|n[(a=u+16|0)>>2])&&(n[f+16>>2]=t,n[t+24>>2]=f),0|(a=0|n[a+4>>2])&&(n[f+20>>2]=a,n[a+24>>2]=f)}}while(0);return c>>>0<16?(n[i>>2]=1&s|r|2,n[(s=A+r+4|0)>>2]=1|n[s>>2],0|A):(u=A+e|0,n[i>>2]=1&s|e|2,n[u+4>>2]=3|c,n[(s=A+r+4|0)>>2]=1|n[s>>2],Ie(u,c),0|A)}(A+-8|0,e>>>0<11?16:e+11&-8))?0|(e=r+8|0):(r=0|_e(e))?(Ne(0|r,0|A,0|((i=(-8&(i=0|n[A+-4>>2]))-(0==(3&i|0)?8:4)|0)>>>0<e>>>0?i:e)),ye(A),0|(e=r)):0|(e=0):0|(e=0|_e(e))}function Ie(A,e){var r=0,i=0,a=0,t=0,f=0,o=0;o=(A|=0)+(e|=0)|0,r=0|n[A+4>>2];do{if(1&r)f=A;else{if(!(3&r))return;if(e=(a=0|n[A>>2])+e|0,(0|n[6926])==(0|(f=A+(0-a)|0))){if(3!=(3&(r=0|n[(A=o+4|0)>>2])|0))break;return n[6923]=e,n[A>>2]=-2&r,n[f+4>>2]=1|e,void(n[o>>2]=e)}if(i=a>>>3,a>>>0<256){if((0|(r=0|n[f+12>>2]))==(0|(A=0|n[f+8>>2]))){n[6921]=n[6921]&~(1<<i);break}n[A+12>>2]=r,n[r+8>>2]=A;break}t=0|n[f+24>>2],A=0|n[f+12>>2];do{if((0|A)==(0|f)){if(A=0|n[(i=4+(r=f+16|0)|0)>>2])r=i;else if(!(A=0|n[r>>2])){A=0;break}for(;;)if(i=0|n[(a=A+20|0)>>2])A=i,r=a;else{if(!(i=0|n[(a=A+16|0)>>2]))break;A=i,r=a}n[r>>2]=0}else n[12+(a=0|n[f+8>>2])>>2]=A,n[A+8>>2]=a}while(0);if(t){if((0|n[(i=27988+((r=0|n[f+28>>2])<<2)|0)>>2])==(0|f)){if(n[i>>2]=A,!A){n[6922]=n[6922]&~(1<<r);break}}else if(n[((0|n[(a=t+16|0)>>2])==(0|f)?a:t+20|0)>>2]=A,!A)break;n[A+24>>2]=t,0|(i=0|n[(r=f+16|0)>>2])&&(n[A+16>>2]=i,n[i+24>>2]=A),(r=0|n[r+4>>2])&&(n[A+20>>2]=r,n[r+24>>2]=A)}}}while(0);if(2&(i=0|n[(A=o+4|0)>>2]))n[A>>2]=-2&i,n[f+4>>2]=1|e,n[f+e>>2]=e,a=e;else{if((0|n[6927])==(0|o)){if(n[6924]=o=(0|n[6924])+e|0,n[6927]=f,n[f+4>>2]=1|o,(0|f)!=(0|n[6926]))return;return n[6926]=0,void(n[6923]=0)}if((0|n[6926])==(0|o))return n[6923]=o=(0|n[6923])+e|0,n[6926]=f,n[f+4>>2]=1|o,void(n[f+o>>2]=o);a=(-8&i)+e|0,r=i>>>3;do{if(i>>>0<256){if((0|(e=0|n[o+12>>2]))==(0|(A=0|n[o+8>>2]))){n[6921]=n[6921]&~(1<<r);break}n[A+12>>2]=e,n[e+8>>2]=A;break}t=0|n[o+24>>2],e=0|n[o+12>>2];do{if((0|e)==(0|o)){if(e=0|n[(r=4+(A=o+16|0)|0)>>2])A=r;else if(!(e=0|n[A>>2])){r=0;break}for(;;)if(r=0|n[(i=e+20|0)>>2])e=r,A=i;else{if(!(r=0|n[(i=e+16|0)>>2]))break;e=r,A=i}n[A>>2]=0,r=e}else n[12+(r=0|n[o+8>>2])>>2]=e,n[e+8>>2]=r,r=e}while(0);if(0|t){if((0|n[(A=27988+((e=0|n[o+28>>2])<<2)|0)>>2])==(0|o)){if(n[A>>2]=r,!r){n[6922]=n[6922]&~(1<<e);break}}else if(n[((0|n[(i=t+16|0)>>2])==(0|o)?i:t+20|0)>>2]=r,!r)break;n[r+24>>2]=t,0|(A=0|n[(e=o+16|0)>>2])&&(n[r+16>>2]=A,n[A+24>>2]=r),0|(e=0|n[e+4>>2])&&(n[r+20>>2]=e,n[e+24>>2]=r)}}while(0);if(n[f+4>>2]=1|a,n[f+a>>2]=a,(0|f)==(0|n[6926]))return void(n[6923]=a)}if(e=a>>>3,a>>>0<256)return r=27724+(e<<1<<2)|0,(A=0|n[6921])&(e=1<<e)?e=0|n[(A=r+8|0)>>2]:(n[6921]=A|e,e=r,A=r+8|0),n[A>>2]=f,n[e+12>>2]=f,n[f+8>>2]=e,void(n[f+12>>2]=r);if(e=27988+((i=(e=a>>>8)?a>>>0>16777215?31:a>>>(7+(i=14-((r=(520192+(o=e<<(t=(e+1048320|0)>>>16&8))|0)>>>16&4)|t|(i=(245760+(o<<=r)|0)>>>16&2))+(o<<i>>>15)|0)|0)&1|i<<1:0)<<2)|0,n[f+28>>2]=i,n[f+20>>2]=0,n[f+16>>2]=0,!((A=0|n[6922])&(r=1<<i)))return n[6922]=A|r,n[e>>2]=f,n[f+24>>2]=e,n[f+12>>2]=f,void(n[f+8>>2]=f);e=0|n[e>>2];A:do{if((-8&n[e+4>>2]|0)!=(0|a)){for(i=a<<(31==(0|i)?0:25-(i>>>1)|0);A=0|n[(r=e+16+(i>>>31<<2)|0)>>2];){if((-8&n[A+4>>2]|0)==(0|a)){e=A;break A}i<<=1,e=A}return n[r>>2]=f,n[f+24>>2]=e,n[f+12>>2]=f,void(n[f+8>>2]=f)}}while(0);n[12+(o=0|n[(t=e+8|0)>>2])>>2]=f,n[t>>2]=f,n[f+8>>2]=o,n[f+12>>2]=e,n[f+24>>2]=0}function pe(A,e,r,i){return 0|(D((e|=0)+(i|=0)+((r=(A|=0)+(r|=0)>>>0)>>>0<A>>>0|0)>>>0|0),0|r)}function Te(A,e,r,i){return 0|(D(0|(i=(e|=0)-(i|=0)-((r|=0)>>>0>(A|=0)>>>0|0)>>>0)),A-r>>>0|0)}function Fe(A){return 0|((A|=0)?31-(0|Q(A^A-1))|0:32)}function Le(A,e,r,i,a){a|=0;var t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0;if(c=A|=0,f=r|=0,o=b=i|=0,!(u=l=e|=0))return t=0!=(0|a),o?t?(n[a>>2]=0|A,n[a+4>>2]=0&e,a=0,0|(D(0|(b=0)),a)):(a=0,0|(D(0|(b=0)),a)):(t&&(n[a>>2]=(c>>>0)%(f>>>0),n[a+4>>2]=0),a=(c>>>0)/(f>>>0)>>>0,0|(D(0|(b=0)),a));t=0==(0|o);do{if(f){if(!t){if((t=(0|Q(0|o))-(0|Q(0|u))|0)>>>0<=31){f=s=t+1|0,A=c>>>(s>>>0)&(e=t-31>>31)|u<<(o=31-t|0),e&=u>>>(s>>>0),t=0,o=c<<o;break}return a?(n[a>>2]=0|A,n[a+4>>2]=l|0&e,a=0,0|(D(0|(b=0)),a)):(a=0,0|(D(0|(b=0)),a))}if((t=f-1|0)&f|0){f=o=33+(0|Q(0|f))-(0|Q(0|u))|0,A=(s=32-o|0)-1>>31&u>>>((d=o-32|0)>>>0)|(u<<s|c>>>(o>>>0))&(e=d>>31),e&=u>>>(o>>>0),t=c<<(g=64-o|0)&(l=s>>31),o=(u<<g|c>>>(d>>>0))&l|c<<s&o-33>>31;break}return 0|a&&(n[a>>2]=t&c,n[a+4>>2]=0),1==(0|f)?(g=0|A,0|(D(0|(d=l|0&e)),g)):(d=u>>>((g=0|Fe(0|f))>>>0)|0,g=u<<32-g|c>>>(g>>>0)|0,0|(D(0|d),g))}if(t)return 0|a&&(n[a>>2]=(u>>>0)%(f>>>0),n[a+4>>2]=0),g=(u>>>0)/(f>>>0)>>>0,0|(D(0|(d=0)),g);if(!c)return 0|a&&(n[a>>2]=0,n[a+4>>2]=(u>>>0)%(o>>>0)),g=(u>>>0)/(o>>>0)>>>0,0|(D(0|(d=0)),g);if(!((t=o-1|0)&o))return 0|a&&(n[a>>2]=0|A,n[a+4>>2]=t&u|0&e),d=0,g=u>>>((0|Fe(0|o))>>>0),0|(D(0|d),g);if((t=(0|Q(0|o))-(0|Q(0|u))|0)>>>0<=30){f=e=t+1|0,A=u<<(o=31-t|0)|c>>>(e>>>0),e=u>>>(e>>>0),t=0,o=c<<o;break}return a?(n[a>>2]=0|A,n[a+4>>2]=l|0&e,g=0,0|(D(0|(d=0)),g)):(g=0,0|(D(0|(d=0)),g))}while(0);if(f){u=0|pe(0|(s=0|r),0|(c=b|0&i),-1,-1),r=0|C(),l=o,o=0;do{i=l,l=t>>>31|l<<1,t=o|t<<1,Te(0|u,0|r,0|(i=A<<1|i>>>31|0),0|(b=A>>>31|e<<1|0)),o=1&(d=(g=0|C())>>31|((0|g)<0?-1:0)<<1),A=0|Te(0|i,0|b,d&s|0,(((0|g)<0?-1:0)>>31|((0|g)<0?-1:0)<<1)&c|0),e=0|C(),f=f-1|0}while(0!=(0|f));u=l,l=0}else u=o,l=0,o=0;return f=0,0|a&&(n[a>>2]=A,n[a+4>>2]=e),g=-2&(t<<1|0)|o,0|(D(0|(d=(0|t)>>>31|(u|f)<<1|0&(f<<1|t>>>31)|l)),g)}function Ge(A,e,r,i){var n,a,t,f,o;return r|=0,a=(i|=0)>>31|((0|i)<0?-1:0)<<1,n=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,t=0|Te((o=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0)|0,(f=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|o,0|f),A=a^o,e=n^f,0|Te((0|Le(t,0|C(),0|Te(a^r|0,n^i|0,0|a,0|n),0|C(),0))^A|0,(0|C())^e|0,0|A,0|e)}function Ue(A,e,r,i){var n,a;return e|=0,i|=0,r=0|function(A,e){var r,i,n,a=0;return A=((r=0|h(a=65535&(e|=0),n=65535&(A|=0)))>>>16)+(0|h(a,i=A>>>16))|0,e=0|h(a=e>>>16,n),0|(D((A>>>16)+(0|h(a,i))+(((65535&A)+e|0)>>>16)|0),A+e<<16|65535&r|0)}(n=A|=0,a=r|=0),A=0|C(),0|(D((0|h(e,a))+(0|h(i,n))+A|0&A|0),0|r)}function ze(A,e,r,i){var a,t,f,o,l,u;return r|=0,a=T,T=T+16|0,o=0|a,u=(i|=0)>>31|((0|i)<0?-1:0)<<1,l=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,Le(A=0|Te((f=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(A|=0)|0,(t=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|f,0|t),e=0|C(),0|Te(u^r|0,l^i|0,0|u,0|l),0|C(),o),i=0|Te(n[o>>2]^f|0,n[o+4>>2]^t|0,0|f,0|t),r=0|C(),T=a,0|(D(0|r),i)}function xe(A,e,r,i){var a,t;return t=T,T=T+16|0,Le(A|=0,e|=0,r|=0,i|=0,a=0|t),T=t,0|(D(0|n[a+4>>2]),0|n[a>>2])}function Ve(A,e,r){return A|=0,e|=0,(0|(r|=0))<32?(D(e>>r|0),A>>>r|(e&(1<<r)-1)<<32-r):(D(0|((0|e)<0?-1:0)),e>>r-32|0)}function Se(A,e,r){return A|=0,e|=0,(0|(r|=0))<32?(D(e>>>r|0),A>>>r|(e&(1<<r)-1)<<32-r):(D(0),e>>>r-32|0)}function He(A,e,r){return A|=0,(0|(r|=0))<32?(D((e|=0)<<r|(A&(1<<r)-1<<32-r)>>>32-r|0),A<<r):(D(A<<r-32|0),0)}function Re(A,e,r){return A|=0,32==(0|(e=0|Q(e|=0)))&&(e=e+(0|Q(A))|0),D(0),0|e}function Ye(A,e){return e=+e,(A=+A)!=A?+e:e!=e?+A:+v(+A,+e)}function je(A,e){return e=+e,(A=+A)!=A?+e:e!=e?+A:+m(+A,+e)}function Oe(A){return(A=+A)>=0?+o(A+.5):+B(A-.5)}function Ne(A,e,r){A|=0,e|=0;var a,t,f=0;if((0|(r|=0))>=8192)return P(0|A,0|e,0|r),0|A;if(t=0|A,a=A+r|0,(3&A)==(3&e)){for(;3&A;){if(!r)return 0|t;i[A>>0]=0|i[e>>0],A=A+1|0,e=e+1|0,r=r-1|0}for(f=(r=-4&a|0)-64|0;(0|A)<=(0|f);)n[A>>2]=n[e>>2],n[A+4>>2]=n[e+4>>2],n[A+8>>2]=n[e+8>>2],n[A+12>>2]=n[e+12>>2],n[A+16>>2]=n[e+16>>2],n[A+20>>2]=n[e+20>>2],n[A+24>>2]=n[e+24>>2],n[A+28>>2]=n[e+28>>2],n[A+32>>2]=n[e+32>>2],n[A+36>>2]=n[e+36>>2],n[A+40>>2]=n[e+40>>2],n[A+44>>2]=n[e+44>>2],n[A+48>>2]=n[e+48>>2],n[A+52>>2]=n[e+52>>2],n[A+56>>2]=n[e+56>>2],n[A+60>>2]=n[e+60>>2],A=A+64|0,e=e+64|0;for(;(0|A)<(0|r);)n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}else for(r=a-4|0;(0|A)<(0|r);)i[A>>0]=0|i[e>>0],i[A+1>>0]=0|i[e+1>>0],i[A+2>>0]=0|i[e+2>>0],i[A+3>>0]=0|i[e+3>>0],A=A+4|0,e=e+4|0;for(;(0|A)<(0|a);)i[A>>0]=0|i[e>>0],A=A+1|0,e=e+1|0;return 0|t}function We(A,e,r){var n=0;if((0|(e|=0))<(0|(A|=0))&(0|A)<(e+(r|=0)|0)){for(n=A,e=e+r|0,A=A+r|0;(0|r)>0;)r=r-1|0,i[(A=A-1|0)>>0]=0|i[(e=e-1|0)>>0];A=n}else Ne(A,e,r);return 0|A}function Ze(A,e,r){e|=0;var a,t=0,f=0,o=0;if(a=(A|=0)+(r|=0)|0,e&=255,(0|r)>=67){for(;3&A;)i[A>>0]=e,A=A+1|0;for(o=e|e<<8|e<<16|e<<24,f=(t=-4&a|0)-64|0;(0|A)<=(0|f);)n[A>>2]=o,n[A+4>>2]=o,n[A+8>>2]=o,n[A+12>>2]=o,n[A+16>>2]=o,n[A+20>>2]=o,n[A+24>>2]=o,n[A+28>>2]=o,n[A+32>>2]=o,n[A+36>>2]=o,n[A+40>>2]=o,n[A+44>>2]=o,n[A+48>>2]=o,n[A+52>>2]=o,n[A+56>>2]=o,n[A+60>>2]=o,A=A+64|0;for(;(0|A)<(0|t);)n[A>>2]=o,A=A+4|0}for(;(0|A)<(0|a);)i[A>>0]=e,A=A+1|0;return a-r|0}function Je(A){return(A=+A)>=0?+o(A+.5):+B(A-.5)}function Ke(A){var e,r,i;return A|=0,i=0|M(),(0|A)>0&(0|(e=(r=0|n[f>>2])+A|0))<(0|r)|(0|e)<0?(p(0|e),y(12),-1):(0|e)>(0|i)&&!(0|I(0|e))?(y(12),-1):(n[f>>2]=e,0|r)}var Xe=[function(A,e){return E(0),0},function(A,e){var r=0,i=0;return A=0|n[(i=A|=0)>>2],e=0|n[(r=e|=0)>>2],0|((i=0|n[i+4>>2])>>>0<(r=0|n[r+4>>2])>>>0|(0|i)==(0|r)&A>>>0<e>>>0?-1:1&(i>>>0>r>>>0|(0|i)==(0|r)&A>>>0>e>>>0))},function(A,e){var r,i,t,f,o=0,l=0;return f=0|n[(l=A|=0)>>2],t=0|n[(o=e|=0)>>2],(l=0|n[l+4>>2])>>>0<(o=0|n[o+4>>2])>>>0|(0|l)==(0|o)&f>>>0<t>>>0?0|(e=-1):l>>>0>o>>>0|(0|l)==(0|o)&f>>>0>t>>>0?0|(e=1):(i=+a[A+8>>3])<(r=+a[e+8>>3])?0|(e=-1):0|(e=i>r&1)},function(A,e){var r,i;return 0|((i=+a[(A|=0)>>3])>(r=+a[(e|=0)>>3])?-1:i<r&1)}];return{___divdi3:Ge,___muldi3:Ue,___remdi3:ze,___uremdi3:xe,_areNeighborCells:function(A,e,r,i,a){a|=0;var t,f,o,l=0,u=0,c=0,s=0;if(o=T,T=T+64|0,f=o,t=o+56|0,!(!0&134217728==(2013265920&(e|=0)|0)&!0&134217728==(2013265920&(i|=0)|0)))return T=o,5;if((0|(A|=0))==(0|(r|=0))&(0|e)==(0|i))return n[a>>2]=0,T=o,0;if(u=0|Se(0|A,0|e,52),C(),u&=15,s=0|Se(0|r,0|i,52),C(),(0|u)!=(15&s|0))return T=o,12;if(l=u+-1|0,u>>>0>1){EA(A,e,l,f),EA(r,i,l,t),c=0|n[(s=f)>>2],s=0|n[s+4>>2];A:do{if((0|c)==(0|n[t>>2])&&(0|s)==(0|n[t+4>>2])){l=0|Se(0|A,0|e,0|(u=3*(15^u)|0)),C(),l&=7,u=0|Se(0|r,0|i,0|u),C(),u&=7;do{if(0==(0|l)|0==(0|u))n[a>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|u)&&0|CA(c,s)){l=5;break}if((0|n[15824+(l<<2)>>2])!=(0|u)&&(0|n[15856+(l<<2)>>2])!=(0|u))break A;n[a>>2]=1,l=0}}while(0);return T=o,0|l}}while(0)}u=(l=f)+56|0;do{n[l>>2]=0,l=l+4|0}while((0|l)<(0|u));return F(A,e,1,f),l=(0|n[(e=f)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+8|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+16|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+24|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+32|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)||(0|n[(e=f+40|0)>>2])==(0|r)&&(0|n[e+4>>2])==(0|i)?1:1&((0|n[(l=f+48|0)>>2])==(0|r)?(0|n[l+4>>2])==(0|i):0),n[a>>2]=l,T=o,0},_bitshift64Ashr:Ve,_bitshift64Lshr:Se,_bitshift64Shl:He,_calloc:Me,_cellAreaKm2:function(A,e,r){r|=0;var i,t,f,o=0;return f=T,T=T+192|0,i=f+176|0,o=f+168|0,(A=0|VA(A|=0,e|=0,t=f))?(T=f,0|(o=A)):(n[o>>2]=n[t>>2],n[o+4>>2]=t+8,n[i>>2]=n[o>>2],n[i+4>>2]=n[o+4>>2],R(i,r),a[r>>3]=40589732.49931477*+a[r>>3],T=f,0|(o=0))},_cellAreaM2:function(A,e,r){r|=0;var i,t,f,o=0;return f=T,T=T+192|0,i=f+176|0,o=f+168|0,(A=0|VA(A|=0,e|=0,t=f))?(T=f,0|(o=A)):(n[o>>2]=n[t>>2],n[o+4>>2]=t+8,n[i>>2]=n[o>>2],n[i+4>>2]=n[o+4>>2],R(i,r),a[r>>3]=40589732.49931477*+a[r>>3]*1e6,T=f,0|(o=0))},_cellAreaRads2:function(A,e,r){r|=0;var i,a,t,f=0;return t=T,T=T+192|0,i=t+176|0,f=t+168|0,0|(A=0|VA(A|=0,e|=0,a=t))?(T=t,0|(f=A)):(n[f>>2]=n[a>>2],n[f+4>>2]=a+8,n[i>>2]=n[f>>2],n[i+4>>2]=n[f+4>>2],R(i,r),T=t,0|(f=0))},_cellToBoundary:VA,_cellToCenterChild:yA,_cellToChildPos:function(A,e,r,i){r|=0,i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0;if(a=T,T=T+16|0,B=a,h=0|Se(0|(A|=0),0|(e|=0),52),C(),r>>>0>15)return T=a,4;if((0|(h&=15))<(0|r))return T=a,12;if((0|h)!=(0|r))if(f=0|He(0|r,0,52),f|=A,l=0|C()|-15728641&e,(0|h)>(0|r)){u=r;do{k=0|He(7,0,3*(14-u|0)|0),u=u+1|0,f|=k,l=0|C()|l}while((0|u)<(0|h));k=f}else k=f;else k=A,l=e;w=0|Se(0|k,0|l,45),C();A:do{if(0|Y(127&w)){if(u=0|Se(0|k,0|l,52),C(),0|(u&=15))for(f=1;;){if(!(0==((w=0|He(7,0,3*(15-f|0)|0))&k|0)&0==((0|C())&l|0))){c=33;break A}if(!(f>>>0<u>>>0))break;f=f+1|0}if(n[(w=i)>>2]=0,n[w+4>>2]=0,(0|h)>(0|r)){for(w=-15728641&e,g=h;;){if(d=g,(g=g+-1|0)>>>0>15|(0|h)<(0|g)){c=19;break}if((0|h)!=(0|g))if(f=0|He(0|g,0,52),f|=A,u=0|C()|w,(0|h)<(0|d))b=f;else{c=g;do{b=0|He(7,0,3*(14-c|0)|0),c=c+1|0,f|=b,u=0|C()|u}while((0|c)<(0|h));b=f}else b=A,u=e;if(s=0|Se(0|b,0|u,45),C(),0|Y(127&s)){s=0|Se(0|b,0|u,52),C(),s&=15;e:do{if(s)for(c=1;;){if(f=0|Se(0|b,0|u,3*(15-c|0)|0),C(),0|(f&=7))break e;if(!(c>>>0<s>>>0)){f=0;break}c=c+1|0}else f=0}while(0);f=0==(0|f)&1}else f=0;if(u=0|Se(0|A,0|e,3*(15-d|0)|0),C(),7==(0|(u&=7))){t=5,c=42;break}if(1==(0|u)&(f=0!=(0|f))){t=5,c=42;break}if(0|(b=u+((0!=(0|u)&f)<<31>>31)|0)&&(c=0|$A(7,0,c=h-d|0,((0|c)<0)<<31>>31),s=0|C(),f?(f=0|pe(0|(f=0|Ue(0|c,0|s,5,0)),0|C(),-5,-1),f=0|pe(0|(f=0|Ge(0|f,0|C(),6,0)),0|C(),1,0),u=0|C()):(f=c,u=s),d=0|pe(0|f,0|u,0|(d=0|Ue(0|c,0|s,0|(d=b+-1|0),((0|d)<0)<<31>>31|0)),0|C()),s=0|pe(0|d,0|(b=0|C()),0|n[(s=i)>>2],0|n[s+4>>2]),b=0|C(),n[(d=i)>>2]=s,n[d+4>>2]=b),(0|g)<=(0|r)){c=37;break}}if(19==(0|c))_(27634,27225,1407,27259);else{if(37==(0|c)){t=0|n[(o=i)+4>>2],o=0|n[o>>2];break}if(42==(0|c))return T=a,0|t}}else t=0,o=0}else c=33}while(0);A:do{if(33==(0|c)){if(n[(w=i)>>2]=0,n[w+4>>2]=0,(0|h)>(0|r)){for(f=h;;){if(t=0|Se(0|A,0|e,3*(15-f|0)|0),C(),7==(0|(t&=7))){t=5;break}if(t=0|Ue(0|(o=0|$A(7,0,o=h-f|0,((0|o)<0)<<31>>31)),0|C(),0|t,0),o=0|C(),o=0|pe(0|n[(w=i)>>2],0|n[w+4>>2],0|t,0|o),t=0|C(),n[(w=i)>>2]=o,n[w+4>>2]=t,(0|(f=f+-1|0))<=(0|r))break A}return T=a,0|t}t=0,o=0}}while(0);return 0|DA(k,l,h,B)&&_(27634,27225,1367,27274),((0|t)>-1|-1==(0|t)&o>>>0>4294967295)&((0|(B=0|n[(h=B)+4>>2]))>(0|t)|((0|B)==(0|t)?(0|n[h>>2])>>>0>o>>>0:0))?(T=a,0|(h=0)):(_(27634,27225,1447,27259),0)},_cellToChildren:function(A,e,r,i){i|=0;var a,t,f=0,o=0;if(t=T,T=T+16|0,HA(a=t,A|=0,e|=0,r|=0),0==(0|(A=0|n[(e=a)>>2]))&0==(0|(e=0|n[e+4>>2])))return T=t,0;f=0,r=0;do{n[(o=i+(f<<3)|0)>>2]=A,n[o+4>>2]=e,f=0|pe(0|f,0|r,1,0),r=0|C(),YA(a),A=0|n[(o=a)>>2],e=0|n[o+4>>2]}while(!(0==(0|A)&0==(0|e)));return T=t,0},_cellToChildrenSize:DA,_cellToLatLng:xA,_cellToLocalIj:function(A,e,r,i,a,t){t|=0;var f,o=0;return f=T,T=T+16|0,o=f,0|(a|=0)?(T=f,0|(o=15)):((A=0|JA(A|=0,e|=0,r|=0,i|=0,o))||(a=0|n[o+4>>2],n[t>>2]=(0|n[o>>2])-(A=0|n[o+8>>2]),n[t+4>>2]=a-A,A=0),T=f,0|(o=A))},_cellToParent:EA,_cellToVertex:ge,_cellToVertexes:function(A,e,r){r|=0;var i,a=0,t=0;return t=0==(0|CA(A|=0,e|=0)),i=0==(0|(a=0|ge(A,e,0,r))),t?i?0|(a=0|ge(A,e,1,r+8|0))?0|(t=a):0|(a=0|ge(A,e,2,r+16|0))?0|(t=a):0|(a=0|ge(A,e,3,r+24|0))?0|(t=a):(a=0|ge(A,e,4,r+32|0))?0|(t=a):0|ge(A,e,5,r+40|0):0|(t=a):i?0|(a=0|ge(A,e,1,r+8|0))?0|(t=a):0|(a=0|ge(A,e,2,r+16|0))?0|(t=a):0|(a=0|ge(A,e,3,r+24|0))?0|(t=a):0|(a=0|ge(A,e,4,r+32|0))?0|(t=a):(n[(t=r+40|0)>>2]=0,n[t+4>>2]=0,0|(t=0)):0|(t=a)},_cellsToDirectedEdge:function(A,e,r,i,a){return a|=0,7==(0|(r=0|S(A|=0,e|=0,r|=0,i|=0)))?0|(a=11):(i=0|He(0|r,0,56),e=-2130706433&e|0|C()|268435456,n[a>>2]=A|i,n[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(A,e,r){r|=0;var i,a,t,f=0,o=0,l=0,u=0;if(a=T,T=T+16|0,0|(A=0|nA(A|=0,e|=0,((0|e)<0)<<31>>31,t=a)))return T=a,0|A;if(i=0|function(A,e){A|=0;var r,i,a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(n[(e|=0)>>2]=0,n[(i=e+4|0)>>2]=0,n[(a=e+8|0)>>2]=0,(0|(B=0|n[A>>2]))<=0)return 0;r=A+4|0,A=e,k=0;A:for(;;){if(k){if(!(t=0|Me(1,12))){t=5;break}n[A+8>>2]=t,A=t}if(s=0|n[r>>2],!(b=0|Me(1,12))){A=13,t=37;break}if(n[(0==(0|(f=0|n[(w=A+4|0)>>2]))?A:f+8|0)>>2]=b,n[w>>2]=b,(0|(f=0|n[s+(k<<4)>>2]))<3){A=1,t=37;break}o=s+(k<<4)+4|0,l=b+4|0,t=0,u=0;do{if(c=u,!(u=0|_e(24))){A=13,t=37;break A}We(0|u,(0|n[o>>2])+(t<<4)|0,16),n[u+16>>2]=0,c?n[c+16>>2]=u:n[b>>2]=u,n[l>>2]=u,t=t+1|0}while((0|t)<(0|f));if((0|(g=0|n[s+(k<<4)+8>>2]))>0){d=s+(k<<4)+12|0,s=0;do{if(f=0|n[d>>2],t=b,!(b=0|Me(1,12))){A=13,t=37;break A}if(n[t+8>>2]=b,n[w>>2]=b,(0|(c=0|n[f+(s<<3)>>2]))<3){A=1,t=37;break A}f=f+(s<<3)+4|0,o=b+4|0,t=0,l=0;do{if(u=l,!(l=0|_e(24))){A=13,t=37;break A}We(0|l,(0|n[f>>2])+(t<<4)|0,16),n[l+16>>2]=0,u?n[u+16>>2]=l:n[b>>2]=l,n[o>>2]=l,t=t+1|0}while((0|t)<(0|c));s=s+1|0}while((0|s)<(0|g))}if((0|(k=k+1|0))>=(0|B)){A=0,t=50;break}}if(5==(0|t)){if(!e)return 13;for(f=1,o=e;;){if(0|(A=0|n[o>>2]))do{if(0|(t=0|n[A>>2]))do{B=t,t=0|n[t+16>>2],ye(B)}while(0!=(0|t));B=A,A=0|n[A+8>>2],ye(B)}while(0!=(0|A));if(A=o,o=0|n[o+8>>2],f?(n[e>>2]=0,n[i>>2]=0,n[a>>2]=0):ye(A),!o){A=13;break}f=0}return 0|A}if(37==(0|t)){if(!e)return 0|A;for(o=1,l=e;;){if(0|(t=0|n[l>>2]))do{if(0|(f=0|n[t>>2]))do{B=f,f=0|n[f+16>>2],ye(B)}while(0!=(0|f));B=t,t=0|n[t+8>>2],ye(B)}while(0!=(0|t));if(t=l,l=0|n[l+8>>2],o?(n[e>>2]=0,n[i>>2]=0,n[a>>2]=0):ye(t),!l)break;o=0}return 0|A}return 50==(0|t)?0|A:0}(t,r),r=t+4|0,(0|n[t>>2])>0){e=0;do{if(ye(0|n[(f=(o=0|n[r>>2])+(e<<4)+4|0)>>2]),n[f>>2]=0,n[o+(e<<4)>>2]=0,f=o+(e<<4)+8|0,o=o+(e<<4)+12|0,(0|n[f>>2])>0){A=0;do{ye(0|n[(u=(l=0|n[o>>2])+(A<<3)+4|0)>>2]),n[u>>2]=0,n[l+(A<<3)>>2]=0,A=A+1|0}while((0|A)<(0|n[f>>2]))}ye(0|n[o>>2]),n[o>>2]=0,n[f>>2]=0,e=e+1|0}while((0|e)<(0|n[t>>2]))}return ye(0|n[r>>2]),n[r>>2]=0,n[t>>2]=0,T=a,0|i},_childPosToCell:function(A,e,r,i,a,t){A|=0,e|=0,t|=0;var f,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(f=T,T=T+16|0,o=f,(a|=0)>>>0>15)return T=f,4;if(l=0|Se(0|(r|=0),0|(i|=0),52),C(),(0|(l&=15))>(0|a))return T=f,12;if(0|DA(r,i,a,o)&&_(27634,27225,1367,27274),!(((0|e)>-1|-1==(0|e)&A>>>0>4294967295)&((0|(c=0|n[(s=o)+4>>2]))>(0|e)|((0|c)==(0|e)?(0|n[s>>2])>>>0>A>>>0:0))))return T=f,2;s=a-l|0,a=0|He(0|a,0,52),u=0|C()|-15728641&i,n[(c=t)>>2]=a|r,n[c+4>>2]=u,c=0|Se(0|r,0|i,45),C();A:do{if(0|Y(127&c)){if(0|l)for(o=1;;){if(!(0==((c=0|He(7,0,3*(15-o|0)|0))&r|0)&0==((0|C())&i|0)))break A;if(!(o>>>0<l>>>0))break;o=o+1|0}if((0|s)<1)return T=f,0;for(c=15^l,i=-1,u=1,o=1;;){l=0|$A(7,0,l=s-u|0,((0|l)<0)<<31>>31),r=0|C();do{if(o){if(o=0|Ge(0|(o=0|pe(0|(o=0|Ue(0|l,0|r,5,0)),0|C(),-5,-1)),0|C(),6,0),(0|e)>(0|(a=0|C()))|(0|e)==(0|a)&A>>>0>o>>>0){e=0|Te(0|(e=0|pe(0|A,0|e,-1,-1)),0|C(),0|o,0|a),o=0|C(),g=0|n[(b=t)>>2],b=0|n[b+4>>2],d=0|He(7,0,0|(w=3*(c+i|0)|0)),b&=~(0|C()),w=0|He(0|(a=0|pe(0|(i=0|Ge(0|e,0|o,0|l,0|r)),0|(A=0|C()),2,0)),0|C(),0|w),b=0|C()|b,n[(a=t)>>2]=w|g&~d,n[a+4>>2]=b,A=0|Te(0|e,0|o,0|(A=0|Ue(0|i,0|A,0|l,0|r)),0|C()),o=0,e=0|C();break}d=0|n[(w=t)>>2],w=0|n[w+4>>2],g=0|He(7,0,3*(c+i|0)|0),w&=~(0|C()),n[(o=t)>>2]=d&~g,n[o+4>>2]=w,o=1;break}a=0|n[(d=t)>>2],d=0|n[d+4>>2],b=0|He(7,0,0|(i=3*(c+i|0)|0)),d&=~(0|C()),i=0|He(0|(w=0|Ge(0|A,0|e,0|l,0|r)),0|(o=0|C()),0|i),d=0|C()|d,n[(g=t)>>2]=i|a&~b,n[g+4>>2]=d,A=0|Te(0|A,0|e,0|(o=0|Ue(0|w,0|o,0|l,0|r)),0|C()),o=0,e=0|C()}while(0);if(!((0|s)>(0|u))){e=0;break}i=~u,u=u+1|0}return T=f,0|e}}while(0);if((0|s)<1)return T=f,0;for(a=15^l,o=1;;){if(g=0|$A(7,0,g=s-o|0,((0|g)<0)<<31>>31),w=0|C(),r=0|n[(u=t)>>2],u=0|n[u+4>>2],i=0|He(7,0,0|(l=3*(a-o|0)|0)),u&=~(0|C()),l=0|He(0|(b=0|Ge(0|A,0|e,0|g,0|w)),0|(d=0|C()),0|l),u=0|C()|u,n[(c=t)>>2]=l|r&~i,n[c+4>>2]=u,A=0|Te(0|A,0|e,0|(w=0|Ue(0|b,0|d,0|g,0|w)),0|C()),e=0|C(),(0|s)<=(0|o)){e=0;break}o=o+1|0}return T=f,0|e},_compactCells:function(A,e,r,i){e|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,y=0,M=0,P=0,I=0,p=0,T=0;if(0==(0|(r|=0))&0==(0|(i|=0)))return 0;if(f=0|n[(t=A|=0)>>2],!0&0==(15728640&(t=0|n[t+4>>2])|0)){if(!((0|i)>0|0==(0|i)&r>>>0>0))return 0;if(n[(T=e)>>2]=f,n[T+4>>2]=t,1==(0|r)&0==(0|i))return 0;t=1,f=0;do{p=0|n[4+(I=A+(t<<3)|0)>>2],n[(T=e+(t<<3)|0)>>2]=n[I>>2],n[T+4>>2]=p,t=0|pe(0|t,0|f,1,0),f=0|C()}while((0|f)<(0|i)|(0|f)==(0|i)&t>>>0<r>>>0);return 0}if(!(p=0|_e(a=r<<3)))return 13;if(Ne(0|p,0|A,0|a),!(I=0|Me(r,8)))return ye(p),13;A:for(;;){M=0|Se(0|(c=0|n[(t=p)>>2]),0|(t=0|n[t+4>>2]),52),C(),P=(M&=15)-1|0,y=0!=(0|M),D=(0|i)>0|0==(0|i)&r>>>0>0;e:do{if(y&D){if(m=0|He(0|P,0,52),v=0|C(),P>>>0>15){if(!(0==(0|c)&0==(0|t))){T=16;break A}for(f=0,A=0;;){if(f=0|pe(0|f,0|A,1,0),!((0|(A=0|C()))<(0|i)|(0|A)==(0|i)&f>>>0<r>>>0))break e;if(!(0==(0|(E=0|n[(o=p+(f<<3)|0)>>2]))&0==(0|(o=0|n[o+4>>2])))){t=o,T=16;break A}}}for(l=c,A=t,f=0,o=0;;){if(!(0==(0|l)&0==(0|A))){if(!(!0&0==(117440512&A|0))){T=21;break A}if(s=0|Se(0|l,0|A,52),C(),(0|(s&=15))<(0|P)){t=12,T=27;break A}if((0|s)!=(0|P)&&(l|=m,A=-15728641&A|v,s>>>0>=M>>>0)){u=P;do{E=0|He(7,0,3*(14-u|0)|0),u=u+1|0,l|=E,A=0|C()|A}while(u>>>0<s>>>0)}if(d=0|xe(0|l,0|A,0|r,0|i),g=0|C(),!(0==(0|(b=0|n[(s=u=I+(d<<3)|0)>>2]))&0==(0|(s=0|n[s+4>>2])))){B=0,h=0;do{if((0|B)>(0|i)|(0|B)==(0|i)&h>>>0>r>>>0){T=31;break A}if((0|b)==(0|l)&(-117440513&s|0)==(0|A)){w=0|Se(0|b,0|s,56),C(),k=1+(w&=7)|0,E=0|Se(0|b,0|s,45),C();r:do{if(0|Y(127&E)){if(b=0|Se(0|b,0|s,52),C(),!(b&=15)){s=6;break}for(s=1;;){if(!(0==((E=0|He(7,0,3*(15-s|0)|0))&l|0)&0==((0|C())&A|0))){s=7;break r}if(!(s>>>0<b>>>0)){s=6;break}s=s+1|0}}else s=7}while(0);if((w+2|0)>>>0>s>>>0){T=41;break A}E=0|He(0|k,0,56),A=0|C()|-117440513&A,n[(Q=u)>>2]=0,n[Q+4>>2]=0,l|=E}else d=0|ze(0|(d=0|pe(0|d,0|g,1,0)),0|C(),0|r,0|i),g=0|C();h=0|pe(0|h,0|B,1,0),B=0|C(),b=0|n[(s=u=I+(d<<3)|0)>>2],s=0|n[s+4>>2]}while(!(0==(0|b)&0==(0|s)))}n[(E=u)>>2]=l,n[E+4>>2]=A}if(f=0|pe(0|f,0|o,1,0),!((0|(o=0|C()))<(0|i)|(0|o)==(0|i)&f>>>0<r>>>0))break e;l=0|n[(A=p+(f<<3)|0)>>2],A=0|n[A+4>>2]}}}while(0);if(E=0|pe(0|r,0|i,5,0),(Q=0|C())>>>0<0|0==(0|Q)&E>>>0<11){T=85;break}if(E=0|Ge(0|r,0|i,6,0),C(),!(E=0|Me(E,8))){T=48;break}do{if(D){for(k=0,A=0,w=0,B=0;;){if(0==(0|(f=0|n[(o=s=I+(k<<3)|0)>>2]))&0==(0|(o=0|n[o+4>>2])))Q=w;else{b=0|Se(0|f,0|o,56),C(),l=1+(b&=7)|0,d=-117440513&o,Q=0|Se(0|f,0|o,45),C();e:do{if(0|Y(127&Q)){if(g=0|Se(0|f,0|o,52),C(),0|(g&=15))for(u=1;;){if(!(0==(f&(Q=0|He(7,0,3*(15-u|0)|0))|0)&0==(d&(0|C())|0)))break e;if(!(u>>>0<g>>>0))break;u=u+1|0}f|=o=0|He(0|l,0,56),o=0|C()|d,n[(l=s)>>2]=f,n[l+4>>2]=o,l=b+2|0}}while(0);7==(0|l)?(n[(Q=E+(A<<3)|0)>>2]=f,n[Q+4>>2]=-117440513&o,A=0|pe(0|A,0|w,1,0),Q=0|C()):Q=w}if(k=0|pe(0|k,0|B,1,0),!((0|(B=0|C()))<(0|i)|(0|B)==(0|i)&k>>>0<r>>>0))break;w=Q}if(D){if(h=P>>>0>15,m=0|He(0|P,0,52),v=0|C(),!y){for(f=0,u=0,l=0,o=0;0==(0|c)&0==(0|t)||(n[(P=e+(f<<3)|0)>>2]=c,n[P+4>>2]=t,f=0|pe(0|f,0|u,1,0),u=0|C()),l=0|pe(0|l,0|o,1,0),(0|(o=0|C()))<(0|i)|(0|o)==(0|i)&l>>>0<r>>>0;)c=0|n[(t=p+(l<<3)|0)>>2],t=0|n[t+4>>2];t=Q;break}for(f=0,u=0,o=0,l=0;;){do{if(!(0==(0|c)&0==(0|t))){if(g=0|Se(0|c,0|t,52),C(),h|(0|(g&=15))<(0|P)){T=80;break A}if((0|g)!=(0|P)){if(s=c|m,b=-15728641&t|v,g>>>0>=M>>>0){d=P;do{y=0|He(7,0,3*(14-d|0)|0),d=d+1|0,s|=y,b=0|C()|b}while(d>>>0<g>>>0)}}else s=c,b=t;w=0|xe(0|s,0|b,0|r,0|i),d=0,g=0,B=0|C();do{if((0|d)>(0|i)|(0|d)==(0|i)&g>>>0>r>>>0){T=81;break A}if((-117440513&(k=0|n[4+(y=I+(w<<3)|0)>>2])|0)==(0|b)&&(0|n[y>>2])==(0|s)){T=65;break}w=0|ze(0|(y=0|pe(0|w,0|B,1,0)),0|C(),0|r,0|i),B=0|C(),g=0|pe(0|g,0|d,1,0),d=0|C(),y=I+(w<<3)|0}while((0|n[y>>2])!=(0|s)||(0|n[y+4>>2])!=(0|b));if(65==(0|T)&&(T=0,!0&100663296==(117440512&k|0)))break;n[(y=e+(f<<3)|0)>>2]=c,n[y+4>>2]=t,f=0|pe(0|f,0|u,1,0),u=0|C()}}while(0);if(o=0|pe(0|o,0|l,1,0),!((0|(l=0|C()))<(0|i)|(0|l)==(0|i)&o>>>0<r>>>0))break;c=0|n[(t=p+(o<<3)|0)>>2],t=0|n[t+4>>2]}t=Q}else f=0,t=Q}else f=0,A=0,t=0}while(0);if(Ze(0|I,0,0|a),Ne(0|p,0|E,A<<3|0),ye(E),0==(0|A)&0==(0|t)){T=89;break}e=e+(f<<3)|0,i=t,r=A}if(16==(0|T))!0&0==(117440512&t|0)?(t=4,T=27):T=21;else if(31==(0|T))_(27634,27225,620,27235);else{if(41==(0|T))return ye(p),ye(I),10;if(48==(0|T))return ye(p),ye(I),13;80==(0|T)?_(27634,27225,711,27235):81==(0|T)?_(27634,27225,723,27235):85==(0|T)&&(Ne(0|e,0|p,r<<3|0),T=89)}return 21==(0|T)?(ye(p),ye(I),0|(T=5)):27==(0|T)?(ye(p),ye(I),0|(T=t)):89==(0|T)?(ye(p),ye(I),0|(T=0)):0},_constructCell:function(A,e,r,a){r|=0,a|=0;var t=0,f=0,o=0,l=0,u=0,c=0;if((A|=0)>>>0>15)return 4;if((e|=0)>>>0>121)return 17;o=0|He(0|A,0,52),t=0|C(),l=0|He(0|e,0,45),t=0|t|C()|134225919;A:do{if((0|A)>=1){for(l=1,o=0!=(0|i[20496+e>>0]),f=-1;;){if((e=0|n[r+(l+-1<<2)>>2])>>>0>6){t=18,e=10;break}if(!(0==(0|e)|1^o)){if(1==(0|e)){t=19,e=10;break}o=0}if(u=0|He(7,0,0|(c=3*(15-l|0)|0)),t&=~(0|C()),f=(e=0|He(0|e,((0|e)<0)<<31>>31|0,0|c))|f&~u,t=0|C()|t,!((0|l)<(0|A)))break A;l=l+1|0}if(10==(0|e))return 0|t}else f=-1}while(0);return n[(c=a)>>2]=f,n[c+4>>2]=t,0},_destroyLinkedMultiPolygon:function(A){var e,r,i=0,a=0,t=0,f=0,o=0;if(A|=0)for(e=A+4|0,r=A+8|0,t=1,f=A;;){if(0|(i=0|n[f>>2]))do{if(0|(a=0|n[i>>2]))do{o=a,a=0|n[a+16>>2],ye(o)}while(0!=(0|a));o=i,i=0|n[i+8>>2],ye(o)}while(0!=(0|i));if(i=f,f=0|n[f+8>>2],t?(n[A>>2]=0,n[e>>2]=0,n[r>>2]=0):ye(i),!f)break;t=0}},_directedEdgeToBoundary:oA,_directedEdgeToCells:function(A,e,r){A|=0;var i,a,t,f=0;return i=T,T=T+16|0,f=i,!0&268435456==(2013265920&(e|=0)|0)?(a=-2130706433&e|134217728,n[(t=r|=0)>>2]=A,n[t+4>>2]=a,n[f>>2]=0,e=0|Se(0|A,0|e,56),C(),f=0|z(A,a,7&e,f,r+8|0),T=i,0|f):(T=i,0|(f=6))},_edgeLengthKm:function(A,e,r){r|=0;var i,t=0,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,l=i)))return l=A,o=+a[r>>3],a[r>>3]=o*=6371.007180918475,T=i,0|l;if(a[r>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,o=0,a[r>>3]=o*=6371.007180918475,T=i,0|l;e=A+-1|0,A=0,t=+a[l+8>>3],f=+a[l+16>>3],o=0;do{d=t,b=f,b=(g=+s(.5*((t=+a[l+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((f=+a[l+8+(A<<4)+8>>3])-b)))*(+c(+d)*+c(+t)*b),o+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)!=(0|e));return a[r>>3]=o,l=0,g=o,a[r>>3]=g*=6371.007180918475,T=i,0|l},_edgeLengthM:function(A,e,r){r|=0;var i,t=0,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,l=i)))return l=A,o=+a[r>>3],o*=6371.007180918475,a[r>>3]=o*=1e3,T=i,0|l;if(a[r>>3]=0,(0|(A=0|n[l>>2]))<=1)return l=0,o=0,o*=6371.007180918475,a[r>>3]=o*=1e3,T=i,0|l;e=A+-1|0,A=0,t=+a[l+8>>3],f=+a[l+16>>3],o=0;do{d=t,b=f,b=(g=+s(.5*((t=+a[l+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((f=+a[l+8+(A<<4)+8>>3])-b)))*(+c(+d)*+c(+t)*b),o+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)!=(0|e));return a[r>>3]=o,l=0,g=o,g*=6371.007180918475,a[r>>3]=g*=1e3,T=i,0|l},_edgeLengthRads:function(A,e,r){r|=0;var i,t,f=0,o=0,l=0,b=0,d=0,g=0;if(i=T,T=T+176|0,0|(A=0|oA(A|=0,e|=0,t=i)))return T=i,0|A;if(a[r>>3]=0,(0|(A=0|n[t>>2]))<=1)return T=i,0;e=A+-1|0,A=0,f=+a[t+8>>3],o=+a[t+16>>3],l=0;do{d=f,b=o,b=(g=+s(.5*((f=+a[t+8+((A=A+1|0)<<4)>>3])-d)))*g+(b=+s(.5*((o=+a[t+8+(A<<4)+8>>3])-b)))*(+c(+f)*+c(+d)*b),l+=2*+k(+ +u(+b),+ +u(+(1-b)))}while((0|A)<(0|e));return a[r>>3]=l,T=i,0},_emscripten_replace_memory:function(A){return i=new Int8Array(A),new Uint8Array(A),n=new Int32Array(A),new Float32Array(A),a=new Float64Array(A),r=A,!0},_free:ye,_getBaseCellNumber:mA,_getDirectedEdgeDestination:function(A,e,r){A|=0,e|=0,r|=0;var i,a,t=0;return i=T,T=T+16|0,n[(t=i)>>2]=0,!0&268435456==(2013265920&e|0)?(a=0|Se(0|A,0|e,56),C(),t=0|z(A,-2130706433&e|134217728,7&a,t,r),T=i,0|t):(T=i,0|(t=6))},_getDirectedEdgeOrigin:function(A,e,r){return r|=0,!0&268435456==(2013265920&(e|=0)|0)?(n[r>>2]=A|=0,n[r+4>>2]=-2130706433&e|134217728,0|(r=0)):0|(r=6)},_getHexagonAreaAvgKm2:WA,_getHexagonAreaAvgM2:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20752+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20880+(A<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(A,e){return e|=0,(A|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[21008+(A<<3)>>3],0|(e=0))},_getIcosahedronFaces:function A(e,r,i){i|=0;var a,t=0,f=0,o=0,l=0,u=0,c=0,s=0,b=0;a=T,T=T+128|0,s=a+112|0,o=a+96|0,b=a,f=0|Se(0|(e|=0),0|(r|=0),52),C(),n[s>>2]=u=15&f,l=0|Se(0|e,0|r,45),C(),l&=127;A:do{if(0|Y(l)){if(0|u)for(t=1;;){if(!(0==((c=0|He(7,0,3*(15-t|0)|0))&e|0)&0==((0|C())&r|0))){f=0;break A}if(!(t>>>0<u>>>0))break;t=t+1|0}if(!(1&f))return c=0|He(u+1|0,0,52),b=0|C()|-15728641&r,b=0|A((c|e)&~(s=0|He(7,0,3*(14-u|0)|0)),b&~(0|C()),i),T=a,0|b;f=1}else f=0}while(0);if(!(t=0|zA(e,r,o))){f?(dA(o,s,b),c=5):(BA(o,s,b),c=6);A:do{if(0|Y(l))if(u)for(t=1;;){if(!(0==((l=0|He(7,0,3*(15-t|0)|0))&e|0)&0==((0|C())&r|0))){e=2;break A}if(!(t>>>0<u>>>0)){e=5;break}t=t+1|0}else e=5;else e=2}while(0);Ze(0|i,-1,e<<2|0);A:do{if(f)for(o=0;;){if(wA(l=b+(o<<4)|0,0|n[s>>2]),-1==(0|(u=0|n[i>>2]))|(0|u)==(0|(l=0|n[l>>2])))t=i;else{f=0;do{if((f=f+1|0)>>>0>=e>>>0){t=1;break A}u=0|n[(t=i+(f<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|l)))}if(n[t>>2]=l,(o=o+1|0)>>>0>=c>>>0){t=0;break}}else for(o=0;;){if(gA(l=b+(o<<4)|0,0|n[s>>2],0,1),-1==(0|(u=0|n[i>>2]))|(0|u)==(0|(l=0|n[l>>2])))t=i;else{f=0;do{if((f=f+1|0)>>>0>=e>>>0){t=1;break A}u=0|n[(t=i+(f<<2)|0)>>2]}while(!(-1==(0|u)|(0|u)==(0|l)))}if(n[t>>2]=l,(o=o+1|0)>>>0>=c>>>0){t=0;break}}}while(0)}return T=a,0|t},_getIndexDigit:function(A,e,r,i){return i|=0,((r|=0)-1|0)>>>0>14?0|(i=4):(r=0|Se(0|(A|=0),0|(e|=0),3*(15-r|0)|0),C(),n[i>>2]=7&r,0|(i=0))},_getNumCells:ZA,_getPentagons:SA,_getRes0Cells:function(A){A|=0;var e=0,r=0,i=0;e=0;do{He(0|e,0,45),i=134225919|C(),n[(r=A+(e<<3)|0)>>2]=-1,n[r+4>>2]=i,e=e+1|0}while(122!=(0|e));return 0},_getResolution:hA,_greatCircleDistanceKm:NA,_greatCircleDistanceM:function(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(A,e){var r,i,n,t=0;return t=(n=+s(.5*((i=+a[(e|=0)>>3])-(r=+a[(A|=0)>>3]))))*n+(t=+s(.5*(+a[e+8>>3]-+a[A+8>>3])))*(+c(+i)*+c(+r)*t),2*+k(+ +u(+t),+ +u(+(1-t)))},_gridDisk:F,_gridDiskDistances:L,_gridDistance:XA,_gridPathCells:function(A,e,r,i,a){a|=0;var t,f,o=0,l=0;return f=T,T=T+16|0,0|(l=0|XA(A|=0,e|=0,r|=0,i|=0,o=f))?(T=f,0|(a=l)):0==(0|(o=0|n[(l=o)>>2]))&0==(0|(l=0|n[l+4>>2]))?(n[a>>2]=A,n[a+4>>2]=e,T=f,0|(a=0)):(t=0|qA(A,e,r,i,o,l,a,0,0,1,0))?(a=0==(0|qA(r,i,A,e,o,l,a,o,l,-1,-1)),T=f,0|(a=a?0:t)):(T=f,0|(a=0))},_gridPathCellsSize:function(A,e,r,i,a){a|=0;var t,f=0;return t=T,T=T+16|0,0|(A=0|XA(A|=0,e|=0,r|=0,i|=0,f=t))?(T=t,0|(f=A)):(r=0|pe(0|n[(r=f)>>2],0|n[r+4>>2],1,0),i=0|C(),n[(f=a)>>2]=r,n[f+4>>2]=i,T=t,0|(f=0))},_gridRing:function(A,e,r,i){return 0|x(A|=0,e|=0,r|=0,i|=0)?(Ze(0|i,0,48*r|0),0|(i=0|V(A,e,r,i))):0|(i=0)},_gridRingUnsafe:x,_i64Add:pe,_i64Subtract:Te,_isPentagon:CA,_isResClassIII:function(A,e){return e=0|Se(0|(A|=0),0|(e|=0),52),C(),1&e|0},_isValidCell:vA,_isValidDirectedEdge:tA,_isValidIndex:function(A,e){A|=0;var r=0,n=0,a=0,t=0;if(!0&134217728==(-16777216&(e|=0)|0)&&(n=0|Se(0|A,0|e,52),C(),n&=15,r=0|Se(0|A,0|e,45),C(),(r&=127)>>>0<=121)&&0==(613566756&(t=0|He(0|(a=0|Se(0|A,0|e,0|(t=3*(15^n)|0))),0|C(),0|t))&(0|Te(-1227133514,-1171,0|t,0|(a=0|C())))|0)&0==(4681&a&(0|C())|0)&&15==(0|n)|0==(0|(t=0|Se(0|He(0|~A,0|~e,0|(t=19+(3*n|0)|0)),0|C(),0|t)))&0==(0|C())){if(!(0|i[20496+r>>0]))return 1;if(0==(0|A)&0==(0|(r=8191&e)))return 1;if(t=0|Re(0|A,0|r),C(),0|(63-t|0)%3)return 1}return 0|tA(A,e)?0|(t=1):0|(t=0!=(0|we(A,e))&1)},_isValidVertex:we,_latLngToCell:GA,_llvm_ctlz_i64:Re,_llvm_maxnum_f64:Ye,_llvm_minnum_f64:je,_llvm_round_f64:Oe,_localIjToCell:function(A,e,r,i,a){A|=0,e|=0,a|=0;var t,f,o,l=0,u=0,c=0,s=0;return o=T,T=T+16|0,s=o,0|(i|=0)?(T=o,0|(s=15)):(u=0|n[4+(r|=0)>>2],n[s>>2]=c=0|n[r>>2],n[(t=s+4|0)>>2]=u,n[(f=s+8|0)>>2]=0,i=(r=(0|u)<(0|c))?c:u,(0|(r=r?u:c))<0&&(-2147483648==(0|r)||((0|i)>0?(2147483647-i|0)<(0|r):(-2147483648-i|0)>(0|r))||((0|i)>-1?(-2147483648|i|0)>=(0|r):(-2147483648^i|0)<(0|r)))?i=1:l=5,5==(0|l)&&(i=u-c|0,l=0-c|0,(0|c)<0?(n[t>>2]=i,n[f>>2]=l,n[s>>2]=0,c=0):(i=u,l=0),u=c-i|0,r=l-i|0,(0|i)<0?(n[s>>2]=u,n[f>>2]=r,n[t>>2]=0,c=u,i=0):r=l,u=c-r|0,l=i-r|0,(0|r)<0?(n[s>>2]=u,n[t>>2]=l,n[f>>2]=0,r=0):(l=i,u=c),(0|(i=(0|r)<(0|(i=(0|l)<(0|u)?l:u))?r:i))>0&&(n[s>>2]=u-i,n[t>>2]=l-i,n[f>>2]=r-i),i=0|KA(A,e,s,a)),T=o,0|(s=i))},_malloc:_e,_maxFaceCount:function(A,e,r){r|=0;var i=0,a=0;if(a=0|Se(0|(A|=0),0|(e|=0),45),C(),!(0|Y(127&a)))return n[r>>2]=a=2,0;if(a=0|Se(0|A,0|e,52),C(),!(a&=15))return n[r>>2]=a=5,0;for(i=1;;){if(!(0==((0|He(7,0,3*(15-i|0)|0))&A|0)&0==((0|C())&e|0))){i=2,A=6;break}if(!(i>>>0<a>>>0)){i=5,A=6;break}i=i+1|0}return 6==(0|A)?(n[r>>2]=i,0):0},_maxGridDiskSize:function(A,e){e|=0;var r=0,i=0,a=0;return(0|(A|=0))<0?0|(e=2):(0|A)>13780509?0|(e=0|ZA(15,e)):(a=0|Ue(0|A,0|(r=((0|A)<0)<<31>>31),3,0),i=0|C(),r=0|pe(0|A,0|r,1,0),r=0|pe(0|(r=0|Ue(0|a,0|i,0|r,0|C())),0|C(),1,0),A=0|C(),n[e>>2]=r,n[e+4>>2]=A,0|(e=0))},_maxPolygonToCellsSize:function(A,e,r,i){A|=0,e|=0,i|=0;var a,t,f=0,o=0,l=0,u=0;if(a=T,T=T+48|0,f=a+16|0,o=a+8|0,t=a,0|(r=0|te(r|=0)))return T=a,0|r;if(l=0|n[(u=A)+4>>2],n[(r=o)>>2]=n[u>>2],n[r+4>>2]=l,ae(o,f),!(r=0|rA(f,e,t))){if(e=0|n[o>>2],(0|(o=0|n[A+8>>2]))>0){f=0|n[A+12>>2],r=0;do{e=(0|n[f+(r<<3)>>2])+e|0,r=r+1|0}while((0|r)<(0|o))}f=0|n[(r=t)>>2],(0|(r=0|n[r+4>>2]))<(0|(o=((0|e)<0)<<31>>31))|(0|r)==(0|o)&f>>>0<e>>>0?(n[(r=t)>>2]=e,n[r+4>>2]=o,r=o):e=f,l=0|pe(0|e,0|r,12,0),u=0|C(),n[(r=t)>>2]=l,n[r+4>>2]=u,n[(r=i)>>2]=l,n[r+4>>2]=u,r=0}return T=a,0|r},_maxPolygonToCellsSizeExperimental:function(A,e,r,t){e|=0,r|=0,t|=0;var f,o,u=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0;if(o=T,T=T+48|0,g=o+32|0,d=o+40|0,f=o,!(0|n[(A|=0)>>2]))return n[(w=t)>>2]=0,n[w+4>>2]=0,T=o,0;QA(g,0,0,0),u=0|n[(b=g)>>2],b=0|n[b+4>>2];do{if(e>>>0>15)n[(w=f)>>2]=0,n[w+4>>2]=0,n[f+8>>2]=4,n[f+12>>2]=-1,r=f+29|0,n[(w=f+16|0)>>2]=0,n[w+4>>2]=0,n[w+8>>2]=0,i[w+12>>0]=0,i[r>>0]=0|i[d>>0],i[r+1>>0]=0|i[d+1>>0],i[r+2>>0]=0|i[d+2>>0],r=4,w=9;else{if(0|(r=0|te(r))){n[(g=f)>>2]=0,n[g+4>>2]=0,n[f+8>>2]=r,n[f+12>>2]=-1,w=f+29|0,n[(g=f+16|0)>>2]=0,n[g+4>>2]=0,n[g+8>>2]=0,i[g+12>>0]=0,i[w>>0]=0|i[d>>0],i[w+1>>0]=0|i[d+1>>0],i[w+2>>0]=0|i[d+2>>0],w=9;break}if(!(r=0|Me(1+(0|n[A+8>>2])|0,32))){n[(w=f)>>2]=0,n[w+4>>2]=0,n[f+8>>2]=13,n[f+12>>2]=-1,r=f+29|0,n[(w=f+16|0)>>2]=0,n[w+4>>2]=0,n[w+8>>2]=0,i[w+12>>0]=0,i[r>>0]=0|i[d>>0],i[r+1>>0]=0|i[d+1>>0],i[r+2>>0]=0|i[d+2>>0],r=13,w=9;break}fe(A,r),n[(B=f)>>2]=u,n[B+4>>2]=b,n[(b=f+8|0)>>2]=0,n[f+12>>2]=e,n[f+20>>2]=A,n[f+24>>2]=r,i[f+28>>0]=0,i[(u=f+29|0)>>0]=0|i[d>>0],i[u+1>>0]=0|i[d+1>>0],i[u+2>>0]=0|i[d+2>>0],n[f+16>>2]=3,k=+X(r),k*=+K(r),s=+l(+ +a[r>>3]),s=k/+c(+ +je(+s,+ +l(+ +a[r+8>>3])))*6371.007180918475*6371.007180918475,r=0|n[(u=f+12|0)>>2];A:do{if((0|r)>0)do{if(WA(r+-1|0,g),!(s/+a[g>>3]>10))break A;n[u>>2]=r=(B=0|n[u>>2])-1|0}while((0|B)>1)}while(0);if(re(f),n[(u=t)>>2]=0,n[u+4>>2]=0,!(0==(0|(r=0|n[(u=f)>>2]))&0==(0|(u=0|n[u+4>>2]))))do{DA(r,u,e,g),d=0|pe(0|n[(A=t)>>2],0|n[A+4>>2],0|n[(d=g)>>2],0|n[d+4>>2]),A=0|C(),n[(B=t)>>2]=d,n[B+4>>2]=A,re(f),r=0|n[(B=f)>>2],u=0|n[B+4>>2]}while(!(0==(0|r)&0==(0|u)));r=0|n[b>>2]}}while(0);return T=o,0|r},_memcpy:Ne,_memmove:We,_memset:Ze,_originToDirectedEdges:fA,_pentagonCount:function(){return 12},_polygonToCells:function(A,e,r,i){A|=0,e|=0,i|=0;var a,t,f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0,B=0,h=0,m=0,v=0,Q=0,E=0,D=0,_=0,y=0,M=0,P=0,I=0,p=0,F=0,L=0,z=0,x=0,V=0;if(o=T,T=T+112|0,a=o+80|0,d=o+72|0,t=o,f=o+56|0,0|(u=0|te(r|=0)))return T=o,0|u;if(!(l=0|_e(32+(n[(g=A+8|0)>>2]<<5)|0)))return T=o,13;if(fe(A,l),!(u=0|te(r))){if(V=0|n[(x=A)+4>>2],n[(u=d)>>2]=n[x>>2],n[u+4>>2]=V,ae(d,a),u=0|rA(a,e,t))x=0,V=0;else{if(u=0|n[d>>2],(0|(c=0|n[g>>2]))>0){s=0|n[A+12>>2],r=0;do{u=(0|n[s+(r<<3)>>2])+u|0,r=r+1|0}while((0|r)!=(0|c));r=u}else r=u;c=0|n[(u=t)>>2],(0|(u=0|n[u+4>>2]))<(0|(s=((0|r)<0)<<31>>31))|(0|u)==(0|s)&c>>>0<r>>>0?(n[(u=t)>>2]=r,n[u+4>>2]=s,u=s):r=c,x=0|pe(0|r,0|u,12,0),V=0|C(),n[(u=t)>>2]=x,n[u+4>>2]=V,u=0}if(!u){if(!(r=0|Me(x,8)))return ye(l),T=o,13;if(!(b=0|Me(x,8)))return ye(l),ye(r),T=o,13;n[(L=a)>>2]=0,n[L+4>>2]=0,z=0|n[(L=A)+4>>2],n[(u=d)>>2]=n[L>>2],n[u+4>>2]=z,u=0|H(d,x,V,e,a,r,b);A:do{if(u)ye(r),ye(b),ye(l);else{e:do{if((0|n[g>>2])>0){for(s=A+12|0,c=0;u=0|H((0|n[s>>2])+(c<<3)|0,x,V,e,a,r,b),c=c+1|0,!(0|u);)if((0|c)>=(0|n[g>>2]))break e;ye(r),ye(b),ye(l);break A}}while(0);(0|V)>0|0==(0|V)&x>>>0>0&&Ze(0|b,0,x<<3|0),L=0|n[(z=a)+4>>2];e:do{if((0|L)>0|0==(0|L)&(0|n[z>>2])>>>0>0){I=r,p=b,F=r,L=b,z=r,u=r,y=r,M=b,P=b,r=b;r:for(;;){for(Q=0,E=0,D=0,_=0,c=0,s=0;;){d=(b=t)+56|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|d));if(0|G(g=0|n[(e=I+(Q<<3)|0)>>2],e=0|n[e+4>>2],1,t,0)){d=(b=t)+56|0;do{n[b>>2]=0,b=b+4|0}while((0|b)<(0|d));0|(b=0|Me(7,4))&&(U(g,e,1,t,b,7,0,0),ye(b))}for(v=0;;){h=0|n[(m=t+(v<<3)|0)>>2],m=0|n[m+4>>2];i:do{if(0==(0|h)&0==(0|m))b=c,d=s;else{if(w=0|xe(0|h,0|m,0|x,0|V),g=0|C(),!(0==(0|(d=0|n[(e=b=i+(w<<3)|0)>>2]))&0==(0|(e=0|n[e+4>>2])))){k=0,B=0;do{if((0|k)>(0|V)|(0|k)==(0|V)&B>>>0>x>>>0)break r;if((0|d)==(0|h)&(0|e)==(0|m)){b=c,d=s;break i}w=0|ze(0|(b=0|pe(0|w,0|g,1,0)),0|C(),0|x,0|V),g=0|C(),B=0|pe(0|B,0|k,1,0),k=0|C(),d=0|n[(e=b=i+(w<<3)|0)>>2],e=0|n[e+4>>2]}while(!(0==(0|d)&0==(0|e)))}if(0==(0|h)&0==(0|m)){b=c,d=s;break}xA(h,m,f),0|oe(A,l,f)&&(B=0|pe(0|c,0|s,1,0),s=0|C(),n[(k=b)>>2]=h,n[k+4>>2]=m,n[(c=p+(c<<3)|0)>>2]=h,n[c+4>>2]=m,c=B),b=c,d=s}}while(0);if((v=v+1|0)>>>0>=7)break;c=b,s=d}if(Q=0|pe(0|Q,0|E,1,0),E=0|C(),D=0|pe(0|D,0|_,1,0),_=0|C(),c=0|n[(s=a)>>2],!((0|_)<(0|(s=0|n[s+4>>2]))|(0|_)==(0|s)&D>>>0<c>>>0))break;c=b,s=d}if((0|s)>0|0==(0|s)&c>>>0>0){c=0,s=0;do{n[(_=I+(c<<3)|0)>>2]=0,n[_+4>>2]=0,c=0|pe(0|c,0|s,1,0),s=0|C(),D=0|n[(_=a)+4>>2]}while((0|s)<(0|D)|((0|s)==(0|D)?c>>>0<(0|n[_>>2])>>>0:0))}if(n[(_=a)>>2]=b,n[_+4>>2]=d,!((0|d)>0|0==(0|d)&b>>>0>0))break e;v=r,Q=P,E=z,D=M,_=p,r=y,P=u,M=F,y=v,u=Q,z=L,L=E,F=D,p=I,I=_}ye(F),ye(L),ye(l),u=1;break A}u=b}while(0);ye(l),ye(r),ye(u),u=0}}while(0);return T=o,0|u}}return ye(l),T=o,0|u},_polygonToCellsExperimental:function(A,e,r,i,a,t){i|=0,a|=0,t|=0;var f,o,l,u=0,c=0,s=0,b=0,d=0,g=0,w=0,k=0;l=T,T=T+160|0,c=l+64|0,d=l+112|0,k=l,ee(b=l+80|0,A|=0,e|=0,r|=0),HA(c,0|n[(s=b)>>2],0|n[s+4>>2],e),f=0|n[(s=c)>>2],s=0|n[s+4>>2],u=0|n[b+8>>2],n[(g=d+4|0)>>2]=n[b>>2],n[g+4>>2]=n[b+4>>2],n[g+8>>2]=n[b+8>>2],n[g+12>>2]=n[b+12>>2],n[g+16>>2]=n[b+16>>2],n[g+20>>2]=n[b+20>>2],n[g+24>>2]=n[b+24>>2],n[g+28>>2]=n[b+28>>2],n[(g=k)>>2]=f,n[g+4>>2]=s,n[(g=k+8|0)>>2]=u,e=d,r=36+(A=k+12|0)|0;do{n[A>>2]=n[e>>2],A=A+4|0,e=e+4|0}while((0|A)<(0|r));if(n[(d=k+48|0)>>2]=n[c>>2],n[d+4>>2]=n[c+4>>2],n[d+8>>2]=n[c+8>>2],n[d+12>>2]=n[c+12>>2],0==(0|f)&0==(0|s))return T=l,0|u;r=k+16|0,o=k+24|0,b=k+28|0,u=0,c=0,e=f,A=s;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&c>>>0<i>>>0)){w=4;break}if(s=c,c=0|pe(0|c,0|u,1,0),u=0|C(),n[(s=t+(s<<3)|0)>>2]=e,n[s+4>>2]=A,YA(d),0==(0|(e=0|n[(A=d)>>2]))&0==(0|(A=0|n[A+4>>2]))){if(re(r),0==(0|(A=0|n[(e=r)>>2]))&0==(0|(e=0|n[e+4>>2]))){w=10;break}RA(A,e,0|n[b>>2],d),e=0|n[(A=d)>>2],A=0|n[A+4>>2]}n[(s=k)>>2]=e,n[s+4>>2]=A}while(!(0==(0|e)&0==(0|A)));return 4==(0|w)?(0|(e=0|n[(A=k+40|0)>>2])&&ye(e),n[(w=k+16|0)>>2]=0,n[w+4>>2]=0,n[o>>2]=0,n[k+36>>2]=0,n[b>>2]=-1,n[k+32>>2]=0,n[A>>2]=0,RA(0,0,0,d),n[k>>2]=0,n[k+4>>2]=0,n[g>>2]=0,T=l,0|(k=14)):(10==(0|w)&&(n[k>>2]=0,n[k+4>>2]=0,n[g>>2]=n[o>>2]),T=l,0|(k=0|n[g>>2]))},_readInt64AsDoubleFromPointer:function(A){return+(+((0|n[(A|=0)>>2])>>>0)+4294967296*+(0|n[A+4>>2]))},_res0CellCount:function(){return 122},_reverseDirectedEdge:lA,_round:Je,_sbrk:Ke,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(A,e,r,i,a,t,f){A|=0,i|=0,a|=0,t|=0;var o,l=0,u=0,c=0,s=0,b=0,d=0,g=0,w=0;if(o=T,T=T+16|0,w=o,!((0|(r|=0))>0|0==(0|r)&(e|=0)>>>0>0))return T=o,0;if((0|(f|=0))>=16)return T=o,12;d=0,g=0,b=0,l=0;A:for(;;){if(s=0|Se(0|(u=0|n[(c=A+(d<<3)|0)>>2]),0|(c=0|n[c+4>>2]),52),C(),(15&s|0)>(0|f)){l=12,u=11;break}if(HA(w,u,c,f),0==(0|(c=0|n[(s=w)>>2]))&0==(0|(s=0|n[s+4>>2])))u=b;else{u=b;do{if(!((0|l)<(0|t)|(0|l)==(0|t)&u>>>0<a>>>0)){u=10;break A}n[(b=i+(u<<3)|0)>>2]=c,n[b+4>>2]=s,u=0|pe(0|u,0|l,1,0),l=0|C(),YA(w),c=0|n[(b=w)>>2],s=0|n[b+4>>2]}while(!(0==(0|c)&0==(0|s)))}if(d=0|pe(0|d,0|g,1,0),!((0|(g=0|C()))<(0|r)|(0|g)==(0|r)&d>>>0<e>>>0)){l=0,u=11;break}b=u}return 10==(0|u)?(T=o,0|(w=14)):11==(0|u)?(T=o,0|l):0},_uncompactCellsSize:function(A,e,r,i,a){A|=0,e|=0,r|=0,i|=0,a|=0;var t,f,o=0,l=0,u=0,c=0,s=0,b=0;f=T,T=T+16|0,t=f;A:do{if((0|r)>0|0==(0|r)&e>>>0>0){for(s=0,l=0,o=0,b=0;;){if(!(0==(0|(u=0|n[(c=A+(s<<3)|0)>>2]))&0==(0|(c=0|n[c+4>>2]))||(c=0==(0|DA(u,c,i,t)),l=0|pe(0|n[(u=t)>>2],0|n[u+4>>2],0|l,0|o),o=0|C(),c))){o=12;break}if(s=0|pe(0|s,0|b,1,0),!((0|(b=0|C()))<(0|r)|(0|b)==(0|r)&s>>>0<e>>>0))break A}return T=f,0|o}l=0,o=0}while(0);return n[a>>2]=l,n[a+4>>2]=o,T=f,0},_vertexToLatLng:function(A,e,r){r|=0;var i,a,t,f,o=0,l=0;return f=T,T=T+192|0,a=f,t=f+168|0,o=0|Se(0|(A|=0),0|(e|=0),56),C(),o&=7,0|(i=0|zA(A,l=-2130706433&e|134217728,t))?(T=f,0|(l=i)):(e=0|Se(0|A,0|e,52),C(),e&=15,0|CA(A,l)?bA(t,e,o,1,a):kA(t,e,o,1,a),n[r>>2]=n[(l=a+8|0)>>2],n[r+4>>2]=n[l+4>>2],n[r+8>>2]=n[l+8>>2],n[r+12>>2]=n[l+12>>2],T=f,0|(l=0))},dynCall_iii:function(A,e,r){return 0|Xe[3&(A|=0)](0|(e|=0),0|(r|=0))},establishStackSpace:function(A,e){T=A|=0},stackAlloc:function(A){var e;return e=T,T=15+(T=T+(A|=0)|0)&-16,0|e},stackRestore:function(A){T=A|=0},stackSave:function(){return 0|T}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:BA,b:function(A){B=A},c:function(){return B},d:function(A,e,r,i){BA("Assertion failed: "+I(A)+", at: "+[e?I(e):"unknown filename",r,i?I(i):"unknown function"])},e:function(A){return r.___errno_location&&(_[r.___errno_location()>>2]=A),A},f:AA,g:function(A,e,r){D.set(D.subarray(e,e+r),A)},h:function(A){var e=AA();if(A>2130706432)return!1;for(var r=Math.max(e,16777216);r<A;)r=r<=536870912?p(2*r,16777216):Math.min(p((3*r+2147483648)/4,16777216),2130706432);return!!eA(r)},i:function(A){BA("OOM")},j:X,k:q,l:eA,m:$,n:function(){var A=$();return r.extraStackTrace&&(A+="\\n"+r.extraStackTrace()),q(A)},o:28400,p:28384},Q),oA=(r.___divdi3=fA.___divdi3,r.___muldi3=fA.___muldi3,r.___remdi3=fA.___remdi3,r.___uremdi3=fA.___uremdi3,r._areNeighborCells=fA._areNeighborCells,r._bitshift64Ashr=fA._bitshift64Ashr,r._bitshift64Lshr=fA._bitshift64Lshr,r._bitshift64Shl=fA._bitshift64Shl,r._calloc=fA._calloc,r._cellAreaKm2=fA._cellAreaKm2,r._cellAreaM2=fA._cellAreaM2,r._cellAreaRads2=fA._cellAreaRads2,r._cellToBoundary=fA._cellToBoundary,r._cellToCenterChild=fA._cellToCenterChild,r._cellToChildPos=fA._cellToChildPos,r._cellToChildren=fA._cellToChildren,r._cellToChildrenSize=fA._cellToChildrenSize,r._cellToLatLng=fA._cellToLatLng,r._cellToLocalIj=fA._cellToLocalIj,r._cellToParent=fA._cellToParent,r._cellToVertex=fA._cellToVertex,r._cellToVertexes=fA._cellToVertexes,r._cellsToDirectedEdge=fA._cellsToDirectedEdge,r._cellsToLinkedMultiPolygon=fA._cellsToLinkedMultiPolygon,r._childPosToCell=fA._childPosToCell,r._compactCells=fA._compactCells,r._constructCell=fA._constructCell,r._destroyLinkedMultiPolygon=fA._destroyLinkedMultiPolygon,r._directedEdgeToBoundary=fA._directedEdgeToBoundary,r._directedEdgeToCells=fA._directedEdgeToCells,r._edgeLengthKm=fA._edgeLengthKm,r._edgeLengthM=fA._edgeLengthM,r._edgeLengthRads=fA._edgeLengthRads,r._emscripten_replace_memory=fA._emscripten_replace_memory),lA=(r._free=fA._free,r._getBaseCellNumber=fA._getBaseCellNumber,r._getDirectedEdgeDestination=fA._getDirectedEdgeDestination,r._getDirectedEdgeOrigin=fA._getDirectedEdgeOrigin,r._getHexagonAreaAvgKm2=fA._getHexagonAreaAvgKm2,r._getHexagonAreaAvgM2=fA._getHexagonAreaAvgM2,r._getHexagonEdgeLengthAvgKm=fA._getHexagonEdgeLengthAvgKm,r._getHexagonEdgeLengthAvgM=fA._getHexagonEdgeLengthAvgM,r._getIcosahedronFaces=fA._getIcosahedronFaces,r._getIndexDigit=fA._getIndexDigit,r._getNumCells=fA._getNumCells,r._getPentagons=fA._getPentagons,r._getRes0Cells=fA._getRes0Cells,r._getResolution=fA._getResolution,r._greatCircleDistanceKm=fA._greatCircleDistanceKm,r._greatCircleDistanceM=fA._greatCircleDistanceM,r._greatCircleDistanceRads=fA._greatCircleDistanceRads,r._gridDisk=fA._gridDisk,r._gridDiskDistances=fA._gridDiskDistances,r._gridDistance=fA._gridDistance,r._gridPathCells=fA._gridPathCells,r._gridPathCellsSize=fA._gridPathCellsSize,r._gridRing=fA._gridRing,r._gridRingUnsafe=fA._gridRingUnsafe,r._i64Add=fA._i64Add,r._i64Subtract=fA._i64Subtract,r._isPentagon=fA._isPentagon,r._isResClassIII=fA._isResClassIII,r._isValidCell=fA._isValidCell,r._isValidDirectedEdge=fA._isValidDirectedEdge,r._isValidIndex=fA._isValidIndex,r._isValidVertex=fA._isValidVertex,r._latLngToCell=fA._latLngToCell,r._llvm_ctlz_i64=fA._llvm_ctlz_i64,r._llvm_maxnum_f64=fA._llvm_maxnum_f64,r._llvm_minnum_f64=fA._llvm_minnum_f64,r._llvm_round_f64=fA._llvm_round_f64,r._localIjToCell=fA._localIjToCell,r._malloc=fA._malloc,r._maxFaceCount=fA._maxFaceCount,r._maxGridDiskSize=fA._maxGridDiskSize,r._maxPolygonToCellsSize=fA._maxPolygonToCellsSize,r._maxPolygonToCellsSizeExperimental=fA._maxPolygonToCellsSizeExperimental,r._memcpy=fA._memcpy,r._memmove=fA._memmove,r._memset=fA._memset,r._originToDirectedEdges=fA._originToDirectedEdges,r._pentagonCount=fA._pentagonCount,r._polygonToCells=fA._polygonToCells,r._polygonToCellsExperimental=fA._polygonToCellsExperimental,r._readInt64AsDoubleFromPointer=fA._readInt64AsDoubleFromPointer,r._res0CellCount=fA._res0CellCount,r._reverseDirectedEdge=fA._reverseDirectedEdge,r._round=fA._round,r._sbrk=fA._sbrk,r._sizeOfCellBoundary=fA._sizeOfCellBoundary,r._sizeOfCoordIJ=fA._sizeOfCoordIJ,r._sizeOfGeoLoop=fA._sizeOfGeoLoop,r._sizeOfGeoPolygon=fA._sizeOfGeoPolygon,r._sizeOfH3Index=fA._sizeOfH3Index,r._sizeOfLatLng=fA._sizeOfLatLng,r._sizeOfLinkedGeoPolygon=fA._sizeOfLinkedGeoPolygon,r._uncompactCells=fA._uncompactCells,r._uncompactCellsSize=fA._uncompactCellsSize,r._vertexToLatLng=fA._vertexToLatLng,r.establishStackSpace=fA.establishStackSpace,r.stackAlloc=fA.stackAlloc),uA=r.stackRestore=fA.stackRestore,cA=r.stackSave=fA.stackSave;if(r.dynCall_iii=fA.dynCall_iii,r.asm=fA,r.cwrap=function(A,e,r,i){var n=(r=r||[]).every(function(A){return"number"===A});return"string"!==e&&n&&!i?v(A):function(){return function(A,e,r,i,n){var a={string:function(A){var e=0;return null!=A&&0!==A&&(e=lA(1+(A.length<<2))),e},array:function(A){var e=lA(A.length);return E.set(A,e),e}},t=v(A),f=[],o=0;if(i)for(var l=0;l<i.length;l++){var u=a[r[l]];u?(0===o&&(o=cA()),f[l]=u(i[l])):f[l]=i[l]}var c=t.apply(null,f);return c=function(A){return"string"===e?I(A):"boolean"===e?Boolean(A):A}(c),0!==o&&uA(o),c}(A,e,r,arguments)}},r.setValue=function(A,e,r,i){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":E[A>>0]=e;break;case"i16":C[A>>1]=e;break;case"i32":_[A>>2]=e;break;case"i64":W=[e>>>0,(N=e,+V(N)>=1?N>0?(0|R(+H(N/4294967296),4294967295))>>>0:~~+S((N-+(~~N>>>0))/4294967296)>>>0:0)],_[A>>2]=W[0],_[A+4>>2]=W[1];break;case"float":y[A>>2]=e;break;case"double":M[A>>3]=e;break;default:BA("invalid type for setValue: "+r)}},r.getValue=function(A,e,r){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return E[A>>0];case"i16":return C[A>>1];case"i32":case"i64":return _[A>>2];case"float":return y[A>>2];case"double":return M[A>>3];default:BA("invalid type for getValue: "+e)}return null},Z)if(K(Z)||(aA=Z,Z=r.locateFile?r.locateFile(aA,g):g+aA),l||f){var sA=s(Z);D.set(sA,8)}else{Y++,r.monitorRunDependencies&&r.monitorRunDependencies(Y);var bA=function(A){A.byteLength&&(A=new Uint8Array(A)),D.set(A,8),r.memoryInitializerRequest&&delete r.memoryInitializerRequest.response,function(A){if(Y--,r.monitorRunDependencies&&r.monitorRunDependencies(Y),0==Y&&(null!==j&&(clearInterval(j),j=null),O)){var e=O;O=null,e()}}()},dA=function(){c(Z,bA,function(){throw"could not load memory initializer "+Z})},gA=nA(Z);if(gA)bA(gA.buffer);else if(r.memoryInitializerRequest){var wA=function(){var A=r.memoryInitializerRequest,e=A.response;if(200!==A.status&&0!==A.status){var i=nA(r.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+A.status+", retrying "+Z),void dA();e=i.buffer}bA(e)};r.memoryInitializerRequest.response?setTimeout(wA,0):r.memoryInitializerRequest.addEventListener("load",wA)}else dA()}function kA(A){function e(){tA||(tA=!0,h||(L(U),L(z),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)A=r.postRun.shift(),x.unshift(A);var A;L(x)}()))}A=A||o,Y>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)A=r.preRun.shift(),G.unshift(A);var A;L(G)}(),Y>0||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),e()},1)):e()))}function BA(A){throw r.onAbort&&r.onAbort(A),w(A+=""),k(A),h=!0,"abort("+A+"). Build with -s ASSERTIONS=1 for more info."}if(O=function A(){tA||kA(),tA||(O=A)},r.run=kA,r.abort=BA,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return kA(),A}("object"==typeof e?e:{}),r="number",i=[["sizeOfH3Index",r],["sizeOfLatLng",r],["sizeOfCellBoundary",r],["sizeOfGeoLoop",r],["sizeOfGeoPolygon",r],["sizeOfLinkedGeoPolygon",r],["sizeOfCoordIJ",r],["readInt64AsDoubleFromPointer",r],["isValidCell","number",["number","number"]],["isValidIndex","number",["number","number"]],["latLngToCell","number",[r,r,"number",r]],["cellToLatLng","number",["number","number",r]],["cellToBoundary","number",["number","number",r]],["maxGridDiskSize","number",[r,r]],["gridDisk","number",["number","number",r,r]],["gridDiskDistances","number",["number","number",r,r,r]],["gridRing","number",["number","number",r,r]],["gridRingUnsafe","number",["number","number",r,r]],["maxPolygonToCellsSize","number",[r,"number",r,r]],["polygonToCells","number",[r,"number",r,r]],["maxPolygonToCellsSizeExperimental","number",[r,"number",r,r]],["polygonToCellsExperimental","number",[r,"number",r,r,r,r]],["cellsToLinkedMultiPolygon","number",[r,r,r]],["destroyLinkedMultiPolygon",null,[r]],["compactCells","number",[r,r,r,r]],["uncompactCells","number",[r,r,r,r,r,"number"]],["uncompactCellsSize","number",[r,r,r,"number",r]],["isPentagon","number",["number","number"]],["isResClassIII","number",["number","number"]],["getBaseCellNumber",r,["number","number"]],["getResolution",r,["number","number"]],["getIndexDigit",r,["number","number",r]],["constructCell","number",[r,r,r,r]],["maxFaceCount","number",["number","number",r]],["getIcosahedronFaces","number",["number","number",r]],["cellToParent","number",["number","number","number",r]],["cellToChildren","number",["number","number","number",r]],["cellToCenterChild","number",["number","number","number",r]],["cellToChildrenSize","number",["number","number","number",r]],["cellToChildPos","number",["number","number","number",r]],["childPosToCell","number",[r,r,"number","number","number",r]],["areNeighborCells","number",["number","number","number","number",r]],["cellsToDirectedEdge","number",["number","number","number","number",r]],["getDirectedEdgeOrigin","number",["number","number",r]],["getDirectedEdgeDestination","number",["number","number",r]],["isValidDirectedEdge","number",["number","number"]],["directedEdgeToCells","number",["number","number",r]],["originToDirectedEdges","number",["number","number",r]],["directedEdgeToBoundary","number",["number","number",r]],["reverseDirectedEdge","number",["number","number",r]],["gridDistance","number",["number","number","number","number",r]],["gridPathCells","number",["number","number","number","number",r]],["gridPathCellsSize","number",["number","number","number","number",r]],["cellToLocalIj","number",["number","number","number","number",r,r]],["localIjToCell","number",["number","number",r,r,r]],["getHexagonAreaAvgM2","number",["number",r]],["getHexagonAreaAvgKm2","number",["number",r]],["getHexagonEdgeLengthAvgM","number",["number",r]],["getHexagonEdgeLengthAvgKm","number",["number",r]],["greatCircleDistanceM",r,[r,r]],["greatCircleDistanceKm",r,[r,r]],["greatCircleDistanceRads",r,[r,r]],["cellAreaM2","number",["number","number",r]],["cellAreaKm2","number",["number","number",r]],["cellAreaRads2","number",["number","number",r]],["edgeLengthM","number",["number","number",r]],["edgeLengthKm","number",["number","number",r]],["edgeLengthRads","number",["number","number",r]],["getNumCells","number",["number",r]],["getRes0Cells","number",[r]],["res0CellCount",r],["getPentagons","number",[r,r]],["pentagonCount",r],["cellToVertex","number",["number","number",r,r]],["cellToVertexes","number",["number","number",r]],["vertexToLatLng","number",["number","number",r]],["isValidVertex","number",["number","number"]]],n=4,a=5,t=13,f={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};f[n]="Resolution argument was outside of acceptable range",f[a]="Cell argument was not valid",f[6]="Directed edge argument was not valid",f[7]="Undirected edge argument was not valid",f[8]="Vertex argument was not valid",f[9]="Pentagon distortion was encountered",f[10]="Duplicate input",f[11]="Cell arguments were not neighbors",f[12]="Cell arguments had incompatible resolutions",f[t]="Memory allocation failed",f[14]="Bounds of provided memory were insufficient",f[15]="Mode or flags argument was not valid",f[16]="Index argument was not valid",f[17]="Base cell number was outside of acceptable range",f[18]="Child indexing digits invalid",f[19]="Child indexing digits refer to a deleted subsequence";var o=1001,l=1002,u={1000:"Unknown unit"};u[o]="Array length out of bounds",u[l]="Got unexpected null value for H3 index";var c="Unknown error";function s(A,e,r){var i=new Error((A[e]||c)+" (code: "+e+(r&&"value"in r?", value: "+r.value:"")+")");return i.code=e,i}function b(A,e){return s(f,A,2===arguments.length?{value:e}:{})}function d(A,e){return s(u,A,2===arguments.length?{value:e}:{})}function g(A){if(0!==A)throw b(A)}var w={};i.forEach(function(A){w[A[0]]=e.cwrap.apply(e,A)});var k=16,B=4,h=8,m=8,v=w.sizeOfH3Index(),Q=w.sizeOfLatLng(),E=w.sizeOfCellBoundary(),D=w.sizeOfGeoPolygon(),C=w.sizeOfGeoLoop(),_=w.sizeOfLinkedGeoPolygon(),y=w.sizeOfCoordIJ(),M={m:"m",m2:"m2",km:"km",km2:"km2",rads:"rads",rads2:"rads2"},P={containmentCenter:"containmentCenter",containmentFull:"containmentFull",containmentOverlapping:"containmentOverlapping",containmentOverlappingBbox:"containmentOverlappingBbox"};function I(A){if("number"!=typeof A||A<0||A>15||Math.floor(A)!==A)throw b(n,A);return A}function p(A){if(!A)throw d(l);return A}var T=Math.pow(2,32)-1,F=Math.pow(2,31)-1;function L(A){if(A>T)throw d(o,A);return A}function G(A,r){var i=A*r;if(!Number.isSafeInteger(i)||i>F)throw b(t,i);var n=e._calloc(A,r);if(!n&&i>0)throw b(t,i);return n}var U=/[^0-9a-fA-F]/;function z(A){if(Array.isArray(A)&&2===A.length&&Number.isInteger(A[0])&&Number.isInteger(A[1]))return A;if("string"!=typeof A||U.test(A))return[0,0];var e=parseInt(A.substring(0,A.length-8),k);return[parseInt(A.substring(A.length-8),k),e]}function x(A){if(A>=0)return A.toString(k);var e=S(8,(A&=2147483647).toString(k));return(parseInt(e[0],k)+8).toString(k)+e.substring(1)}function V(A,e){return x(e)+S(8,x(A))}function S(A,e){for(var r=A-e.length,i="",n=0;n<r;n++)i+="0";return i+e}var H=Math.pow(2,32);function R(A,r,i){for(var n=A.length,a=e._calloc(n,Q),t=i?1:0,f=i?0:1,o=0;o<2*n;o+=2)e.HEAPF64.set([A[o/2][t],A[o/2][f]].map(nA),a/h+o);return e.HEAPU32.set([n,a],r/B),r}function Y(A,r){var i,n=A.length-1,a=e._calloc(D),t=0+C,f=t+B;if(R(A[0],a+0,r),n>0){i=e._calloc(n,C);for(var o=0;o<n;o++)R(A[o+1],i+C*o,r)}return e.setValue(a+t,n,"i32"),e.setValue(a+f,i,"i32"),a}function j(A){var r=0+C,i=r+B,n=B;e._free(e.getValue(A+0+n,"i8*"));var a=e.getValue(A+r,"i32");if(a>0){for(var t=e.getValue(A+i,"i32"),f=0;f<a;f++)e._free(e.getValue(t+C*f+n,"i8*"));e._free(t)}e._free(A)}function O(A,r){void 0===r&&(r=0);var i=e.getValue(A+v*r,"i32"),n=e.getValue(A+v*r+B,"i32");return n?V(i,n):null}function N(A,r){return void 0===r&&(r=0),e.getValue(A+h*r,"double")}function W(A){return w.readInt64AsDoubleFromPointer(A)}function Z(A,r,i){e.HEAPU32.set(z(A),r/B+2*i)}function J(A,e){for(var r=[],i=0;i<e;i++){var n=O(A,i);null!==n&&r.push(n)}return r}function K(A,e){for(var r=e.length,i=0;i<r;i++)Z(e[i],A,i)}function X(A,r){var i=e._calloc(1,Q);return e.HEAPF64.set([A,r].map(nA),i/h),i}function q(A){return aA(e.getValue(A,"double"))}function $(A){return[q(A),q(A+h)]}function AA(A){return[q(A+h),q(A)]}function eA(A,r,i){for(var n=e.getValue(A,"i32"),a=A+h,t=[],f=r?AA:$,o=0;o<2*n;o+=2)t.push(f(a+h*o));return i&&t.push(t[0]),t}function rA(A){var e=z(A);return Boolean(w.isValidCell(e[0],e[1]))}function iA(A,r){if(!rA(A))throw b(a);var i=z(A),n=i[0],t=i[1],f=e._malloc(m);try{return g(w.cellToChildrenSize(n,t,r,f)),W(f)}finally{e._free(f)}}function nA(A){return A*Math.PI/180}function aA(A){return 180*A/Math.PI}A.UNITS=M,A.POLYGON_TO_CELLS_FLAGS=P,A.h3IndexToSplitLong=z,A.splitLongToH3Index=V,A.isValidCell=rA,A.isValidIndex=function(A){var e=z(A);return Boolean(w.isValidIndex(e[0],e[1]))},A.isPentagon=function(A){var e=z(A);return Boolean(w.isPentagon(e[0],e[1]))},A.isResClassIII=function(A){var e=z(A);return Boolean(w.isResClassIII(e[0],e[1]))},A.getBaseCellNumber=function(A){var e=z(A);return w.getBaseCellNumber(e[0],e[1])},A.getIndexDigit=function(A,r){var i=e._malloc(B),n=z(A),a=n[0],t=n[1];try{return g(w.getIndexDigit(a,t,r,i)),e.getValue(i,"i32")}finally{e._free(i)}},A.getIcosahedronFaces=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(B);try{g(w.maxFaceCount(i,n,a));var t=e.getValue(a,"i32"),f=e._malloc(B*t);try{return g(w.getIcosahedronFaces(i,n,f)),function(A,r){for(var i=[],n=0;n<r;n++){var a=e.getValue(A+B*n,"i32");a>=0&&i.push(a)}return i}(f,t)}finally{e._free(f)}}finally{e._free(a)}},A.getResolution=function(A){var e=z(A),r=e[0],i=e[1];return w.isValidCell(r,i)?w.getResolution(r,i):-1},A.constructCell=function(A,r,i){if(void 0===i&&(i=r.length),r.length!==i)throw b(18,r.length);if(r.length>15)throw b(18,r.length);var n=e._malloc(B*r.length),a=e._malloc(v);try{return r.forEach(function(A,r){e.setValue(n+B*r,A,"i32")}),g(w.constructCell(i,A,n,a)),p(O(a))}finally{e._free(a),e._free(n)}},A.latLngToCell=function(A,r,i){var n=e._malloc(Q);e.HEAPF64.set([A,r].map(nA),n/h);var a=e._malloc(v);try{return g(w.latLngToCell(n,i,a)),p(O(a))}finally{e._free(a),e._free(n)}},A.cellToLatLng=function(A){var r=e._malloc(Q),i=z(A),n=i[0],a=i[1];try{return g(w.cellToLatLng(n,a,r)),$(r)}finally{e._free(r)}},A.cellToBoundary=function(A,r){var i=e._malloc(E),n=z(A),a=n[0],t=n[1];try{return g(w.cellToBoundary(a,t,i)),eA(i,r,r)}finally{e._free(i)}},A.cellToParent=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToParent(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToChildren=function(A,r){if(!rA(A))return[];var i=z(A),n=i[0],a=i[1],t=L(iA(A,r)),f=e._calloc(t,v);try{return g(w.cellToChildren(n,a,r,f)),J(f,t)}finally{e._free(f)}},A.cellToChildrenSize=iA,A.cellToCenterChild=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToCenterChild(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToChildPos=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{return g(w.cellToChildPos(n,a,r,t)),W(t)}finally{e._free(t)}},A.childPosToCell=function(A,r,i){var n,a="number"!=typeof(n=A)?[0,0]:[0|n,n/H|0],t=a[0],f=a[1],o=z(r),l=o[0],u=o[1],c=e._malloc(v);try{return g(w.childPosToCell(t,f,l,u,i,c)),p(O(c))}finally{e._free(c)}},A.gridDisk=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{g(w.maxGridDiskSize(r,t));var f=L(W(t)),o=G(f,v);try{return g(w.gridDisk(n,a,r,o)),J(o,f)}finally{e._free(o)}}finally{e._free(t)}},A.gridDiskDistances=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(m);try{g(w.maxGridDiskSize(r,t));var f,o=L(W(t)),l=G(o,v);try{f=G(o,B),g(w.gridDiskDistances(n,a,r,l,f));for(var u=[],c=0;c<r+1;c++)u.push([]);for(var s=0;s<o;s++){var b=O(l,s),d=e.getValue(f+B*s,"i32");null!==b&&u[d].push(b)}return u}finally{e._free(l),f&&e._free(f)}}finally{e._free(t)}},A.gridRing=function(A,r){var i=0===r?1:6*r,n=e._calloc(i,v);try{return g(w.gridRing.apply(w,z(A).concat([r],[n]))),J(n,i)}finally{e._free(n)}},A.gridRingUnsafe=function(A,r){var i=0===r?1:6*r,n=e._calloc(i,v);try{return g(w.gridRingUnsafe.apply(w,z(A).concat([r],[n]))),J(n,i)}finally{e._free(n)}},A.polygonToCells=function(A,r,i){if(I(r),i=Boolean(i),0===A.length||0===A[0].length)return[];var n=Y("number"==typeof A[0][0]?[A]:A,i),a=e._malloc(m);try{g(w.maxPolygonToCellsSize(n,r,0,a));var t=L(W(a)),f=e._calloc(t,v);try{return g(w.polygonToCells(n,r,0,f)),J(f,t)}finally{e._free(f)}}finally{e._free(a),j(n)}},A.polygonToCellsExperimental=function(A,r,i,n){I(r),n=Boolean(n);var a=function(A){switch(A){case P.containmentCenter:return 0;case P.containmentFull:return 1;case P.containmentOverlapping:return 2;case P.containmentOverlappingBbox:return 3;default:throw d(15,A)}}(i);if(0===A.length||0===A[0].length)return[];var t=Y("number"==typeof A[0][0]?[A]:A,n),f=e._malloc(m);try{g(w.maxPolygonToCellsSizeExperimental(t,r,a,f));var o=L(W(f)),l=e._calloc(o,v);try{return g(w.polygonToCellsExperimental(t,r,a,o,0,l)),J(l,o)}finally{e._free(l)}}finally{e._free(f),j(t)}},A.cellsToMultiPolygon=function(A,r){if(!A||!A.length)return[];var i=A.length,n=e._calloc(i,v);K(n,A);var a=e._calloc(_);try{return g(w.cellsToLinkedMultiPolygon(n,i,a)),function(A,r){for(var i,n,a,t,f=[],o=r?AA:$;A;){for(f.push(i=[]),n=e.getValue(A,"i8*");n;){for(i.push(a=[]),t=e.getValue(n,"i8*");t;)a.push(o(t)),t=e.getValue(t+2*h,"i8*");r&&a.push(a[0]),n=e.getValue(n+8,"i8*")}A=e.getValue(A+8,"i8*")}return f}(a,r)}finally{w.destroyLinkedMultiPolygon(a),e._free(a),e._free(n)}},A.compactCells=function(A){if(!A||!A.length)return[];var r=A.length,i=e._calloc(r,v);K(i,A);var n=e._calloc(r,v);try{return g(w.compactCells(i,n,r,0)),J(n,r)}finally{e._free(i),e._free(n)}},A.uncompactCells=function(A,r){if(I(r),!A||!A.length)return[];var i=A.length,n=e._calloc(i,v);K(n,A);var a=e._malloc(m);try{g(w.uncompactCellsSize(n,i,0,r,a));var t=L(W(a)),f=e._calloc(t,v);try{return g(w.uncompactCells(n,i,0,f,t,0,r)),J(f,t)}finally{e._free(n),e._free(f)}}finally{e._free(a)}},A.areNeighborCells=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(B);try{return g(w.areNeighborCells(n,a,f,o,l)),function(A,r){void 0===r&&(r=0);var i=e.getValue(l+B*r,"i32");return Boolean(i)}()}finally{e._free(l)}},A.cellsToDirectedEdge=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(v);try{return g(w.cellsToDirectedEdge(n,a,f,o,l)),p(O(l))}finally{e._free(l)}},A.getDirectedEdgeOrigin=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.getDirectedEdgeOrigin(i,n,a)),p(O(a))}finally{e._free(a)}},A.getDirectedEdgeDestination=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.getDirectedEdgeDestination(i,n,a)),p(O(a))}finally{e._free(a)}},A.isValidDirectedEdge=function(A){var e=z(A);return Boolean(w.isValidDirectedEdge(e[0],e[1]))},A.directedEdgeToCells=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(2,v);try{return g(w.directedEdgeToCells(i,n,a)),J(a,2)}finally{e._free(a)}},A.originToDirectedEdges=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(6,v);try{return g(w.originToDirectedEdges(i,n,a)),J(a,6)}finally{e._free(a)}},A.directedEdgeToBoundary=function(A,r){var i=e._malloc(E),n=z(A),a=n[0],t=n[1];try{return g(w.directedEdgeToBoundary(a,t,i)),eA(i,r)}finally{e._free(i)}},A.reverseDirectedEdge=function(A){var r=z(A),i=r[0],n=r[1],a=e._malloc(v);try{return g(w.reverseDirectedEdge(i,n,a)),p(O(a))}finally{e._free(a)}},A.gridDistance=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(m);try{return g(w.gridDistance(n,a,f,o,l)),W(l)}finally{e._free(l)}},A.gridPathCells=function(A,r){var i=z(A),n=i[0],a=i[1],t=z(r),f=t[0],o=t[1],l=e._malloc(m);try{g(w.gridPathCellsSize(n,a,f,o,l));var u=L(W(l)),c=e._calloc(u,v);try{return w.gridPathCells(n,a,f,o,c),J(c,u)}finally{e._free(c)}}finally{e._free(l)}},A.cellToLocalIj=function(A,r){var i,n=e._malloc(y);try{return g(w.cellToLocalIj.apply(w,z(A).concat(z(r),[0],[n]))),{i:e.getValue(i=n,"i32"),j:e.getValue(i+B,"i32")}}finally{e._free(n)}},A.localIjToCell=function(A,r){if(!r||"number"!=typeof r.i||"number"!=typeof r.j)throw new Error("Coordinates must be provided as an {i, j} object");var i,n,a,t=e._malloc(y),f=e._malloc(v);a=(n=r).j,e.setValue(i=t,n.i,"i32"),e.setValue(i+B,a,"i32");try{return g(w.localIjToCell.apply(w,z(A).concat([t],[0],[f]))),p(O(f))}finally{e._free(t),e._free(f)}},A.greatCircleDistance=function(A,r,i){var n,a=X(A[0],A[1]),t=X(r[0],r[1]);switch(i){case M.m:n=w.greatCircleDistanceM(a,t);break;case M.km:n=w.greatCircleDistanceKm(a,t);break;case M.rads:n=w.greatCircleDistanceRads(a,t);break;default:n=null}if(e._free(a),e._free(t),null===n)throw d(1e3,i);return n},A.cellArea=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(h);try{switch(r){case M.m2:g(w.cellAreaM2(n,a,t));break;case M.km2:g(w.cellAreaKm2(n,a,t));break;case M.rads2:g(w.cellAreaRads2(n,a,t));break;default:throw d(1e3,r)}return N(t)}finally{e._free(t)}},A.edgeLength=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(h);try{switch(r){case M.m:g(w.edgeLengthM(n,a,t));break;case M.km:g(w.edgeLengthKm(n,a,t));break;case M.rads:g(w.edgeLengthRads(n,a,t));break;default:throw d(1e3,r)}return N(t)}finally{e._free(t)}},A.getHexagonAreaAvg=function(A,r){I(A);var i=e._malloc(h);try{switch(r){case M.m2:g(w.getHexagonAreaAvgM2(A,i));break;case M.km2:g(w.getHexagonAreaAvgKm2(A,i));break;default:throw d(1e3,r)}return N(i)}finally{e._free(i)}},A.getHexagonEdgeLengthAvg=function(A,r){I(A);var i=e._malloc(h);try{switch(r){case M.m:g(w.getHexagonEdgeLengthAvgM(A,i));break;case M.km:g(w.getHexagonEdgeLengthAvgKm(A,i));break;default:throw d(1e3,r)}return N(i)}finally{e._free(i)}},A.cellToVertex=function(A,r){var i=z(A),n=i[0],a=i[1],t=e._malloc(v);try{return g(w.cellToVertex(n,a,r,t)),p(O(t))}finally{e._free(t)}},A.cellToVertexes=function(A){var r=z(A),i=r[0],n=r[1],a=e._calloc(6,v);try{return g(w.cellToVertexes(i,n,a)),J(a,6)}finally{e._free(a)}},A.vertexToLatLng=function(A){var r=e._malloc(Q),i=z(A),n=i[0],a=i[1];try{return g(w.vertexToLatLng(n,a,r)),$(r)}finally{e._free(r)}},A.isValidVertex=function(A){var e=z(A);return Boolean(w.isValidVertex(e[0],e[1]))},A.getNumCells=function(A){I(A);var r=e._malloc(m);try{return g(w.getNumCells(A,r)),W(r)}finally{e._free(r)}},A.getRes0Cells=function(){var A=w.res0CellCount(),r=e._malloc(v*A);try{return g(w.getRes0Cells(r)),J(r,A)}finally{e._free(r)}},A.getPentagons=function(A){I(A);var r=w.pentagonCount(),i=e._malloc(v*r);try{return g(w.getPentagons(A,i)),J(i,r)}finally{e._free(i)}},A.degsToRads=nA,A.radsToDegs=aA});\n//# sourceMappingURL=h3-js.umd.js.map\n\n;(function(e){var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e};e=((e,r,i)=>(i=e==null?{}:t(a(e)),s(n(i,`default`,{value:e,enumerable:!0}),e)))(e,1);var c=.5,l=3,u=6,d=[`roadworks`,`road-closed`],f=1,p=.5,m=.1,h=(e,t)=>e!==void 0&&Number.isInteger(e)&&e>0?e:t,g=(e,t)=>e!==void 0&&Number.isFinite(e)&&e>0?e:t,_=(e,t)=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:t,ee=(e,t)=>Number(e>t)-Number(e<t),te=(e,t,n)=>{if(n===0)return e;let r=new Set(t);return e.filter(e=>{let t=e.properties.category,i=e.properties.delayInSeconds??0;return!(r.has(t)&&i<n)})},ne=t=>{let n=t.properties.id;return t.geometry.type===`Point`?e.point(t.geometry.coordinates,{_incidentId:n}):e.centroid(t,{properties:{_incidentId:n}})},re=e=>{let t=new Map;for(let n of e)for(let e of n.properties.roadNumbers??[])t.set(e,(t.get(e)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>e)},ie=e=>{let t=new Map;for(let n of e){let e=n.properties.category;e&&t.set(e,(t.get(e)??0)+1)}return[...t.entries()].sort((e,t)=>t[1]-e[1])[0]?.[0]??`incident`},v=(e,t)=>{let n=0;for(let r of e)t.has(r)&&n++;let r=e.size+t.size-n;return r===0?0:n/r},y=(e,t)=>{let n=t.map(e=>new Set(e.memberIds)),r=[];for(let i=0;i<e.length;i++){let a=new Set(e[i].memberIds);for(let e=0;e<t.length;e++){let t=v(a,n[e]);t>=p&&r.push({freshIndex:i,previousIndex:e,overlap:t})}}r.sort((e,t)=>t.overlap-e.overlap);let i=new Map,a=new Set,o=new Set;for(let{freshIndex:e,previousIndex:n,overlap:s}of r)a.has(e)||o.has(n)||(i.set(e,t[n].id),a.add(e),o.add(n));return i},b=e=>{if(e.length<3)return`steady`;let[t,n,r]=e.slice(-3),i=(r-t)/Math.max(t,1);return n>t&&r>n&&i>m?`growing`:n<t&&r<n&&i<-.1?`fading`:`steady`},x=(t,n,r,i,a)=>{if(t.length===0)return{groups:[]};let o=_(n.preFilter?.excludeCategories,d),s=n.preFilter?.minDelaySeconds,p=te(t,o,typeof s==`number`&&Number.isFinite(s)?s:f);if(p.length===0)return{groups:[]};let m=new Map;for(let e of p)m.set(e.properties.id,e);let v=[...m.values()].map(ne),x=e.featureCollection(v),S=g(n.eps,c),C=h(n.minMembers,l),w=e.clustersDbscan(x,S,{minPoints:C,mutate:!0}),T=new Map;for(let e of w.features){let t=e.properties.cluster;if(t===void 0||t<0)continue;let n=T.get(t);n||(n=[],T.set(t,n)),n.push(e)}let E=h(n.maxClusters,u),D=[...T.values()].map(e=>{let t=e.map(e=>e.properties._incidentId),n=t.map(e=>m.get(e)).filter(e=>e!==void 0);return{groupPoints:e,memberIds:t,members:n,totalDelaySeconds:n.reduce((e,t)=>e+(t.properties.delayInSeconds??0),0)}});D.sort((e,t)=>t.totalDelaySeconds-e.totalDelaySeconds);let O=D.slice(0,E).map(({groupPoints:t,memberIds:n,members:r,totalDelaySeconds:i})=>{let a=r.reduce((e,t)=>Math.max(e,t.properties.delayInSeconds??0),0),o=e.featureCollection(t),s=e.centroid(o).geometry.coordinates,c=0;if(t.length>=2){let t=e.bbox(o);c=e.distance([t[0],t[1]],[t[2],t[3]])}return{centroid:s,memberIds:n,size:r.length,totalDelaySeconds:i,peakDelaySeconds:a,diameterKm:c,primaryRoads:re(r),primaryCategory:ie(r)}}),k=r?y(O,r):new Map,A=new Map;if(r)for(let e of r)A.set(e.id,e);let j=i===void 0||a===void 0||i>a;return{groups:O.map((e,t)=>{let n=k.get(t),r=n??`cluster-${e.centroid[0].toFixed(3)}-${e.centroid[1].toFixed(3)}-${[...e.memberIds].sort(ee)[0]??t}`,i=n?A.get(n):void 0,a=i?.delaySamples??[],o=i?(j?[...a,e.totalDelaySeconds]:[...a.slice(0,-1),e.totalDelaySeconds]).slice(-3):[e.totalDelaySeconds],s=o.length===1?`new`:b(o);return{id:r,centroid:e.centroid,memberIds:e.memberIds,size:e.size,totalDelaySeconds:e.totalDelaySeconds,peakDelaySeconds:e.peakDelaySeconds,diameterKm:e.diameterKm,primaryRoads:e.primaryRoads,primaryCategory:e.primaryCategory,trend:s,delaySamples:o}})}},S=e=>{if(e!=null)return e instanceof Date?e.getTime():e},C=(e,t={},n,r)=>{let i=S(r),{groups:a}=x(e,t??{},n?.groups,i,n?.sampledAt);return i===void 0?{groups:a}:{groups:a,sampledAt:i}},w=[`carpool`,`carTrain`,`country`,`ferry`,`importantRoadStretch`,`lowEmissionZone`,`motorway`,`pedestrian`,`roadShields`,`speedLimit`,`toll`,`tollRoad`,`tollVignette`,`traffic`,`tunnel`,`unpaved`,`urban`,`vehicleRestricted`,`curve`,`curvyStretch`,`lanes`],T=[...w,`leg`,`distinct`],E=(e,t,n)=>Math.max(t,Math.min(e,n)),D=e=>e>180||e<-180?e-360*Math.round(e/360):e,O=(e,t)=>{if(e){if(Array.isArray(e))return e;if(`coordinates`in e)return e.coordinates;if(e.geometry)return t?.useEntryPoint===`main-when-available`?(e=>{let t=e.properties?.entryPoints;return t?.find(e=>e.type===`main`)??t?.find(e=>!e.type)})(e)?.position??e.geometry.coordinates:e.geometry.coordinates}return null},k=(e,t)=>{let n=O(e,t);if(!n)throw Error(`The received object does not have lng-lat coordinates: ${JSON.stringify(e)}`);return n},A=([e,,t])=>e>t?t+360:t,j=e=>A(e)-e[0],ae=(e,t,n,r)=>e<=n?[e,t,n,r]:e===180?[-180,t,n,r]:[e,t,n===-180?180:n,r],M=e=>{let t=e?.filter(e=>!!e)??[];if(t.length<=1)return t[0];let n=1/0,r=-1/0,i=1/0,a=-1/0,o=!0;for(let e of t)n=Math.min(n,e[1]),r=Math.max(r,e[3]),i=Math.min(i,e[0]),a=Math.max(a,e[2]),o&&=e[0]<=e[2]&&e[0]>=-180&&e[2]<=180;if(o&&a-i<=180)return[i,n,a,r];let{wests:s,easts:c}=(e=>{let t=[],n=[];for(let r of e){let e=D(r[0]),i=D(r[2]);j(r)>=360?(t.push(-180),n.push(180)):e>i?(t.push(e,-180),n.push(180,i)):(t.push(e),n.push(i))}return{wests:Float64Array.from(t).sort(),easts:Float64Array.from(n).sort()}})(t),l=s.length-1,u=l,d=s[0]+360-c[l];for(let e=0;e<l;e++){let t=s[e+1]-c[e];t>d&&(d=t,u=e)}return ae(s[(u+1)%s.length],n,c[u],r)},N=(e,t,n=1e3,r)=>{let i=e?.length;if(!i)return;let a={west:1/0,east:-1/0,south:1/0,north:-1/0},o=e=>{if(!e||e.length<2)return;let n=t(e[0]);a.west=Math.min(a.west,n),a.east=Math.max(a.east,n),r?.push(n),a.south=Math.min(a.south,e[1]),a.north=Math.max(a.north,e[1])},s=Math.max(Math.ceil(i/n),1);for(let t=0;t<i;t+=s)o(e[t]);return s>1&&o(e[i-1]),a.south===1/0?void 0:a},P=e=>{let t=[],n=N(e,D,void 0,t);if(!n)return;let{west:r,south:i,east:a,north:o}=n;return a-r<=180||a-r>=360?[r,i,a,o]:M(t.map(e=>[e,i,e,o]))},F=({distanceInMeters:e,travelTimeInSeconds:t})=>e===void 0||t===void 0?void 0:{distanceInMeters:e,travelTimeInSeconds:t},I=(e,t,n)=>({distanceInMeters:e.distanceInMeters+n*(t.distanceInMeters-e.distanceInMeters),travelTimeInSeconds:e.travelTimeInSeconds+n*(t.travelTimeInSeconds-e.travelTimeInSeconds)}),L=(e,t)=>{let{progress:n}=e.properties;if(!n||n.length===0)return;let r=e.geometry.coordinates.length;if(!Number.isInteger(t)||t<0||t>=r)return;let i=V(n,`pointIndex`,t);if(!i)return;let{lower:a,lowerValue:o,upper:s,upperValue:c}=i,l=F(a),u=F(s);if(l&&u)return o===c?l:I(l,u,le(e.geometry.coordinates,o,t,c))},R=(e,t,n)=>{let r=L(e,t),i=L(e,n);if(r&&i)return{start:r,end:i,delta:{distanceInMeters:i.distanceInMeters-r.distanceInMeters,travelTimeInSeconds:i.travelTimeInSeconds-r.travelTimeInSeconds}}},oe=(e,t)=>R(e,t.startPointIndex,t.endPointIndex),se=(e,t)=>{let n=e.geometry.coordinates;if(!n||t.startPointIndex<0||t.endPointIndex>=n.length||t.startPointIndex>t.endPointIndex)return;let r=Math.floor((t.startPointIndex+t.endPointIndex)/2);return P([n[t.startPointIndex],n[r],n[t.endPointIndex]])},ce=(e,t)=>{let n=Math.max(e.startPointIndex,t.startPointIndex),r=Math.min(e.endPointIndex,t.endPointIndex);return r>n?{startPointIndex:n,endPointIndex:r}:void 0},z=(e,t,n=[{startPointIndex:0,endPointIndex:e.length-1}])=>n.reduce((n,r)=>{let i=ce(r,t);return n+(i?e[i.endPointIndex]-e[i.startPointIndex]:0)},0),B=(e,t,n)=>{let r=e,i=0,a=e;for(;i<a;){let e=i+a>>>1,o=e;for(;o<a&&t(o)===void 0;)o++;let s=o<a?t(o):void 0;s===void 0?a=e:n(s)?(r=o,a=e):i=o+1}return r},V=(e,t,n)=>{let r=n=>e[n][t],i=e[B(e.length,r,e=>e>=n)],a=B(e.length,r,e=>e>n)-1;for(;a>=0&&e[a][t]===void 0;)a--;let o=e[a],s=o?.[t],c=i?.[t];return s!==void 0&&c!==void 0?{lower:o,lowerValue:s,upper:i,upperValue:c}:void 0},H=new WeakMap,U=Math.PI/180,W=e=>{let t=H.get(e);if(t?.length===e.length)return t;let n=new Float64Array(e.length),[r=0,i=0]=e[0]??[],a=Math.cos(i*U);for(let t=1;t<e.length;t++){let[o,s]=e[t],c=Math.cos(s*U),l=Math.sin((s-i)*U/2),u=Math.sin((o-r)*U/2),d=l*l+u*u*a*c;n[t]=n[t-1]+12742017.6*Math.asin(Math.min(Math.sqrt(d),1)),r=o,i=s,a=c}return H.set(e,n),n},G=(e,t,n,r)=>{let i=E(B(e.length,t=>e[t],e=>e>=t)-1,n,r-1),a=e[i+1]-e[i];return{pathIndex:i,share:a>0?E((t-e[i])/a,0,1):0}},K=(e,t,n)=>{let r=t[0]-e[0],i=D(r),a=e[0]+n*i;return[i===r?a:D(a),e[1]+n*(t[1]-e[1])]},le=(e,t,n,r)=>{let i=W(e),a=i[r]-i[t];return a>0?(i[n]-i[t])/a:(n-t)/(r-t)},ue=(e,t,n,r)=>{let i=W(e),a=i[n]-i[t],o,s;if(a===0){let e=t+r*(n-t);o=Math.floor(e),s=e-o}else{let e=i[t]+r*a;({pathIndex:o,share:s}=G(i,e,t,n))}let c=Math.min(o+1,e.length-1);return K(e[o],e[c],s)},q=(e,t)=>{let n=F(t);return n&&{position:e[t.pointIndex],...n}},J=(e,t,n)=>{let{progress:r}=e.properties,i=r?.at(-1);if(!r||!i)return;let a=e.geometry.coordinates,o=r[0],s=o[t],c=i[t];if(s===void 0||c===void 0)return;if(n<=s)return q(a,o);if(n>=c)return q(a,i);let l=V(r,t,n);if(!l)return;let{lower:u,lowerValue:d,upper:f,upperValue:p}=l,m=F(u),h=F(f);if(!m||!h)return;let g=d===p?0:(n-d)/(p-d);return{position:ue(a,u.pointIndex,f.pointIndex,g),...I(m,h,g)}},de=(e,t)=>{if(`traveledTimeInSeconds`in t)return J(e,`travelTimeInSeconds`,t.traveledTimeInSeconds);if(`traveledDistanceInMeters`in t)return J(e,`distanceInMeters`,t.traveledDistanceInMeters);let n=e.properties.summary.departureTime;if(!n)return;let r=(t.clockTime.getTime()-n.getTime())/1e3;return r<0?void 0:J(e,`travelTimeInSeconds`,r)},Y=(t,n)=>{let{progress:r}=t.properties,i=t.geometry.coordinates;if(!r?.length||i.length<2)return;let a=1e3*(0,e.nearestPointOnLine)(t,k(n)).properties.totalDistance,{pathIndex:o,share:s}=G(W(i),a,0,i.length-1);return((e,t,n)=>{let r=e.geometry.coordinates,i=Math.min(t+1,r.length-1),a=L(e,t),o=L(e,i);if(a&&o)return{position:K(r[t],r[i],n),...I(a,o,n)}})(t,o,s)},fe=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),pe=e=>!e.maneuver&&Math.abs(e.headingChangeInDegrees)>=140&&e.radiusInMeters<=40,X=e=>Math.round(1e5*e),Z=(e,t)=>Math.imul(Math.imul(e,2654435761)^t,2246822507),Q=(e,t,n,r,i,a)=>e[t]===n&&e[t+1]===r&&e[t+2]===i&&e[t+3]===a,me=(e,t,n,r,i,a,o)=>{let s=Z(r,i)+Z(a,o),c=6*((s^s>>>15)&e.length/6-1);for(;e[c+4]&&!Q(e,c,r,i,a,o)&&!Q(e,c,a,o,r,i);)c=(c+6)%e.length;return e[c+4]||(e[c]=r,e[c+1]=i,e[c+2]=a,e[c+3]=o,e[c+4]=t+1,e[c+5]=n),c},he=(e,{minLengthInMeters:t=0}={})=>{let n=Array.isArray(e)?e:e.features,{firsts:r,shared:i}=(e=>{let t=new Int32Array(6*2**Math.ceil(Math.log2(1.5*e.reduce((e,t)=>e+t.length,0)+1))),n=e.map(e=>new Int32Array(Math.max(e.length-1,0))),r=n.map(e=>new Uint8Array(e.length)),i=(e,t)=>{r[e][n[e][t]]=1};return e.forEach((r,a)=>{let o=n[a],s,[c=0,l=0]=r[0]??[],u=X(c),d=X(l);for(let n=0;n<o.length;n++){let c=u,l=d;if(u=X(r[n+1][0]),d=X(r[n+1][1]),c===u&&l===d){o[n]=-1;continue}o[n]=n;let f=s&&e[s.route][s.vertex+s.step];if(s&&f&&X(f[0])===u&&X(f[1])===d){i(a,n),i(s.route,Math.min(s.vertex,s.vertex+s.step)),s.vertex+=s.step;continue}let p=me(t,a,n,c,l,u,d),m=t[p+4]-1,h=t[p+5];if(s=void 0,m===a){o[n]=h;continue}i(a,n),i(m,h);let g=t[p]===c&&t[p+1]===l;s={route:m,vertex:g?h+1:h,step:g?1:-1}}}),{firsts:n,shared:r}})(n.map(e=>e.geometry.coordinates));return n.map((e,n)=>{let a=r[n],o=i[n],s=W(e.geometry.coordinates),c=[],l;for(let e=0;e<=a.length;e++){if(a[e]===-1)continue;if(e<a.length&&!o[a[e]]){l??=e;continue}if(l===void 0)continue;let n=s[e]-s[l];n>=t&&c.push({id:fe(),startPointIndex:l,endPointIndex:e,lengthInMeters:n}),l=void 0}return c})},ge=(e,{within:t,minLengthInMeters:n=0}={})=>{let r=W(e.geometry.coordinates),i=new Map,a=[...e.properties.sections.importantRoadStretch??[]].sort((e,t)=>e.startPointIndex-t.startPointIndex);for(let e of a){let n=z(r,e,t);if(!n)continue;let{index:a,roadNumbers:o=[],streetName:s}=e,c=o[0]??s,l=c??a,u=i.get(l);u?(u.index=Math.min(u.index,a),u.roadNumbers=[...new Set([...u.roadNumbers,...o])],u.streetName??=s,u.lengthInMeters+=n,u.sections.push(e)):i.set(l,{index:a,...c&&{name:c},roadNumbers:o,...s&&{streetName:s},lengthInMeters:n,sections:[e]})}return[...i.values()].filter(e=>e.lengthInMeters>=n)},$=(e,{within:t,types:n=T}={})=>{let r=W(e.geometry.coordinates),i={};for(let a of n){let n=e.properties.sections[a]??[],o=[],s=[],c=0;for(let e of n){let{startPointIndex:n=0,endPointIndex:i=0}=e,a=z(r,{startPointIndex:n,endPointIndex:i},t);a>0&&(o.push(e),s.push(a/(r[i]-r[n])),c+=a)}o.length&&(i[a]={sections:o,shares:s,lengthInMeters:c})}return i};Object.assign(globalThis,{routeUtils:{calculateProgressAtRoutePoint:L,compareRoutes:(e,t,{types:n=w}={})=>{let[r,i]=he([e,t]);return{distinct:r,referenceDistinct:i,adds:$(e,{within:r,types:n}),avoids:$(t,{within:i,types:n})}},getCoordinateAtRouteProgress:de,getImportantRoads:ge,getProgressAtNearestRoutePoint:Y,getRouteProgressBetween:R,getRouteProgressForSection:oe,getSectionBBox:se,getSectionsWithin:$,isHairpin:pe},cluster:C})})(self.turf);';export{sandboxLibrarySource};
|