PageSourceSearch

https://bikebook.co.uk/_next/static/chunks/41034ddc-a25bc90cc06ef020.js

js bikebook.co.uk collected 2026-09-24 09:49:28 UTC 335,228 bytes, 2 lines download raw bytes

1try{!function(){var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="c328915e-47eb-4b2a-bb5e-4231bdb2c978",t._sentryDebugIdIdentifier="sentry-dbid-c328915e-47eb-4b2a-bb5e-4231bdb2c978")}()}catch(t){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6038],{57058:function(t,e){(function(t){"use strict";function e(){}function n(t){this.message=t||""}function i(t){this.message=t||""}function r(t){this.message=t||""}function o(){}function s(t){return null===t?tB:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function h(){}function f(){this.array_=[],arguments[0]instanceof tS&&this.addAll(arguments[0])}function g(){}function d(t){this.message=t||""}function _(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,0x1fffffffffffff),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);i<r;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var y=function(){};y.prototype.interfaces_=function(){return[]},y.prototype.getClass=function(){return y},y.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var m=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),v=function(){},I={MAX_VALUE:{configurable:!0}};v.isNaN=function(t){return Number.isNaN(t)},v.doubleToLongBits=function(t){return t},v.longBitsToDouble=function(t){return t},v.isInfinite=function(t){return!Number.isFinite(t)},I.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,I);var E=function(){},x=function(){},N=function(){},C=function t(){if(this.x=null,this.y=null,this.z=null,0==arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1==arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2==arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3==arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},S={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};C.prototype.setOrdinate=function(t,e){switch(t){case C.X:this.x=e;break;case C.Y:this.y=e;break;case C.Z:this.z=e;break;default:throw new m("Invalid ordinate index: "+t)}},C.prototype.equals2D=function(){if(1==arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!y.equalsWithTolerance(this.x,e.x,n)&&!!y.equalsWithTolerance(this.y,e.y,n)}},C.prototype.getOrdinate=function(t){switch(t){case C.X:return this.x;case C.Y:return this.y;case C.Z:return this.z}throw new m("Invalid ordinate index: "+t)},C.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||v.isNaN(this.z))&&v.isNaN(t.z)},C.prototype.equals=function(t){return t instanceof C&&this.equals2D(t)},C.prototype.equalInZ=function(t,e){return y.equalsWithTolerance(this.z,t.z,e)},C.prototype.compareTo=function(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:+(this.y>t.y)},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},C.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},C.prototype.hashCode=function(){return 37*(629+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[E,x,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1==arguments.length){var t=arguments[0],e=v.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},S.DimensionalComparator.get=function(){return L},S.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},S.NULL_ORDINATE.get=function(){return v.NaN},S.X.get=function(){return 0},S.Y.get=function(){return 1},S.Z.get=function(){return 2},Object.defineProperties(C,S);var L=function(t){if(this._dimensionsToTest=2,0==arguments.length);else if(1==arguments.length){var e=arguments[0];
1if(2!==e&&3!==e)throw new m("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};L.prototype.compare=function(t,e){var n=L.compare(t.x,e.x);if(0!==n)return n;var i=L.compare(t.y,e.y);return 0!==i?i:this._dimensionsToTest<=2?0:L.compare(t.z,e.z)},L.prototype.interfaces_=function(){return[N]},L.prototype.getClass=function(){return L},L.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:+!!v.isNaN(e)};var b=function(){};b.prototype.create=function(){},b.prototype.interfaces_=function(){return[]},b.prototype.getClass=function(){return b};var O=function(){},T={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new m("Unknown location value: "+t)},T.INTERIOR.get=function(){return 0},T.BOUNDARY.get=function(){return 1},T.EXTERIOR.get=function(){return 2},T.NONE.get=function(){return -1},Object.defineProperties(O,T);var R=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},w=function(){},P={LOG_10:{configurable:!0}};w.prototype.interfaces_=function(){return[]},w.prototype.getClass=function(){return w},w.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/w.LOG_10},w.min=function(t,e,n,i){var r=t;return e<r&&(r=e),n<r&&(r=n),i<r&&(r=i),r},w.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return i<r?r:i>o?o:i}},w.wrap=function(t,e){return t<0?e- -t%e:t%e},w.max=function(){if(3==arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}if(4==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=r;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},w.average=function(t,e){return(t+e)/2},P.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(w,P);var D=function(t){this.str=t};D.prototype.append=function(t){this.str+=t},D.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},D.prototype.toString=function(t){return this.str};var M=function(t){this.value=t};M.prototype.intValue=function(){return this.value},M.prototype.compareTo=function(t){return this.value<t?-1:+(this.value>t)},M.isNaN=function(t){return Number.isNaN(t)};var A=function(){};A.isWhitespace=function(t){return t<=32&&t>=0||127===t},A.toUpperCase=function(t){return t.toUpperCase()};var F=function t(){if(this._hi=0,this._lo=0,0==arguments.length)this.init(0);else if(1==arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var i=arguments[0];t.call(this,t.parse(i))}}else if(2==arguments.length){var r=arguments[0],o=arguments[1];this.init(r,o)}},G={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=F.magnitude(n._hi),r=F.TEN.pow(i);(n=n.divide(r)).gt(F.TEN)?(n=n.divide(F.TEN),i+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),i-=1);for(var o=i+1,s=new D,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,p=0;l>9?(c=!0,p="9"):p="0"+l,s.append(p),n=n.subtract(F.valueOf(l)).multiply(F.TEN),c&&n.selfAdd(F.TEN);var h=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(h=!1),!h)break}return e[0]=i,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1==arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1==arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2==arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null,c=null,p=null;return u=this._hi/n,r=(l=F.SPLIT*u)-u,p=F.SPLIT*n,o=u-(r=l-r),s=p-n,c=u*n,a=n-(s=p-s),p=r*s-c+r*a+o*s+o*a,l=(this._hi-c-p+this._lo-u*i)/n,p=u+l,this._hi=p,this._lo=u-p+l,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t=arguments[0],e=null,n=null,i=null,r=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=F.SPLIT*o)-(e=s-o)),u=e*(i=(u=F.SPLIT*t._hi)-(i=u-t._hi))-(a=o*t._hi)+e*(r=t._hi-i)+n*i+n*r,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new F(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var l=arguments[0];return v.isNaN(l)?F.createNaN():F.copy(this).selfDivide(l,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.prototype.compareTo=function(t){return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:+(this._lo>t._lo)},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),i=this.subtract(n.sqr())._hi*(.5*t);return n.add(i)},F.prototype.selfAdd=function(){if(1==arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,o=null,s=null,a=null;return s=(r=this._hi+e)-this._hi,o=r-s,n=r+(a=(o=e-s+(this._hi-o))+this._lo),i=a+(r-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(2==arguments.length){var u=arguments[0],l=arguments[1],c=null,p=null,h=null,f=null,g=null,d=null,_=null;
1f=this._hi+u,p=this._lo+l,g=f-(d=f-this._hi),h=p-(_=p-this._lo);var y=(c=f+(d=(g=u-d+(this._hi-g))+p))+(d=(h=l-_+(this._lo-h))+(d+(f-c))),m=d+(c-y);return this._hi=y,this._lo=m,this}},F.prototype.selfMultiply=function(){if(1==arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2==arguments.length){var n=arguments[0],i=arguments[1],r=null,o=null,s=null,a=null,u=null,l=null;r=(u=F.SPLIT*this._hi)-this._hi,l=F.SPLIT*n,r=u-r,o=this._hi-r,s=l-n;var c=(u=this._hi*n)+(l=r*(s=l-s)-u+r*(a=n-s)+o*s+o*a+(this._hi*i+this._lo*n)),p=l+(r=u-c);return this._hi=c,this._lo=p,this}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return v.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return v.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=[,].fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+F.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length;r=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+r:r},F.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;e=(r=1/this._hi)-(t=(o=F.SPLIT*r)-(t=o-r)),n=(a=F.SPLIT*this._hi)-this._hi;var u=r+(o=(1-(s=r*this._hi)-(a=t*(n=a-n)-s+t*(i=this._hi-n)+e*n+e*i)-r*this._lo)/this._hi);return new F(u,r-u+o)},F.prototype.toSciNotation=function(){if(this.isZero())return F.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=[,].fill(null),n=this.extractSignificantDigits(!1,e),i=F.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw Error("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.prototype.init=function(){if(1==arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof F){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,E,x]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new F(e)}},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;A.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(i=!0))}for(var o=new F,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,A.isDigit(l)){var c=l-0;o.selfMultiply(F.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var p=t.substring(e);try{u=M.parseInt(p)}catch(e){throw e instanceof Error?Error("Invalid exponent "+p+" in string "+t):e}break}throw Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var h=o,f=s-a-u;if(0===f)h=o;else if(f>0){var g=F.TEN.pow(f);h=o.divide(g)}else if(f<0){var d=F.TEN.pow(-f);h=o.multiply(d)}return i?h.negate():h},F.createNaN=function(){return new F(v.NaN,v.NaN)},F.copy=function(t){return new F(t)},F.magnitude=function(t){var e=Math.abs(t),n=Math.trunc(Math.floor(Math.log(e)/Math.log(10)));return 10*Math.pow(10,n)<=e&&(n+=1),n},F.stringOfChar=function(t,e){for(var n=new D,i=0;i<e;i++)n.append(t);return n.toString()},G.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},G.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},G.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},G.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},G.NaN.get=function(){return new F(v.NaN,v.NaN)},G.EPS.get=function(){return 123259516440783e-46},G.SPLIT.get=function(){return 0x8000001},G.MAX_PRINT_DIGITS.get=function(){return 32},G.TEN.get=function(){return F.valueOf(10)},G.ONE.get=function(){return F.valueOf(1)},G.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},G.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,G);var q=function(){},B={DP_SAFE_EPSILON:{configurable:!0}};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.orientationIndex=function(t,e,n){var i=q.orientationIndexFilter(t,e,n);if(i<=1)return i;var r=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.valueOf(n.y).selfAdd(-e.y);return r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},q.signOfDet2x2=function(t,e,n,i){return t.multiply(i).selfSubtract(e.multiply(n)).signum()},q.intersection=function(t,e,n,i){var r=F.valueOf(i.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(i.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=F.valueOf(i.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),u=F.valueOf(i.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),p=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),h=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=p.subtract(h).selfDivide(s).doubleValue();return new C(c,F.valueOf(n.y).selfAdd(F.valueOf(i.y).selfSubtract(n.y).selfMultiply(f)).doubleValue())},q.orientationIndexFilter=function(t,e,n){var i=null,r=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=r-o;if(r>0){if(o<=0)return q.signum(s);i=r+o}else{if(!(r<0)||o>=0)return q.signum(s);i=-r-o}var a=q.DP_SAFE_EPSILON*i;return s>=a||-s>=a?q.signum(s):2},q.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(q,B);var V=function(){},U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},V.prototype.setOrdinate=function(t,e,n){},V.prototype.size=function(){},V.prototype.getOrdinate=function(t,e){},V.prototype.getCoordinate=function(){},V.prototype.getCoordinateCopy=function(t){},V.prototype.getDimension=function(){},V.prototype.getX=function(t){},V.prototype.clone=function(){},V.prototype.expandEnvelope=function(t){},V.prototype.copy=function(){},V.prototype.getY=function(t){},V.prototype.toCoordinateArray=function(){},V.prototype.interfaces_=function(){return[x]},V.prototype.getClass=function(){return V},Object.defineProperties(V,U);var z=function(){},X=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(z),Y=function(){};Y.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s<e+r;s++)n[i+o]=t[s],o++},Y.getProperty=function(t){return({"line.separator":"\n"})[t]};var k=function t(){if(this.x=null,this.y=null,this.w=null,0==arguments.length)this.x=0,this.y=0,this.w=1;else if(1==arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2==arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this.x=n,this.y=i,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var r=arguments[0],o=arguments[1];this.x=r.y*o.w-o.y*r.w,this.y=o.x*r.w-r.x*o.w,this.w=r.x*o.y-o.x*r.y}else if(arguments[0]instanceof C&&arguments[1]instanceof C){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],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4==arguments.length){var p=arguments[0],h=arguments[1],f=arguments[2],g=arguments[3],d=p.y-h.y,_=h.x-p.x,y=p.x*h.y-h.x*p.y,m=f.y-g.y,v=g.x-f.x,I=f.x*g.y-g.x*f.y;this.x=_*I-v*y,this.y=m*y-d*I,this.w=d*v-m*_}};k.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new X;return t},k.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new X;return t},k.prototype.getCoordinate=function(){var t=new C;return t.x=this.getX(),t.y=this.getY(),t},k.prototype.interfaces_=function(){return[]},k.prototype.getClass=function(){return k},k.intersection=function(t,e,n,i){var r=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-i.y,u=i.x-n.x,l=n.x*i.y-i.x*n.y,c=r*u-a*o,p=(o*l-u*s)/c,h=(a*s-r*l)/c;if(v.isNaN(p)||v.isInfinite(p)||v.isNaN(h)||v.isInfinite(h))throw new X;return new C(p,h)};
1var j=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0==arguments.length)this.init();else if(1==arguments.length){if(arguments[0]instanceof C){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2==arguments.length){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(4==arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},H={serialVersionUID:{configurable:!0}};j.prototype.getArea=function(){return this.getWidth()*this.getHeight()},j.prototype.equals=function(t){return t instanceof j&&(this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY())},j.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new j;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny;return new j(e,this._maxx<t._maxx?this._maxx:t._maxx,n,this._maxy<t._maxy?this._maxy:t._maxy)},j.prototype.isNull=function(){return this._maxx<this._minx},j.prototype.getMaxX=function(){return this._maxx},j.prototype.covers=function(){if(1==arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof j){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},j.prototype.intersects=function(){if(1==arguments.length){if(arguments[0]instanceof j){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 C){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},j.prototype.getMinY=function(){return this._miny},j.prototype.getMinX=function(){return this._minx},j.prototype.expandToInclude=function(){if(1==arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},j.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},j.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},j.prototype.compareTo=function(t){return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:+(this._maxy>t._maxy)},j.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},j.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}
1,j.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},j.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},j.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},j.prototype.expandBy=function(){if(1==arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},j.prototype.contains=function(){if(1==arguments.length){if(arguments[0]instanceof j){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},j.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},j.prototype.init=function(){if(0==arguments.length)this.setToNull();else if(1==arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof j){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];r<o?(this._minx=r,this._maxx=o):(this._minx=o,this._maxx=r),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},j.prototype.getMaxY=function(){return this._maxy},j.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},j.prototype.hashCode=function(){return 37*(37*(37*(629+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},j.prototype.interfaces_=function(){return[E,e]},j.prototype.getClass=function(){return j},j.intersects=function(){if(3==arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u)&&!(c<a)&&(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(i.y,r.y),c=Math.max(i.y,r.y),!(l>u)&&!(c<a))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(j,H);var W=/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,K=/^\s*(\w+)\s*EMPTY\s*$/,J=/\s+/,Q=/\)\s*,\s*\(/,Z=/\)\s*\)\s*,\s*\(\s*\(/,$=/^\s*\(?(.*?)\)?\s*$/,tt=function(t){this.geometryFactory=t||new eh};tt.prototype.read=function(t){t=t.replace(/[\n\r]/g," ");var e,n,i,r=W.exec(t);if(-1!==t.search("EMPTY")&&((r=K.exec(t))[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],tn[n]&&(e=tn[n].apply(this,[i]))),void 0===e)throw Error("Could not parse WKT "+t);return e},tt.prototype.write=function(t){return this.extractGeometry(t)},tt.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!te[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+te[e].apply(this,[t])+")"};var te={coordinate:function(t){return t.x+" "+t.y},point:function(t){return te.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+te.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(te.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(te.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+te.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+te.linestring.apply(this,[t._shell])+")");for(var n=0,i=t._holes.length;n<i;++n)e.push("("+te.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+te.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},tn={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(J);return this.geometryFactory.createPoint(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace($,"$1"),i.push(tn.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(J),i.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(J),i.push(new C(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Q),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace($,"$1"),i.push(tn.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(i)}
1,polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,i,r,o=t.trim().split(Q),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace($,"$1"),n=tn.linestring.apply(this,[e]),i=this.geometryFactory.createLinearRing(n._points),0===a?r=i:s.push(i);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Z),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace($,"$1"),i.push(tn.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(i)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],i=0,r=e.length;i<r;++i)n.push(this.read(e[i]));return this.geometryFactory.createGeometryCollection(n)}},ti=function(t){this.parser=new tt(t)};ti.prototype.write=function(t){return this.parser.write(t)},ti.toLineString=function(t,e){if(2!=arguments.length)throw Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var tr=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),to=function(t){function e(){if(t.call(this),0==arguments.length)t.call(this);else if(1==arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(tr),ts=function(){};ts.prototype.interfaces_=function(){return[]},ts.prototype.getClass=function(){return ts},ts.shouldNeverReachHere=function(){if(0==arguments.length)ts.shouldNeverReachHere(null);else if(1==arguments.length){var t=arguments[0];throw new to("Should never reach here"+(null!==t?": "+t:""))}},ts.isTrue=function(){var t,e;if(1==arguments.length)t=arguments[0],ts.isTrue(t,null);else if(2==arguments.length&&(t=arguments[0],e=arguments[1],!t))throw null===e?new to:new to(e)},ts.equals=function(){var t,e,n;if(2==arguments.length)t=arguments[0],e=arguments[1],ts.equals(t,e,null);else if(3==arguments.length&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new to("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var ta=function(){this._result=null,this._inputLines=[,,].fill().map(function(){return[,,]}),this._intPt=[,,].fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new C,this._intPt[1]=new C,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},tu={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ta.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ta.prototype.getTopologySummary=function(){var t=new D;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ta.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},ta.prototype.getIntersectionNum=function(){return this._result},ta.prototype.computeIntLineIndex=function(){if(0==arguments.length)null===this._intLineIndex&&(this._intLineIndex=[,,].fill().map(function(){return[,,]}),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)}},ta.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ta.prototype.setPrecisionModel=function(t){this._precisionModel=t},ta.prototype.isInteriorIntersection=function(){if(0==arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1==arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},ta.prototype.getIntersection=function(t){return this._intPt[t]},ta.prototype.isEndPoint=function(){return this.hasIntersection()&&
1!this._isProper},ta.prototype.hasIntersection=function(){return this._result!==ta.NO_INTERSECTION},ta.prototype.getEdgeDistance=function(t,e){return ta.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},ta.prototype.isCollinear=function(){return this._result===ta.COLLINEAR_INTERSECTION},ta.prototype.toString=function(){return ti.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+ti.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ta.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ta.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},ta.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ta.prototype.interfaces_=function(){return[]},ta.prototype.getClass=function(){return ta},ta.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=i>r?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return ts.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},ta.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return ts.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},tu.DONT_INTERSECT.get=function(){return 0},tu.DO_INTERSECT.get=function(){return 1},tu.COLLINEAR.get=function(){return 2},tu.NO_INTERSECTION.get=function(){return 0},tu.POINT_INTERSECTION.get=function(){return 1},tu.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ta,tu);var tl=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new j(this._inputLines[0][0],this._inputLines[0][1]),n=new j(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!=arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],i=arguments[2];if(this._isProper=!1,j.intersects(n,i,e)&&0===th.orientationIndex(n,i,e)&&0===th.orientationIndex(i,n,e))return this._isProper=!0,(e.equals(n)||e.equals(i))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},e.prototype.safeHCoordinateIntersection=function(t,n,i,r){var o=null;try{o=k.intersection(t,n,i,r)}catch(s){if(!(s instanceof X))throw s;o=e.nearestEndpoint(t,n,i,r)}return o},e.prototype.intersection=function(t,n,i,r){var o=this.intersectionWithNormalization(t,n,i,r);return this.isInSegmentEnvelopes(o)||(o=new C(e.nearestEndpoint(t,n,i,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)<o&&(r=e,o=Math.abs(e)),Math.abs(n)<o&&(r=n,o=Math.abs(n)),Math.abs(i)<o&&(r=i),r},e.prototype.checkDD=function(t,e,n,i,r){var o=q.intersection(t,e,n,i),s=this.isInSegmentEnvelopes(o);Y.out.println("DD in env = "+s+"  --------------------- "+o),r.distance(o)>1e-4&&Y.out.println("Distance = "+r.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,i){var r=new C(t),o=new C(e),s=new C(n),a=new C(i),u=new C;this.normalizeToEnvCentre(r,o,s,a,u);var l=this.safeHCoordinateIntersection(r,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,i,r){var o=j.intersects(e,n,i),s=j.intersects(e,n,r),a=j.intersects(i,r,e),u=j.intersects(i,r,n);return o&&s?(this._intPt[0]=i,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,i,r){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>
1e.y?t.y:e.y,l=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,p=n.x>i.x?n.x:i.x,h=n.y>i.y?n.y:i.y;r.x=((o>l?o:l)+(a<p?a:p))/2,r.y=((s>c?s:c)+(u<h?u:h))/2,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},e.prototype.computeIntersect=function(e,n,i,r){if(this._isProper=!1,!j.intersects(e,n,i,r))return t.NO_INTERSECTION;var o=th.orientationIndex(e,n,i),s=th.orientationIndex(e,n,r);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=th.orientationIndex(i,r,e),u=th.orientationIndex(i,r,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,i,r):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(i)||e.equals2D(r)?this._intPt[0]=e:n.equals2D(i)||n.equals2D(r)?this._intPt[0]=n:0===o?this._intPt[0]=new C(i):0===s?this._intPt[0]=new C(r):0===a?this._intPt[0]=new C(e):0===u&&(this._intPt[0]=new C(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,i,r)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,i){var r=t,o=th.distancePointLine(t,n,i),s=th.distancePointLine(e,n,i);return s<o&&(o=s,r=e),(s=th.distancePointLine(n,t,e))<o&&(o=s,r=n),(s=th.distancePointLine(i,t,e))<o&&(o=s,r=i),r},e}(ta),tc=function(){};tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc},tc.orientationIndex=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return tc.signOfDet2x2(i,r,o,s)},tc.signOfDet2x2=function(t,e,n,i){var r=null,o=null,s=null;if(r=1,0===t||0===i)return 0===e||0===n?0:e>0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(e>0?i>0?e<=i||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?-e<=i?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0){if(!(n>0)||!(t<=n))return r}else{if(n>0||!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if(s=Math.floor(n/t),n-=s*t,(i-=s*e)<0)return-r;if(i>e)return r;if(t>n+n){if(e<i+i)return r}else{if(e>i+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n||(s=Math.floor(t/n),t-=s*n,(e-=s*i)<0))return r;if(e>i)return-r;if(n>t+t){if(i<e+e)return-r}else{if(i>e+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}};var tp=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};tp.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var r=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=tc.signOfDet2x2(r,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},tp.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},tp.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2==1?O.INTERIOR:O.EXTERIOR},tp.prototype.isOnSegment=function(){return this._isPointOnSegment},tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp},tp.locatePointInRing=function(){if(arguments[0]instanceof C&&R(arguments[1],V)){for(var t=arguments[0],e=arguments[1],n=new tp(t),i=new C,r=new C,o=1;o<e.size()&&(e.getCoordinate(o,i),e.getCoordinate(o-1,r),n.countSegment(i,r),!n.isOnSegment());o++);return n.getLocation()}if(arguments[0]instanceof C&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],u=new tp(s),l=1;l<a.length;l++){var c=a[l],p=a[l-1];if(u.countSegment(c,p),u.isOnSegment())break}return u.getLocation()}};var th=function(){},tf={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};th.prototype.interfaces_=function(){return[]},th.prototype.getClass=function(){return th},th.orientationIndex=function(t,e,n){return q.orientationIndex(t,e,n)},th.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var r=t[i].x-n,o=t[i+1].y;e+=r*(t[i-1].y-o)}return e/2}if(R(arguments[0],V)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new C,l=new C,c=new C;s.getCoordinate(0,l),s.getCoordinate(1,c);var p=l.x;c.x-=p;for(var h=0,f=1;f<a-1;f++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(f+1,c),c.x-=p,h+=l.x*(u.y-c.y);return h/2}},th.distanceLineLine=function(t,e,n,i){if(t.equals(e))return th.distancePointLine(t,n,i);if(n.equals(i))return th.distancePointLine(i,t,e);var r=!1;if(j.intersects(t,e,n,i)){var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(0===o)r=!0;else{var s=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(r=!0)}}else r=!0;return r?w.min(th.distancePointLine(t,n,i),th.distancePointLine(e,n,i),th.distancePointLine(n,t,e),th.distancePointLine(i,t,e)):0},th.isPointInRing=function(t,e){return th.locatePointInRing(t,e)!==O.EXT
1ERIOR},th.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new C;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;s<e;s++){t.getCoordinate(s,i);var a=i.x,u=i.y,l=a-r,c=u-o;n+=Math.sqrt(l*l+c*c),r=a,o=u}return n},th.isCCW=function(t){var e=t.length-1;if(e<3)throw new m("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,r=1;r<=e;r++){var o=t[r];o.y>n.y&&(n=o,i=r)}var s=i;do(s-=1)<0&&(s=e);while(t[s].equals2D(n)&&s!==i);var a=i;do a=(a+1)%e;while(t[a].equals2D(n)&&a!==i);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=th.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},th.locatePointInRing=function(t,e){return tp.locatePointInRing(t,e)},th.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y);return Math.abs(((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i)*Math.sqrt(i)},th.computeOrientation=function(t,e,n){return th.orientationIndex(t,e,n)},th.distancePointLine=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new m("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var r=th.distancePointLine(t,e[i],e[i+1]);r<n&&(n=r)}return n}if(3==arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;return l<=0?o.distance(s):l>=1?o.distance(a):Math.abs(((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u)*Math.sqrt(u)}},th.isOnLine=function(t,e){for(var n=new tl,i=1;i<e.length;i++){var r=e[i-1],o=e[i];if(n.computeIntersection(t,r,o),n.hasIntersection())return!0}return!1},tf.CLOCKWISE.get=function(){return -1},tf.RIGHT.get=function(){return th.CLOCKWISE},tf.COUNTERCLOCKWISE.get=function(){return 1},tf.LEFT.get=function(){return th.COUNTERCLOCKWISE},tf.COLLINEAR.get=function(){return 0},tf.STRAIGHT.get=function(){return th.COLLINEAR},Object.defineProperties(th,tf);var tg=function(){};tg.prototype.filter=function(t){},tg.prototype.interfaces_=function(){return[]},tg.prototype.getClass=function(){return tg};var td=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},t_={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};td.prototype.isGeometryCollection=function(){return this.getSortIndex()===td.SORTINDEX_GEOMETRYCOLLECTION},td.prototype.getFactory=function(){return this._factory},td.prototype.getGeometryN=function(t){return this},td.prototype.getArea=function(){return 0},td.prototype.isRectangle=function(){return!1},td.prototype.equals=function(){if(arguments[0]instanceof td){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];return e instanceof td&&this.equalsExact(e)}},td.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},td.prototype.geometryChanged=function(){this.apply(td.geometryChangedFilter)},td.prototype.geometryChangedAction=function(){this._envelope=null},td.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},td.prototype.getLength=function(){return 0},td.prototype.getNumGeometries=function(){return 1},td.prototype.compareTo=function(){if(1==arguments.length){var t=arguments[0];return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(t)}if(2==arguments.length){var e=arguments[0],n=arguments[1];return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(e,n)}},td.prototype.getUserData=function(){return this._userData},td.prototype.getSRID=function(){return this._SRID},td.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},td.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===td.SORTINDEX_GEOMETRYCOLLECTION)throw new m
1("This method does not support GeometryCollection arguments")},td.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},td.prototype.norm=function(){var t=this.copy();return t.normalize(),t},td.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},td.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new j(this._envelope)},td.prototype.setSRID=function(t){this._SRID=t},td.prototype.setUserData=function(t){this._userData=t},td.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var r=n.next(),o=i.next(),s=r.compareTo(o);if(0!==s)return s}return n.hasNext()?1:i.hasNext()?-1:0},td.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},td.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===td.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===td.SORTINDEX_MULTIPOINT||this.getSortIndex()===td.SORTINDEX_MULTILINESTRING||this.getSortIndex()===td.SORTINDEX_MULTIPOLYGON},td.prototype.interfaces_=function(){return[x,E,e]},td.prototype.getClass=function(){return td},td.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},td.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},t_.serialVersionUID.get=function(){return 0x799ea46522854c00},t_.SORTINDEX_POINT.get=function(){return 0},t_.SORTINDEX_MULTIPOINT.get=function(){return 1},t_.SORTINDEX_LINESTRING.get=function(){return 2},t_.SORTINDEX_LINEARRING.get=function(){return 3},t_.SORTINDEX_MULTILINESTRING.get=function(){return 4},t_.SORTINDEX_POLYGON.get=function(){return 5},t_.SORTINDEX_MULTIPOLYGON.get=function(){return 6},t_.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},t_.geometryChangedFilter.get=function(){return ty},Object.defineProperties(td,t_);var ty=function(){};ty.interfaces_=function(){return[tg]},ty.filter=function(t){t.geometryChangedAction()};var tm=function(){};tm.prototype.filter=function(t){},tm.prototype.interfaces_=function(){return[]},tm.prototype.getClass=function(){return tm};var tv=function(){},tI={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};tv.prototype.isInBoundary=function(t){},tv.prototype.interfaces_=function(){return[]},tv.prototype.getClass=function(){return tv},tI.Mod2BoundaryNodeRule.get=function(){return tE},tI.EndPointBoundaryNodeRule.get=function(){return tx},tI.MultiValentEndPointBoundaryNodeRule.get=function(){return tN},tI.MonoValentEndPointBoundaryNodeRule.get=function(){return tC},tI.MOD2_BOUNDARY_RULE.get=function(){return new tE},tI.ENDPOINT_BOUNDARY_RULE.get=function(){return new tx},tI.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new tN},tI.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new tC},tI.OGC_SFS_BOUNDARY_RULE.get=function(){return tv.MOD2_BOUNDARY_RULE},Object.defineProperties(tv,tI);var tE=function(){};tE.prototype.isInBoundary=function(t){return t%2==1},tE.prototype.interfaces_=function(){return[tv]},tE.prototype.getClass=function(){return tE};var tx=function(){};tx.prototype.isInBoundary=function(t){return t>0},tx.prototype.interfaces_=function(){return[tv]},tx.prototype.getClass=function(){return tx};var tN=function(){};tN.prototype.isInBoundary=function(t){return t>1},tN.prototype.interfaces_=function(){return[tv]},tN.prototype.getClass=function(){return tN};var tC=function(){};tC.prototype.isInBoundary=function(t){return 1===t},tC.prototype.interfaces_=function(){return[tv]},tC.prototype.getClass=function(){return tC};var tS=function(){};tS.prototype.add=function(){},tS.prototype.addAll=function(){},tS.prototype.isEmpty=function(){},tS.prototype.iterator=function(){},tS.prototype.size=function(){},tS.prototype.toArray=function(){},tS.prototype.remove=function(){},(n.prototype=Error()).name="IndexOutOfBoundsException";var tL=function(){};tL.prototype.hasNext=function(){},tL.prototype.next=function(){},tL.prototype.remove=function(){};var tb=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(tS);(i.prototype=Error()).name="NoSuchElementException";var tO=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof tS&&this.addAll(
1arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,tS]},e.prototype.add=function(t){return 1==arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new tT(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,i=this.array_.length;n<i;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(tb),tT=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new i;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(tL),tR=function(t){function e(){if(t.call(this),0==arguments.length);else if(1==arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this.ensureCapacity(n.length),this.add(n,i)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return[].fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2==arguments.length){for(var e=arguments[0],n=arguments[1],i=!1,r=e.iterator();r.hasNext();)this.add(r.next(),n),i=!0;return i}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1==arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2==arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return this.add(n,i,!0),!0}if(arguments[0]instanceof C&&"boolean"==typeof arguments[1]){var r=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(r))return null;t.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3==arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var p=arguments[0],h=arguments[1];if(!arguments[2]){var f=this.size();if(f>0&&(p>0&&this.get(p-1).equals2D(h)||p<f&&this.get(p).equals2D(h)))return null}t.prototype.add.call(this,p,h)}}else if(4==arguments.length){var g=arguments[0],d=arguments[1],_=arguments[2],y=arguments[3],m=1;_>y&&(m=-1);for(var v=_;v!==y;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(tO),tw=function(){},tP={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};tP.ForwardComparator.get=function(){return tD},tP.BidirectionalComparator.get=function(){return tM},tP.coordArrayType.get=function(){return[].fill(null)},tw.prototype.interfaces_=function(){return[]},tw.prototype.getClass=function(){return tw},tw.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},tw.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(0>tw.indexOf(i,e))return i}return null},tw.scroll=function(t,e){var n=tw.indexOf(e,t);if(n<0)return null;var i=Array(t.length).fill(null);Y.arraycopy(t,n,i,0,t.length-n),Y.arraycopy(t,0,i,t.length-n,n),Y.arraycopy(i,0,t,0,t.length)},tw.equals=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;
1if(null===t||null===e||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];if(i===r)return!0;if(null===i||null===r||i.length!==r.length)return!1;for(var s=0;s<i.length;s++)if(0!==o.compare(i[s],r[s]))return!1;return!0}},tw.intersection=function(t,e){for(var n=new tR,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},tw.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},tw.removeRepeatedPoints=function(t){return tw.hasRepeatedPoints(t)?new tR(t,!1).toCoordinateArray():t},tw.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var r=t[i];t[i]=t[e-i],t[e-i]=r}},tw.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var i=Array(e).fill(null);if(0===e)return i;for(var r=0,o=0;o<t.length;o++)null!==t[o]&&(i[r++]=t[o]);return i},tw.copyDeep=function(){if(1==arguments.length){for(var t=arguments[0],e=Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new C(t[n]);return e}if(5==arguments.length)for(var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new C(i[r+u])},tw.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[t.length-n-1];if(0!==i.compareTo(r))return!1}return!0},tw.envelope=function(t){for(var e=new j,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},tw.toCoordinateArray=function(t){return t.toArray(tw.coordArrayType)},tw.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},tw.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return -1},tw.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(0!==i)return i}return 1},tw.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(0!==i)return i;n++}return n<e.length?-1:+(n<t.length)},tw.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},tw.extract=function(t,e,n){e=w.clamp(e,0,t.length);var i=(n=w.clamp(n,-1,t.length))-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var r=Array(i).fill(null);if(0===i)return r;for(var o=0,s=e;s<=n;s++)r[o++]=t[s];return r},Object.defineProperties(tw,tP);var tD=function(){};tD.prototype.compare=function(t,e){return tw.compare(t,e)},tD.prototype.interfaces_=function(){return[N]},tD.prototype.getClass=function(){return tD};var tM=function(){};tM.prototype.compare=function(t,e){if(t.length<e.length)return -1;if(t.length>e.length)return 1;if(0===t.length)return 0;var n=tw.compare(t,e);return tw.isEqualReversed(t,e)?0:n},tM.prototype.OLDcompare=function(t,e){if(t.length<e.length)return -1;if(t.length>e.length)return 1;if(0===t.length)return 0;for(var n=tw.increasingDirection(t),i=tw.increasingDirection(e),r=n>0?0:t.length-1,o=i>0?0:t.length-1,s=0;s<t.length;s++){var a=t[r].compareTo(e[o]);if(0!==a)return a;r+=n,o+=i}return 0},tM.prototype.interfaces_=function(){return[N]},tM.prototype.getClass=function(){return tM};var tA=function(){};tA.prototype.get=function(){},tA.prototype.put=function(){},tA.prototype.size=function(){},tA.prototype.values=function(){},tA.prototype.entrySet=function(){};var tF=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(tA);(r.prototype=Error()).name="OperationNotSupported",(o.prototype=new tS).contains=function(){};var tG=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof tS&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw Error()},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new tq(this)},e}(o),tq=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.
1size())throw new i;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new r},e}(tL),tB=0;(p.prototype=new tF).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},p.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:tB,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:tB,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),tB),u(e,tB),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),tB),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=l(a(a(t)));1===s(n)?(u(a(t),tB),u(n,tB),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),tB),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=tB},p.prototype.values=function(){var t=new tO,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new tG,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},p.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,i=t;null!==n&&i===n.right;)i=n,n=n.parent;return n},p.prototype.size=function(){return this.size_};var tV=function(){};tV.prototype.interfaces_=function(){return[]},tV.prototype.getClass=function(){return tV},h.prototype=new o,(f.prototype=new h).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},f.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new r},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new tU(this)};var tU=function(t){this.treeSet_=t,this.position_=0};tU.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new i;return this.treeSet_.array_[this.position_++]},tU.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},tU.prototype.remove=function(){throw new r};var tz=function(){};tz.sort=function(){var t,e,n,i,r=arguments[0];if(1==arguments.length)i=function(t,e){return t.compareTo(e)},r.sort(i);else if(2==arguments.length)n=arguments[1],i=function(t,e){return n.compare(t,e)},r.sort(i);else if(3==arguments.length){(e=r.slice(arguments[1],arguments[2])).sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])}else if(4==arguments.length)for(e=r.slice(arguments[1],arguments[2]),n=arguments[3],i=function(t,e){return n.compare(t,e)},e.sort(i),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])},tz.asList=function(t){for(var e=new tO,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var tX=function(){},tY={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};tY.P.get=function(){return 0},tY.L.get=function(){return 1},tY.A.get=function(){return 2},tY.FALSE.get=function(){return -1},tY.TRUE.get=function(){return -2},tY.DONTCARE.get=function(){return -3},tY.SYM_FALSE.get=function(){return"F"},tY.SYM_TRUE.get=function(){return"T"},tY.SYM_DONTCARE.get=function(){return"*"},tY.SYM_P.get=function(){return"0"},tY.SYM_L.get=function(){return"1"},tY.SYM_A.get=function(){return"2"},tX.prototype.interfaces_=function(){return[]},tX.prototype.getClass=function(){return tX}
1,tX.toDimensionSymbol=function(t){switch(t){case tX.FALSE:return tX.SYM_FALSE;case tX.TRUE:return tX.SYM_TRUE;case tX.DONTCARE:return tX.SYM_DONTCARE;case tX.P:return tX.SYM_P;case tX.L:return tX.SYM_L;case tX.A:return tX.SYM_A}throw new m("Unknown dimension value: "+t)},tX.toDimensionValue=function(t){switch(A.toUpperCase(t)){case tX.SYM_FALSE:return tX.FALSE;case tX.SYM_TRUE:return tX.TRUE;case tX.SYM_DONTCARE:return tX.DONTCARE;case tX.SYM_P:return tX.P;case tX.SYM_L:return tX.L;case tX.SYM_A:return tX.A}throw new m("Unknown dimension symbol: "+t)},Object.defineProperties(tX,tY);var tk=function(){};tk.prototype.filter=function(t){},tk.prototype.interfaces_=function(){return[]},tk.prototype.getClass=function(){return tk};var tj=function(){};tj.prototype.filter=function(t,e){},tj.prototype.isDone=function(){},tj.prototype.isGeometryChanged=function(){},tj.prototype.interfaces_=function(){return[]},tj.prototype.getClass=function(){return tj};var tH=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new m("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new j,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var i=this._geometries[n].getCoordinates(),r=0;r<i.length;r++)t[++e]=i[r];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e)||this._geometries.length!==e._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(e._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();tz.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=tX.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=tX.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1==arguments.length){var t=arguments[0],e=new f(tz.asList(this._geometries)),n=new f(tz.asList(t._geometries));return this.compare(e,n)}if(2==arguments.length){for(var i=arguments[0],r=arguments[1],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=i.getGeometryN(a),c=u.compareToSameClass(l,r);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(R(arguments[0],tm))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(R(arguments[0],tj)){var n=arguments[0];if(0===this._geometries.length)return null;for(var i=0;i<this._geometries.length&&(this._geometries[i].apply(n),!n.isDone());i++);n.isGeometryChanged()&&this.geometryChanged()}else if(R(arguments[0],tk)){var r=arguments[0];r.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(r)}else if(R(arguments[0],tg)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ts.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return -0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(td),tW=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return td.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?tX.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new tK(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[tV]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(tH),tK=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1==arguments.length){var t=arguments[0],e=tv.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};tK.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},tK.prototype.getBoundary=function(){return this._geom instanceof t0?this.boundaryLineString(this._geom):this._geom instanceof tW?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},tK.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},tK.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},tK.prototype.computeBoundaryCoordinates=function(t){var e=new tO;this._endpointMap=new p;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var r=this._endpointMap.entrySet().iterator();r.hasNext();){var o=r.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return tw.toCoordinateArray(e)},tK.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new tJ,this._endpointMap.put(t,e)),e.count++},tK.prototype.interfaces_=function(){return[]},tK.prototype.getClass=function(){return tK},tK.getBoundary=function(){if(1==arguments.length){var t=arguments[0];return new tK(t).getBoundary()}if(2==arguments.length){var e=arguments[0],n=arguments[1];return new tK(e,n).getBoundary()}};var tJ=function(){this.count=null};tJ.prototype.interfaces_=function(){return[]},tJ.prototype.getClass=function(){return tJ};var tQ=function(){},tZ={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};tQ.prototype.interfaces_=function(){return[]},tQ.prototype.getClass=function(){return tQ},tQ.chars=function(t,e){for(var n=Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},tQ.getStackTrace=function(){if(1==arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2==arguments.length){for(var i=arguments[0],r=arguments[1],o="",s=new function(){}(new function(){}(tQ.getStackTrace(i))),a=0;a<r;a++)try{o+=s.readLine()+tQ.NEWLINE}catch(t){if(!(t instanceof g))throw t;ts.shouldNeverReachHere()}return o}},tQ.split=function(t,e){for(var n=e.length,i=new tO,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);i.add(s),o=(r=r.substring(o+n)).indexOf(e)}r.length>0&&i.add(r);for(var a=Array(i.size()).fill(null),u=0;u<a.length;u++)a[u]=i.get(u);return a},tQ.toString=function(){if(1==arguments.length){var t=arguments[0];return tQ.SIMPLE_ORDINATE_FORMAT.format(t)}},tQ.spaces=function(t){return tQ.chars(" ",t)},tZ.NEWLINE.get=function(){return Y.getProperty("line.separator")},tZ.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(tQ,tZ);var t$=function(){};t$.prototype.interfaces_=function(){return[]},t$.prototype.getClass=function(){return t$},t$.copyCoord=function(t,e,n,i){for(var r=Math.min(t.getDimension(),n.getDimension()),o=0;o<r;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},t$.isRing=function(t){var e=t.size();
1return 0===e||!(e<=3)&&t.getOrdinate(0,V.X)===t.getOrdinate(e-1,V.X)&&t.getOrdinate(0,V.Y)===t.getOrdinate(e-1,V.Y)},t$.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var i=Math.min(t.getDimension(),e.getDimension()),r=0;r<n;r++)for(var o=0;o<i;o++){var s=t.getOrdinate(r,o),a=e.getOrdinate(r,o);if(t.getOrdinate(r,o)!==e.getOrdinate(r,o)&&(!v.isNaN(s)||!v.isNaN(a)))return!1}return!0},t$.extend=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();if(t$.copy(e,0,i,0,r),r>0)for(var o=r;o<n;o++)t$.copy(e,r-1,i,o,1);return i},t$.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)t$.swap(t,i,e-i)},t$.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var r=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,r)}},t$.copy=function(t,e,n,i,r){for(var o=0;o<r;o++)t$.copyCoord(t,e+o,n,i+o)},t$.toString=function(){if(1==arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),i=new D;i.append("(");for(var r=0;r<e;r++){r>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(tQ.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},t$.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?t$.createClosedRing(t,e,4):e.getOrdinate(0,V.X)===e.getOrdinate(n-1,V.X)&&e.getOrdinate(0,V.Y)===e.getOrdinate(n-1,V.Y)?e:t$.createClosedRing(t,e,n+1)},t$.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();t$.copy(e,0,i,0,r);for(var o=r;o<n;o++)t$.copy(e,0,i,o,1);return i};var t0=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new j:this._points.expandEnvelope(new j)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e)||this._points.size()!==e._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),e._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&t$.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?tX.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return th.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return t$.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1==arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var i=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==i)return i;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2==arguments.length){var r=arguments[0];return arguments[1].compare(this._points,r._points)}},e.prototype.apply=function(){if(R(arguments[0],tm))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(R(arguments[0],tj)){var n=arguments[0];if(0===this._points.size())return null;for(var i=0;i<this._points.size()&&(n.filter(this._points,i),!n.isDone());i++);n.isGeometryChanged()&&this.geometryChanged()}else R(arguments[0],tk)?arguments[0].filter(this):R(arguments[0],tg)&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new tK(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new m
1("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[tV]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(td),t1=function(){};t1.prototype.interfaces_=function(){return[]},t1.prototype.getClass=function(){return t1};var t2=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new j;var t=new j;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return tX.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return+!this.isEmpty()},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1==arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2==arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(R(arguments[0],tm)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(R(arguments[0],tj)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else R(arguments[0],tk)?arguments[0].filter(this):R(arguments[0],tg)&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),ts.isTrue(1>=t.size()),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[t1]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(td),t3=function(){};t3.prototype.interfaces_=function(){return[]},t3.prototype.getClass=function(){return t3};var t4=function(t){function e(e,n,i){if(t.call(this,i),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new m("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new m("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),i=0;i<n.length;i++)t[++e]=n[i];for(var r=0;r<this._holes.length;r++)for(var o=this._holes[r].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t;t=0+Math.abs(th.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(th.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing()||null===this._shell||5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var i=t.getX(n);if(i!==e.getMinX()&&i!==e.getMaxX())return!1;var r=t.getY(n);if(r!==e.getMinY()&&r!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),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},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=this._shell,r=e._shell;if(!i.equalsExact(r,n)||this._holes.length!==e._holes.length)return!1;for(var o=0;o<this._holes.length;o++)if(!this._holes[o].equalsExact(e._holes[o],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0==arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);tz.sort(this._holes)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var i=Array(e.getCoordinates().length-1).fill(null);Y.arraycopy(e.getCoordinates(),0,i,0,i.length);var r=tw.minCoordinate(e.getCoordinates());tw.scroll(i,r),Y.arraycopy(i,0,e.getCoordinates(),0,i.length),e.getCoordinates()[i.length]=i[0],th.isCCW(e.getCoordinates())===n&&tw.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t;t=0+this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1==arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2==arguments.length){var i=arguments[0],r=arguments[1],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var p=this.getInteriorRingN(c),h=i.getInteriorRingN(c),f=p.compareToSameClass(h,r);if(0!==f)return f;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(R(t,tm)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(R(t,tj)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(R(t,tk))t.filter(this);else if(R(t,tg)){t.filter(this),this._shell.apply(t);for(var i=0;i<this._holes.length;i++)this._holes[i].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=Array(this._holes.length).fill(null),i=0;i<n.length;i++)n[i]=this._holes[i].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[t3]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return -0x307ffefd8dc97200},Object.defineProperties(e,n),e}(td),t5=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return td.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1==arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return tX.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[t1]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return -0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(tH),t9=function(t){function e(e,n){e instanceof C&&n instanceof eh&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return td.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return tX.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return t$.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new m
1("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new m("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return -0x3b229e262367a600},Object.defineProperties(e,n),e}(t0),t6=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return td.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new tO,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),i=0;i<n.getNumGeometries();i++)t.add(n.getGeometryN(i));var r=Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(r))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[t3]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return -0x7a5aa1369171980},Object.defineProperties(e,n),e}(tH),t7=function(t){this._factory=t||null,this._isUserDataCopied=!1},t8={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};t7.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},t7.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},t7.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof tH?this.editGeometryCollection(t,e):t instanceof t4?this.editPolygon(t,e):t instanceof t2||t instanceof t0?e.edit(t,this._factory):(ts.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},t7.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),i=new tO,r=0;r<n.getNumGeometries();r++){var o=this.edit(n.getGeometryN(r),e);null===o||o.isEmpty()||i.add(o)}return n.getClass()===t5?this._factory.createMultiPoint(i.toArray([])):n.getClass()===tW?this._factory.createMultiLineString(i.toArray([])):n.getClass()===t6?this._factory.createMultiPolygon(i.toArray([])):this._factory.createGeometryCollection(i.toArray([]))},t7.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var i=this.edit(n.getExteriorRing(),e);if(null===i||i.isEmpty())return this._factory.createPolygon();for(var r=new tO,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this._factory.createPolygon(i,r.toArray([]))},t7.prototype.interfaces_=function(){return[]},t7.prototype.getClass=function(){return t7},t7.GeometryEditorOperation=function(){},t8.NoOpGeometryOperation.get=function(){return et},t8.CoordinateOperation.get=function(){return ee},t8.CoordinateSequenceOperation.get=function(){return en},Object.defineProperties(t7,t8);var et=function(){};et.prototype.edit=function(t,e){return t},et.prototype.interfaces_=function(){return[t7.GeometryEditorOperation]},et.prototype.getClass=function(){return et};var ee=function(){};ee.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof t9?e.createLinearRing(n):t instanceof t0?e.createLineString(n):t instanceof t2?n.length>0?e.createPoint(n[0]):e.createPoint():t},ee.prototype.interfaces_=function(){return[t7.GeometryEditorOperation]},ee.prototype.getClass=function(){return ee};var en=function(){};en.prototype.edit=function(t,e){return t instanceof t9?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof t0?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof t2?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},en.prototype.interfaces_=function(){return[t7.GeometryEditorOperation]},en.prototype.getClass=function(){return en};var ei=function(){if(this._dimension=3,this._coordinates=null,1==arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new C}else if(R(arguments[0],V)){var n=arguments[0];if(null===n)return this._coordinates=[].fill(null),null;this._dimension=n.getDimension(),this._coordinates=Array(n.size()).fill(null);for(var i=0;i<this._coordinates.length;i++)this._coordinates[i]=n.getCoordinateCopy(i)}}else if(2==arguments.length){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var r=arguments[0],o=arguments[1];this._coordinates=r,this._dimension=o,null===r&&(this._coordinates=[].fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new C}}},er={serialVersionUID:{configurable:!0}};ei.prototype.setOrdinate=function(t,e,n){switch(e){case V.X:this._coordinates[t].x=n;break;case V.Y:this._coordinates[t].y=n;break;case V.Z:this._coordinates[t].z=n;break;
1default:throw new m("invalid ordinateIndex")}},ei.prototype.size=function(){return this._coordinates.length},ei.prototype.getOrdinate=function(t,e){switch(e){case V.X:return this._coordinates[t].x;case V.Y:return this._coordinates[t].y;case V.Z:return this._coordinates[t].z}return v.NaN},ei.prototype.getCoordinate=function(){if(1==arguments.length){var t=arguments[0];return this._coordinates[t]}if(2==arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ei.prototype.getCoordinateCopy=function(t){return new C(this._coordinates[t])},ei.prototype.getDimension=function(){return this._dimension},ei.prototype.getX=function(t){return this._coordinates[t].x},ei.prototype.clone=function(){for(var t=Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ei(t,this._dimension)},ei.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ei.prototype.copy=function(){for(var t=Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ei(t,this._dimension)},ei.prototype.toString=function(){if(this._coordinates.length>0){var t=new D(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"()"},ei.prototype.getY=function(t){return this._coordinates[t].y},ei.prototype.toCoordinateArray=function(){return this._coordinates},ei.prototype.interfaces_=function(){return[V,e]},ei.prototype.getClass=function(){return ei},er.serialVersionUID.get=function(){return -0xcb44a778db18e00},Object.defineProperties(ei,er);var eo=function(){},es={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};eo.prototype.readResolve=function(){return eo.instance()},eo.prototype.create=function(){if(1==arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ei(t)}if(R(arguments[0],V)){var e=arguments[0];return new ei(e)}}else if(2==arguments.length){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new ei(n):new ei(n,i)}},eo.prototype.interfaces_=function(){return[b,e]},eo.prototype.getClass=function(){return eo},eo.instance=function(){return eo.instanceObject},es.serialVersionUID.get=function(){return -0x38e49fa6cf6f2e00},es.instanceObject.get=function(){return new eo},Object.defineProperties(eo,es);var ea=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new tO,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new tG;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(tA),eu=function t(){if(this._modelType=null,this._scale=null,0==arguments.length)this._modelType=t.FLOATING;else if(1==arguments.length){if(arguments[0]instanceof ec){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}}},el={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};eu.prototype.equals=function(t){return t instanceof eu&&this._modelType===t._modelType&&this._scale===t._scale},eu.prototype.compareTo=function(t){var e=this.getMaximumSignificantDigits(),n=t.getMaximumSignificantDigits();return new M(e).compareTo(new M(n))},eu.prototype.getScale=function(){return this._scale},eu.prototype.isFloating=function(){return this._modelType===eu.FLOATING||this._modelType===eu.FLOATING_SINGLE},eu.prototype.getType=function(){return this._modelType},eu.prototype.toString=function(){var t="UNKNOWN";return this._modelType===eu.FLOATING?t="Floating":this._modelType===eu.FLOATING_SINGLE?t="Floating-Single":this._modelType===eu.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},eu.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return v.isNaN(t)||this._modelType===eu.FLOATING_SINGLE?t:this._modelType===eu.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===eu.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},eu.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===eu.FLOATING?t=16:this._modelType===eu.FLOATING_SINGLE?t=6:this._modelType===eu.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},eu.prototype.setScale=function(t){this._scale=Math.abs(t)},eu.prototype.interfaces_=function(){return[e,E]},eu.prototype.getClass=function(){return eu},eu.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},el.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},el.maximumPreciseValue.get=function(){return 0x20000000000000},Object.defineProperties(eu,el);var ec=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ep={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ec.prototype.readResolve=function(){return ec.nameToTypeMap.get(this._name)},ec.prototype.toString=function(){return this._name},ec.prototype.interfaces_=function(){return[e]},ec.prototype.getClass=function(){return ec},ep.serialVersionUID.get=function(){return -0x4cb98acd40a6b400},ep.nameToTypeMap.get=function(){return new ea},Object.defineProperties(ec,ep),eu.Type=ec,eu.FIXED=new ec("FIXED"),eu.FLOATING=new ec("FLOATING"),eu.FLOATING_SINGLE=new ec("FLOATING SINGLE");var eh=function t(){this._precisionModel=new eu,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0==arguments.length||(1==arguments.length?R(arguments[0],b)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof eu&&(this._precisionModel=arguments[0]):2==arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3==arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ef={serialVersionUID:{configurable:!0}};eh.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},eh.prototype.createLineString=function(t){return t?t instanceof Array?new t0(this.getCoordinateSequenceFactory().create(t),this):R(t,V)?new t0(t,this):void 0:new t0(this.getCoordinateSequenceFactory().create([]),this)},eh.prototype.createMultiLineString=function(){if(0==arguments.length)return new tW(null,this);if(1==arguments.length){var t=arguments[0];return new tW(t,this)}},eh.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(eh.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof t4)return this.createMultiPolygon(eh.toPolygonArray(t));if(a instanceof t0)return this.createMultiLineString(eh.toLineStringArray(t));if(a instanceof t2)return this.createMultiPoint(eh.toPointArray(t));ts.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},eh.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},eh.prototype.createPoint=function(){if(0==arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(R(arguments[0],V)){var e=arguments[0];return new t2(e,this)}}},eh.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},eh.prototype.createPolygon=function(){if(0==arguments.length)return new t4(null,null,this);if(1==arguments.length){if(R(arguments[0],V)){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 t9){var n=arguments[0];return this.createPolygon(n,null)}}else if(2==arguments.length){var i=arguments[0],r=arguments[1];return new t4(i,r,this)}},eh.prototype.getSRID=function(){return this._SRID},eh.prototype.createGeometryCollection=function(){if(0==arguments.length)return new tH(null,this);if(1==arguments.length){var t=arguments[0];return new tH(t,this)}},eh.prototype.createGeometry=function(t){return new t7(this).edit(t,{edit:function(){if(2==arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},eh.prototype.getPrecisionModel=function(){return this._precisionModel},eh.prototype.createLinearRing=function(){if(0==arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(R(arguments[0],V)){var e=arguments[0];return new t9(e,this)}}},eh.prototype.createMultiPolygon=function(){if(0==arguments.length)return new t6(null,this);if(1==arguments.length){var t=arguments[0];return new t6(t,this)}},eh.prototype.createMultiPoint=function(){if(0==arguments.length)return new t5(null,this);if(1==arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new t5(t,this)}
1if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(R(arguments[0],V)){var n=arguments[0];if(null===n)return this.createMultiPoint([].fill(null));for(var i=Array(n.size()).fill(null),r=0;r<n.size();r++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());t$.copy(n,r,o,0,1),i[r]=this.createPoint(o)}return this.createMultiPoint(i)}}},eh.prototype.interfaces_=function(){return[e]},eh.prototype.getClass=function(){return eh},eh.toMultiPolygonArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toGeometryArray=function(t){if(null===t)return null;var e=Array(t.size()).fill(null);return t.toArray(e)},eh.getDefaultCoordinateSequenceFactory=function(){return eo.instance()},eh.toMultiLineStringArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toLineStringArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toMultiPointArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toLinearRingArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toPointArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.toPolygonArray=function(t){var e=Array(t.size()).fill(null);return t.toArray(e)},eh.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ef.serialVersionUID.get=function(){return -0x5ea75f2051eeb400},Object.defineProperties(eh,ef);var eg=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ed=function(t){this.geometryFactory=t||new eh};ed.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!e_[n])throw Error("Unknown GeoJSON type: "+e.type);return -1!==eg.indexOf(n)?e_[n].apply(this,[e.coordinates]):"GeometryCollection"===n?e_[n].apply(this,[e.geometries]):e_[n].apply(this,[e])},ed.prototype.write=function(t){var e=t.getGeometryType();if(!ey[e])throw Error("Geometry is not supported");return ey[e].apply(this,[t])};var e_={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){if(!e_[t.geometry.type])throw Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=e_.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(new C(i[0],i[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new C(t[0],t[1]),new C(t[2],t[1]),new C(t[2],t[3]),new C(t[0],t[3]),new C(t[0],t[1])])},Point:function(t){var e=new C(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(e_.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=e_.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(e_.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=e_.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),i=[],r=1;r<t.length;++r){var o=t[r],s=e_.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);i.push(a)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(e_.Polygon.apply(this,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(this.read(i))}return this.geometryFactory.createGeometryCollection(e)}},ey={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:ey.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ey.Point.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),i=0;i<n.length;++i){var r=n[i];e.push(ey.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ey.LineString.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=ey.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var i=0;i<t._holes.length;++i){var r=t._holes[i],o=ey.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=ey.Polygon.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=i.getGeometryType();e.push(ey[r].apply(this,[i]))}return{type:"GeometryCollection",geometries:e}}},em=function(t){this.geometryFactory=t||new eh,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ed(this.geometryFactory)};em.prototype.read=function(t){var e=this.parser.read(t);
1return this.precisionModel.getType()===eu.FIXED&&this.reducePrecision(e),e},em.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var ev=function(){this.parser=new ed(this.geometryFactory)};ev.prototype.write=function(t){return this.parser.write(t)};var eI=function(){},eE={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};eI.prototype.interfaces_=function(){return[]},eI.prototype.getClass=function(){return eI},eI.opposite=function(t){return t===eI.LEFT?eI.RIGHT:t===eI.RIGHT?eI.LEFT:t},eE.ON.get=function(){return 0},eE.LEFT.get=function(){return 1},eE.RIGHT.get=function(){return 2},Object.defineProperties(eI,eE),(d.prototype=Error()).name="EmptyStackException",(_.prototype=new tb).add=function(t){return this.array_.push(t),!0},_.prototype.get=function(t){if(t<0||t>=this.size())throw Error();return this.array_[t]},_.prototype.push=function(t){return this.array_.push(t),t},_.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},_.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},_.prototype.empty=function(){return 0===this.array_.length},_.prototype.isEmpty=function(){return this.empty()},_.prototype.search=function(t){return this.array_.indexOf(t)},_.prototype.size=function(){return this.array_.length},_.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var ex=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};ex.prototype.getCoordinate=function(){return this._minCoord},ex.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},ex.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();ts.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=th.computeOrientation(this._minCoord,n,e),r=!1;e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===th.COUNTERCLOCKWISE?r=!0:e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===th.CLOCKWISE&&(r=!0),r&&(this._minIndex=this._minIndex-1)},ex.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length||n[e].y===n[e+1].y)return -1;var i=eI.LEFT;return n[e].y<n[e+1].y&&(i=eI.RIGHT),i},ex.prototype.getEdge=function(){return this._orientedDe},ex.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},ex.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},ex.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}ts.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)===eI.LEFT&&(this._orientedDe=this._minDe.getSym())},ex.prototype.interfaces_=function(){return[]},ex.prototype.getClass=function(){return ex};var eN=function(t){function e(n,i){t.call(this,e.msgWithCoord(n,i)),this.pt=i?new C(i):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(tr),eC=function(){this.array_=[]};eC.prototype.addLast=function(t){this.array_.push(t)},eC.prototype.removeFirst=function(){return this.array_.shift()},eC.prototype.isEmpty=function(){return 0===this.array_.length};var eS=function(){this._finder=null,this._dirEdgeList=new tO,this._nodes=new tO,this._rightMostCoord=null,this._env=null,this._finder=new ex};eS.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},eS.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},eS.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new eN("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var r=t.getEdges().iterator();r.hasNext();){var o=r.next();o.setVisited(!0),this.copySymDepths(o)}},eS.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(eI.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},eS.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},eS.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(eI.RIGHT)>=1&&0>=e.getDepth(eI.LEFT)&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},eS.prototype.computeDepths=function(t){var e=new tG,n=new eC,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},eS.prototype.compareTo=function(t){return this._rightMostCoord.x<t._rightMostCoord.x?-1:+(this._rightMostCoord.x>t._rightMostCoord.x)},eS.prototype.getEnvelope=function(){if(null===this._env){for(var t=new j,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),i=0;i<n.length-1;i++)t.expandToInclude(n[i]);this._env=t}return this._env},eS.prototype.addReachable=function(t){var e=new _;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},eS.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(eI.LEFT,t.getDepth(eI.RIGHT)),e.setDepth(eI.RIGHT,t.getDepth(eI.LEFT))},eS.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();this._dirEdgeList.add(i);var r=i.getSym().getNode();r.isVisited()||e.push(r)}},eS.prototype.getNodes=function(){return this._nodes},eS.prototype.getDirectedEdges=function(){return this._dirEdgeList},eS.prototype.interfaces_=function(){return[E]},eS.prototype.getClass=function(){return eS};var eL=function t(){if(this.location=null,1==arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[eI.ON]=n}else if(arguments[0]instanceof t){var i=arguments[0];if(this.init(i.location.length),null!==i)for(var r=0;r<this.location.length;r++)this.location[r]=i.location[r]}}else if(3==arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[eI.ON]=o,this.location[eI.LEFT]=s,this.location[eI.RIGHT]=a}};eL.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},eL.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},eL.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},eL.prototype.isLine=function(){return 1===this.location.length},eL.prototype.merge=function(t){if(t.location.length>this.location.length){var e=[,,,].fill(null);e[eI.ON]=this.location[eI.ON],e[eI.LEFT]=O.NONE,e[eI.RIGHT]=O.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===O.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},eL.prototype.getLocations=function(){return this.location},eL.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[eI.LEFT];this.location[eI.LEFT]=this.location[eI.RIGHT],this.location[eI.RIGHT]=t},eL.prototype.toString=function(){var t=new D;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[eI.LEFT])),t.append(O.toLocationSymbol(this.location[eI.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[eI.RIGHT])),t.toString()},eL.prototype.setLocations=function(t,e,n){this.location[eI.ON]=t,this.location[eI.LEFT]=e,this.location[eI.RIGHT]=n},eL.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},eL.prototype.isArea=function(){return this.location.length>1},eL.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},eL.prototype.setLocation=function(){if(1==arguments.length){var t=arguments[0];this.setLocation(eI.ON,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},eL.prototype.init=function(t){this.location=Array(t).fill(null),this.setAllLocations(O.NONE)},eL.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},eL.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},eL.prototype.interfaces_=function(){return[]},eL.prototype.getClass=function(){return eL};var eb=function t(){if(this.elt=[,,].fill(null),1==arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new eL(e),this.elt[1]=new eL(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new eL(n.elt[0]),this.elt[1]=new eL(n.elt[1])}}else if(2==arguments.length){var i=arguments[0],r=arguments[1];this.elt[0]=new eL(O.NONE),this.elt[1]=new eL(O.NONE),this.elt[i].setLocation(r)}else if(3==arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new eL(o,s,a),this.elt[1]=new eL(o,s,a)}else if(4==arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],p=arguments[3];this.elt[0]=new eL(O.NONE,O.NONE,O.NONE),this.elt[1]=new eL(O.NONE,O.NONE,O.NONE),this.elt[u].setLocations(l,c,p)}};eb.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},eb.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},eb.prototype.isNull=function(t){return this.elt[t].isNull()},eb.prototype.setAllLocationsIfNull=function(){if(1==arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},eb.prototype.isLine=function(t){return this.elt[t].isLine()},eb.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new eL(t.elt[e]):this.elt[e].merge
1(t.elt[e])},eb.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},eb.prototype.getLocation=function(){if(1==arguments.length){var t=arguments[0];return this.elt[t].get(eI.ON)}if(2==arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},eb.prototype.toString=function(){var t=new D;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()},eb.prototype.isArea=function(){if(0==arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1==arguments.length){var t=arguments[0];return this.elt[t].isArea()}},eb.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},eb.prototype.setLocation=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(eI.ON,e)}else if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.elt[n].setLocation(i,r)}},eb.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},eb.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},eb.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new eL(this.elt[t].location[0]))},eb.prototype.interfaces_=function(){return[]},eb.prototype.getClass=function(){return eb},eb.toLineLabel=function(t){for(var e=new eb(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var eO=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new tO,this._pts=new tO,this._label=new eb(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new tO,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};eO.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=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=th.isCCW(this._ring.getCoordinates())},eO.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},eO.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new eN("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new eN("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var i=e.getLabel();ts.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},eO.prototype.getLinearRing=function(){return this._ring},eO.prototype.getCoordinate=function(t){return this._pts.get(t)},eO.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},eO.prototype.addPoints=function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o<i.length;o++)this._pts.add(i[o])}else{var s=i.length-2;n&&(s=i.length-1);for(var a=s;a>=0;a--)this._pts.add(i[a])}},eO.prototype.isHole=function(){return this._isHole},eO.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},eO.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!th.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},eO.prototype.addHole=function(t){this._holes.add(t)},eO.prototype.isShell=function(){return null===this._shell},eO.prototype.getLabel=function(){return this._label},eO.prototype.getEdges=function(){return this._edges},eO.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},eO.prototype.getShell=function(){return this._shell},eO.prototype.mergeLabel=function(){if(1==arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2==arguments.length){var e=arguments[0],n=arguments[1],i=e.getLocation(n,eI.RIGHT);if(i===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,i),null}},eO.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},eO.prototype.toPolygon=function(t){for(var e=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)},eO.prototype.interfaces_=function(){return[]},eO.prototype.getClass=function(){return eO};var eT=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(eO),eR=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new tO,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new eT(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext();while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(eO),ew=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}};ew.prototype.setVisited=function(t){this._isVisited=t},ew.prototype.setInResult=function(t){this._isInResult=t},ew.prototype.isCovered=function(){return this._isCovered},ew.prototype.isCoveredSet=function(){return this._isCoveredSet},ew.prototype.setLabel=function(t){this._label=t},ew.prototype.getLabel=function(){return this._label},ew.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ew.prototype.updateIM=function(t){ts.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ew.prototype.isInResult=function(){return this._isInResult},ew.prototype.isVisited=function(){return this._isVisited},ew.prototype.interfaces_=function(){return[]},ew.prototype.getClass=function(){return ew};var eP=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new eb(0,O.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=O.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==O.BOUNDARY&&(n=i)}return n},e.prototype.setLabel=function(){if(2!=arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new eb(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof eb)for(var n=arguments[0],i=0;i<2;i++){var r=this.computeMergedLocation(n,i);this._label.getLocation(i)===O.NONE&&this._label.setLocation(i,r)}}
1,e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=O.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case O.BOUNDARY:n=O.INTERIOR;break;case O.INTERIOR:default:n=O.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ew),eD=function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};eD.prototype.find=function(t){return this.nodeMap.get(t)},eD.prototype.addNode=function(){if(arguments[0]instanceof C){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 eP){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return null===i?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},eD.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},eD.prototype.iterator=function(){return this.nodeMap.values().iterator()},eD.prototype.values=function(){return this.nodeMap.values()},eD.prototype.getBoundaryNodes=function(t){for(var e=new tO,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===O.BOUNDARY&&e.add(i)}return e},eD.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},eD.prototype.interfaces_=function(){return[]},eD.prototype.getClass=function(){return eD};var eM=function(){},eA={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};eM.prototype.interfaces_=function(){return[]},eM.prototype.getClass=function(){return eM},eM.isNorthern=function(t){return t===eM.NE||t===eM.NW},eM.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},eM.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return -1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},eM.isInHalfPlane=function(t,e){return e===eM.SE?t===eM.SE||t===eM.SW:t===e||t===e+1},eM.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new m("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?eM.NE:eM.SE:e>=0?eM.NW:eM.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new m("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?eM.NE:eM.SE:i.y>=n.y?eM.NW:eM.SW}},eA.NE.get=function(){return 0},eA.NW.get=function(){return 1},eA.SW.get=function(){return 2},eA.SE.get=function(){return 3},Object.defineProperties(eM,eA);var eF=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1==arguments.length){var t=arguments[0];this._edge=t}else if(3==arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this._edge=e,this.init(n,i),this._label=null}else if(4==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=r,this.init(o,s),this._label=a}};eF.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:th.computeOrientation(t._p0,t._p1,this._p1)},eF.prototype.getDy=function(){return this._dy},eF.prototype.getCoordinate=function(){return this._p0},eF.prototype.setNode=function(t){this._node=t},eF.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),r=n.substring(i+1);t.print("  "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label)},eF.prototype.compareTo=function(t){return this.compareDirection(t)},eF.prototype.getDirectedCoordinate=function(){return this._p1},eF.prototype.getDx=function(){return this._dx},eF.prototype.getLabel=function(){return this._label},eF.prototype.getEdge=function(){return this._edge},eF.prototype.getQuadrant=function(){return this._quadrant},eF.prototype.getNode=function(){return this._node},eF.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return"  "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+"   "+this._label},eF.prototype.computeLabel=function(t){},eF.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=eM.quadrant(this._dx,this._dy),ts.isTrue(0!==this._dx||0!==this._dy,"EdgeEnd with identical endpoints found")},eF.prototype.interfaces_=function(){return[E]},eF.prototype.getClass=function(){return eF};var eG=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new eb(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new eN("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,eI.LEFT)===O.INTERIOR&&this._label.getLocation(e,eI.RIGHT)===O.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[eI.LEFT]+"/"+this._depth[eI.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,O.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var i=1;t===eI.LEFT&&(i=-1);var r=eI.opposite(t),o=e+n*i;this.setDepth(t,e),this.setDepth(r,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===O.EXTERIOR&&e===O.INTERIOR?1:t===O.INTERIOR&&e===O.EXTERIOR?-1:0},e}(eF),eq=function(){};eq.prototype.createNode=function(t){return new eP(t,null)},eq.prototype.interfaces_=function(){return[]},eq.prototype.getClass=function(){return eq};var eB=function(){if(this._edges=new tO,this._nodes=null,this._edgeEndList=new tO,0==arguments.length)this._nodes=new eD(new eq);else if(1==arguments.length){var t=arguments[0];this._nodes=new eD(t)}};eB.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},eB.prototype.find=function(t){return this._nodes.find(t)},eB.prototype.addNode=function(){if(arguments[0]instanceof eP){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof C){var e=arguments[0];return this._nodes.addNode(e)}},eB.prototype.getNodeIterator=function(){return this._nodes.iterator()},eB.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},eB.prototype.debugPrintln=function(t){Y.out.println(t)},eB.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var i=n.getLabel();return null!==i&&i.getLocation(t)===O.BOUNDARY},eB.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},eB.prototype.matchInSameDirection=function(t,e,n,i){return!!t.equals(n)&&th.computeOrientation(t,e,
1i)===th.COLLINEAR&&eM.quadrant(t,e)===eM.quadrant(n,i)},eB.prototype.getEdgeEnds=function(){return this._edgeEndList},eB.prototype.debugPrint=function(t){Y.out.print(t)},eB.prototype.getEdgeIterator=function(){return this._edges.iterator()},eB.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(this.matchInSameDirection(t,e,r[0],r[1])||this.matchInSameDirection(t,e,r[r.length-1],r[r.length-2]))return i}return null},eB.prototype.insertEdge=function(t){this._edges.add(t)},eB.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},eB.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var i=new eG(n,!0),r=new eG(n,!1);i.setSym(r),r.setSym(i),this.add(i),this.add(r)}},eB.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},eB.prototype.getNodes=function(){return this._nodes.values()},eB.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return i}return null},eB.prototype.interfaces_=function(){return[]},eB.prototype.getClass=function(){return eB},eB.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var eV=function(){this._geometryFactory=null,this._shellList=new tO;var t=arguments[0];this._geometryFactory=t};eV.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()?n.add(r):e.add(r)}},eV.prototype.computePolygons=function(t){for(var e=new tO,n=t.iterator();n.hasNext();){var i=n.next().toPolygon(this._geometryFactory);e.add(i)}return e},eV.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(null===i.getShell()){var r=this.findEdgeRingContaining(i,t);if(null===r)throw new eN("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(r)}}},eV.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=new tO,r=t.iterator();r.hasNext();){var o=r.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},eV.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},eV.prototype.buildMaximalEdgeRings=function(t){for(var e=new tO,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new eR(i,this._geometryFactory);e.add(r),r.setInResult()}}return e},eV.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},eV.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},eV.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var p=!1;c.contains(i)&&th.isPointInRing(r,l.getCoordinates())&&(p=!0),p&&(null===o||s.contains(c))&&(o=u)}return o},eV.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return ts.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},eV.prototype.add=function(){if(1==arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2==arguments.length){var e=arguments[0],n=arguments[1];eB.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new tO,o=this.buildMinimalEdgeRings(i,this._shellList,r);this.sortShellsAndHoles(o,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},eV.prototype.interfaces_=function(){return[]},eV.prototype.getClass=function(){return eV};var eU=function(){};eU.prototype.getBounds=function(){},eU.prototype.interfaces_=function(){return[]},eU.prototype.getClass=function(){return eU};var ez=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};ez.prototype.getItem=function(){return this._item},ez.prototype.getBounds=function(){return this._bounds},ez.prototype.interfaces_=function(){return[eU,e]},ez.prototype.getClass=function(){return ez};var eX=function(){this._size=null,this._items=null,this._size=0,this._items=new tO,this._items.add(null)};eX.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},eX.prototype.size=function(){return this._size},eX.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&0>this._items.get(e+1).compareTo(this._items.get(e))&&e++,0>
1this._items.get(e).compareTo(n));t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},eX.prototype.clear=function(){this._size=0,this._items.clear()},eX.prototype.isEmpty=function(){return 0===this._size},eX.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);0>t.compareTo(this._items.get(Math.trunc(e/2)));e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},eX.prototype.interfaces_=function(){return[]},eX.prototype.getClass=function(){return eX};var eY=function(){};eY.prototype.visitItem=function(t){},eY.prototype.interfaces_=function(){return[]},eY.prototype.getClass=function(){return eY};var ek=function(){};ek.prototype.insert=function(t,e){},ek.prototype.remove=function(t,e){},ek.prototype.query=function(){},ek.prototype.interfaces_=function(){return[]},ek.prototype.getClass=function(){return ek};var ej=function(){if(this._childBoundables=new tO,this._bounds=null,this._level=null,0==arguments.length);else if(1==arguments.length){var t=arguments[0];this._level=t}},eH={serialVersionUID:{configurable:!0}};ej.prototype.getLevel=function(){return this._level},ej.prototype.size=function(){return this._childBoundables.size()},ej.prototype.getChildBoundables=function(){return this._childBoundables},ej.prototype.addChildBoundable=function(t){ts.isTrue(null===this._bounds),this._childBoundables.add(t)},ej.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ej.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},ej.prototype.interfaces_=function(){return[eU,e]},ej.prototype.getClass=function(){return ej},eH.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(ej,eH);var eW=function(){};eW.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},eW.min=function(t){return eW.sort(t),t.get(0)},eW.sort=function(t,e){var n=t.toArray();e?tz.sort(n,e):tz.sort(n);for(var i=t.iterator(),r=0,o=n.length;r<o;r++)i.next(),i.set(n[r])},eW.singletonList=function(t){var e=new tO;return e.add(t),e};var eK=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()};eK.prototype.expandToQueue=function(t,e){var n=eK.isComposite(this._boundable1),i=eK.isComposite(this._boundable2);if(n&&i)return eK.area(this._boundable1)>eK.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,t,e):this.expand(this._boundable2,this._boundable1,t,e),null;if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new m("neither boundable is composite")},eK.prototype.isLeaves=function(){return!(eK.isComposite(this._boundable1)||eK.isComposite(this._boundable2))},eK.prototype.compareTo=function(t){return this._distance<t._distance?-1:+(this._distance>t._distance)},eK.prototype.expand=function(t,e,n,i){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=new eK(r.next(),e,this._itemDistance);o.getDistance()<i&&n.add(o)}},eK.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},eK.prototype.getDistance=function(){return this._distance},eK.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},eK.prototype.interfaces_=function(){return[E]},eK.prototype.getClass=function(){return eK},eK.area=function(t){return t.getBounds().getArea()},eK.isComposite=function(t){return t instanceof ej};var eJ=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new tO,this._nodeCapacity=null,0==arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1==arguments.length){var n=arguments[0];ts.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},eQ={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};eJ.prototype.getNodeCapacity=function(){return this._nodeCapacity}
1,eJ.prototype.lastNode=function(t){return t.get(t.size()-1)},eJ.prototype.size=function(){if(0==arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1==arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof ej?t+=this.size(n):n instanceof ez&&(t+=1)}return t}},eJ.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof ez&&r.getItem()===e&&(n=r)}return null!==n&&(t.getChildBoundables().remove(n),!0)},eJ.prototype.itemsTree=function(){if(0==arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new tO:t}if(1==arguments.length){for(var e=arguments[0],n=new tO,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof ej){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof ez?n.add(r.getItem()):ts.shouldNeverReachHere()}return 0>=n.size()?null:n}},eJ.prototype.insert=function(t,e){ts.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new ez(t,e))},eJ.prototype.boundablesAtLevel=function(){if(1==arguments.length){var t=arguments[0],e=new tO;return this.boundablesAtLevel(t,this._root,e),e}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(ts.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof ej?this.boundablesAtLevel(n,s,r):(ts.isTrue(s instanceof ez),-1===n&&r.add(s))}return null}},eJ.prototype.query=function(){if(1==arguments.length){var t=arguments[0];this.build();var e=new tO;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2==arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i)}else if(3==arguments.length){if(R(arguments[2],eY)&&arguments[0]instanceof Object&&arguments[1]instanceof ej)for(var r=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;u<a.size();u++){var l=a.get(u);this.getIntersectsOp().intersects(l.getBounds(),r)&&(l instanceof ej?this.query(r,l,s):l instanceof ez?s.visitItem(l.getItem()):ts.shouldNeverReachHere())}else if(R(arguments[2],tb)&&arguments[0]instanceof Object&&arguments[1]instanceof ej)for(var c=arguments[0],p=arguments[1],h=arguments[2],f=p.getChildBoundables(),g=0;g<f.size();g++){var d=f.get(g);this.getIntersectsOp().intersects(d.getBounds(),c)&&(d instanceof ej?this.query(c,d,h):d instanceof ez?h.add(d.getItem()):ts.shouldNeverReachHere())}}},eJ.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},eJ.prototype.getRoot=function(){return this.build(),this._root},eJ.prototype.remove=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=this.removeItem(i,r);if(o)return!0;for(var s=null,a=i.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof ej&&(o=this.remove(n,u,r))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(s),o}},eJ.prototype.createHigherLevels=function(t,e){ts.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},eJ.prototype.depth=function(){if(0==arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1==arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof ej){var i=this.depth(n);i>t&&(t=i)}}return t+1}},eJ.prototype.createParentBoundables=function(t,e){ts.isTrue(!t.isEmpty());var n=new tO;n.add(this.createNode(e));var i=new tO(t);eW.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},eJ.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},eJ.prototype.interfaces_=function(){return[e]},eJ.prototype.getClass=function(){return eJ},eJ.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},eQ.IntersectsOp.get=function(){return eZ},eQ.serialVersionUID.get=function(){return -0x35ef64c82d4c5400},eQ.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(eJ,eQ);var eZ=function(){},e$=function(){};e$.prototype.distance=function(t,e){},e$.prototype.interfaces_=function(){return[]},e$.prototype.getClass=function(){return e$};var e0=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var i={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){ts.isTrue(t.length>0);for(var n=new tO,i=0;i<t.length;i++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[i],e));return n},n.prototype.createNode=function(t){return new e1(t)},n.prototype.size=function(){return 0==arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!=arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),i=Array(e).fill(null),r=t.iterator(),o=0;o<e;o++){i[o]=new tO;for(var s=0;r.hasNext()&&s<n;
1){var a=r.next();i[o].add(a),s++}}return i},n.prototype.query=function(){if(1==arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2==arguments.length){var n=arguments[0],i=arguments[1];t.prototype.query.call(this,n,i)}else if(3==arguments.length){if(R(arguments[2],eY)&&arguments[0]instanceof Object&&arguments[1]instanceof ej){var r=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,r,o,s)}else if(R(arguments[2],tb)&&arguments[0]instanceof Object&&arguments[1]instanceof ej){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0==arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){ts.isTrue(!t.isEmpty());var i=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),r=new tO(t);eW.sort(r,n.xComparator);var o=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(i))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1==arguments.length){if(R(arguments[0],e$)){var t=arguments[0],e=new eK(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof eK){var i=arguments[0];return this.nearestNeighbour(i,v.POSITIVE_INFINITY)}}else if(2==arguments.length){if(arguments[0]instanceof n&&R(arguments[1],e$)){var r=arguments[0],o=arguments[1],s=new eK(this.getRoot(),r.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof eK&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],l=null,c=new eX;for(c.add(a);!c.isEmpty()&&u>0;){var p=c.poll(),h=p.getDistance();if(h>=u)break;p.isLeaves()?(u=h,l=p):p.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3==arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],_=new ez(f,g),y=new eK(this.getRoot(),_,d);return this.nearestNeighbour(y)[0]}},n.prototype.interfaces_=function(){return[ek,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},i.STRtreeNode.get=function(){return e1},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[N]},compare:function(e,i){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(i.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[N]},compare:function(e,i){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(i.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,i),n}(eJ),e1=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new j(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ej),e2=function(){};e2.prototype.interfaces_=function(){return[]},e2.prototype.getClass=function(){return e2},e2.relativeSign=function(t,e){return t<e?-1:+(t>e)},e2.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=e2.relativeSign(e.x,n.x),r=e2.relativeSign(e.y,n.y);switch(t){case 0:return e2.compareValue(i,r);case 1:return e2.compareValue(r,i);case 2:return e2.compareValue(r,-i);case 3:return e2.compareValue(-i,r);case 4:return e2.compareValue(-i,-r);case 5:return e2.compareValue(-r,-i);case 6:return e2.compareValue(-r,i);case 7:return e2.compareValue(i,-r)}return ts.shouldNeverReachHere("invalid octant value"),0},e2.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:+(e>0)};var e3=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],i=arguments[3];this._segString=t,this.coord=new C(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};e3.prototype.getCoordinate=function(){return this.coord},e3.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},e3.prototype.compareTo=function(t){return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:e2.compare(this._segmentOctant,this.coord,t.coord)},e3.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},e3.prototype.isInterior=function(){return this._isInterior},e3.prototype.interfaces_=function(){return[E]},e3.prototype.getClass=function(){return e3};var e4=function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t};e4.prototype.getSplitCoordinates=function(){var t=new tR;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},e4.prototype.addCollapsedNodes=function(){var t=new tO;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)}},e4.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},e4.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),i=this._edge.getCoordinate(e+2);n.equals2D(i)&&t.add(new M(e+1))}},e4.prototype.addEdgeCoordinates=function(t,e,n){var i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);n.add(new C(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));r&&n.add(new C(e.coord))},e4.prototype.iterator=function(){return this._nodeMap.values().iterator()},e4.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},e4.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,1===i&&(n[0]=t.segmentIndex+1,!0)},e4.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=[,].fill(null),n=this.iterator(),i=n.next();n.hasNext();){var r=n.next();this.findCollapseIndex(i,r,e)&&t.add(new M(e[0])),i=r}},e4.prototype.getEdge=function(){return this._edge},e4.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},e4.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var o=Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return r&&(o[s]=new C(e.coord)),new e7(o,this._edge.getData())},e4.prototype.add=function(t,e){var n=new e3(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return null!==i?(ts.isTrue(i.coord.equals2D(t),"Found equal nodes with different c
1oordinates"),i):(this._nodeMap.put(n,n),n)},e4.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new tr("bad split edge start point at "+n);var i=t.get(t.size()-1).getCoordinates(),r=i[i.length-1];if(!r.equals2D(e[e.length-1]))throw new tr("bad split edge end point at "+r)},e4.prototype.interfaces_=function(){return[]},e4.prototype.getClass=function(){return e4};var e5=function(){};e5.prototype.interfaces_=function(){return[]},e5.prototype.getClass=function(){return e5},e5.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new m("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var r=arguments[0],o=arguments[1],s=o.x-r.x,a=o.y-r.y;if(0===s&&0===a)throw new m("Cannot compute the octant for two identical points "+r);return e5.octant(s,a)}};var e9=function(){};e9.prototype.getCoordinates=function(){},e9.prototype.size=function(){},e9.prototype.getCoordinate=function(t){},e9.prototype.isClosed=function(){},e9.prototype.setData=function(t){},e9.prototype.getData=function(){},e9.prototype.interfaces_=function(){return[]},e9.prototype.getClass=function(){return e9};var e6=function(){};e6.prototype.addIntersection=function(t,e){},e6.prototype.interfaces_=function(){return[e9]},e6.prototype.getClass=function(){return e6};var e7=function(){this._nodeList=new e4(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};e7.prototype.getCoordinates=function(){return this._pts},e7.prototype.size=function(){return this._pts.length},e7.prototype.getCoordinate=function(t){return this._pts[t]},e7.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},e7.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},e7.prototype.setData=function(t){this._data=t},e7.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:e5.octant(t,e)},e7.prototype.getData=function(){return this._data},e7.prototype.addIntersection=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[3],o=new C(n.getIntersection(r));this.addIntersection(o,i)}},e7.prototype.toString=function(){return ti.toLineString(new ei(this._pts))},e7.prototype.getNodeList=function(){return this._nodeList},e7.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var r=this._pts[i];t.equals2D(r)&&(n=i)}return this._nodeList.add(t,n)},e7.prototype.addIntersections=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},e7.prototype.interfaces_=function(){return[e6]},e7.prototype.getClass=function(){return e7},e7.getNodedSubstrings=function(){if(1==arguments.length){var t=arguments[0],e=new tO;return e7.getNodedSubstrings(t,e),e}if(2==arguments.length)for(var n=arguments[0],i=arguments[1],r=n.iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(i)};var e8=function(){if(this.p0=null,this.p1=null,0==arguments.length)this.p0=new C,this.p1=new C;else if(1==arguments.length){var t=arguments[0];this.p0=new C(t.p0),this.p1=new C(t.p1)}else if(2==arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4==arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=arguments[3];this.p0=new C(e,n),this.p1=new C(i,r)}},nt={serialVersionUID:{configurable:!0}};e8.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},e8.prototype.orientationIndex=function(){if(arguments[0]instanceof e8){var t=arguments[0],e=th.orientationIndex(this.p0,this.p1,t.p0),n=th.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof C){var i=arguments[0];return th.orientationIndex(this.p0,this.p1,i)}},e8.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},e8.prototype.isVertical=function(){return this.p0.x===this.p1.x},e8.prototype.equals=function(t){return t instanceof e8&&this.p0.equals(t.p0)&&this.p1.equals(t.p1)},e8.prototype.intersection=function(t){var e=new tl;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},e8.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),n=new C;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}
1if(arguments[0]instanceof e8){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1||r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new e8(s,a)}},e8.prototype.normalize=function(){0>this.p1.compareTo(this.p0)&&this.reverse()},e8.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},e8.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},e8.prototype.distancePerpendicular=function(t){return th.distancePointLinePerpendicular(t,this.p0,this.p1)},e8.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},e8.prototype.midPoint=function(){return e8.midPoint(this.p0,this.p1)},e8.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;return i<=0?v.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},e8.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=[,,].fill(null),i=v.MAX_VALUE,r=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(r=s.distance(t.p1))<i&&(i=r,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(r=a.distance(this.p0))<i&&(i=r,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(r=u.distance(this.p1))<i&&(i=r,n[0]=this.p1,n[1]=u),n},e8.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},e8.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},e8.prototype.getLength=function(){return this.p0.distance(this.p1)},e8.prototype.compareTo=function(t){var e=this.p0.compareTo(t.p0);return 0!==e?e:this.p1.compareTo(t.p1)},e8.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},e8.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},e8.prototype.lineIntersection=function(t){try{return k.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof X))throw t}return null},e8.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},e8.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+o*o),a=0,u=0;if(0!==e){if(s<=0)throw Error("Cannot compute offset from zero-length line segment");a=e*r/s,u=e*o/s}return new C(n-u,i+a)},e8.prototype.setCoordinates=function(){if(1==arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},e8.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||v.isNaN(e))&&(e=1),e},e8.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},e8.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},e8.prototype.distance=function(){if(arguments[0]instanceof e8){var t=arguments[0];return th.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return th.distancePointLine(e,this.p0,this.p1)}},e8.prototype.pointAlong=function(t){var e=new C;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},e8.prototype.hashCode=function(){var t=v.doubleToLongBits(this.p0.x),e=Math.trunc(t^=31*v.doubleToLongBits(this.p0.y))^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return Math.trunc(n^=31*v.doubleToLongBits(this.p1.y))^Math.trunc(n>>32)^e},e8.prototype.interfaces_=function(){return[E,e]},e8.prototype.getClass=function(){return e8},e8.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},nt.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(e8,nt);var ne=function(){this.tempEnv1=new j,this.tempEnv2=new j,this._overlapSeg1=new e8,this._overlapSeg2=new e8};ne.prototype.overlap=function(){if(2==arguments.length);else if(4==arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne};var nn=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],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};nn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},nn.prototype.computeSelect=function(t,e,n,i){var r=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,i),s<n&&this.computeSelect(t,s,n,i)},nn.prototype.getCoordinates=function(){for(var t=Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;
1n++)t[e++]=this._pts[n];return t},nn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},nn.prototype.setId=function(t){this._id=t},nn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},nn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new j(t,e)}return this._env},nn.prototype.getEndIndex=function(){return this._end},nn.prototype.getStartIndex=function(){return this._start},nn.prototype.getContext=function(){return this._context},nn.prototype.getId=function(){return this._id},nn.prototype.computeOverlapsInternal=function(t,e,n,i,r,o){var s=this._pts[t],a=this._pts[e],u=n._pts[i],l=n._pts[r];if(e-t==1&&r-i==1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),p=Math.trunc((i+r)/2);t<c&&(i<p&&this.computeOverlapsInternal(t,c,n,i,p,o),p<r&&this.computeOverlapsInternal(t,c,n,p,r,o)),c<e&&(i<p&&this.computeOverlapsInternal(c,e,n,i,p,o),p<r&&this.computeOverlapsInternal(c,e,n,p,r,o))},nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn};var ni=function(){};ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ni.getChainStartIndices=function(t){var e=0,n=new tO;n.add(new M(e));do{var i=ni.findChainEnd(t,e);n.add(new M(i)),e=i}while(e<t.length-1);return ni.toIntArray(n)},ni.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=eM.quadrant(t[n],t[n+1]),r=e+1;r<t.length&&(t[r-1].equals2D(t[r])||eM.quadrant(t[r-1],t[r])===i);)r++;return r-1},ni.getChains=function(){if(1==arguments.length){var t=arguments[0];return ni.getChains(t,null)}if(2==arguments.length){for(var e=arguments[0],n=arguments[1],i=new tO,r=ni.getChainStartIndices(e),o=0;o<r.length-1;o++){var s=new nn(e,r[o],r[o+1],n);i.add(s)}return i}},ni.toIntArray=function(t){for(var e=Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var nr=function(){};nr.prototype.computeNodes=function(t){},nr.prototype.getNodedSubstrings=function(){},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr};var no=function(){if(this._segInt=null,0==arguments.length);else if(1==arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};no.prototype.setSegmentIntersector=function(t){this._segInt=t},no.prototype.interfaces_=function(){return[nr]},no.prototype.getClass=function(){return no};var ns=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new tO,this._index=new e0,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return e7.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=ni.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new na(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),i=this._index.query(n.getEnvelope()).iterator();i.hasNext();){var r=i.next();if(r.getId()>n.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return na},Object.defineProperties(e,n),e}(no),na=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!=arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],i=arguments[2],r=arguments[3],o=e.getContext(),s=i.getContext();this._si.processIntersections(o,n,s,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ne),nu=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0==arguments.length);else if(1==arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(i)}else if(4==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},nl={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};nu.prototype.getEndCapStyle=function(){return this._endCapStyle},nu.prototype.isSingleSided=function(){return this._isSingleSided},nu.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=nu.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=nu.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==nu.JOIN_ROUND&&(this._quadrantSegments=nu.DEFAULT_QUADRANT_SEGMENTS)},nu.prototype.getJoinStyle=function(){return this._joinStyle},nu.prototype.setJoinStyle=function(t){this._joinStyle=t},nu.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},nu.prototype.getSimplifyFactor=function(){return this._simplifyFactor},nu.prototype.getQuadrantSegments=function(){return this._quadrantSegments},nu.prototype.setEndCapStyle=function(t){this._endCapStyle=t},nu.prototype.getMitreLimit=function(){return this._mitreLimit},nu.prototype.setMitreLimit=function(t){this._mitreLimit=t},nu.prototype.setSingleSided=function(t){this._isSingleSided=t},nu.prototype.interfaces_=function(){return[]},nu.prototype.getClass=function(){return nu},nu.bufferDistanceError=function(t){return 1-Math.cos(Math.PI/2/t/2)},nl.CAP_ROUND.get=function(){return 1},nl.CAP_FLAT.get=function(){return 2},nl.CAP_SQUARE.get=function(){return 3},nl.JOIN_ROUND.get=function(){return 1},nl.JOIN_MITRE.get=function(){return 2},nl.JOIN_BEVEL.get=function(){return 3},nl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},nl.DEFAULT_MITRE_LIMIT.get=function(){return 5},nl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(nu,nl);var nc=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=th.COUNTERCLOCKWISE,this._inputLine=t||null},np={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};nc.prototype.isDeletable=function(t,e,n,i){var r=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(r,o,s)&&!!this.isShallow(r,o,s,i)&&this.isShallowSampled(r,o,t,n,i)},nc.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),i=!1;n<this._inputLine.length;){var r=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=nc.DELETE,r=!0,i=!0),t=r?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return i},nc.prototype.isShallowConcavity=function(t,e,n,i){return th.computeOrientation(t,e,n)===this._angleOrientation&&th.distancePointLine(e,t,n)<i},nc.prototype.isShallowSampled=function(t,e,n,i,r){var o=Math.trunc((i-n)/nc.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<i;s+=o)if(!this.isShallow(t,e,this._inputLine[s],r))return!1;return!0},nc.prototype.isConcave=function(t,e,n){return th.computeOrientation(t,e,n)===this._angleOrientation},nc.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=th.CLOCKWISE),this._isDeleted=Array(this._inputLine.length).fill(null);var e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()},nc.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===nc.DELETE;)e++;return e},nc.prototype.isShallow=function(t,e,n,i){return th.distancePointLine(e,t,n)<i},nc.prototype.collapseLine=function(){for(var t=new tR,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==nc.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},nc.prototype.interfaces_=function(){return[]},nc.prototype.getClass=function(){return nc},nc.simplify=function(t,e){return new nc(t).simplify(e)},np.INIT.get=function(){return 0},np.DELETE.get=function(){return 1},np.KEEP.get=function(){return 1},np.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(nc,np);var nh=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new tO},nf={COORDINATE_ARRAY_TYPE:{configurable:!0}};nh.prototype.getCoordinates=function(){return this._ptList.toArray(nh.COORDINATE_ARRAY_TYPE)},nh.prototype.setPrecisionModel=function(t){this._precisionModel=t},nh.prototype.addPt=function(t){var e=new C(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},nh.prototype.revere=function(){},nh.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var i=t.length-1;i>=0;i--)this.addPt(t[i])},nh.prototype.isRedundant=function(t){if(1>this._ptList.size())return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},nh.prototype.toString=function(){return(new eh).createLineString(this.getCoordinates()).toString()},nh.prototype.closeRing=function(){if(1>this._ptList.size())return null;var t=new C(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},nh.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},nh.prototype.interfaces_=function(){return[]},nh.prototype.getClass=function(){return nh},nf.COORDINATE_ARRAY_TYPE.get=function(){return[].fill(null)},Object.defineProperties(nh,nf);var ng=function(){},nd={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};ng.prototype.interfaces_=function(){return[]},ng.prototype.getClass=function(){return ng},ng.toDegrees=function(t){return 180*t/Math.PI},ng.normalize=function(t){for(;t>Math.PI;)t-=ng.PI_TIMES_2;for(;t<=-Math.PI;)t+=ng.PI_TIMES_2;return t},ng.angle=function(){if(1==arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2==arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x;return Math.atan2(n.y-e.y,i)}},ng.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},ng.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},ng.interiorAngle=function(t,e,n){var i=ng.angle(e,t);return Math.abs(ng.angle(e,n)-i)},ng.normalizePositive=function(t){if(t<0){for(;t<0;)t+=ng.PI_TIMES_2;t>=ng.PI_TIMES_2&&(t=0)}else{for(;t>=ng.PI_TIMES_2;)t-=ng.PI_TIMES_2;t<0&&(t=0)}return t},ng.angleBetween=function(t,e,n){var i=ng.angle(e,t),r=ng.angle(e,n);return ng.diff(i,r)},ng.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},ng.toRadians=function(t){return t*Math.PI/180},ng.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?ng.COUNTERCLOCKWISE:n<0?ng.CLOCKWISE:ng.NONE},ng.angleBetweenOriented=function(t,e,n){var i=ng.angle(e,t),r=ng.angle(e,n)-i;return r<=-Math.PI?r+ng.PI_TIMES_2:r>Math.PI?r-ng.PI_TIMES_2:r},nd.PI_TIMES_2.get=function(){return 2*Math.PI},nd.PI_OVER_2.get=function(){return Math.PI/2},nd.PI_OVER_4.get=function(){return Math.PI/4},nd.COUNTERCLOCKWISE.get=function(){return th.COUNTERCLOCKWISE},nd.CLOCKWISE.get=function(){return th.CLOCKWISE},nd.NONE.get=function(){return th.COLLINEAR},Object.defineProperties(ng,nd);var n_=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new e8,this._seg1=new e8,this._offset0=new e8,this._offset1=new e8,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new tl,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===nu.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)},ny={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};n_.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=th.computeOrientation(this._s0,this._s1,this._s2),i=n===th.CLOCKWISE&&this._side===eI.LEFT||n===th.COUNTERCLOCKWISE&&this._side===eI.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},n_.prototype.addLineEndCap=function(t,e){var n=new e8(t,e),i=new e8;this.computeOffsetSegment(n,eI.LEFT,this._distance,i);var r=new e8;this.computeOffsetSegment(n,eI.RIGHT,this._distance,r);var o=e.x-t.x,s=Math.atan2(e.y-t.y,o);switch(this._bufParams.getEndCapStyle()){case nu.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,th.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case nu.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case nu.CAP_SQUARE:var a=new C;a.x=Math.abs(this._distance)*Math.cos(s),a.y=Math.abs(this._distance)*Math.sin(s);var u=new C(i.p1.x+a.x,i.p1.y+a.y),l=new C(r.p1.x+a.x,r.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(l)}},n_.prototype.getCoordinates=function(){return this._segList.getCoordinates()},n_.prototype.addMitreJoin=function(t,e,n,i){var r=!0,o=null;try{o=k.intersection(e.p0,e.p1,n.p0,n.p1),(i<=0?1:o.distance(t)/Math.abs(i))>this._bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof X))throw t;o=new C(0,0),r=!1}r?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},n_.prototype.addFilletCorner=function(t,e,n,i,r){var o=e.x-t.x,s=Math.atan2(e.y-t.y,o),a=n.x-t.x,u=Math.atan2(n.y-t.y,a);i===th.CLOCKWISE?s<=u&&(s+=2*Math.PI):s>=u&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,u,i,r),this._segList.addPt(n)},n_.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*n_.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===nu.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===nu.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},n_.prototype.createSquare=function(t){this._segList.addPt(new C(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new C(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new C(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},n_.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},n_.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},n_.prototype.addLastSegment=function(){this._segList
1.addPt(this._offset1.p1)},n_.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},n_.prototype.addLimitedMitreJoin=function(t,e,n,i){var r=this._seg0.p1,o=ng.angle(r,this._seg0.p0),s=ng.angleBetweenOriented(this._seg0.p0,r,this._seg1.p1)/2,a=ng.normalize(o+s),u=ng.normalize(a+Math.PI),l=i*n,c=n-l*Math.abs(Math.sin(s)),p=new C(r.x+l*Math.cos(u),r.y+l*Math.sin(u)),h=new e8(r,p),f=h.pointAlongOffset(1,c),g=h.pointAlongOffset(1,-c);this._side===eI.LEFT?(this._segList.addPt(f),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(f))},n_.prototype.computeOffsetSegment=function(t,e,n,i){var r=e===eI.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=r*n*o/a,l=r*n*s/a;i.p0.x=t.p0.x-l,i.p0.y=t.p0.y+u,i.p1.x=t.p1.x-l,i.p1.y=t.p1.y+u},n_.prototype.addFilletArc=function(t,e,n,i,r){var o=i===th.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=0,c=new C;l<s;){var p=e+o*l;c.x=t.x+r*Math.cos(p),c.y=t.y+r*Math.sin(p),this._segList.addPt(c),l+=u}},n_.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*n_.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new C((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new C((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)}},n_.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},n_.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},n_.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new nh,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*n_.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},n_.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===nu.JOIN_BEVEL||this._bufParams.getJoinStyle()===nu.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,th.CLOCKWISE,this._distance))},n_.prototype.closeRing=function(){this._segList.closeRing()},n_.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},n_.prototype.interfaces_=function(){return[]},n_.prototype.getClass=function(){return n_},ny.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},ny.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},ny.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ny.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(n_,ny);var nm=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};nm.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&tw.reverse(o),o},nm.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var r=nc.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],eI.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=nc.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],eI.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()},nm.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===eI.RIGHT&&(i=-i);var r=nc.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},nm.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=nc.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],eI.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=nc.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],eI.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},nm.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case nu.CAP_ROUND:e.createCircle(t);break;case nu.CAP_SQUARE:e.createSquare(t)}},nm.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);return t.length<=1?this.computePointCurve(t[0],i):this._bufParams.isSingleSided()?this.computeSingleSidedBufferCurve(t,e<0,i):this.computeLineBufferCurve(t,i),i.getCoordinates()},nm.prototype.getBufferParameters=function(){return this._bufParams},nm.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},nm.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return nm.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},nm.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var r=nc.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],eI.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=nc.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],eI.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},nm.prototype.getSegGen=function(t){return new n_(this._precisionModel,this._bufParams,t)},nm.prototype.interfaces_=function(){return[]},nm.prototype.getClass=function(){return nm},nm.copyCoordinates=function(t){for(var e=Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new C(t[n]);return e};var nv=function(){this._subgraphs=null,this._seg=new e8,this._cga=new th;var t=arguments[0];this._subgraphs=t},nI={DepthSegment:{configurable:!0}};nv.prototype.findStabbedSegments=function(){if(1==arguments.length){for(var t=arguments[0],e=new tO,n=this._subgraphs.iterator();n.hasNext();){var i=n.next(),r=i.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3==arguments.length){if(R(arguments[2],tb)&&arguments[0]instanceof C&&arguments[1]instanceof eG){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||th.computeOrientation(this._seg.p0,this._seg.p1,o)===th.RIGHT)){var c=s.getDepth(eI.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(eI.RIGHT));var p=new nE(this._seg,c);a.add(p)}}else if(R(arguments[2],tb)&&arguments[0]instanceof C&&R(arguments[1],tb))for(var h=arguments[0],f=arguments[1],g=arguments[2],d=f.iterator();d.hasNext();){var _=d.next();_.isForward()&&this.findStabbedSegments(h,_,g)}}},nv.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:eW.min(e)._leftDepth},nv.prototype.interfaces_=function(){return[]},nv.prototype.getClass=function(){return nv},nI.DepthSegment.get=function(){return nE},Object.defineProperties(nv,nI);var nE=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new e8(t),this._leftDepth=e};nE.prototype.compareTo=function(t){if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return -1;var e=this._upwardSeg.orientationIndex(t._upwardSeg);return 0!==e||0!=(e=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?e:this._upwardSeg.compareTo(t._upwardSeg)},nE.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},nE.prototype.toString=function(){return this._upwardSeg.toString()},nE.prototype.interfaces_=function(){return[E]},nE.prototype.getClass=function(){return nE};var nx=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};nx.prototype.area=function(){return nx.area(this.p0,this.p1,this.p2)},nx.prototype.signedArea=function(){return nx.signedArea(this.p0,this.p1,this.p2)}
1,nx.prototype.interpolateZ=function(t){if(null===t)throw new m("Supplied point is null.");return nx.interpolateZ(t,this.p0,this.p1,this.p2)},nx.prototype.longestSideLength=function(){return nx.longestSideLength(this.p0,this.p1,this.p2)},nx.prototype.isAcute=function(){return nx.isAcute(this.p0,this.p1,this.p2)},nx.prototype.circumcentre=function(){return nx.circumcentre(this.p0,this.p1,this.p2)},nx.prototype.area3D=function(){return nx.area3D(this.p0,this.p1,this.p2)},nx.prototype.centroid=function(){return nx.centroid(this.p0,this.p1,this.p2)},nx.prototype.inCentre=function(){return nx.inCentre(this.p0,this.p1,this.p2)},nx.prototype.interfaces_=function(){return[]},nx.prototype.getClass=function(){return nx},nx.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},nx.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},nx.det=function(t,e,n,i){return t*i-e*n},nx.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,u=n.y-o,l=i.y-o,c=s*l-a*u,p=t.x-r,h=t.y-o;return e.z+(l*p-a*h)/c*(n.z-e.z)+(-u*p+s*h)/c*(i.z-e.z)},nx.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},nx.isAcute=function(t,e,n){return!!ng.isAcute(t,e,n)&&!!ng.isAcute(e,n,t)&&!!ng.isAcute(n,t,e)},nx.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,u=e.y-r,l=2*nx.det(o,s,a,u);return new C(i-nx.det(s,o*o+s*s,u,a*a+u*u)/l,r+nx.det(o,o*o+s*s,a,a*a+u*u)/l)},nx.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=new k(t.x+n/2,t.y+i/2,1),o=new k(t.x-i+n/2,t.y+n+i/2,1);return new k(r,o)},nx.angleBisector=function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new C(t.x+r*o,t.y+r*s)},nx.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-o*a,c=o*s-i*u,p=i*a-r*s;return Math.sqrt(l*l+c*c+p*p)/2},nx.centroid=function(t,e,n){return new C((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},nx.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o;return new C((i*t.x+r*e.x+o*n.x)/s,(i*t.y+r*e.y+o*n.y)/s)};var nN=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new tO;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};nN.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},nN.prototype.addPolygon=function(t){var e=this._distance,n=eI.LEFT;this._distance<0&&(e=-this._distance,n=eI.RIGHT);var i=t.getExteriorRing(),r=tw.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance)||this._distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,O.EXTERIOR,O.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=tw.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,eI.opposite(n),O.INTERIOR,O.EXTERIOR)}},nN.prototype.isTriangleErodedCompletely=function(t,e){var n=new nx(t[0],t[1],t[2]),i=n.inCentre();return th.distancePointLine(i,n.p0,n.p1)<Math.abs(e)},nN.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=tw.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},nN.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var i=new e7(t,new eb(0,O.BOUNDARY,e,n));this._curveList.add(i)},nN.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},nN.prototype.addPolygonRing=function(t,e,n,i,r){if(0===e&&t.length<t9.MINIMUM_VALID_SIZE)return null;var o=i,s=r;t.length>=t9.MINIMUM_VALID_SIZE&&th.isCCW(t)&&(o=r,s=i,n=eI.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},nN.prototype.add=function(t){if(t.isEmpty())return null;t instanceof t4?this.addPolygon(t):t instanceof t0?this.addLineString(t):t instanceof t2?this.addPoint(t):t instanceof t5||t instanceof tW||t instanceof t6?this.addCollection(t):t instanceof tH&&this.addCollection(t)},nN.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},nN.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},nN.prototype.interfaces_=function(){return[]},nN.prototype.getClass=function(){return nN};var nC=function(){};nC.prototype.locate=function(t){},nC.prototype.interfaces_=function(){return[]},nC.prototype.getClass=function(){return nC};var nS=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()};nS.prototype.next=function(){if(this._atStart)return this._atStart=!1,nS.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 i;var t=this._parent.getGeometryN(this._index++);return t instanceof tH?(this._subcollectionIterator=new nS(t),this._subcollectionIterator.next()):t},nS.prototype.remove=function(){throw Error(this.getClass().getName())},nS.prototype.hasNext=function(){if(this._atStart)return!0;
1if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},nS.prototype.interfaces_=function(){return[tL]},nS.prototype.getClass=function(){return nS},nS.isAtomic=function(t){return!(t instanceof tH)};var nL=function(){this._geom=null;var t=arguments[0];this._geom=t};nL.prototype.locate=function(t){return nL.locate(t,this._geom)},nL.prototype.interfaces_=function(){return[nC]},nL.prototype.getClass=function(){return nL},nL.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&th.isPointInRing(t,e.getCoordinates())},nL.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!nL.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(nL.isPointInRing(t,r))return!1}return!0},nL.containsPoint=function(t,e){if(e instanceof t4)return nL.containsPointInPolygon(t,e);if(e instanceof tH)for(var n=new nS(e);n.hasNext();){var i=n.next();if(i!==e&&nL.containsPoint(t,i))return!0}return!1},nL.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:nL.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var nb=function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]};nb.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},nb.prototype.propagateSideLabels=function(t){for(var e=O.NONE,n=this.iterator();n.hasNext();){var i=n.next().getLabel();i.isArea(t)&&i.getLocation(t,eI.LEFT)!==O.NONE&&(e=i.getLocation(t,eI.LEFT))}if(e===O.NONE)return null;for(var r=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,eI.ON)===O.NONE&&a.setLocation(t,eI.ON,r),a.isArea(t)){var u=a.getLocation(t,eI.LEFT),l=a.getLocation(t,eI.RIGHT);if(l!==O.NONE){if(l!==r)throw new eN("side location conflict",s.getCoordinate());u===O.NONE&&ts.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),r=u}else ts.isTrue(a.getLocation(t,eI.LEFT)===O.NONE,"found single null side"),a.setLocation(t,eI.RIGHT,r),a.setLocation(t,eI.LEFT,r)}}},nb.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},nb.prototype.print=function(t){Y.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},nb.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},nb.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(0>=e.size())return!0;var n=e.size()-1,i=e.get(n).getLabel().getLocation(t,eI.LEFT);ts.isTrue(i!==O.NONE,"Found unlabelled area edge");for(var r=i,o=this.iterator();o.hasNext();){var s=o.next().getLabel();ts.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,eI.LEFT),u=s.getLocation(t,eI.RIGHT);if(a===u||u!==r)return!1;r=a}return!0},nb.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return -1},nb.prototype.iterator=function(){return this.getEdges().iterator()},nb.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new tO(this._edgeMap.values())),this._edgeList},nb.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=nL.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},nb.prototype.toString=function(){var t=new D;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()},nb.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},nb.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.prop
1agateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var i=n.next().getLabel(),r=0;r<2;r++)i.isLine(r)&&i.getLocation(r)===O.BOUNDARY&&(e[r]=!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=O.NONE;if(e[u])l=O.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},nb.prototype.getDegree=function(){return this._edgeMap.size()},nb.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},nb.prototype.interfaces_=function(){return[]},nb.prototype.getClass=function(){return nb};var nO=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,i=0;i<this._resultAreaEdgeList.size();i++){var r=this._resultAreaEdgeList.get(i),o=r.getSym();if(r.getLabel().isArea())switch(null===t&&r.isInResult()&&(t=r),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!r.isInResult())continue;e.setNext(r),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new eN("no outgoing dirEdge found",this.getCoordinate());ts.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){this.insertEdgeEnd(t,t)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var i=t.get(e-1),r=n.getQuadrant(),o=i.getQuadrant();return eM.isNorthern(r)&&eM.isNorthern(o)?n:eM.isNorthern(r)||eM.isNorthern(o)?0!==n.getDy()?n:0!==i.getDy()?i:(ts.shouldNeverReachHere("found two horizontal edges incident on node"),null):i},e.prototype.print=function(t){Y.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new tO;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var i=this._edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},e.prototype.computeDepths=function(){if(1==arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(eI.LEFT),i=t.getDepth(eI.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new eN("depth mismatch at "+t.getCoordinate())}else if(3==arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u<s;u++){var l=this._edgeList.get(u);l.setEdgeDepths(eI.RIGHT,a),a=l.getDepth(eI.LEFT)}return a}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,i=this._SCANNING_FOR_INCOMING,r=this._resultAreaEdgeList.size()-1;r>=0;r--){var o=this._resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this._SCANNING_FOR_INCOMING}}i===this._LINKING_TO_OUTGOING&&(ts.isTrue(null!==e,"found null for first outgoing dirEdge"),ts.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0==arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1==arguments.length){for(var n=arguments[0],i=0,r=this.iterator();r.hasNext();)r.next().getEdgeRing()===n&&i++;return i}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(i.isInResult()){t=O.EXTERIOR;break}}}if(t===O.NONE)return null;for(var r=t,o=this.iterator();o.hasNext();
1){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(r===O.INTERIOR):(s.isInResult()&&(r=O.EXTERIOR),a.isInResult()&&(r=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new eb(O.NONE);for(var n=this.iterator();n.hasNext();)for(var i=n.next().getEdge().getLabel(),r=0;r<2;r++){var o=i.getLocation(r);o!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(r,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(nb),nT=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new eP(t,new nO)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(eq),nR=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};nR.prototype.compareTo=function(t){return nR.compareOriented(this._pts,this._orientation,t._pts,t._orientation)},nR.prototype.interfaces_=function(){return[E]},nR.prototype.getClass=function(){return nR},nR.orientation=function(t){return 1===tw.increasingDirection(t)},nR.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var p=(u+=r)===s,h=(l+=o)===a;if(p&&!h)return -1;if(!p&&h)return 1;if(p&&h)return 0}};var nw=function(){this._edges=new tO,this._ocaMap=new p};nw.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r<i.length;r++)r>0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(")  ")},nw.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},nw.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return -1},nw.prototype.iterator=function(){return this._edges.iterator()},nw.prototype.getEdges=function(){return this._edges},nw.prototype.get=function(t){return this._edges.get(t)},nw.prototype.findEqualEdge=function(t){var e=new nR(t.getCoordinates());return this._ocaMap.get(e)},nw.prototype.add=function(t){this._edges.add(t);var e=new nR(t.getCoordinates());this._ocaMap.put(e,t)},nw.prototype.interfaces_=function(){return[]},nw.prototype.getClass=function(){return nw};var nP=function(){};nP.prototype.processIntersections=function(t,e,n,i){},nP.prototype.isDone=function(){},nP.prototype.interfaces_=function(){return[]},nP.prototype.getClass=function(){return nP};var nD=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};nD.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(nD.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},nD.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},nD.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},nD.prototype.getLineIntersector=function(){return this._li},nD.prototype.hasProperIntersection=function(){return this._hasProper},nD.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},nD.prototype.hasIntersection=function(){return this._hasIntersection},nD.prototype.isDone=function(){return!1},nD.prototype.hasInteriorIntersection=function(){return this._hasInterior},nD.prototype.interfaces_=function(){return[nP]},nD.prototype.getClass=function(){return nD},nD.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var nM=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new C(t),this.segmentIndex=e,this.dist=n};nM.prototype.getSegmentIndex=function(){return this.segmentIndex},nM.prototype.getCoordinate=function(){return this.coord},nM.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},nM.prototype.compareTo=function(t){return this.compare(t.segmentIndex,t.dist)},nM.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},nM.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},nM.prototype.getDistance=function(){return this.dist},nM.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:+(this.dist>e)},nM.prototype.interfaces_=function(){return[E]},nM.prototype.getClass=function(){return nM};var nA=function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t};nA.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},nA.prototype.iterator=function(){return this._nodeMap.values().iterator()},nA.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},nA.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},nA.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var o=Array(n).fill(null),s=0;o[s++]=new C(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new nV(o,new eb(this.edge._label))},nA.prototype.add=function(t,e,n){var i=new nM(t,e,n),r=this._nodeMap.get(i);return null!==r?r:(this._nodeMap.put(i,i),i)},nA.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},nA.prototype.interfaces_=function(){return[]},nA.prototype.getClass=function(){return nA};var nF=function(){};nF.prototype.getChainStartIndices=function(t){var e=0,n=new tO;n.add(new M(e));do{var i=this.findChainEnd(t,e);n.add(new M(i)),e=i}while(e<t.length-1);return nF.toIntArray(n)},nF.prototype.findChainEnd=function(t,e){for(var n=eM.quadrant(t[e],t[e+1]),i=e+1;i<t.length&&eM.quadrant(t[i-1],t[i])===n;)i++;return i-1},nF.prototype.interfaces_=function(){return[]},nF.prototype.getClass=function(){return nF},nF.toIntArray=function(t){for(var e=Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var nG=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new j,this.env2=new j;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new nF;this.startIndex=e.getChainStartIndices(this.pts)};nG.prototype.getCoordinates=function(){return this.pts},nG.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},nG.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},nG.prototype.computeIntersectsForChain=function(){if(4==arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(6==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[r],p=this.pts[o],h=s.pts[a],f=s.pts[u];if(o-r==1&&u-a==1)return l.addIntersections(this.e,r,s.e,a),null;if(this.env1.init(c,p),this.env2.init(h,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((r+o)/2),d=Math.trunc((a+u)/2);r<g&&(a<d&&this.computeIntersectsForChain(r,g,s,a,d,l),d<u&&this.computeIntersectsForChain(r,g,s,d,u,l)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,l),d<u&&this.computeIntersectsForChain(g,o,s,d,u,l))}},nG.prototype.getStartIndexes=function(){return this.startIndex},nG.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<t.startIndex.length-1;i++)this.computeIntersectsForChain(n,t,i,e)},nG.prototype.interfaces_=function(){return[]},nG.prototype.getClass=function(){return nG};var nq=function t(){this._depth=[,,].fill().map(function(){return[,,,]});for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},nB={NULL_VALUE:{configurable:!0}};nq.prototype.getDepth=function(t,e){return this._depth[t][e]},nq.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},nq.prototype.isNull=function(){if(0==arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==nq.NULL_VALUE)return!1;return!0}if(1==arguments.length){var n=arguments[0];return this._depth[n][1]===nq.NULL_VALUE}if(2==arguments.length){var i=arguments[0],r=arguments[1];return this._depth[i][r]===nq.NULL_VALUE}},nq.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var i=0;this._depth[t][n]>e&&(i=1),this._depth[t][n]=i}}},nq.prototype.getDelta=function(t){return this._depth[t][eI.RIGHT]-this._depth[t][eI.LEFT]},nq.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},nq.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},nq.prototype.add=function(){if(1==arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);
1i!==O.EXTERIOR&&i!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=nq.depthAtLocation(i):this._depth[e][n]+=nq.depthAtLocation(i))}else if(3==arguments.length){var r=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[r][o]++}},nq.prototype.interfaces_=function(){return[]},nq.prototype.getClass=function(){return nq},nq.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:nq.NULL_VALUE},nB.NULL_VALUE.get=function(){return -1},Object.defineProperties(nq,nB);var nV=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new nA(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new nq,this._depthDelta=0,1==arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2==arguments.length){var i=arguments[0],r=arguments[1];this.pts=i,this._label=r}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=[,,].fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,eb.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e)||this.pts.length!==t.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(t.pts[o])||(n=!1),this.pts[o].equals2D(t.pts[--r])||(i=!1),!n&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0==arguments.length)return this.pts.length>0?this.pts[0]:null;if(1==arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(")  "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new nG(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new j;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,i){var r=new C(t.getIntersection(i)),o=e,s=t.getEdgeDistance(n,i),a=o+1;if(a<this.pts.length){var u=this.pts[a];r.equals2D(u)&&(o=a,s=0)}this.eiList.add(r,o,s)},e.prototype.toString=function(){var t=new D;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(")  "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!=arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,eI.ON),e.getLocation(1,eI.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,eI.LEFT),e.getLocation(1,eI.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,eI.RIGHT),e.getLocation(1,eI.RIGHT),2))},e}(ew),nU=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new nw,this._bufParams=t||null};nU.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},nU.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new eb(t.getLabel())).flip(),n.merge(i);var r=nU.depthDelta(i),o=e.getDepthDelta()+r;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(nU.depthDelta(t.getLabel()))},nU.prototype.buildSubgraphs=function(t,e){for(var n=new tO,i=t.iterator();i.hasNext();){var r=i.next(),o=r.getRightmostCoordinate(),s=new nv(n).getDepth(o);r.computeDepth(s),r.findResultEdges(),n.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},nU.prototype.createSubgraphs=function(t){for(var e=new tO,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var r=new eS;r.create(i),e.add(r)}}return eW.sort(e,eW.reverseOrder()),e},nU.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},nU.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new ns,n=new tl;return n.setPrecisionModel(t),e.setSegmentIntersector(new nD(n)),e},nU.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new nN(t,e,new nm(n,this._bufParams)).getCurves();if(0>=i.size())return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new eB(new nT),this._graph.addEdges(this._edgeList.getEdges());var r=this.createSubgraphs(this._graph),o=new eV(this._geomFact);this.buildSubgraphs(r,o);var s=o.getPolygons();return 0>=s.size()?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},nU.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings().iterator();i.hasNext();){var r=i.next(),o=r.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=r.getData(),a=new nV(r.getCoordinates(),new eb(s));this.insertUniqueEdge(a)}}}
1,nU.prototype.setNoder=function(t){this._workingNoder=t},nU.prototype.interfaces_=function(){return[]},nU.prototype.getClass=function(){return nU},nU.depthDelta=function(t){var e=t.getLocation(0,eI.LEFT),n=t.getLocation(0,eI.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},nU.convertSegStrings=function(t){for(var e=new eh,n=new tO;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)};var nz=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2==arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=r,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};nz.prototype.rescale=function(){if(R(arguments[0],tS))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],i=0;i<n.length;i++)n[i].x=n[i].x/this._scaleFactor+this._offsetX,n[i].y=n[i].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&Y.out.println(n)}},nz.prototype.scale=function(){if(R(arguments[0],tS)){for(var t=arguments[0],e=new tO,n=t.iterator();n.hasNext();){var i=n.next();e.add(new e7(this.scale(i.getCoordinates()),i.getData()))}return e}if(arguments[0]instanceof Array){for(var r=arguments[0],o=Array(r.length).fill(null),s=0;s<r.length;s++)o[s]=new C(Math.round((r[s].x-this._offsetX)*this._scaleFactor),Math.round((r[s].y-this._offsetY)*this._scaleFactor),r[s].z);return tw.removeRepeatedPoints(o)}},nz.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},nz.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},nz.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},nz.prototype.interfaces_=function(){return[nr]},nz.prototype.getClass=function(){return nz};var nX=function(){this._li=new tl,this._segStrings=null;var t=arguments[0];this._segStrings=t},nY={fact:{configurable:!0}};nX.prototype.checkEndPtVertexIntersections=function(){if(0==arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2==arguments.length){for(var n=arguments[0],i=arguments[1].iterator();i.hasNext();)for(var r=i.next().getCoordinates(),o=1;o<r.length-1;o++)if(r[o].equals(n))throw new tr("found endpt/interior pt intersection at index "+o+" :pt "+n)}},nX.prototype.checkInteriorIntersections=function(){if(0==arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var i=n.next();this.checkInteriorIntersections(e,i)}else if(2==arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var l=0;l<a.length-1;l++)this.checkInteriorIntersections(r,u,o,l);else if(4==arguments.length){var c=arguments[0],p=arguments[1],h=arguments[2],f=arguments[3];if(c===h&&p===f)return null;var g=c.getCoordinates()[p],d=c.getCoordinates()[p+1],_=h.getCoordinates()[f],y=h.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,_,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,_,y)))throw new tr("found non-noded intersection at "+g+"-"+d+" and "+_+"-"+y)}},nX.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},nX.prototype.checkCollapses=function(){if(0==arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1==arguments.length)for(var n=arguments[0].getCoordinates(),i=0;i<n.length-2;i++)this.checkCollapse(n[i],n[i+1],n[i+2])},nX.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var r=t.getIntersection(i);if(!r.equals(e)&&!r.equals(n))return!0}return!1},nX.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new tr("found non-noded collapse at "+nX.fact.createLineString([t,e,n]))},nX.prototype.interfaces_=function(){return[]},nX.prototype.getClass=function(){return nX},nY.fact.get=function(){return new eh},Object.defineProperties(nX,nY);var nk=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._max
1x=null,this._miny=null,this._maxy=null,this._corner=[,,,,].fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new m("Scale factor must be non-zero");1!==e&&(this._pt=new C(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new C,this._p1Scaled=new C),this.initCorners(this._pt)},nj={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};nk.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>i||this._maxy<r||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return ts.isTrue(!(s&&a),"Found bad envelope test"),a},nk.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},nk.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},nk.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},nk.prototype.getCoordinate=function(){return this._originalPt},nk.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},nk.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=nk.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new j(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},nk.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},nk.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||
1(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!i)||!!t.equals(this._pt)||!!e.equals(this._pt))))},nk.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},nk.prototype.interfaces_=function(){return[]},nk.prototype.getClass=function(){return nk},nj.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(nk,nj);var nH=function(){this.tempEnv1=new j,this.selectedSegment=new e8};nH.prototype.select=function(){if(1==arguments.length);else if(2==arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},nH.prototype.interfaces_=function(){return[]},nH.prototype.getClass=function(){return nH};var nW=function(){this._index=null;var t=arguments[0];this._index=t},nK={HotPixelSnapAction:{configurable:!0}};nW.prototype.snap=function(){if(1==arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3==arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=e.getSafeEnvelope(),o=new nJ(e,n,i);return this._index.query(r,{interfaces_:function(){return[eY]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},nW.prototype.interfaces_=function(){return[]},nW.prototype.getClass=function(){return nW},nK.HotPixelSnapAction.get=function(){return nJ},Object.defineProperties(nW,nK);var nJ=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!=arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],i=e.getContext();if(null!==this._parentEdge&&i===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(nH),nQ=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new tO};nQ.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},nQ.prototype.isDone=function(){return!1},nQ.prototype.getInteriorIntersections=function(){return this._interiorIntersections},nQ.prototype.interfaces_=function(){return[nP]},nQ.prototype.getClass=function(){return nQ};var nZ=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 tl,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};nZ.prototype.checkCorrectness=function(t){var e=new nX(e7.getNodedSubstrings(t));try{e.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},nZ.prototype.getNodedSubstrings=function(){return e7.getNodedSubstrings(this._nodedSegStrings)},nZ.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},nZ.prototype.findInteriorIntersections=function(t,e){var n=new nQ(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},nZ.prototype.computeVertexSnaps=function(){if(R(arguments[0],tS))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof e7)for(var n=arguments[0],i=n.getCoordinates(),r=0;r<i.length;r++){var o=new nk(i[r],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,r)&&n.addIntersection(i[r],r)}},nZ.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ns,this._pointSnapper=new nW(this._noder.getIndex()),this.snapRound(t,this._li)},nZ.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=new nk(e.next(),this._scaleFactor,this._li);this._pointSnapper.snap(n)}},nZ.prototype.interfaces_=function(){return[nr]},nZ.prototype.getClass=function(){return nZ};var n$=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new nu,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}},n0={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};n$.prototype.bufferFixedPrecision=function(t){var e=new nz(new nZ(new eu(1)),t.getScale()),n=new nU(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},n$.prototype.bufferReducedPrecision=function(){if(0==arguments.length){for(var t=n$.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof eN))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1==arguments.length){var e=arguments[0],n=new eu(n$.precisionScaleFactor(this._argGeom,this._distance,e));this.bufferFixedPrecision(n)}},n$.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===eu.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},n$.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},n$.prototype.bufferOriginalPrecision=function(){try{var t=new nU(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof tr))throw t;this._saveException=t}},n$.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},n$.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},n$.prototype.interfaces_=function(){return[]},n$.prototype.getClass=function(){return n$},n$.bufferOp=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];return new n$(t).getResultGeometry(e)}if(3==arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof td&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1],r=arguments[2],o=new n$(n);return o.setQuadrantSegments(r),o.getResultGeometry(i)}
1if(arguments[2]instanceof nu&&arguments[0]instanceof td&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new n$(s,u).getResultGeometry(a)}}else if(4==arguments.length){var l=arguments[0],c=arguments[1],p=arguments[2],h=arguments[3],f=new n$(l);return f.setQuadrantSegments(p),f.setEndCapStyle(h),f.getResultGeometry(c)}},n$.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal();return Math.pow(10,n-Math.trunc(Math.log(w.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0))/Math.log(10)+1))},n0.CAP_ROUND.get=function(){return nu.CAP_ROUND},n0.CAP_BUTT.get=function(){return nu.CAP_FLAT},n0.CAP_FLAT.get=function(){return nu.CAP_FLAT},n0.CAP_SQUARE.get=function(){return nu.CAP_SQUARE},n0.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(n$,n0);var n1=function(){this._pt=[new C,new C],this._distance=v.NaN,this._isNull=!0};n1.prototype.getCoordinates=function(){return this._pt},n1.prototype.getCoordinate=function(t){return this._pt[t]},n1.prototype.setMinimum=function(){if(1==arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},n1.prototype.initialize=function(){if(0==arguments.length)this._isNull=!0;else if(2==arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=r,this._isNull=!1}},n1.prototype.getDistance=function(){return this._distance},n1.prototype.setMaximum=function(){if(1==arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},n1.prototype.interfaces_=function(){return[]},n1.prototype.getClass=function(){return n1};var n2=function(){};n2.prototype.interfaces_=function(){return[]},n2.prototype.getClass=function(){return n2},n2.computeDistance=function(){if(arguments[2]instanceof n1&&arguments[0]instanceof t0&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),r=new e8,o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof n1&&arguments[0]instanceof t4&&arguments[1]instanceof C){var a=arguments[0],u=arguments[1],l=arguments[2];n2.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)n2.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof n1&&arguments[0]instanceof td&&arguments[1]instanceof C){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof t0)n2.computeDistance(p,h,f);else if(p instanceof t4)n2.computeDistance(p,h,f);else if(p instanceof tH)for(var g=0;g<p.getNumGeometries();g++){var d=p.getGeometryN(g);n2.computeDistance(d,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof n1&&arguments[0]instanceof e8&&arguments[1]instanceof C){var _=arguments[0],y=arguments[1],m=arguments[2],v=_.closestPoint(y);m.setMinimum(v,y)}};var n3=function(t){this._maxPtDist=new n1,this._inputGeom=t||null},n4={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};n3.prototype.computeMaxMidpointDistance=function(t){var e=new n9(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},n3.prototype.computeMaxVertexDistance=function(t){var e=new n5(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},n3.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},n3.prototype.getDistancePoints=function(){return this._maxPtDist},n3.prototype.interfaces_=function(){return[]},n3.prototype.getClass=function(){return n3},n4.MaxPointDistanceFilter.get=function(){return n5},n4.MaxMidpointDistanceFilter.get=function(){return n9},Object.defineProperties(n3,n4);var n5=function(t){this._maxPtDist=new n1,this._minPtDist=new n1,this._geom=t||null};n5.prototype.filter=function(t){this._minPtDist.initialize(),n2.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},n5.prototype.getMaxPointDistance=function(){return this._maxPtDist},n5.prototype.interfaces_=function(){return[tm]},n5.prototype.getClass=function(){return n5};var n9=function(t){this._maxPtDist=new n1,this._minPtDist=new n1,this._geom=t||null};n9.prototype.filter=function(t,e){if(0===e)return null;
1var n=t.getCoordinate(e-1),i=t.getCoordinate(e),r=new C((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),n2.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},n9.prototype.isDone=function(){return!1},n9.prototype.isGeometryChanged=function(){return!1},n9.prototype.getMaxPointDistance=function(){return this._maxPtDist},n9.prototype.interfaces_=function(){return[tj]},n9.prototype.getClass=function(){return n9};var n6=function(t){this._comps=t||null};n6.prototype.filter=function(t){t instanceof t4&&this._comps.add(t)},n6.prototype.interfaces_=function(){return[tk]},n6.prototype.getClass=function(){return n6},n6.getPolygons=function(){if(1==arguments.length){var t=arguments[0];return n6.getPolygons(t,new tO)}if(2==arguments.length){var e=arguments[0],n=arguments[1];return e instanceof t4?n.add(e):e instanceof tH&&e.apply(new n6(n)),n}};var n7=function(){if(this._lines=null,this._isForcedToLineString=!1,1==arguments.length){var t=arguments[0];this._lines=t}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};n7.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof t9){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof t0&&this._lines.add(t)},n7.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},n7.prototype.interfaces_=function(){return[tg]},n7.prototype.getClass=function(){return n7},n7.getGeometry=function(){if(1==arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(n7.getLines(t))}if(2==arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(n7.getLines(e,n))}},n7.getLines=function(){if(1==arguments.length){var t=arguments[0];return n7.getLines(t,!1)}if(2==arguments.length){if(R(arguments[0],tS)&&R(arguments[1],tS)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var r=i.next();n7.getLines(r,n)}return n}if(arguments[0]instanceof td&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new tO;
1return o.apply(new n7(a,s)),a}if(arguments[0]instanceof td&&R(arguments[1],tS)){var u=arguments[0],l=arguments[1];return u instanceof t0?l.add(u):u.apply(new n7(l)),l}}else if(3==arguments.length){if("boolean"==typeof arguments[2]&&R(arguments[0],tS)&&R(arguments[1],tS)){for(var c=arguments[0],p=arguments[1],h=arguments[2],f=c.iterator();f.hasNext();){var g=f.next();n7.getLines(g,p,h)}return p}if("boolean"==typeof arguments[2]&&arguments[0]instanceof td&&R(arguments[1],tS)){var d=arguments[0],_=arguments[1],y=arguments[2];return d.apply(new n7(_,y)),_}}};var n8=function(){if(this._boundaryRule=tv.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0==arguments.length);else if(1==arguments.length){var t=arguments[0];if(null===t)throw new m("Rule must be non-null");this._boundaryRule=t}};n8.prototype.locateInternal=function(){if(arguments[0]instanceof C&&arguments[1]instanceof t4){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===O.EXTERIOR)return O.EXTERIOR;if(i===O.BOUNDARY)return O.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof t0){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var l=u.getCoordinates();return!u.isClosed()&&(a.equals(l[0])||a.equals(l[l.length-1]))?O.BOUNDARY:th.isOnLine(a,l)?O.INTERIOR:O.EXTERIOR}if(arguments[0]instanceof C&&arguments[1]instanceof t2){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?O.INTERIOR:O.EXTERIOR}},n8.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?th.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},n8.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},n8.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},n8.prototype.computeLocation=function(t,e){if(e instanceof t2&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof t0)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof t4)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof tW)for(var n=0;n<e.getNumGeometries();n++){var i=e.getGeometryN(n);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof t6)for(var r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,o))}else if(e instanceof tH)for(var s=new nS(e);s.hasNext();){var a=s.next();a!==e&&this.computeLocation(t,a)}},n8.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof t0||e instanceof t4?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},n8.prototype.interfaces_=function(){return[]},n8.prototype.getClass=function(){return n8};var it=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2==arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._component=i,this._segIndex=r,this._pt=o}},ie={INSIDE_AREA:{configurable:!0}};it.prototype.isInsideArea=function(){return this._segIndex===it.INSIDE_AREA},it.prototype.getCoordinate=function(){return this._pt},it.prototype.getGeometryComponent=function(){return this._component},it.prototype.getSegmentIndex=function(){return this._segIndex},it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},ie.INSIDE_AREA.get=function(){return -1},Object.defineProperties(it,ie);var ii=function(t){this._pts=t||null};ii.prototype.filter=function(t){t instanceof t2&&this._pts.add(t)},ii.prototype.interfaces_=function(){return[tk]},ii.prototype.getClass=function(){return ii},ii.getPoints=function(){if(1==arguments.length){var t=arguments[0];return t instanceof t2?eW.singletonList(t):ii.getPoints(t,new tO)}if(2==arguments.length){var e=arguments[0],n=arguments[1];return e instanceof t2?n.add(e):e instanceof tH&&e.apply(new ii(n)),n}};var ir=function(){this._locations=null;var t=arguments[0];this._locations=t};ir.prototype.filter=function(t){(t instanceof t2||t instanceof t0||t instanceof t4)&&this._locations.add(new it(t,0,t.getCoordinate()))},ir.prototype.interfaces_=function(){return[tk]},ir.prototype.getClass=function(){return ir},ir.getLocations=function(t){var e=new tO;return t.apply(new ir(e)),e};var io=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new n8,this._minDistanceLocation=null,this._minDistance=v.MAX_VALUE,2==arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._geom=[,,].fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=r}};io.prototype.computeContainmentDistance=function(){if(0==arguments.length){var t=[,,].fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=n6.getPolygons(this._geom[e]);if(r.size()>0){var o=ir.getLocations(this._geom[i]);if(this.computeContainmentDistance(o,r,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3==arguments.length){if(arguments[2]instanceof Array&&R(arguments[0],tb)&&R(arguments[1],tb)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),p=0;p<a.size();p++)if(this.computeContainmentDistance(c,a.get(p),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof it&&arguments[1]instanceof t4){var h=arguments[0],f=arguments[1],g=arguments[2],d=h.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=h,g[1]=new it(f,d),null}}},io.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},io.prototype.computeFacetDistance=function(){var t=[,,].fill(null),e=n7.getLines(this._geom[0]),n=n7.getLines(this._geom[1]),i=ii.getPoints(this._geom[0]),r=ii.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(i,r,t),void this.updateMinDistance(t,!1))))},io.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},io.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},io.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},io.prototype.computeMinDistance=function(){if(0==arguments.length){if(null!==this._minDistanceLocation||(this._minDistanceLocation=[,,].fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(3==arguments.length){if(arguments[2]instanceof Array&&arguments[0]instanceof t0&&arguments[1]instanceof t2){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;o<i.length-1;o++){var s=th.distancePointLine(r,i[o],i[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new e8(i[o],i[o+1]).closestPoint(r);n[0]=new it(t,o,a),n[1]=new it(e,0,r)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof t0&&arguments[1]instanceof t0){var u=arguments[0],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var p=u.getCoordinates(),h=l.getCoordinates(),f=0;f<p.length-1;f++)for(var g=0;g<h.length-1;g++){var d=th.distanceLineLine(p[f],p[f+1],h[g],h[g+1]);if(d<this._minDistance){this._minDistance=d;var _=new e8(p[f],p[f+1]),y=new e8(h[g],h[g+1]),m=_.closestPoints(y);c[0]=new it(u,f,m[0]),c[1]=new it(l,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}}},io.prototype.computeMinDistancePoints=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o),a=r.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new it(r,0,r.getCoordinate()),n[1]=new it(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},io.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new m
1("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},io.prototype.computeMinDistanceLines=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io},io.distance=function(t,e){return new io(t,e).distance()},io.isWithinDistance=function(t,e,n){return new io(t,e,n).distance()<=n},io.nearestPoints=function(t,e){return new io(t,e).nearestPoints()};var is=function(){this._pt=[new C,new C],this._distance=v.NaN,this._isNull=!0};is.prototype.getCoordinates=function(){return this._pt},is.prototype.getCoordinate=function(t){return this._pt[t]},is.prototype.setMinimum=function(){if(1==arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},is.prototype.initialize=function(){if(0==arguments.length)this._isNull=!0;else if(2==arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=r,this._isNull=!1}},is.prototype.toString=function(){return ti.toLineString(this._pt[0],this._pt[1])},is.prototype.getDistance=function(){return this._distance},is.prototype.setMaximum=function(){if(1==arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is};var ia=function(){};ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.computeDistance=function(){if(arguments[2]instanceof is&&arguments[0]instanceof t0&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new e8,r=t.getCoordinates(),o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof is&&arguments[0]instanceof t4&&arguments[1]instanceof C){var a=arguments[0],u=arguments[1],l=arguments[2];ia.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)ia.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof is&&arguments[0]instanceof td&&arguments[1]instanceof C){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof t0)ia.computeDistance(p,h,f);else if(p instanceof t4)ia.computeDistance(p,h,f);else if(p instanceof tH)for(var g=0;g<p.getNumGeometries();g++){var d=p.getGeometryN(g);ia.computeDistance(d,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof is&&arguments[0]instanceof e8&&arguments[1]instanceof C){var _=arguments[0],y=arguments[1],m=arguments[2],v=_.closestPoint(y);m.setMinimum(v,y)}};var iu=function(){this._g0=null,this._g1=null,this._ptDist=new is,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},il={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};iu.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},iu.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},iu.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},iu.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},iu.prototype.computeOrientedDistance=function(t,e,n){var i=new ic(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var r=new ip(e,this._densifyFrac);t.apply(r),n.setMaximum(r.getMaxPointDistance())}},iu.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},iu.prototype.interfaces_=function(){return[]},iu.prototype.getClass=function(){return iu},iu.distance=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];return new iu(t,e).distance()}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new iu(n,i);return o.setDensifyFraction(r),o.distance()}},il.MaxPointDistanceFilter.get=function(){return ic},il.MaxDensifiedByFractionDistanceFilter.get=function(){return ip},Object.defineProperties(iu,il);var ic=function(){this._maxPtDist=new is,this._minPtDist=new is,this._euclideanDist=new ia,this._geom=null;var t=arguments[0];this._geom=t};ic.prototype.filter=function(t){this._minPtDist.initialize(),ia.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ic.prototype.getMaxPointDistance=function(){return this._maxPtDist},ic.prototype.interfaces_=function(){return[tm]},ic.prototype.getClass=function(){return ic};var ip=function(){this._maxPtDist=new is,this._minPtDist=new is,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};ip.prototype.filter=function(t,e){if(0===e)return null;
1for(var n=t.getCoordinate(e-1),i=t.getCoordinate(e),r=(i.x-n.x)/this._numSubSegs,o=(i.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=new C(n.x+s*r,n.y+s*o);this._minPtDist.initialize(),ia.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},ip.prototype.isDone=function(){return!1},ip.prototype.isGeometryChanged=function(){return!1},ip.prototype.getMaxPointDistance=function(){return this._maxPtDist},ip.prototype.interfaces_=function(){return[tj]},ip.prototype.getClass=function(){return ip};var ih=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},ig={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};ih.prototype.checkMaximumDistance=function(t,e,n){var i=new iu(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var r=i.getCoordinates();this._errorLocation=r[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ti.toLineString(r[0],r[1])+")"}},ih.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=ih.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),ih.VERBOSE&&Y.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},ih.prototype.checkNegativeValid=function(){if(!(this._input instanceof t4||this._input instanceof t6||this._input instanceof tH))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},ih.prototype.getErrorIndicator=function(){return this._errorIndicator},ih.prototype.checkMinimumDistance=function(t,e,n){var i=new io(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var r=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+ti.toLineString(r[0],r[1])+" )"}},ih.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},ih.prototype.getErrorLocation=function(){return this._errorLocation},ih.prototype.getPolygonLines=function(t){for(var e=new tO,n=new n7(e),i=n6.getPolygons(t).iterator();i.hasNext();)i.next().apply(n);return t.getFactory().buildGeometry(e)},ih.prototype.getErrorMessage=function(){return this._errMsg},ih.prototype.interfaces_=function(){return[]},ih.prototype.getClass=function(){return ih},ig.VERBOSE.get=function(){return!1},ig.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(ih,ig);var id=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},i_={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};id.prototype.isValid=function(){return this.checkPolygonal(),this._isValid&&(this.checkExpectedEmpty(),this._isValid&&(this.checkEnvelope(),this._isValid&&(this.checkArea(),this._isValid&&this.checkDistance()))),this._isValid},id.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*id.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new j(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new j(this._result.getEnvelopeInternal());
1n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},id.prototype.checkDistance=function(){var t=new ih(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},id.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},id.prototype.checkPolygonal=function(){this._result instanceof t4||this._result instanceof t6||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},id.prototype.getErrorIndicator=function(){return this._errorIndicator},id.prototype.getErrorLocation=function(){return this._errorLocation},id.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},id.prototype.report=function(t){if(!id.VERBOSE)return null;Y.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},id.prototype.getErrorMessage=function(){return this._errorMsg},id.prototype.interfaces_=function(){return[]},id.prototype.getClass=function(){return id},id.isValidMsg=function(t,e,n){var i=new id(t,e,n);return i.isValid()?null:i.getErrorMessage()},id.isValid=function(t,e,n){return!!new id(t,e,n).isValid()},i_.VERBOSE.get=function(){return!1},i_.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(id,i_);var iy=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};iy.prototype.getCoordinates=function(){return this._pts},iy.prototype.size=function(){return this._pts.length},iy.prototype.getCoordinate=function(t){return this._pts[t]},iy.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},iy.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:e5.octant(this.getCoordinate(t),this.getCoordinate(t+1))},iy.prototype.setData=function(t){this._data=t},iy.prototype.getData=function(){return this._data},iy.prototype.toString=function(){return ti.toLineString(new ei(this._pts))},iy.prototype.interfaces_=function(){return[e9]},iy.prototype.getClass=function(){return iy};var im=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new tO,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};im.prototype.getInteriorIntersection=function(){return this._interiorIntersection},im.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},im.prototype.getIntersectionSegments=function(){return this._intSegments},im.prototype.count=function(){return this._intersectionCount},im.prototype.getIntersections=function(){return this._intersections},im.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},im.prototype.setKeepIntersections=function(t){this._keepIntersections=t},im.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(n,i)))return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=[,,,,].fill(null),this._intSegments[0]=r,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},im.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},im.prototype.hasIntersection=function(){return null!==this._interiorIntersection},im.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},im.prototype.interfaces_=function(){return[nP]},im.prototype.getClass=function(){return im},im.createAllIntersectionsFinder=function(t){var e=new im(t);return e.setFindAllIntersections(!0),e},im.createAnyIntersectionFinder=function(t){return new im(t)},im.createIntersectionCounter=function(t){var e=new im(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var iv=function(){this._li=new tl,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};iv.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},iv.prototype.getIntersections=function(){return this._segInt.getIntersections()},iv.prototype.isValid=function(){return this.execute(),this._isValid},iv.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},iv.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new im(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ns;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},iv.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new eN(this.getErrorMessage(),this._segInt.getInteriorIntersection())},iv.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections foun
1d";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ti.toLineString(t[0],t[1])+" and "+ti.toLineString(t[2],t[3])},iv.prototype.interfaces_=function(){return[]},iv.prototype.getClass=function(){return iv},iv.computeIntersections=function(t){var e=new iv(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var iI=function t(){this._nv=null;var e=arguments[0];this._nv=new iv(t.toSegmentStrings(e))};iI.prototype.checkValid=function(){this._nv.checkValid()},iI.prototype.interfaces_=function(){return[]},iI.prototype.getClass=function(){return iI},iI.toSegmentStrings=function(t){for(var e=new tO,n=t.iterator();n.hasNext();){var i=n.next();e.add(new iy(i.getCoordinates(),i))}return e},iI.checkValid=function(t){new iI(t).checkValid()};var iE=function(t){this._mapOp=t};iE.prototype.map=function(t){for(var e=new tO,n=0;n<t.getNumGeometries();n++){var i=this._mapOp.map(t.getGeometryN(n));i.isEmpty()||e.add(i)}return t.getFactory().createGeometryCollection(eh.toGeometryArray(e))},iE.prototype.interfaces_=function(){return[]},iE.prototype.getClass=function(){return iE},iE.map=function(t,e){return new iE(e).map(t)};var ix=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new tO,this._resultLineList=new tO;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};ix.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},ix.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},ix.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},ix.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!i2.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},ix.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this._op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},ix.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},ix.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(i),n.setInResult(!0)}},ix.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(ts.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(i2.isResultOfOp(i,e)&&e===i2.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},ix.prototype.interfaces_=function(){return[]},ix.prototype.getClass=function(){return ix};var iN=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new tO;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};iN.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},iN.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!n.isInResult()&&!n.isIncidentEdgeInResult()&&(0===n.getEdges().getDegree()||t===i2.INTERSECTION)){var i=n.getLabel();i2.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},iN.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},iN.prototype.interfaces_=function(){return[]},iN.prototype.getClass=function(){return iN};var iC=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};iC.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},iC.prototype.transformPolygon=function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof t9&&!i.isEmpty()||(n=!1);for(var r=new tO,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof t9||(n=!1),r.add(s))}if(n)return this._factory.createPolygon(i,r.toArray([]));var a=new tO;return null!==i&&a.add(i),a.addAll(r),this._factory.buildGeometry(a)},iC.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},iC.prototype.getInputGeometry=function(){return this._inputGeom},iC.prototype.transformMultiLineString=function(t,e){for(var n=new tO,i=0;i<t.getNumGeometries();i++){var r=this.transformLineString(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},iC.prototype.transformCoordinates=function(t,e){return this.copy(t)},iC.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},iC.prototype.transformMultiPoint=function(t,e){for(var n=new tO,i=0;i<t.getNumGeometries();i++){var r=this.transformPoint(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},iC.prototype.transformMultiPolygon=function(t,e){for(var n=new tO,i=0;i<t.getNumGeometries();i++){var r=this.transformPolygon(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},iC.prototype.copy=function(t){return t.copy()},iC.prototype.transformGeometryCollection=function(t,e){for(var n=new tO,i=0;i<t.getNumGeometries();i++){var r=this.transform(t.getGeometryN(i));null!==r&&(this._pruneEmptyGeometry&&r.isEmpty()||n.add(r))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(eh.toGeometryArray(n)):this._factory.buildGeometry(n)},iC.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof t2)return this.transformPoint(t,null);if(t instanceof t5)return this.transformMultiPoint(t,null);if(t instanceof t9)return this.transformLinearRing(t,null);if(t instanceof t0)return this.transformLineString(t,null);if(t instanceof tW)return this.transformMultiLineString(t,null);if(t instanceof t4)return this.transformPolygon(t,null);if(t instanceof t6)return this.transformMultiPolygon(t,null);if(t instanceof tH)return this.transformGeometryCollection(t,null);
1throw new m("Unknown Geometry subtype: "+t.getClass().getName())},iC.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},iC.prototype.interfaces_=function(){return[]},iC.prototype.getClass=function(){return iC};var iS=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new e8,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof t0&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var i=arguments[0],r=arguments[1];this._srcPts=i,this._isClosed=t.isClosed(i),this._snapTolerance=r}};iS.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i<n;i++){var r=t.get(i),o=this.findSnapForVertex(r,e);null!==o&&(t.set(i,new C(o)),0===i&&this._isClosed&&t.set(t.size()-1,new C(o)))}},iS.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length&&!t.equals2D(e[n]);n++)if(t.distance(e[n])<this._snapTolerance)return e[n];return null},iS.prototype.snapTo=function(t){var e=new tR(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},iS.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var i=0;i<n;i++){var r=e[i],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new C(r),!1)}},iS.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.MAX_VALUE,i=-1,r=0;r<e.size()-1;r++){if(this._seg.p0=e.get(r),this._seg.p1=e.get(r+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return -1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,i=r)}return i},iS.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},iS.prototype.interfaces_=function(){return[]},iS.prototype.getClass=function(){return iS},iS.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var iL=function(t){this._srcGeom=t||null},ib={SNAP_PRECISION_FACTOR:{configurable:!0}};iL.prototype.snapTo=function(t,e){return new iO(e,this.extractTargetCoordinates(t)).transform(this._srcGeom)},iL.prototype.snapToSelf=function(t,e){var n=new iO(t,this.extractTargetCoordinates(this._srcGeom),!0).transform(this._srcGeom),i=n;return e&&R(i,t3)&&(i=n.buffer(0)),i},iL.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},iL.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray([].fill(null))},iL.prototype.computeMinimumSegmentLength=function(t){for(var e=v.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},iL.prototype.interfaces_=function(){return[]},iL.prototype.getClass=function(){return iL},iL.snap=function(t,e,n){var i=[,,].fill(null),r=new iL(t);i[0]=r.snapTo(e,n);var o=new iL(e);return i[1]=o.snapTo(i[0],n),i},iL.computeOverlaySnapTolerance=function(){if(1==arguments.length){var t=arguments[0],e=iL.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===eu.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}if(2==arguments.length){var r=arguments[0],o=arguments[1];return Math.min(iL.computeOverlaySnapTolerance(r),iL.computeOverlaySnapTolerance(o))}},iL.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*iL.SNAP_PRECISION_FACTOR},iL.snapToSelf=function(t,e,n){return new iL(t).snapToSelf(e,n)},ib.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(iL,ib);var iO=function(t){function e(e,n,i){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==i&&i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new iS(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(iC),iT=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};iT.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},iT.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=iT.signExpBits(this._commonBits),this._isFirst=!1,null):iT.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):void(this._commonMantissaBitsCount=iT.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=iT.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount)))},iT.prototype.toString=function(){if(1==arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),i=n.substring(n.length-64);return i.substring(0,1)+"  "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]"}},iT.prototype.interfaces_=function(){return[]},iT.prototype.getClass=function(){return iT},iT.getBit=function(t,e){return+(0!=(t&1<<e))},iT.signExpBits=function(t){return t>>52},iT.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},iT.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(iT.getBit(t,i)!==iT.getBit(e,i))return n;n++}return 52};var iR=function(){this._commonCoord=null,this._ccFilter=new iP},iw={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};iR.prototype.addCommonBits=function(t){var e=new iD(this._commonCoord);t.apply(e),t.geometryChanged()},iR.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new iD(e);return t.apply(n),t.geometryChanged(),t},iR.prototype.getCommonCoordinate=function(){return this._commonCoord},iR.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},iR.prototype.interfaces_=function(){return[]},iR.prototype.getClass=function(){return iR},iw.CommonCoordinateFilter.get=function(){return iP},iw.Translater.get=function(){return iD},Object.defineProperties(iR,iw);var iP=function(){this._commonBitsX=new iT,this._commonBitsY=new iT};iP.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},iP.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},iP.prototype.interfaces_=function(){return[tm]},iP.prototype.getClass=function(){return iP};var iD=function(){this.trans=null;var t=arguments[0];this.trans=t};iD.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},iD.prototype.isDone=function(){return!1},iD.prototype.isGeometryChanged=function(){return!0},iD.prototype.interfaces_=function(){return[tj]},iD.prototype.getClass=function(){return iD};var iM=function(t,e){this._geom=[,,].fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};iM.prototype.selfSnap=function(t){return new iL(t).snapTo(t,this._snapTolerance)},iM.prototype.removeCommonBits=function(t){this._cbr=new iR,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=[,,].fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},iM.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},iM.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=i2.overlayOp(e[0],e[1],t);return this.prepareResult(n)},iM.prototype.checkValid=function(t){t.isValid()||Y.out.println("Snapped geometry is invali
1d")},iM.prototype.computeSnapTolerance=function(){this._snapTolerance=iL.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},iM.prototype.snap=function(t){var e=this.removeCommonBits(t);return iL.snap(e[0],e[1],this._snapTolerance)},iM.prototype.interfaces_=function(){return[]},iM.prototype.getClass=function(){return iM},iM.overlayOp=function(t,e,n){return new iM(t,e).getResultGeometry(n)},iM.union=function(t,e){return iM.overlayOp(t,e,i2.UNION)},iM.intersection=function(t,e){return iM.overlayOp(t,e,i2.INTERSECTION)},iM.symDifference=function(t,e){return iM.overlayOp(t,e,i2.SYMDIFFERENCE)},iM.difference=function(t,e){return iM.overlayOp(t,e,i2.DIFFERENCE)};var iA=function(t,e){this._geom=[,,].fill(null),this._geom[0]=t,this._geom[1]=e};iA.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=i2.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof tr))throw t;i=t}if(!n)try{e=iM.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof tr?i:t}return e},iA.prototype.interfaces_=function(){return[]},iA.prototype.getClass=function(){return iA},iA.overlayOp=function(t,e,n){return new iA(t,e).getResultGeometry(n)},iA.union=function(t,e){return iA.overlayOp(t,e,i2.UNION)},iA.intersection=function(t,e){return iA.overlayOp(t,e,i2.INTERSECTION)},iA.symDifference=function(t,e){return iA.overlayOp(t,e,i2.SYMDIFFERENCE)},iA.difference=function(t,e){return iA.overlayOp(t,e,i2.DIFFERENCE)};var iF=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};iF.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},iF.prototype.interfaces_=function(){return[]},iF.prototype.getClass=function(){return iF};var iG=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2==arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=i,this._xValue=r,this._obj=o}},iq={INSERT:{configurable:!0},DELETE:{configurable:!0}};iG.prototype.isDelete=function(){return this._eventType===iG.DELETE},iG.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},iG.prototype.getObject=function(){return this._obj},iG.prototype.compareTo=function(t){return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:+(this._eventType>t._eventType)},iG.prototype.getInsertEvent=function(){return this._insertEvent},iG.prototype.isInsert=function(){return this._eventType===iG.INSERT},iG.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},iG.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},iG.prototype.interfaces_=function(){return[E]},iG.prototype.getClass=function(){return iG},iq.INSERT.get=function(){return 1},iq.DELETE.get=function(){return 2},Object.defineProperties(iG,iq);var iB=function(){};iB.prototype.interfaces_=function(){return[]},iB.prototype.getClass=function(){return iB};var iV=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};iV.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(iV.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},iV.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},iV.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},iV.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},iV.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next().getCoordinate();if(t.isIntersection(i))return!0}return!1},iV.prototype.hasProperIntersection=function(){return this._hasProper},iV.prototype.hasIntersection=function(){return this._hasIntersection},iV.prototype.isDone=function(){return this._isDone},iV.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1])
1)},iV.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=[,,].fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},iV.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},iV.prototype.interfaces_=function(){return[]},iV.prototype.getClass=function(){return iV},iV.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var iU=function(t){function e(){t.call(this),this.events=new tO,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){eW.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1==arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3==arguments.length){if(arguments[2]instanceof iV&&R(arguments[0],tb)&&R(arguments[1],tb)){var i=arguments[0],r=arguments[1],o=arguments[2];this.addEdges(i,i),this.addEdges(r,r),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&R(arguments[0],tb)&&arguments[1]instanceof iV){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),i=n.getStartIndexes(),r=0;r<i.length-1;r++){var o=new iF(n,r),s=new iG(e,n.getMinX(r),o);this.events.add(s),this.events.add(new iG(n.getMaxX(r),s))}},e.prototype.processOverlaps=function(t,e,n,i){for(var r=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(r.computeIntersections(a,i),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1==arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2==arguments.length)for(var n=arguments[0],i=arguments[1],r=n.iterator();r.hasNext();){var o=r.next();this.addEdge(o,i)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(iB),iz=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},iX={NodeComparator:{configurable:!0}};iz.prototype.getMin=function(){return this._min},iz.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},iz.prototype.getMax=function(){return this._max},iz.prototype.toString=function(){return ti.toLineString(new C(this._min,0),new C(this._max,0))},iz.prototype.interfaces_=function(){return[]},iz.prototype.getClass=function(){return iz},iX.NodeComparator.get=function(){return iY},Object.defineProperties(iz,iX);var iY=function(){};iY.prototype.compare=function(t,e){var n=(t._min+t._max)/2,i=(e._min+e._max)/2;return n<i?-1:+(n>i)},iY.prototype.interfaces_=function(){return[N]},iY.prototype.getClass=function(){return iY};var ik=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(iz),ij=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(iz),iH=function(){this._leaves=new tO,this._root=null,this._level=0};iH.prototype.buildTree=function(){eW.sort(this._leaves,new iz.NodeComparator);for(var t=this._leaves,e=null,n=new tO;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},iH.prototype.insert=function(t,e,n){if(null!==this._root)throw Error("Index cannot be added to once it has been queried");this._leaves.add(new ik(t,e,n))},iH.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},iH.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},iH.prototype.printNode=function(t){Y.out.println(ti.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},iH.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},iH.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(i);else{var r=new ij(t.get(n),t.get(n+1));e.add(r)}}},iH.prototype.interfaces_=function(){return[]},iH.prototype.getClass=function(){return iH};var iW=function(){this._items=new tO};iW.prototype.visitItem=function(t){this._items.add(t)},iW.prototype.getItems=function(){return this._items},iW.prototype.interfaces_=function(){return[eY]},iW.prototype.getClass=function(){return iW};var iK=function(){this._index=null;var t=arguments[0];
1if(!R(t,t3))throw new m("Argument must be Polygonal");this._index=new iZ(t)},iJ={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};iK.prototype.locate=function(t){var e=new tp(t),n=new iQ(e);return this._index.query(t.y,t.y,n),e.getLocation()},iK.prototype.interfaces_=function(){return[nC]},iK.prototype.getClass=function(){return iK},iJ.SegmentVisitor.get=function(){return iQ},iJ.IntervalIndexedGeometry.get=function(){return iZ},Object.defineProperties(iK,iJ);var iQ=function(){this._counter=null;var t=arguments[0];this._counter=t};iQ.prototype.visitItem=function(t){this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},iQ.prototype.interfaces_=function(){return[eY]},iQ.prototype.getClass=function(){return iQ};var iZ=function(){this._index=new iH;var t=arguments[0];this.init(t)};iZ.prototype.init=function(t){for(var e=n7.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},iZ.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new e8(t[e-1],t[e]),i=Math.min(n.p0.y,n.p1.y),r=Math.max(n.p0.y,n.p1.y);this._index.insert(i,r,n)}},iZ.prototype.query=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1],n=new iW;return this._index.query(t,e,n),n.getItems()}if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._index.query(i,r,o)}},iZ.prototype.interfaces_=function(){return[]},iZ.prototype.getClass=function(){return iZ};var i$=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new ea,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new n8,2==arguments.length){var e=arguments[0],n=arguments[1],i=tv.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,null!==n&&this.add(n)}else if(3==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=r,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var i=this._nodes.addNode(n).getLabel(),r=1;O.NONE,i.getLocation(t,eI.ON)===O.BOUNDARY&&r++;var o=e.determineBoundary(this._boundaryNodeRule,r);i.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],o=new iV(n,!0,!1);o.setIsDoneIfProperInt(r);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof t9||this._parentGeom instanceof t4||this._parentGeom instanceof t6;return s.computeIntersections(this._edges,o,i||!a),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var i=new iV(e,n,!0);return i.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,i),i},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof t2){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof C){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=tw.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nV(e,new eb(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),ts.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===O.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var i=tw.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var r=e,o=n;th.isCCW(i)&&(r=n,o=e);var s=new nV(i,new eb(this._argIndex,O.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,i[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var i=this._nodes.addNode(e),r=i.getLabel();null===r?i._label=new eb(t,n):r.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new iU},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},e.prototype.add=function(){if(1!=arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof t6&&(this._useBoundaryDeterminationRule=!1),e instanceof t4)this.addPolygon(e);else if(e instanceof t0)this.addLineString(e);else if(e instanceof t2)this.addPoint(e);else if(e instanceof t5)this.addCollection(e);else if(e instanceof tW)this.addCollection(e);else if(e instanceof t6)this.addCollection(e);else{if(!(e instanceof tH))throw Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return R(this._parentGeom,t3)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new iK(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1==arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?O.BOUNDARY:O.INTERIOR},e}
1(eB),i0=function(){if(this._li=new tl,this._resultPrecisionModel=null,this._arg=null,1==arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=[,].fill(null),this._arg[0]=new i$(0,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1],i=tv.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=[,,].fill(null),this._arg[0]=new i$(0,e,i),this._arg[1]=new i$(1,n,i)}else if(3==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];r.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=[,,].fill(null),this._arg[0]=new i$(0,r,s),this._arg[1]=new i$(1,o,s)}};i0.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},i0.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},i0.prototype.interfaces_=function(){return[]},i0.prototype.getClass=function(){return i0};var i1=function(){};i1.prototype.interfaces_=function(){return[]},i1.prototype.getClass=function(){return i1},i1.map=function(){if(arguments[0]instanceof td&&R(arguments[1],i1.MapOp)){for(var t=arguments[0],e=arguments[1],n=new tO,i=0;i<t.getNumGeometries();i++){var r=e.map(t.getGeometryN(i));null!==r&&n.add(r)}return t.getFactory().buildGeometry(n)}if(R(arguments[0],tS)&&R(arguments[1],i1.MapOp)){for(var o=arguments[0],s=arguments[1],a=new tO,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},i1.MapOp=function(){};var i2=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new n8,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new nw,this._resultPolyList=new tO,this._resultLineList=new tO,this._resultPointList=new tO,this._graph=new eB(new nT),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new eb(t.getLabel())).flip();var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,i,r){var o=new tO;return o.addAll(t),o.addAll(n),o.addAll(i),o.isEmpty()?e.createEmptyResult(r,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(this._ptLocator.locate(t,i)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new tO,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new tO;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),i
1I.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new eV(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var i=new ix(this,this._geomFact,this._ptLocator);this._resultLineList=i.build(t);var r=new iN(this,this._geomFact,this._ptLocator);this._resultPointList=r.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),r=i.getLabel();r.isArea()&&!i.isInteriorAreaEdge()&&e.isResultOfOp(r.getLocation(0,eI.RIGHT),r.getLocation(1,eI.RIGHT),t)&&i.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;r<2;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(ts.isTrue(!i.isNull(r,eI.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,eI.LEFT,i.getLocation(r,eI.LEFT)),ts.isTrue(!i.isNull(r,eI.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,eI.RIGHT,i.getLocation(r,eI.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(i0);i2.overlayOp=function(t,e,n){return new i2(t,e).getResultGeometry(n)},i2.intersection=function(t,e){return t.isEmpty()||e.isEmpty()?i2.createEmptyResult(i2.INTERSECTION,t,e,t.getFactory()):t.isGeometryCollection()?iE.map(t,{interfaces_:function(){return[i1.MapOp]},map:function(t){return t.intersection(e)}}):(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,i2.INTERSECTION))},i2.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return i2.createEmptyResult(i2.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,i2.SYMDIFFERENCE)},i2.resultDimension=function(t,e,n){var i=e.getDimension(),r=n.getDimension(),o=-1;switch(t){case i2.INTERSECTION:o=Math.min(i,r);break;case i2.UNION:o=Math.max(i,r);break;case i2.DIFFERENCE:o=i;break;case i2.SYMDIFFERENCE:o=Math.max(i,r)}return o},i2.createEmptyResult=function(t,e,n,i){var r=null;switch(i2.resultDimension(t,e,n)){case -1:r=i.createGeometryCollection([].fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon()}return r},i2.difference=function(t,e){return t.isEmpty()?i2.createEmptyResult(i2.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,i2.DIFFERENCE))},i2.isResultOfOp=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),i=t.getLocation(1);return i2.isResultOfOp(n,i,e)}if(3==arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];switch(r===O.BOUNDARY&&(r=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case i2.INTERSECTION:return r===O.INTERIOR&&o===O.INTERIOR;case i2.UNION:return r===O.INTERIOR||o===O.INTERIOR;case i2.DIFFERENCE:return r===O.INTERIOR&&o!==O.INTERIOR;case i2.SYMDIFFERENCE:return r===O.INTERIOR&&o!==O.INTERIOR||r!==O.INTERIOR&&o===O.INTERIOR}return!1}},i2.INTERSECTION=1,i2.UNION=2,i2.DIFFERENCE=3,i2.SYMDIFFERENCE=4;var i3=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new n8,this._seg=new e8;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};i3.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),i=0;i<n.size()-1;i++)if(n.getCoordinate(i,this._seg.p0),n.getCoordinate(i+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},i3.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},i3.prototype.extractLinework=function(t){var e=new i4;t.apply(e);var n=e.getLinework(),i=eh.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},i3.prototype.interfaces_=function(){return[]},i3.prototype.getClass=function(){return i3};var i4=function(){this._linework=null,this._linework=new tO};i4.prototype.getLinework=function(){return this._linework},i4.prototype.filter=function(t){if(t instanceof t4){this._linework.add(t.getExteriorRing());for(var e=0;e<t.getNumInteriorRing();e++)this._linework.add(t.getInteriorRingN(e))}},i4.prototype.interfaces_=function(){return[tk]},i4.prototype.getClass=function(){return i4};var i5=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};i5.prototype.extractPoints=function(t,e,n){for(var i=t.getCoordinates(),r=0;r<i.length-1;r++)this.computeOffsetPoints(i[r],i[r+1],e,n)},i5.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},i5.prototype.getPoints=function(t){for(var e=new tO,n=n7.getLines(this._g).iterator();n.hasNext();){var i=n.next();this.extractPoints(i,t,e)}return e},i5.prototype.computeOffsetPoints=function(t,e,n,i){var r=e.x-t.x,o=e.
1y-t.y,s=Math.sqrt(r*r+o*o),a=n*r/s,u=n*o/s,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var p=new C(l-u,c+a);i.add(p)}if(this._doRight){var h=new C(l+u,c-a);i.add(h)}},i5.prototype.interfaces_=function(){return[]},i5.prototype.getClass=function(){return i5};var i9=function t(){this._geom=null,this._locFinder=null,this._location=[,,,].fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new tO;var e=arguments[0],n=arguments[1],i=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,i],this._locFinder=[new i3(this._geom[0],this._boundaryDistanceTolerance),new i3(this._geom[1],this._boundaryDistanceTolerance),new i3(this._geom[2],this._boundaryDistanceTolerance)]},i6={TOLERANCE:{configurable:!0}};i9.prototype.reportResult=function(t,e,n){Y.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},i9.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},i9.prototype.checkValid=function(){if(1==arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2==arguments.length){var i=arguments[0],r=arguments[1];return this._location[0]=this._locFinder[0].getLocation(r),this._location[1]=this._locFinder[1].getLocation(r),this._location[2]=this._locFinder[2].getLocation(r),!!i9.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(i,this._location)}},i9.prototype.addTestPts=function(t){var e=new i5(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},i9.prototype.isValidResult=function(t,e){var n=i2.isResultOfOp(e[0],e[1],t),i=!(n^e[2]===O.INTERIOR);return i||this.reportResult(t,e,n),i},i9.prototype.getInvalidLocation=function(){return this._invalidLocation},i9.prototype.interfaces_=function(){return[]},i9.prototype.getClass=function(){return i9},i9.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},i9.computeBoundaryDistanceTolerance=function(t,e){return Math.min(iL.computeSizeBasedSnapTolerance(t),iL.computeSizeBasedSnapTolerance(e))},i9.isValid=function(t,e,n,i){return new i9(t,e,i).isValid(n)},i6.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(i9,i6);var i7=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};i7.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);this._skipEmpty&&i.isEmpty()||e.add(i)}},i7.prototype.combine=function(){for(var t=new tO,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},i7.prototype.interfaces_=function(){return[]},i7.prototype.getClass=function(){return i7},i7.combine=function(){if(1==arguments.length){var t=arguments[0];return new i7(t).combine()}if(2==arguments.length){var e=arguments[0],n=arguments[1];return new i7(i7.createList(e,n)).combine()}if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];return new i7(i7.createList(i,r,o)).combine()}},i7.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},i7.createList=function(){if(2==arguments.length){var t=arguments[0],e=arguments[1],n=new tO;return n.add(t),n.add(e),n}if(3==arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=new tO;return s.add(i),s.add(r),s.add(o),s}};var i8=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new tO)},rt={STRTREE_NODE_CAPACITY:{configurable:!0}};i8.prototype.reduceToGeometries=function(t){for(var e=new tO,n=t.iterator();n.hasNext();){var i=n.next(),r=null;R(i,tb)?r=this.unionTree(i):i instanceof td&&(r=i),e.add(r)}return e},i8.prototype.extractByEnvelope=function(t,e,n){for(var i=new tO,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},i8.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i))return i7.combine(t,e);if(1>=t.getNumGeometries()&&1>=e.getNumGeometries())return this.unionActual(t,e);var r=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,r)},i8.prototype.union=function(){if(null===this._inputPolys)throw Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new e0(i8.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree();return this.unionTree(i)},i8.prototype.binaryUnion=function(){if(1==arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3==arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var r=i8.getGeometry(e,n);return this.unionSafe(r,null)}if(i-n==2)return this.unionSafe(i8.getGeometry(e,n),i8.getGeometry(e,n+1));var o=Math.trunc((i+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,i);return this.unionSafe(s,a)}},i8.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();
1e=null===e?i.copy():e.union(i)}return e},i8.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},i8.prototype.unionActual=function(t,e){return i8.restrictToPolygons(t.union(e))},i8.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},i8.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new tO,r=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),s=this.unionActual(r,o);return i.add(s),i7.combine(i)},i8.prototype.bufferUnion=function(){if(1==arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2==arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},i8.prototype.interfaces_=function(){return[]},i8.prototype.getClass=function(){return i8},i8.restrictToPolygons=function(t){if(R(t,t3))return t;var e=n6.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(eh.toPolygonArray(e))},i8.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},i8.union=function(t){return new i8(t).union()},rt.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(i8,rt);var re=function(){};re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return i2.createEmptyResult(i2.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),iA.overlayOp(t,e,i2.UNION)},t.GeoJSONReader=em,t.GeoJSONWriter=ev,t.OverlayOp=i2,t.UnionOp=re,t.BufferOp=n$,Object.defineProperty(t,"__esModule",{value:!0})})(e)}}]);
2//# sourceMappingURL=41034ddc-a25bc90cc06ef020.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.