UNPKG

node-red-contrib-tak-registration

Version:

A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK

7 lines 494 kB
/** * JSTS. See https://github.com/bjornharrtell/jsts * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EDLv1.txt * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EPLv1.txt * @license */ class t{static equalsWithTolerance(t,e,s){return Math.abs(t-e)<=s}}class e extends Error{constructor(t){super(t),this.name=Object.keys({Exception:e})[0]}toString(){return this.message}}class s extends e{constructor(t){super(t),this.name=Object.keys({IllegalArgumentException:s})[0]}}class n{constructor(t,e){this.low=e||0,this.high=t||0}static toBinaryString(t){let e,s="";for(e=2147483648;e>0;e>>>=1)s+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)s+=(t.low&e)===e?"1":"0";return s}}function i(){}function r(){}function o(){}function l(){}function a(){}i.NaN=NaN,i.isNaN=t=>Number.isNaN(t),i.isInfinite=t=>!Number.isFinite(t),i.MAX_VALUE=Number.MAX_VALUE,i.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,i.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?function(){const t=2146435072,e=new Float64Array(1),s=new Int32Array(e.buffer);i.doubleToLongBits=function(i){e[0]=i;let r=0|s[0],o=0|s[1];return(o&t)===t&&0!=(1048575&o)&&0!==r&&(r=0,o=2146959360),new n(o,r)},i.longBitsToDouble=function(t){return s[0]=t.low,s[1]=t.high,e[0]}}():function(){const t=1023,e=Math.log2,s=Math.floor,r=Math.pow,o=function(){for(let t=53;t>0;t--){const n=r(2,t)-1;if(s(e(n))+1===t)return n}return 0}();i.doubleToLongBits=function(i){let l,a,c,h,u,g,d,_,p;if(i<0||1/i===Number.NEGATIVE_INFINITY?(g=1<<31,i=-i):g=0,0===i)return p=0,_=g,new n(_,p);if(i===1/0)return p=0,_=2146435072|g,new n(_,p);if(i!=i)return p=0,_=2146959360,new n(_,p);if(h=0,p=0,l=s(i),l>1)if(l<=o)h=s(e(l)),h<=20?(p=0,_=l<<20-h&1048575):(c=h-20,a=r(2,c),p=l%a<<32-c,_=l/a&1048575);else for(c=l,p=0;a=c/2,c=s(a),0!==c;)h++,p>>>=1,p|=(1&_)<<31,_>>>=1,a!==c&&(_|=524288);if(d=h+t,u=0===l,l=i-l,h<52&&0!==l)for(c=0;;){if(a=2*l,a>=1?(l=a-1,u?(d--,u=!1):(c<<=1,c|=1,h++)):(l=a,u?0==--d&&(h++,u=!1):(c<<=1,h++)),20===h)_|=c,c=0;else if(52===h){p|=c;break}if(1===a){h<20?_|=c<<20-h:h<52&&(p|=c<<52-h);break}}return _|=d<<20,_|=g,new n(_,p)},i.longBitsToDouble=function(e){let s,n,i,o;const l=e.high,a=e.low,c=l&1<<31?-1:1;for(i=((2146435072&l)>>20)-t,o=0,n=1<<19,s=1;s<=20;s++)l&n&&(o+=r(2,-s)),n>>>=1;for(n=1<<31,s=21;s<=52;s++)a&n&&(o+=r(2,-s)),n>>>=1;if(-1023===i){if(0===o)return 0*c;i=-1022}else{if(1024===i)return 0===o?c/0:NaN;o+=1}return c*o*r(2,i)}}();class c extends e{constructor(t){super(t),this.name=Object.keys({RuntimeException:c})[0]}}class h extends c{constructor(){super(),h.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)c.constructor_.call(this);else if(1===arguments.length){const t=arguments[0];c.constructor_.call(this,t)}}}class u{static shouldNeverReachHere(){if(0===arguments.length)u.shouldNeverReachHere(null);else if(1===arguments.length){const t=arguments[0];throw new h("Should never reach here"+(null!==t?": "+t:""))}}static isTrue(){if(1===arguments.length){const t=arguments[0];u.isTrue(t,null)}else if(2===arguments.length){const t=arguments[1];if(!arguments[0])throw null===t?new h:new h(t)}}static equals(){if(2===arguments.length){const t=arguments[0],e=arguments[1];u.equals(t,e,null)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2];if(!e.equals(t))throw new h("Expected "+t+" but encountered "+e+(null!==s?": "+s:""))}}}const g=new ArrayBuffer(8),d=new Float64Array(g),_=new Int32Array(g);class p{constructor(){p.constructor_.apply(this,arguments)}static constructor_(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)p.constructor_.call(this,0,0);else if(1===arguments.length){const t=arguments[0];p.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){const t=arguments[0],e=arguments[1];p.constructor_.call(this,t,e,p.NULL_ORDINATE)}else if(3===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2];this.x=t,this.y=e,this.z=s}}static hashCode(t){return d[0]=t,_[0]^_[1]}getM(){return i.NaN}setOrdinate(t,e){switch(t){case p.X:this.x=e;break;case p.Y:this.y=e;break;case p.Z:this.setZ(e);break;default:throw new s("Invalid ordinate index: "+t)}}equals2D(){if(1===arguments.length){const t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){const e=arguments[0],s=arguments[1];return!!t.equalsWithTolerance(this.x,e.x,s)&&!!t.equalsWithTolerance(this.y,e.y,s)}}setM(t){throw new s("Invalid ordinate index: "+p.M)}getZ(){return this.z}getOrdinate(t){switch(t){case p.X:return this.x;case p.Y:return this.y;case p.Z:return this.getZ()}throw new s("Invalid ordinate index: "+t)}equals3D(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||i.isNaN(this.getZ())&&i.isNaN(t.getZ()))}equals(t){return t instanceof p&&this.equals2D(t)}equalInZ(e,s){return t.equalsWithTolerance(this.getZ(),e.getZ(),s)}setX(t){this.x=t}compareTo(t){const e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0}getX(){return this.x}setZ(t){this.z=t}clone(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return u.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}}copy(){return new p(this)}toString(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}distance3D(t){const e=this.x-t.x,s=this.y-t.y,n=this.getZ()-t.getZ();return Math.sqrt(e*e+s*s+n*n)}getY(){return this.y}setY(t){this.y=t}distance(t){const e=this.x-t.x,s=this.y-t.y;return Math.sqrt(e*e+s*s)}hashCode(){let t=17;return t=37*t+p.hashCode(this.x),t=37*t+p.hashCode(this.y),t}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}get interfaces_(){return[r,o,a]}}class m{constructor(){m.constructor_.apply(this,arguments)}static constructor_(){if(this._dimensionsToTest=2,0===arguments.length)m.constructor_.call(this,2);else if(1===arguments.length){const t=arguments[0];if(2!==t&&3!==t)throw new s("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}static compare(t,e){return t<e?-1:t>e?1:i.isNaN(t)?i.isNaN(e)?0:-1:i.isNaN(e)?1:0}compare(t,e){const s=m.compare(t.x,e.x);if(0!==s)return s;const n=m.compare(t.y,e.y);if(0!==n)return n;if(this._dimensionsToTest<=2)return 0;return m.compare(t.getZ(),e.getZ())}get interfaces_(){return[l]}}p.DimensionalComparator=m,p.NULL_ORDINATE=i.NaN,p.X=0,p.Y=1,p.Z=2,p.M=3;class f extends p{constructor(){super(),f.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length)p.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof f){const t=arguments[0];p.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof p){const t=arguments[0];p.constructor_.call(this,t.x,t.y)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];p.constructor_.call(this,t,e,p.NULL_ORDINATE)}}setOrdinate(t,e){switch(t){case f.X:this.x=e;break;case f.Y:this.y=e;break;default:throw new s("Invalid ordinate index: "+t)}}getZ(){return p.NULL_ORDINATE}getOrdinate(t){switch(t){case f.X:return this.x;case f.Y:return this.y}throw new s("Invalid ordinate index: "+t)}setZ(t){throw new s("CoordinateXY dimension 2 does not support z-ordinate")}copy(){return new f(this)}toString(){return"("+this.x+", "+this.y+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}f.X=0,f.Y=1,f.Z=-1,f.M=-1;class y extends p{constructor(){super(),y.constructor_.apply(this,arguments)}static constructor_(){if(this._m=null,0===arguments.length)p.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof y){const t=arguments[0];p.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof p){const t=arguments[0];p.constructor_.call(this,t.x,t.y),this._m=this.getM()}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2];p.constructor_.call(this,t,e,p.NULL_ORDINATE),this._m=s}}getM(){return this._m}setOrdinate(t,e){switch(t){case y.X:this.x=e;break;case y.Y:this.y=e;break;case y.M:this._m=e;break;default:throw new s("Invalid ordinate index: "+t)}}setM(t){this._m=t}getZ(){return p.NULL_ORDINATE}getOrdinate(t){switch(t){case y.X:return this.x;case y.Y:return this.y;case y.M:return this._m}throw new s("Invalid ordinate index: "+t)}setZ(t){throw new s("CoordinateXY dimension 2 does not support z-ordinate")}copy(){return new y(this)}toString(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}y.X=0,y.Y=1,y.Z=-1,y.M=2;class x extends p{constructor(){super(),x.constructor_.apply(this,arguments)}static constructor_(){if(this._m=null,0===arguments.length)p.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof x){const t=arguments[0];p.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof p){const t=arguments[0];p.constructor_.call(this,t),this._m=this.getM()}}else if(4===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];p.constructor_.call(this,t,e,s),this._m=n}}getM(){return this._m}setOrdinate(t,e){switch(t){case p.X:this.x=e;break;case p.Y:this.y=e;break;case p.Z:this.z=e;break;case p.M:this._m=e;break;default:throw new s("Invalid ordinate index: "+t)}}setM(t){this._m=t}getOrdinate(t){switch(t){case p.X:return this.x;case p.Y:return this.y;case p.Z:return this.getZ();case p.M:return this.getM()}throw new s("Invalid ordinate index: "+t)}copy(){return new x(this)}toString(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}setCoordinate(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}function E(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}class I{add(){}addAll(){}isEmpty(){}iterator(){}size(){}toArray(){}remove(){}}class N extends e{constructor(t){super(t),this.name=Object.keys({IndexOutOfBoundsException:N})[0]}}class C extends I{get(){}set(){}isEmpty(){}}class w extends e{constructor(t){super(t),this.name=Object.keys({NoSuchElementException:w})[0]}}class S extends C{constructor(t){super(),this.array=[],t instanceof I&&this.addAll(t)}get interfaces_(){return[C,I]}ensureCapacity(){}add(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}clear(){this.array=[]}addAll(t){for(const e of t)this.array.push(e)}set(t,e){const s=this.array[t];return this.array[t]=e,s}iterator(){return new L(this)}get(t){if(t<0||t>=this.size())throw new N;return this.array[t]}isEmpty(){return 0===this.array.length}sort(t){t?this.array.sort(((e,s)=>t.compare(e,s))):this.array.sort()}size(){return this.array.length}toArray(){return this.array.slice()}remove(t){for(let e=0,s=this.array.length;e<s;e++)if(this.array[e]===t)return!!this.array.splice(e,1);return!1}[Symbol.iterator](){return this.array.values()}}class L{constructor(t){this.arrayList=t,this.position=0}next(){if(this.position===this.arrayList.size())throw new w;return this.arrayList.get(this.position++)}hasNext(){return this.position<this.arrayList.size()}set(t){return this.arrayList.set(this.position-1,t)}remove(){this.arrayList.remove(this.arrayList.get(this.position))}}class T extends S{constructor(){super(),T.constructor_.apply(this,arguments)}static constructor_(){if(0===arguments.length);else if(1===arguments.length){const t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.ensureCapacity(t.length),this.add(t,e)}}getCoordinate(t){return this.get(t)}addAll(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&E(arguments[0],I)){const t=arguments[1];let e=!1;for(let s=arguments[0].iterator();s.hasNext();)this.add(s.next(),t),e=!0;return e}return super.addAll.apply(this,arguments)}clone(){const t=super.clone.call(this);for(let e=0;e<this.size();e++)t.add(e,this.get(e).clone());return t}toCoordinateArray(){if(0===arguments.length)return this.toArray(T.coordArrayType);if(1===arguments.length){if(arguments[0])return this.toArray(T.coordArrayType);const t=this.size(),e=new Array(t).fill(null);for(let s=0;s<t;s++)e[s]=this.get(t-s-1);return e}}add(){if(1===arguments.length){const t=arguments[0];return super.add.call(this,t)}if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return this.add(t,e,!0),!0}if(arguments[0]instanceof p&&"boolean"==typeof arguments[1]){const t=arguments[0];if(!arguments[1]&&this.size()>=1){if(this.get(this.size()-1).equals2D(t))return null}super.add.call(this,t)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return this.add(t,e),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){const t=arguments[0],e=arguments[1];if(arguments[2])for(let s=0;s<t.length;s++)this.add(t[s],e);else for(let s=t.length-1;s>=0;s--)this.add(t[s],e);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof p){const t=arguments[0],e=arguments[1];if(!arguments[2]){const s=this.size();if(s>0){if(t>0){if(this.get(t-1).equals2D(e))return null}if(t<s){if(this.get(t).equals2D(e))return null}}}super.add.call(this,t,e)}}else if(4===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];let i=1;s>n&&(i=-1);for(let r=s;r!==n;r+=i)this.add(t[r],e);return!0}}closeRing(){if(this.size()>0){const t=this.get(0).copy();this.add(t,!1)}}}T.coordArrayType=new Array(0).fill(null);class R{filter(t,e){}isDone(){}isGeometryChanged(){}}class P{constructor(){P.constructor_.apply(this,arguments)}static constructor_(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof p){const t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof P){const t=arguments[0];this.init(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t.x,e.x,t.y,e.y)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];this.init(t,e,s,n)}}static intersects(){if(3===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2];return s.x>=(t.x<e.x?t.x:e.x)&&s.x<=(t.x>e.x?t.x:e.x)&&s.y>=(t.y<e.y?t.y:e.y)&&s.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];let i=Math.min(s.x,n.x),r=Math.max(s.x,n.x),o=Math.min(t.x,e.x),l=Math.max(t.x,e.x);return!(o>r)&&(!(l<i)&&(i=Math.min(s.y,n.y),r=Math.max(s.y,n.y),o=Math.min(t.y,e.y),l=Math.max(t.y,e.y),!(o>r)&&!(l<i)))}}getArea(){return this.getWidth()*this.getHeight()}equals(t){if(!(t instanceof P))return!1;const e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()}intersection(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new P;const e=this._minx>t._minx?this._minx:t._minx,s=this._miny>t._miny?this._miny:t._miny,n=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new P(e,n,s,i)}isNull(){return this._maxx<this._minx}getMaxX(){return this._maxx}covers(){if(1===arguments.length){if(arguments[0]instanceof p){const t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof P){const t=arguments[0];return!this.isNull()&&!t.isNull()&&(t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];return!this.isNull()&&(t>=this._minx&&t<=this._maxx&&e>=this._miny&&e<=this._maxy)}}intersects(){if(1===arguments.length){if(arguments[0]instanceof P){const t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof p){const t=arguments[0];return this.intersects(t.x,t.y)}}else if(2===arguments.length){if(arguments[0]instanceof p&&arguments[1]instanceof p){const t=arguments[0],e=arguments[1];if(this.isNull())return!1;if((t.x<e.x?t.x:e.x)>this._maxx)return!1;if((t.x>e.x?t.x:e.x)<this._minx)return!1;if((t.y<e.y?t.y:e.y)>this._maxy)return!1;return!((t.y>e.y?t.y:e.y)<this._miny)}if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1];return!this.isNull()&&!(t>this._maxx||t<this._minx||e>this._maxy||e<this._miny)}}}getMinY(){return this._miny}getDiameter(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return Math.sqrt(t*t+e*e)}getMinX(){return this._minx}expandToInclude(){if(1===arguments.length){if(arguments[0]instanceof p){const t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof P){const t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.isNull()?(this._minx=t,this._maxx=t,this._miny=e,this._maxy=e):(t<this._minx&&(this._minx=t),t>this._maxx&&(this._maxx=t),e<this._miny&&(this._miny=e),e>this._maxy&&(this._maxy=e))}}minExtent(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return t<e?t:e}getWidth(){return this.isNull()?0:this._maxx-this._minx}compareTo(t){const e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0}translate(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}copy(){return new P(this)}toString(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}setToNull(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}disjoint(t){return!(!this.isNull()&&!t.isNull())||(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}getHeight(){return this.isNull()?0:this._maxy-this._miny}maxExtent(){if(this.isNull())return 0;const t=this.getWidth(),e=this.getHeight();return t>e?t:e}expandBy(){if(1===arguments.length){const t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){const t=arguments[0],e=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=e,this._maxy+=e,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}contains(){if(1===arguments.length){if(arguments[0]instanceof P){const t=arguments[0];return this.covers(t)}if(arguments[0]instanceof p){const t=arguments[0];return this.covers(t)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];return this.covers(t,e)}}centre(){return this.isNull()?null:new p((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}init(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof p){const t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof P){const t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t.x,e.x,t.y,e.y)}else if(4===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];t<e?(this._minx=t,this._maxx=e):(this._minx=e,this._maxx=t),s<n?(this._miny=s,this._maxy=n):(this._miny=n,this._maxy=s)}}getMaxY(){return this._maxy}distance(t){if(this.intersects(t))return 0;let e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);let s=0;return this._maxy<t._miny?s=t._miny-this._maxy:this._miny>t._maxy&&(s=this._miny-t._maxy),0===e?s:0===s?e:Math.sqrt(e*e+s*s)}hashCode(){let t=17;return t=37*t+p.hashCode(this._minx),t=37*t+p.hashCode(this._maxx),t=37*t+p.hashCode(this._miny),t=37*t+p.hashCode(this._maxy),t}get interfaces_(){return[r,a]}}class O{constructor(t){this.str=t}append(t){this.str+=t}setCharAt(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}toString(){return this.str}}class v{constructor(t){this.value=t}intValue(){return this.value}compareTo(t){return this.value<t?-1:this.value>t?1:0}static compare(t,e){return t<e?-1:t>e?1:0}static isNan(t){return Number.isNaN(t)}static valueOf(t){return new v(t)}}class M{static isWhitespace(t){return t<=32&&t>=0||127===t}static toUpperCase(t){return t.toUpperCase()}}class b{constructor(){b.constructor_.apply(this,arguments)}static constructor_(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){const t=arguments[0];this.init(t)}else if(arguments[0]instanceof b){const t=arguments[0];this.init(t)}else if("string"==typeof arguments[0]){const t=arguments[0];b.constructor_.call(this,b.parse(t))}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this.init(t,e)}}static determinant(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3];return b.determinant(b.valueOf(t),b.valueOf(e),b.valueOf(s),b.valueOf(n))}if(arguments[3]instanceof b&&arguments[2]instanceof b&&arguments[0]instanceof b&&arguments[1]instanceof b){const t=arguments[1],e=arguments[2],s=arguments[3];return arguments[0].multiply(s).selfSubtract(t.multiply(e))}}static sqr(t){return b.valueOf(t).selfMultiply(t)}static valueOf(){if("string"==typeof arguments[0]){const t=arguments[0];return b.parse(t)}if("number"==typeof arguments[0]){return new b(arguments[0])}}static sqrt(t){return b.valueOf(t).sqrt()}static parse(t){let e=0;const s=t.length;for(;M.isWhitespace(t.charAt(e));)e++;let n=!1;if(e<s){const s=t.charAt(e);"-"!==s&&"+"!==s||(e++,"-"===s&&(n=!0))}const i=new b;let r=0,o=0,l=0,a=!1;for(;!(e>=s);){const s=t.charAt(e);if(e++,M.isDigit(s)){const t=s-"0";i.selfMultiply(b.TEN),i.selfAdd(t),r++}else{if("."!==s){if("e"===s||"E"===s){const s=t.substring(e);try{l=v.parseInt(s)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+s+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+s+"' at position "+e+" in string "+t)}o=r,a=!0}}let c=i;a||(o=r);const h=r-o-l;if(0===h)c=i;else if(h>0){const t=b.TEN.pow(h);c=i.divide(t)}else if(h<0){const t=b.TEN.pow(-h);c=i.multiply(t)}return n?c.negate():c}static createNaN(){return new b(i.NaN,i.NaN)}static copy(t){return new b(t)}static magnitude(t){const e=Math.abs(t),s=Math.log(e)/Math.log(10);let n=Math.trunc(Math.floor(s));return 10*Math.pow(10,n)<=e&&(n+=1),n}static stringOfChar(t,e){const s=new O;for(let n=0;n<e;n++)s.append(t);return s.toString()}le(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<=t._lo}extractSignificantDigits(t,e){let s=this.abs(),n=b.magnitude(s._hi);const i=b.TEN.pow(n);s=s.divide(i),s.gt(b.TEN)?(s=s.divide(b.TEN),n+=1):s.lt(b.ONE)&&(s=s.multiply(b.TEN),n-=1);const r=n+1,o=new O,l=b.MAX_PRINT_DIGITS-1;for(let e=0;e<=l;e++){t&&e===r&&o.append(".");const n=Math.trunc(s._hi);if(n<0)break;let i=!1,a=0;n>9?(i=!0,a="9"):a="0"+n,o.append(a),s=s.subtract(b.valueOf(n)).multiply(b.TEN),i&&s.selfAdd(b.TEN);let c=!0;const h=b.magnitude(s._hi);if(h<0&&Math.abs(h)>=l-e&&(c=!1),!c)break}return e[0]=n,o.toString()}sqr(){return this.multiply(this)}doubleValue(){return this._hi+this._lo}subtract(){if(arguments[0]instanceof b){const t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){const t=arguments[0];return this.add(-t)}}equals(){if(1===arguments.length&&arguments[0]instanceof b){const t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}isZero(){return 0===this._hi&&0===this._lo}selfSubtract(){if(arguments[0]instanceof b){const t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}}getSpecialNumberString(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}min(t){return this.le(t)?this:t}selfDivide(){if(1===arguments.length){if(arguments[0]instanceof b){const t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let s=null,n=null,i=null,r=null,o=null,l=null,a=null,c=null;return o=this._hi/t,l=b.SPLIT*o,s=l-o,c=b.SPLIT*t,s=l-s,n=o-s,i=c-t,a=o*t,i=c-i,r=t-i,c=s*i-a+s*r+n*i+n*r,l=(this._hi-a-c+this._lo-o*e)/t,c=o+l,this._hi=c,this._lo=o-c+l,this}}dump(){return"DD<"+this._hi+", "+this._lo+">"}divide(){if(arguments[0]instanceof b){const t=arguments[0];let e=null,s=null,n=null,i=null,r=null,o=null,l=null,a=null;r=this._hi/t._hi,o=b.SPLIT*r,e=o-r,a=b.SPLIT*t._hi,e=o-e,s=r-e,n=a-t._hi,l=r*t._hi,n=a-n,i=t._hi-n,a=e*n-l+e*i+s*n+s*i,o=(this._hi-l-a+this._lo-r*t._lo)/t._hi,a=r+o;return new b(a,r-a+o)}if("number"==typeof arguments[0]){const t=arguments[0];return i.isNaN(t)?b.createNaN():b.copy(this).selfDivide(t,0)}}ge(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}pow(t){if(0===t)return b.valueOf(1);let e=new b(this),s=b.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&s.selfMultiply(e),n/=2,n>0&&(e=e.sqr());else s=e;return t<0?s.reciprocal():s}ceil(){if(this.isNaN())return b.NaN;const t=Math.ceil(this._hi);let e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new b(t,e)}compareTo(t){const e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0}rint(){if(this.isNaN())return this;return this.add(.5).floor()}setValue(){if(arguments[0]instanceof b){const t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){const t=arguments[0];return this.init(t),this}}max(t){return this.ge(t)?this:t}sqrt(){if(this.isZero())return b.valueOf(0);if(this.isNegative())return b.NaN;const t=1/Math.sqrt(this._hi),e=this._hi*t,s=b.valueOf(e),n=this.subtract(s.sqr())._hi*(.5*t);return s.add(n)}selfAdd(){if(1===arguments.length){if(arguments[0]instanceof b){const t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];let e=null,s=null,n=null,i=null,r=null,o=null;return n=this._hi+t,r=n-this._hi,i=n-r,i=t-r+(this._hi-i),o=i+this._lo,e=n+o,s=o+(n-e),this._hi=e+s,this._lo=s+(e-this._hi),this}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let s=null,n=null,i=null,r=null,o=null,l=null,a=null,c=null;o=this._hi+t,i=this._lo+e,a=o-this._hi,c=i-this._lo,l=o-a,r=i-c,l=t-a+(this._hi-l),r=e-c+(this._lo-r),a=l+i,s=o+a,n=a+(o-s),a=r+n;const h=s+a,u=a+(s-h);return this._hi=h,this._lo=u,this}}selfMultiply(){if(1===arguments.length){if(arguments[0]instanceof b){const t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){const t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];let s=null,n=null,i=null,r=null,o=null,l=null;o=b.SPLIT*this._hi,s=o-this._hi,l=b.SPLIT*t,s=o-s,n=this._hi-s,i=l-t,o=this._hi*t,i=l-i,r=t-i,l=s*i-o+s*r+n*i+n*r+(this._hi*e+this._lo*t);const a=o+l;s=o-a;const c=l+s;return this._hi=a,this._lo=c,this}}selfSqr(){return this.selfMultiply(this)}floor(){if(this.isNaN())return b.NaN;const t=Math.floor(this._hi);let e=0;return t===this._hi&&(e=Math.floor(this._lo)),new b(t,e)}negate(){return this.isNaN()?this:new b(-this._hi,-this._lo)}clone(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}multiply(){if(arguments[0]instanceof b){const t=arguments[0];return t.isNaN()?b.createNaN():b.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){const t=arguments[0];return i.isNaN(t)?b.createNaN():b.copy(this).selfMultiply(t,0)}}isNaN(){return i.isNaN(this._hi)}intValue(){return Math.trunc(this._hi)}toString(){const t=b.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}toStandardNotation(){const t=this.getSpecialNumberString();if(null!==t)return t;const e=new Array(1).fill(null),s=this.extractSignificantDigits(!0,e),n=e[0]+1;let i=s;if("."===s.charAt(0))i="0"+s;else if(n<0)i="0."+b.stringOfChar("0",-n)+s;else if(-1===s.indexOf(".")){const t=n-s.length;i=s+b.stringOfChar("0",t)+".0"}return this.isNegative()?"-"+i:i}reciprocal(){let t=null,e=null,s=null,n=null,i=null,r=null,o=null,l=null;i=1/this._hi,r=b.SPLIT*i,t=r-i,l=b.SPLIT*this._hi,t=r-t,e=i-t,s=l-this._hi,o=i*this._hi,s=l-s,n=this._hi-s,l=t*s-o+t*n+e*s+e*n,r=(1-o-l-i*this._lo)/this._hi;const a=i+r;return new b(a,i-a+r)}toSciNotation(){if(this.isZero())return b.SCI_NOT_ZERO;const t=this.getSpecialNumberString();if(null!==t)return t;const e=new Array(1).fill(null),s=this.extractSignificantDigits(!1,e),n=b.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===s.charAt(0))throw new IllegalStateException("Found leading zero: "+s);let i="";s.length>1&&(i=s.substring(1));const r=s.charAt(0)+"."+i;return this.isNegative()?"-"+r+n:r+n}abs(){return this.isNaN()?b.NaN:this.isNegative()?this.negate():new b(this)}isPositive(){return this._hi>0||0===this._hi&&this._lo>0}lt(t){return this._hi<t._hi||this._hi===t._hi&&this._lo<t._lo}add(){if(arguments[0]instanceof b){const t=arguments[0];return b.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){const t=arguments[0];return b.copy(this).selfAdd(t)}}init(){if(1===arguments.length){if("number"==typeof arguments[0]){const t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof b){const t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(2===arguments.length){const t=arguments[0],e=arguments[1];this._hi=t,this._lo=e}}gt(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>t._lo}isNegative(){return this._hi<0||0===this._hi&&this._lo<0}trunc(){return this.isNaN()?b.NaN:this.isPositive()?this.floor():this.ceil()}signum(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}get interfaces_(){return[a,r,o]}}b.PI=new b(3.141592653589793,12246467991473532e-32),b.TWO_PI=new b(6.283185307179586,24492935982947064e-32),b.PI_2=new b(1.5707963267948966,6123233995736766e-32),b.E=new b(2.718281828459045,14456468917292502e-32),b.NaN=new b(i.NaN,i.NaN),b.EPS=123259516440783e-46,b.SPLIT=134217729,b.MAX_PRINT_DIGITS=32,b.TEN=b.valueOf(10),b.ONE=b.valueOf(1),b.SCI_NOT_EXPONENT_CHAR="E",b.SCI_NOT_ZERO="0.0E0";class D{static orientationIndex(t,e,s){const n=D.orientationIndexFilter(t,e,s);if(n<=1)return n;const i=b.valueOf(e.x).selfAdd(-t.x),r=b.valueOf(e.y).selfAdd(-t.y),o=b.valueOf(s.x).selfAdd(-e.x),l=b.valueOf(s.y).selfAdd(-e.y);return i.selfMultiply(l).selfSubtract(r.selfMultiply(o)).signum()}static signOfDet2x2(){if(arguments[3]instanceof b&&arguments[2]instanceof b&&arguments[0]instanceof b&&arguments[1]instanceof b){const t=arguments[1],e=arguments[2],s=arguments[3];return arguments[0].multiply(s).selfSubtract(t.multiply(e)).signum()}if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],s=arguments[2],n=arguments[3],i=b.valueOf(t),r=b.valueOf(e),o=b.valueOf(s),l=b.valueOf(n);return i.multiply(l).selfSubtract(r.multiply(o)).signum()}}static intersection(t,e,s,n){const r=new b(t.y).selfSubtract(e.y),o=new b(e.x).selfSubtract(t.x),l=new b(t.x).selfMultiply(e.y).selfSubtract(new b(e.x).selfMultiply(t.y)),a=new b(s.y).selfSubtract(n.y),c=new b(n.x).selfSubtract(s.x),h=new b(s.x).selfMultiply(n.y).selfSubtract(new b(n.x).selfMultiply(s.y)),u=o.multiply(h).selfSubtract(c.multiply(l)),g=a.multiply(l).selfSubtract(r.multiply(h)),d=r.multiply(c).selfSubtract(a.multiply(o)),_=u.selfDivide(d).doubleValue(),m=g.selfDivide(d).doubleValue();return i.isNaN(_)||i.isInfinite(_)||i.isNaN(m)||i.isInfinite(m)?null:new p(_,m)}static orientationIndexFilter(t,e,s){let n=null;const i=(t.x-s.x)*(e.y-s.y),r=(t.y-s.y)*(e.x-s.x),o=i-r;if(i>0){if(r<=0)return D.signum(o);n=i+r}else{if(!(i<0))return D.signum(o);if(r>=0)return D.signum(o);n=-i-r}const l=D.DP_SAFE_EPSILON*n;return o>=l||-o>=l?D.signum(o):2}static signum(t){return t>0?1:t<0?-1:0}}D.DP_SAFE_EPSILON=1e-15;class A{getM(t){if(this.hasM()){const e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return i.NaN}setOrdinate(t,e,s){}getZ(t){return this.hasZ()?this.getOrdinate(t,2):i.NaN}size(){}getOrdinate(t,e){}getCoordinate(){}getCoordinateCopy(t){}createCoordinate(){}getDimension(){}hasM(){return this.getMeasures()>0}getX(t){}hasZ(){return this.getDimension()-this.getMeasures()>2}getMeasures(){return 0}expandEnvelope(t){}copy(){}getY(t){}toCoordinateArray(){}get interfaces_(){return[o]}}A.X=0,A.Y=1,A.Z=2,A.M=3;class F{static index(t,e,s){return D.orientationIndex(t,e,s)}static isCCW(){if(arguments[0]instanceof Array){const t=arguments[0],e=t.length-1;if(e<3)throw new s("Ring has fewer than 4 points, so orientation cannot be determined");let n=t[0],i=0;for(let s=1;s<=e;s++){const e=t[s];e.y>n.y&&(n=e,i=s)}let r=i;do{r-=1,r<0&&(r=e)}while(t[r].equals2D(n)&&r!==i);let o=i;do{o=(o+1)%e}while(t[o].equals2D(n)&&o!==i);const l=t[r],a=t[o];if(l.equals2D(n)||a.equals2D(n)||l.equals2D(a))return!1;const c=F.index(l,n,a);let h=null;return h=0===c?l.x>a.x:c>0,h}if(E(arguments[0],A)){const t=arguments[0],e=t.size()-1;if(e<3)throw new s("Ring has fewer than 4 points, so orientation cannot be determined");let n=t.getCoordinate(0),i=0;for(let s=1;s<=e;s++){const e=t.getCoordinate(s);e.y>n.y&&(n=e,i=s)}let r=null,o=i;do{o-=1,o<0&&(o=e),r=t.getCoordinate(o)}while(r.equals2D(n)&&o!==i);let l=null,a=i;do{a=(a+1)%e,l=t.getCoordinate(a)}while(l.equals2D(n)&&a!==i);if(r.equals2D(n)||l.equals2D(n)||r.equals2D(l))return!1;const c=F.index(r,n,l);let h=null;return h=0===c?r.x>l.x:c>0,h}}}F.CLOCKWISE=-1,F.RIGHT=F.CLOCKWISE,F.COUNTERCLOCKWISE=1,F.LEFT=F.COUNTERCLOCKWISE,F.COLLINEAR=0,F.STRAIGHT=F.COLLINEAR;class G{static intersection(t,e,s,n){const r=t.x<e.x?t.x:e.x,o=t.y<e.y?t.y:e.y,l=t.x>e.x?t.x:e.x,a=t.y>e.y?t.y:e.y,c=s.x<n.x?s.x:n.x,h=s.y<n.y?s.y:n.y,u=s.x>n.x?s.x:n.x,g=s.y>n.y?s.y:n.y,d=((r>c?r:c)+(l<u?l:u))/2,_=((o>h?o:h)+(a<g?a:g))/2,m=t.x-d,f=t.y-_,y=e.x-d,x=e.y-_,E=s.x-d,I=s.y-_,N=n.x-d,C=n.y-_,w=f-x,S=y-m,L=m*x-y*f,T=I-C,R=N-E,P=E*C-N*I,O=w*R-T*S,v=(S*P-R*L)/O,M=(T*L-w*P)/O;return i.isNaN(v)||i.isInfinite(v)||i.isNaN(M)||i.isInfinite(M)?null:new p(v+d,M+_)}}class q{static arraycopy(t,e,s,n,i){let r=0;for(let o=e;o<e+i;o++)s[n+r]=t[o],r++}static getProperty(t){return{"line.separator":"\n"}[t]}}class B{static log10(t){const e=Math.log(t);return i.isInfinite(e)||i.isNaN(e)?e:e/B.LOG_10}static min(t,e,s,n){let i=t;return e<i&&(i=e),s<i&&(i=s),n<i&&(i=n),i}static clamp(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){const t=arguments[0],e=arguments[1],s=arguments[2];return t<e?e:t>s?s:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1],s=arguments[2];return t<e?e:t>s?s:t}}static wrap(t,e){return t<0?e- -t%e:t%e}static max(){if(3===arguments.length){const t=arguments[1],e=arguments[2];let s=arguments[0];return t>s&&(s=t),e>s&&(s=e),s}if(4===arguments.length){const t=arguments[1],e=arguments[2],s=arguments[3];let n=arguments[0];return t>n&&(n=t),e>n&&(n=e),s>n&&(n=s),n}}static average(t,e){return(t+e)/2}}B.LOG_10=Math.log(10);class Y{static segmentToSegment(t,e,s,n){if(t.equals(e))return Y.pointToSegment(t,s,n);if(s.equals(n))return Y.pointToSegment(n,t,e);let i=!1;if(P.intersects(t,e,s,n)){const r=(e.x-t.x)*(n.y-s.y)-(e.y-t.y)*(n.x-s.x);if(0===r)i=!0;else{const o=(t.y-s.y)*(n.x-s.x)-(t.x-s.x)*(n.y-s.y),l=((t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y))/r,a=o/r;(a<0||a>1||l<0||l>1)&&(i=!0)}}else i=!0;return i?B.min(Y.pointToSegment(t,s,n),Y.pointToSegment(e,s,n),Y.pointToSegment(s,t,e),Y.pointToSegment(n,t,e)):0}static pointToSegment(t,e,s){if(e.x===s.x&&e.y===s.y)return t.distance(e);const n=(s.x-e.x)*(s.x-e.x)+(s.y-e.y)*(s.y-e.y),i=((t.x-e.x)*(s.x-e.x)+(t.y-e.y)*(s.y-e.y))/n;if(i<=0)return t.distance(e);if(i>=1)return t.distance(s);const r=((e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y))/n;return Math.abs(r)*Math.sqrt(n)}static pointToLinePerpendicular(t,e,s){const n=(s.x-e.x)*(s.x-e.x)+(s.y-e.y)*(s.y-e.y),i=((e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)}static pointToSegmentString(t,e){if(0===e.length)throw new s("Line array must contain at least one vertex");let n=t.distance(e[0]);for(let s=0;s<e.length-1;s++){const i=Y.pointToSegment(t,e[s],e[s+1]);i<n&&(n=i)}return n}}class V{create(){if(1===arguments.length)arguments[0]instanceof Array||E(arguments[0],A);else if(2===arguments.length);else if(3===arguments.length){const t=arguments[0],e=arguments[1];return this.create(t,e)}}}class z{filter(t){}}class X{constructor(){X.constructor_.apply(this,arguments)}isGeometryCollection(){return this.getTypeCode()===X.TYPECODE_GEOMETRYCOLLECTION}getFactory(){return this._factory}getGeometryN(t){return this}getArea(){return 0}isRectangle(){return!1}equalsExact(t){return this===t||this.equalsExact(t,0)}geometryChanged(){this.apply(X.geometryChangedFilter)}geometryChangedAction(){this._envelope=null}equalsNorm(t){return null!==t&&this.norm().equalsExact(t.norm())}getLength(){return 0}getNumGeometries(){return 1}compareTo(){let t;if(1===arguments.length){const e=arguments[0];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){const e=arguments[0],s=arguments[1];return t=e,this.getTypeCode()!==t.getTypeCode()?this.getTypeCode()-t.getTypeCode():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e,s)}}getUserData(){return this._userData}getSRID(){return this._SRID}getEnvelope(){return this.getFactory().toGeometry(this.getEnvelopeInternal())}checkNotGeometryCollection(t){if(t.getTypeCode()===X.TYPECODE_GEOMETRYCOLLECTION)throw new s("This method does not support GeometryCollection arguments")}equal(t,e,s){return 0===s?t.equals(e):t.distance(e)<=s}norm(){const t=this.copy();return t.normalize(),t}reverse(){const t=this.reverseInternal();return null!=this.envelope&&(t.envelope=this.envelope.copy()),t.setSRID(this.getSRID()),t}copy(){const t=this.copyInternal();return t.envelope=null==this._envelope?null:this._envelope.copy(),t._SRID=this._SRID,t._userData=this._userData,t}getPrecisionModel(){return this._factory.getPrecisionModel()}getEnvelopeInternal(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new P(this._envelope)}setSRID(t){this._SRID=t}setUserData(t){this._userData=t}compare(t,e){const s=t.iterator(),n=e.iterator();for(;s.hasNext()&&n.hasNext();){const t=s.next(),e=n.next(),i=t.compareTo(e);if(0!==i)return i}return s.hasNext()?1:n.hasNext()?-1:0}hashCode(){return this.getEnvelopeInternal().hashCode()}isEquivalentClass(t){return this.getClass()===t.getClass()}isGeometryCollectionOrDerived(){return this.getTypeCode()===X.TYPECODE_GEOMETRYCOLLECTION||this.getTypeCode()===X.TYPECODE_MULTIPOINT||this.getTypeCode()===X.TYPECODE_MULTILINESTRING||this.getTypeCode()===X.TYPECODE_MULTIPOLYGON}get interfaces_(){return[o,r,a]}getClass(){return X}static hasNonEmptyElements(t){for(let e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1}static hasNullElements(t){for(let e=0;e<t.length;e++)if(null===t[e])return!0;return!1}}X.constructor_=function(t){t&&(this._envelope=null,this._userData=null,this._factory=t,this._SRID=t.getSRID())},X.TYPECODE_POINT=0,X.TYPECODE_MULTIPOINT=1,X.TYPECODE_LINESTRING=2,X.TYPECODE_LINEARRING=3,X.TYPECODE_MULTILINESTRING=4,X.TYPECODE_POLYGON=5,X.TYPECODE_MULTIPOLYGON=6,X.TYPECODE_GEOMETRYCOLLECTION=7,X.TYPENAME_POINT="Point",X.TYPENAME_MULTIPOINT="MultiPoint",X.TYPENAME_LINESTRING="LineString",X.TYPENAME_LINEARRING="LinearRing",X.TYPENAME_MULTILINESTRING="MultiLineString",X.TYPENAME_POLYGON="Polygon",X.TYPENAME_MULTIPOLYGON="MultiPolygon",X.TYPENAME_GEOMETRYCOLLECTION="GeometryCollection",X.geometryChangedFilter={get interfaces_(){return[z]},filter(t){t.geometryChangedAction()}};class k{filter(t){}}class U{static ofLine(t){const e=t.size();if(e<=1)return 0;let s=0;const n=new p;t.getCoordinate(0,n);let i=n.x,r=n.y;for(let o=1;o<e;o++){t.getCoordinate(o,n);const e=n.x,l=n.y,a=e-i,c=l-r;s+=Math.sqrt(a*a+c*c),i=e,r=l}return s}}class H{}class W{static copyCoord(t,e,s,n){const i=Math.min(t.getDimension(),s.getDimension());for(let r=0;r<i;r++)s.setOrdinate(n,r,t.getOrdinate(e,r))}static isRing(t){const e=t.size();return 0===e||!(e<=3)&&(t.getOrdinate(0,A.X)===t.getOrdinate(e-1,A.X)&&t.getOrdinate(0,A.Y)===t.getOrdinate(e-1,A.Y))}static scroll(){if(2===arguments.length){if(E(arguments[0],A)&&Number.isInteger(arguments[1])){const t=arguments[0],e=arguments[1];W.scroll(t,e,W.isRing(t))}else if(E(arguments[0],A)&&arguments[1]instanceof p){const t=arguments[0],e=arguments[1],s=W.indexOf(e,t);if(s<=0)return null;W.scroll(t,s)}}else if(3===arguments.length){const t=arguments[0],e=arguments[1],s=arguments[2];if(e<=0)return null;const n=t.copy(),i=s?t.size()-1:t.size();for(let s=0;s<i;s++)for(let r=0;r<t.getDimension();r++)t.setOrdinate(s,r,n.getOrdinate((e+s)%i,r));if(s)for(let e=0;e<t.getDimension();e++)t.setOrdinate(i,e,t.getOrdinate(0,e))}}static isEqual(t,e){const s=t.size();if(s!==e.size())return!1;const n=Math.min(t.getDimension(),e.getDimension());for(let r=0;r<s;r++)for(let s=0;s<n;s++){const n=t.getOrdinate(r,s),o=e.getOrdinate(r,s);if(t.getOrdinate(r,s)!==e.getOrdinate(r,s)&&(!i.isNaN(n)||!i.isNaN(o)))return!1}return!0}static minCoordinateIndex(){if(1===arguments.length){const t=arguments[0];return W.minCoordinateIndex(t,0,t.size()-1)}if(3===arguments.length){const t=arguments[0],e=arguments[2];let s=-1,n=null;for(let i=arguments[1];i<=e;i++){const e=t.getCoordinate(i);(null===n||n.compareTo(e)>0)&&(n=e,s=i)}return s}}static extend(t,e,s){const n=t.create(s,e.getDimension()),i=e.size();if(W.copy(e,0,n,0,i),i>0)for(let t=i;t<s;t++)W.copy(e,i-1,n,t,1);return n}static reverse(t){const e=t.size()-1,s=Math.trunc(e/2);for(let n=0;n<=s;n++)W.swap(t,n,e-n)}static swap(t,e,s){if(e===s)return null;for(let n=0;n<t.getDimension();n++){const i=t.getOrdinate(e,n);t.setOrdinate(e,n,t.getOrdinate(s,n)),t.setOrdinate(s,n,i)}}static copy(t,e,s,n,i){for(let r=0;r<i;r++)W.copyCoord(t,e+r,s,n+r)}static ensureValidRing(t,e){const s=e.size();if(0===s)return e;if(s<=3)return W.createClosedRing(t,e,4);return e.getOrdinate(0,A.X)===e.getOrdinate(s-1,A.X)&&e.getOrdinate(0,A.Y)===e.getOrdinate(s-1,A.Y)?e:W.createClosedRing(t,e,s+1)}static indexOf(t,e){for(let s=0;s<e.size();s++)if(t.x===e.getOrdinate(s,A.X)&&t.y===e.getOrdinate(s,A.Y))return s;return-1}static createClosedRing(t,e,s){const n=t.create(s,e.getDimension()),i=e.size();W.copy(e,0,n,0,i);for(let t=i;t<s;t++)W.copy(e,0,n,t,1);return n}static minCoordinate(t){let e=null;for(let s=0;s<t.size();s++){const n=t.getCoordinate(s);(null===e||e.compareTo(n)>0)&&(e=n)}return e}}class Z extends e{constructor(t){super(t),this.name=Object.keys({UnsupportedOperationException:Z})[0]}}class j{static toDimensionSymbol(t){switch(t){case j.FALSE:return j.SYM_FALSE;case j.TRUE:return j.SYM_TRUE;case j.DONTCARE:return j.SYM_DONTCARE;case j.P:return j.SYM_P;case j.L:return j.SYM_L;case j.A:return j.SYM_A}throw new s("Unknown dimension value: "+t)}static toDimensionValue(t){switch(M.toUpperCase(t)){case j.SYM_FALSE:return j.FALSE;case j.SYM_TRUE:return j.TRUE;case j.SYM_DONTCARE:return j.DONTCARE;case j.SYM_P:return j.P;case j.SYM_L:return j.L;case j.SYM_A:return j.A}throw new s("Unknown dimension symbol: "+t)}}j.P=0,j.L=1,j.A=2,j.FALSE=-1,j.TRUE=-2,j.DONTCARE=-3,j.SYM_FALSE="F",j.SYM_TRUE="T",j.SYM_DONTCARE="*",j.SYM_P="0",j.SYM_L="1",j.SYM_A="2";class K{filter(t){}}class Q extends X{constructor(){super(),Q.constructor_.apply(this,arguments)}static constructor_(){if(this._points=null,0===arguments.length);else if(2===arguments.length){const t=arguments[0],e=arguments[1];X.constructor_.call(this,e),this.init(t)}}computeEnvelopeInternal(){return this.isEmpty()?new P:this._points.expandEnvelope(new P)}isRing(){return this.isClosed()&&this.isSimple()}getCoordinates(){return this._points.toCoordinateArray()}copyInternal(){return new Q(this._points.copy(),this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof X){const t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;const s=t;if(this._points.size()!==s._points.size())return!1;for(let t=0;t<this._points.size();t++)if(!this.equal(this._points.getCoordinate(t),s._points.getCoordinate(t),e))return!1;return!0}return super.equalsExact.apply(this,arguments)}normalize(){for(let t=0;t<Math.trunc(this._points.size()/2);t++){const e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e))){if(this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0){const t=this._points.copy();W.reverse(t),this._points=t}return null}}}getCoordinate(){return this.isEmpty()?null:this._points.getCoordinate(0)}getBoundaryDimension(){return this.isClosed()?j.FALSE:0}isClosed(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}reverseInternal(){const t=this._points.copy();return W.reverse(t),this.getFactory().createLineString(t)}getEndPoint(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}getTypeCode(){return X.TYPECODE_LINESTRING}getDimension(){return 1}getLength(){return U.ofLine(this._points)}getNumPoints(){return this._points.size()}compareToSameClass(){if(1===arguments.length){const t=arguments[0];let e=0,s=0;for(;e<this._points.size()&&s<t._points.size();){const n=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(s));if(0!==n)return n;e++,s++}return e<this._points.size()?1:s<t._points.size()?-1:0}if(2===arguments.length){const t=arguments[0];return arguments[1].compare(this._points,t._points)}}apply(){if(E(arguments[0],k)){const t=arguments[0];for(let e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e))}else if(E(arguments[0],R)){const t=arguments[0];if(0===this._points.size())return null;for(let e=0;e<this._points.size()&&(t.filter(this._points,e),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(E(arguments[0],K)){arguments[0].filter(this)}else if(E(arguments[0],z)){arguments[0].filter(this)}}getBoundary(){throw new Z}isEquivalentClass(t){return t instanceof Q}getCoordinateN(t){return this._points.getCoordinate(t)}getGeometryType(){return X.TYPENAME_LINESTRING}getCoordinateSequence(){return this._points}isEmpty(){return 0===this._points.size()}init(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new s("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t}isCoordinate(t){for(let e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1}getStartPoint(){return this.isEmpty()?null:this.getPointN(0)}getPointN(t){return this.getFactory().createPoint(this._points.getCoordinate(t))}get interfaces_(){return[H]}}class J{}class $ extends X{constructor(){super(),$.constructor_.apply(this,arguments)}static constructor_(){this._coordinates=null;const t=arguments[0],e=arguments[1];X.constructor_.call(this,e),this.init(t)}computeEnvelopeInternal(){if(this.isEmpty())return new P;const t=new P;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t}getCoordinates(){return this.isEmpty()?[]:[this.getCoordinate()]}copyInternal(){return new $(this._coordinates.copy(),this._factory)}equalsExact(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof X){const t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),e))}return super.equalsExact.apply(this,arguments)}normalize(){}getCoordinate(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null}getBoundaryDimension(){return j.FALSE}reverseInternal(){return this.getFactory().createPoint(this._coordinates.copy())}getTypeCode(){return X.TYPECODE_POINT}getDimension(){return 0}getNumPoints(){return this.isEmpty()?0:1}getX(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x}compareToSameClass(){if(1===arguments.length){const t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){const t=arguments[0];return arguments[1].compare(this._coordinates,t._coordinates)}}apply(){if(E(arguments[0],k)){const t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(E(arguments[0],R)){const t=arguments[0];if(this.isEmpty())return null;t.filter(this._coordinates,0),t.isGeometryChanged()&&this.geometryChanged()}else if(E(arguments[0],K)){arguments[0].filter(this)}else if(E(arguments[0],z)){arguments[0].filter(this)}}getBoundary(){return this.getFactory().createGeometryCollection()}getGeometryType(){return X.TYPENAME_POINT}getCoordinateSequence(){return this._coordinates}getY(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y}isEmpty(){return 0===this._coordinates.size()}init(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),u.isTrue(t.size()<=1),this._coordinates=t}isSimple(){return!0}get interfaces_(){return[J]}}class tt{static ofRing(){if(arguments[0]instanceof Array){const t=arguments[0];return Math.abs(tt.ofRingSigned(t))}if(E(arguments[0],A)){const t=arguments[0];return Math.abs(tt.ofRingSigned(t))}}static ofRingSigned(){if(arguments[0]instanceof Array){const t=arguments[0];if(t.length<3)return 0;let e=0;const s=t[0].x;for(let n=1;n<t.length-1;n++){const i=t[n].x-s,r=t[n+1].y;e+=i*(t[n-1].y-r)}return e/2}if(E(arguments[0],A)){const t=arguments[0],e=t.size(