(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,710596,t=>{"use strict";var e=t.i(885246),n=t.i(360265);t.s(["distance",0,function(t,i,r={}){var s=(0,e.getCoord)(t),o=(0,e.getCoord)(i),a=Math.pow(Math.sin((0,n.degreesToRadians)(o[1]-s[1])/2),2)+Math.pow(Math.sin((0,n.degreesToRadians)(o[0]-s[0])/2),2)*Math.cos((0,n.degreesToRadians)(s[1]))*Math.cos((0,n.degreesToRadians)(o[1]));return(0,n.radiansToLength)(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),r.units)}])},885246,360265,t=>{"use strict";var e={centimeters:0x25f96350,centimetres:0x25f96350,cm:0x25f96350,degrees:360/(2*Math.PI),deg:360/(2*Math.PI),feet:20902260.511392,ft:20902260.511392,inches:250826616.45599997,in:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,km:6371.0088,meters:6371008.8,metres:6371008.8,m:6371008.8,miles:3958.761333810546,mi:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,mm:0x17bbde120,nauticalmiles:6371008.8/1852,nmi:6371008.8/1852,radians:1,rad:1,yards:6967335.223679999,yd:6967335.223679999};function n(t,e,i={}){let r={type:"Feature"};return(0===i.id||i.id)&&(r.id=i.id),i.bbox&&(r.bbox=i.bbox),r.properties=e||{},r.geometry=t,r}function i(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}t.s(["degreesToRadians",0,function(t){return t%360*Math.PI/180},"earthRadius",0,6371008.8,"feature",0,n,"featureCollection",0,function(t,e={}){let n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n},"isNumber",0,i,"isObject",0,function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},"lengthToRadians",0,function(t,n="kilometers"){let i=e[n];if(!i)throw Error(n+" units is invalid");return t/i},"lineString",0,function(t,e,i={}){if(t.length=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw Error("coord must be GeoJSON Point or an Array of numbers")},"getGeom",0,function(t){return"Feature"===t.type?t.geometry:t}],885246)},811828,(t,e,n)=>{t.e,e.exports=function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);ntypeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=y(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw s}}}}function a(){return(a="u">typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!({}).hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.lengthtypeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||y(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,n){if(e){if("string"==typeof e)return t(e,n);var i=({}).toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function d(t){var e="function"==typeof Map?new Map:void 0;return(d=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return i(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}var v=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(e){this._quadrantSegments=e,0===this._quadrantSegments&&(this._joinStyle=t.JOIN_BEVEL),this._quadrantSegments0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=0x80000000;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]);function L(){}function O(){}L.NaN=NaN,L.isNaN=function(t){return Number.isNaN(t)},L.isInfinite=function(t){return!Number.isFinite(t)},L.MAX_VALUE=Number.MAX_VALUE,L.POSITIVE_INFINITY=1/0,L.NEGATIVE_INFINITY=-1/0,"function"==typeof Float64Array&&"function"==typeof Int32Array?(T=new Int32Array((w=new Float64Array(1)).buffer),L.doubleToLongBits=function(t){w[0]=t;var e=0|T[0],n=0|T[1];return(0x7ff00000&n)==0x7ff00000&&1048575&n&&0!==e&&(e=0,n=0x7ff80000),new R(n,e)},L.longBitsToDouble=function(t){return T[0]=t.low,T[1]=t.high,w[0]}):(S=Math.log2,I=Math.floor,N=Math.pow,C=function(){for(var t=53;t>0;t--){var e=N(2,t)-1;if(I(S(e))+1===t)return e}return 0}(),L.doubleToLongBits=function(t){var e,n,i,r,s,o,a,u,l;if(t1)if(e>>=1,l|=(1&u)>>=1,n!==i&&(u|=524288);if(a=r+1023,s=0===e,e=t-e,r=1?(e=n-1,s?(a--,s=!1):(i>20)-1023,r=0,n=524288,e=1;e>>=1;for(n=-0x80000000,e=21;e>>=1;if(-1023===i){if(0===r)return 0*a;i=-1022}else{if(1024===i)return 0===r?a/0:NaN;r+=1}return a*r*N(2,i)});var M=function(t){function i(t){var r;return n(this,i),(r=e(this,i,[t])).name="RuntimeException",r}return l(i,t),s(i)}(p),P=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,null,[{key:"constructor_",value:function(){if(0==arguments.length)M.constructor_.call(this);else if(1==arguments.length){var t=arguments[0];M.constructor_.call(this,t)}}}])}(M),A=function(){function t(){n(this,t)}return s(t,null,[{key:"shouldNeverReachHere",value:function(){if(0==arguments.length)t.shouldNeverReachHere(null);else if(1==arguments.length){var e=arguments[0];throw new P("Should never reach here"+(null!==e?": "+e:""))}}},{key:"isTrue",value:function(){if(1==arguments.length){var e=arguments[0];t.isTrue(e,null)}else if(2==arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new P:new P(n)}}},{key:"equals",value:function(){if(2==arguments.length){var e=arguments[0],n=arguments[1];t.equals(e,n,null)}else if(3==arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2];if(!r.equals(i))throw new P("Expected "+i+" but encountered "+r+(null!==s?": "+s:""))}}}])}(),D=new ArrayBuffer(8),U=new Float64Array(D),F=new Int32Array(D),G=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getM",value:function(){return L.NaN}},{key:"setOrdinate",value:function(e,n){switch(e){case t.X:this.x=n;break;case t.Y:this.y=n;break;case t.Z:this.setZ(n);break;default:throw new _("Invalid ordinate index: "+e)}}},{key:"equals2D",value:function(){if(1==arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2==arguments.length){var e=arguments[0],n=arguments[1];return!!b.equalsWithTolerance(this.x,e.x,n)&&!!b.equalsWithTolerance(this.y,e.y,n)}}},{key:"setM",value:function(e){throw new _("Invalid ordinate index: "+t.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(e){switch(e){case t.X:return this.x;case t.Y:return this.y;case t.Z:return this.getZ()}throw new _("Invalid ordinate index: "+e)}},{key:"equals3D",value:function(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||L.isNaN(this.getZ())&&L.isNaN(t.getZ()))}},{key:"equals",value:function(e){return e instanceof t&&this.equals2D(e)}},{key:"equalInZ",value:function(t,e){return b.equalsWithTolerance(this.getZ(),t.getZ(),e)}},{key:"setX",value:function(t){this.x=t}},{key:"compareTo",value:function(t){return this.xt.x?1:this.yt.y)}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(t){this.z=t}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return A.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+i*i)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(t){this.y=t}},{key:"distance",value:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){return 37*(629+t.hashCode(this.x))+t.hashCode(this.y)}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}},{key:"interfaces_",get:function(){return[x,k,E]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,0==arguments.length)t.constructor_.call(this,0,0);else if(1==arguments.length){var e=arguments[0];t.constructor_.call(this,e.x,e.y,e.getZ())}else if(2==arguments.length){var n=arguments[0],i=arguments[1];t.constructor_.call(this,n,i,t.NULL_ORDINATE)}else if(3==arguments.length){var r=arguments[0],s=arguments[1],o=arguments[2];this.x=r,this.y=s,this.z=o}}},{key:"hashCode",value:function(t){return U[0]=t,F[0]^F[1]}}])}();G.DimensionalComparator=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"compare",value:function(e,n){var i=t.compare(e.x,n.x);if(0!==i)return i;var r=t.compare(e.y,n.y);return 0!==r?r:this._dimensionsToTeste?1:L.isNaN(t)?L.isNaN(e)?0:-1:+!!L.isNaN(e)}}])}(),G.NULL_ORDINATE=L.NaN,G.X=0,G.Y=1,G.Z=2,G.M=3;var q=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(e){return e instanceof t&&(this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY())}},{key:"intersection",value:function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new t;var n=this._minx>e._minx?this._minx:e._minx,i=this._miny>e._miny?this._miny:e._miny;return new t(n,this._maxx=this._minx&&n.getMaxX()=this._miny&&n.getMaxY()=this._minx&&i=this._miny&&rthis._maxx||e._maxxthis._maxy||e._maxythis._maxx)&&!((i.x>r.x?i.x:r.x)this._maxy)&&!((i.y>r.y?i.y:r.y)this._maxx||sthis._maxy||othis._maxx&&(this._maxx=n._maxx),n._minythis._maxy&&(this._maxy=n._maxy))}}else if(2==arguments.length){var i=arguments[0],r=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=r,this._maxy=r):(ithis._maxx&&(this._maxx=i),rthis._maxy&&(this._maxy=r))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return tt._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy)}},{key:"translate",value:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}},{key:"copy",value:function(){return new t(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxxthis._maxy||t._maxye?t:e}},{key:"expandBy",value:function(){if(1==arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(1==arguments.length){if(arguments[0]instanceof t){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof G){var n=arguments[0];return this.covers(n)}}else if(2==arguments.length){var i=arguments[0],r=arguments[1];return this.covers(i,r)}}},{key:"centre",value:function(){return this.isNull()?null:new G((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(0==arguments.length)this.setToNull();else if(1==arguments.length){if(arguments[0]instanceof G){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._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}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 s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];st._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){return 37*(37*(37*(629+G.hashCode(this._minx))+G.hashCode(this._maxx))+G.hashCode(this._miny))+G.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0==arguments.length)this.init();else if(1==arguments.length){if(arguments[0]instanceof G){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 s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}}},{key:"intersects",value:function(){if(3==arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4==arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=Math.min(s.x,o.x),u=Math.max(s.x,o.x),l=Math.min(i.x,r.x),h=Math.max(i.x,r.x);return!(l>u)&&!(hu)&&!(h=this.size())throw new J;return this.array[t]}},{key:"push",value:function(t){return this.array.push(t),t}},{key:"pop",value:function(){if(0===this.array.length)throw new K;return this.array.pop()}},{key:"peek",value:function(){if(0===this.array.length)throw new K;return this.array[this.array.length-1]}},{key:"empty",value:function(){return 0===this.array.length}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(t){return this.array.indexOf(t)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}])}(Q);function tt(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}var te=s(function t(e){n(this,t),this.str=e},[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),tn=function(){function t(e){n(this,t),this.value=e}return s(t,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(t){return this.valuet)}}],[{key:"compare",value:function(t,e){return te)}},{key:"isNan",value:function(t){return Number.isNaN(t)}},{key:"valueOf",value:function(e){return new t(e)}}])}(),ti=s(function t(){n(this,t)},null,[{key:"isWhitespace",value:function(t){return t=0||127===t}},{key:"toUpperCase",value:function(t){return t.toUpperCase()}}]),tr=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"le",value:function(t){return this._hi9?(c=!0,f="9"):f="0"+h,a.append(f),i=i.subtract(t.valueOf(h)).multiply(t.TEN),c&&i.selfAdd(t.TEN);var g=!0,y=t.magnitude(i._hi);if(y=u-l&&(g=!1),!g)break}return n[0]=r,a.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof t){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}},{key:"equals",value:function(){if(1==arguments.length&&arguments[0]instanceof t){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}}},{key:"isZero",value:function(){return 0===this._hi&&0===this._lo}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof t){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(t){return this.le(t)?this:t}},{key:"selfDivide",value:function(){if(1==arguments.length){if(arguments[0]instanceof t){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfDivide(n,0)}}else if(2==arguments.length){var i,r,s,o,a=arguments[0],u=arguments[1],l=null,h=null,c=null,f=null;return s=this._hi/a,f=(l=(c=t.SPLIT*s)-(l=c-s))*(h=(f=t.SPLIT*a)-(h=f-a))-(o=s*a)+l*(r=a-h)+(i=s-l)*h+i*r,f=s+(c=(this._hi-o-f+this._lo-s*u)/a),this._hi=f,this._lo=s-f+c,this}}},{key:"dump",value:function(){return"DD"}},{key:"divide",value:function(){if(arguments[0]instanceof t){var e,n,i,r,s=arguments[0],o=null,a=null,u=null,l=null;return e=(i=this._hi/s._hi)-(o=(u=t.SPLIT*i)-(o=u-i)),l=o*(a=(l=t.SPLIT*s._hi)-(a=l-s._hi))-(r=i*s._hi)+o*(n=s._hi-a)+e*a+e*n,new t(l=i+(u=(this._hi-r-l+this._lo-i*s._lo)/s._hi),i-l+u)}if("number"==typeof arguments[0]){var h=arguments[0];return L.isNaN(h)?t.createNaN():t.copy(this).selfDivide(h,0)}}},{key:"ge",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}},{key:"pow",value:function(e){if(0===e)return t.valueOf(1);var n=new t(this),i=t.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2==1&&i.selfMultiply(n),(r/=2)>0&&(n=n.sqr());else i=n;return et._hi?1:this._lot._lo)}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof t){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}},{key:"max",value:function(t){return this.ge(t)?this:t}},{key:"sqrt",value:function(){if(this.isZero())return t.valueOf(0);if(this.isNegative())return t.NaN;var e=1/Math.sqrt(this._hi),n=this._hi*e,i=t.valueOf(n),r=this.subtract(i.sqr())._hi*(.5*e);return i.add(r)}},{key:"selfAdd",value:function(){if(1==arguments.length){if(arguments[0]instanceof t){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if("number"==typeof arguments[0]){var n,i,r,s,o,a=arguments[0],u=null;return u=(r=this._hi+a)-(s=r-this._hi),i=(o=(u=a-s+(this._hi-u))+this._lo)+(r-(n=r+o)),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(2==arguments.length){var l,h,c,f,g=arguments[0],y=arguments[1],d=null,v=null,p=null;c=this._hi+g,h=this._lo+y,v=c-(p=c-this._hi),d=h-(f=h-this._lo);var _=(l=c+(p=(v=g-p+(this._hi-v))+h))+(p=(d=y-f+(this._lo-d))+(p+(c-l))),m=p+(l-_);return this._hi=_,this._lo=m,this}}},{key:"selfMultiply",value:function(){if(1==arguments.length){if(arguments[0]instanceof t){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfMultiply(n,0)}}else if(2==arguments.length){var i,r,s=arguments[0],o=arguments[1],a=null,u=null,l=null,h=null;a=(l=t.SPLIT*this._hi)-this._hi,h=t.SPLIT*s,a=l-a,i=this._hi-a,u=h-s;var c=(l=this._hi*s)+(h=a*(u=h-u)-l+a*(r=s-u)+i*u+i*r+(this._hi*o+this._lo*s)),f=h+(a=l-c);return this._hi=c,this._lo=f,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return t.NaN;var e=Math.floor(this._hi),n=0;return e===this._hi&&(n=Math.floor(this._lo)),new t(e,n)}},{key:"negate",value:function(){return this.isNaN()?this:new t(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}},{key:"multiply",value:function(){if(arguments[0]instanceof t){var e=arguments[0];return e.isNaN()?t.createNaN():t.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var n=arguments[0];return L.isNaN(n)?t.createNaN():t.copy(this).selfMultiply(n,0)}}},{key:"isNaN",value:function(){return L.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var e=t.magnitude(this._hi);return e>=-3&&e1&&(s=i.substring(1));var o=i.charAt(0)+"."+s;return this.isNegative()?"-"+o+r:o+r}},{key:"abs",value:function(){return this.isNaN()?t.NaN:this.isNegative()?this.negate():new t(this)}},{key:"isPositive",value:function(){return this._hi>0||0===this._hi&&this._lo>0}},{key:"lt",value:function(t){return this._hit._hi||this._hi===t._hi&&this._lo>t._lo}},{key:"isNegative",value:function(){return this._hi0?1:this._hi0?1:this._lo=i);){var c=e.charAt(n);if(n++,ti.isDigit(c)){var f=c-0;o.selfMultiply(t.TEN),o.selfAdd(f),a++}else{if("."!==c){if("e"===c||"E"===c){var g=e.substring(n);try{l=tn.parseInt(g)}catch(t){throw t instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+g+" in string "+e):t}break}throw new NumberFormatException("Unexpected character '"+c+"' at position "+n+" in string "+e)}u=a,h=!0}}var y=o;h||(u=a);var d=a-u-l;if(0===d)y=o;else if(d>0){var v=t.TEN.pow(d);y=o.divide(v)}else if(d0){if(o=0)return t.signum(a);r=-s-o}var u=t.DP_SAFE_EPSILON*r;return a>=u||-a>=u?t.signum(a):2}},{key:"signum",value:function(t){return t>0?1:t0}},{key:"getX",value:function(t){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(t){}},{key:"copy",value:function(){}},{key:"getY",value:function(t){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[k]}}]);to.X=0,to.Y=1,to.Z=2,to.M=3;var ta=function(){function t(){n(this,t)}return s(t,null,[{key:"index",value:function(t,e,n){return ts.orientationIndex(t,e,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var e=arguments[0],n=e.length-1;if(ni.y&&(i=o,r=s)}var a=r;do(a-=1)h.x:c>0}if(tt(arguments[0],to)){var f=arguments[0],g=f.size()-1;if(gy.y&&(y=p,d=v)}var m=null,x=d;do(x-=1)k.x:S>0}}}])}();ta.CLOCKWISE=-1,ta.RIGHT=ta.CLOCKWISE,ta.COUNTERCLOCKWISE=1,ta.LEFT=ta.COUNTERCLOCKWISE,ta.COLLINEAR=0,ta.STRAIGHT=ta.COLLINEAR;var tu=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&i===ta.CLOCKWISE)&&(r=!0),r&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(t,e){var n=t.getEdge().getCoordinates();if(e=n.length||n[e].y===n[e+1].y)return -1;var i=W.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])}},{key:"findRightmostEdgeAtNode",value:function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}A.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)===W.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),tl=function(t){function i(t,r){var s;return n(this,i),(s=e(this,i,[r?t+" [ "+r+" ]":t])).pt=r?new G(r):void 0,s.name="TopologyException",s}return l(i,t),s(i,[{key:"getCoordinate",value:function(){return this.pt}}])}(M),th=s(function t(){n(this,t),this.array=[]},[{key:"addLast",value:function(t){this.array.push(t)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return 0===this.array.length}}]),tc=function(t){function i(t){var r;return n(this,i),(r=e(this,i)).array=[],t instanceof z&&r.addAll(t),r}return l(i,t),s(i,[{key:"interfaces_",get:function(){return[Q,z]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(t){return 1==arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(t){var e,n=o(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.array.push(i)}}catch(t){n.e(t)}finally{n.f()}}},{key:"set",value:function(t,e){var n=this.array[t];return this.array[t]=e,n}},{key:"iterator",value:function(){return new tf(this)}},{key:"get",value:function(t){if(t=this.size())throw new J;return this.array[t]}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"sort",value:function(t){t?this.array.sort(function(e,n){return t.compare(e,n)}):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(t){for(var e=0,n=this.array.length;e=1&&0>=e.getDepth(W.LEFT)&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}},{key:"computeDepths",value:function(t){var e=new j,n=new th,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 s=r.getEdges().iterator();s.hasNext();){var o=s.next().getSym();if(!o.isVisited()){var a=o.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}}},{key:"compareTo",value:function(t){return this._rightMostCoord.xt._rightMostCoord.x)}},{key:"getEnvelope",value:function(){if(null===this._env){for(var t=new q,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),i=0;ie.x?t.x:e.x,a=t.y>e.y?t.y:e.y,u=n.xi.x?n.x:i.x,c=n.y>i.y?n.y:i.y,f=((r>u?r:u)+(ol?s:l)+(an?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],s=arguments[2];return is?s:i}}},{key:"wrap",value:function(t,e){return tn&&(n=t),e>n&&(n=e),n}if(4==arguments.length){var i=arguments[1],r=arguments[2],s=arguments[3],o=arguments[0];return i>o&&(o=i),r>o&&(o=r),s>o&&(o=s),o}}},{key:"average",value:function(t,e){return(t+e)/2}}])}();tv.LOG_10=Math.log(10);var tp=function(){function t(){n(this,t)}return s(t,null,[{key:"segmentToSegment",value:function(e,n,i,r){if(e.equals(n))return t.pointToSegment(e,i,r);if(i.equals(r))return t.pointToSegment(r,e,n);var s=!1;if(q.intersects(e,n,i,r)){var o=(n.x-e.x)*(r.y-i.y)-(n.y-e.y)*(r.x-i.x);if(0===o)s=!0;else{var a=(e.y-i.y)*(r.x-i.x)-(e.x-i.x)*(r.y-i.y),u=((e.y-i.y)*(n.x-e.x)-(e.x-i.x)*(n.y-e.y))/o,l=a/o;(l1||u1)&&(s=!0)}}else s=!0;return s?tv.min(t.pointToSegment(e,i,r),t.pointToSegment(n,i,r),t.pointToSegment(i,e,n),t.pointToSegment(r,e,n)):0}},{key:"pointToSegment",value:function(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return r=1?t.distance(n):Math.abs(((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i)*Math.sqrt(i)}},{key:"pointToLinePerpendicular",value: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)}},{key:"pointToSegmentString",value:function(e,n){if(0===n.length)throw new _("Line array must contain at least one vertex");for(var i=e.distance(n[0]),r=0;r0)&&(s=a,r=o)}return r}}},{key:"extend",value:function(e,n,i){var r=e.create(i,n.getDimension()),s=n.size();if(t.copy(n,0,r,0,s),s>0)for(var o=s;o0)&&(e=i)}return e}}])}(),tS=function(){function t(){n(this,t)}return s(t,null,[{key:"toDimensionSymbol",value:function(e){switch(e){case t.FALSE:return t.SYM_FALSE;case t.TRUE:return t.SYM_TRUE;case t.DONTCARE:return t.SYM_DONTCARE;case t.P:return t.SYM_P;case t.L:return t.SYM_L;case t.A:return t.SYM_A}throw new _("Unknown dimension value: "+e)}},{key:"toDimensionValue",value:function(e){switch(ti.toUpperCase(e)){case t.SYM_FALSE:return t.FALSE;case t.SYM_TRUE:return t.TRUE;case t.SYM_DONTCARE:return t.DONTCARE;case t.SYM_P:return t.P;case t.SYM_L:return t.L;case t.SYM_A:return t.A}throw new _("Unknown dimension symbol: "+e)}}])}();tS.P=0,tS.L=1,tS.A=2,tS.FALSE=-1,tS.TRUE=-2,tS.DONTCARE=-3,tS.SYM_FALSE="F",tS.SYM_TRUE="T",tS.SYM_DONTCARE="*",tS.SYM_P="0",tS.SYM_L="1",tS.SYM_A="2";var tI=s(function t(){n(this,t)},[{key:"filter",value:function(t){}}]),tN=s(function t(){n(this,t)},[{key:"filter",value:function(t,e){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),tC=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new q:this._points.expandEnvelope(new q)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new i(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2==arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof Y){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t)||this._points.size()!==t._points.size())return!1;for(var n=0;n0){var n=this._points.copy();tE.reverse(n),this._points=n}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?tS.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var t=this._points.copy();return tE.reverse(t),this.getFactory().createLineString(t)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return Y.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return tx.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(1==arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t}},{key:"isCoordinate",value:function(t){for(var e=0;e=t.size()),this._coordinates=t}},{key:"isSimple",value:function(){return!0}},{key:"interfaces_",get:function(){return[tw]}}],[{key:"constructor_",value:function(){this._coordinates=null;var t=arguments[0],e=arguments[1];Y.constructor_.call(this,e),this.init(t)}}])}(Y),tb=function(){function t(){n(this,t)}return s(t,null,[{key:"ofRing",value:function(){if(arguments[0]instanceof Array){var e=arguments[0];return Math.abs(t.ofRingSigned(e))}if(tt(arguments[0],to)){var n=arguments[0];return Math.abs(t.ofRingSigned(n))}}},{key:"ofRingSigned",value:function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length=1&&this.getCoordinateSequence().size()= 4)")}},{key:"getGeometryType",value:function(){return Y.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];tC.constructor_.call(this,t,e),this.validateConstruction()}}])}(tC);tU.MINIMUM_VALID_SIZE=4;var tF=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"setOrdinate",value:function(t,e){switch(t){case i.X:this.x=e;break;case i.Y:this.y=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"getZ",value:function(){return G.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case i.X:return this.x;case i.Y:return this.y}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new i(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}],[{key:"constructor_",value:function(){if(0==arguments.length)G.constructor_.call(this);else if(1==arguments.length){if(arguments[0]instanceof i){var t=arguments[0];G.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof G){var e=arguments[0];G.constructor_.call(this,e.x,e.y)}}else if(2==arguments.length){var n=arguments[0],r=arguments[1];G.constructor_.call(this,n,r,G.NULL_ORDINATE)}}}])}(G);tF.X=0,tF.Y=1,tF.Z=-1,tF.M=-1;var tG=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case i.X:this.x=e;break;case i.Y:this.y=e;break;case i.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getZ",value:function(){return G.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case i.X:return this.x;case i.Y:return this.y;case i.M:return this._m}throw new _("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new _("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new i(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0==arguments.length)G.constructor_.call(this),this._m=0;else if(1==arguments.length){if(arguments[0]instanceof i){var t=arguments[0];G.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof G){var e=arguments[0];G.constructor_.call(this,e.x,e.y),this._m=this.getM()}}else if(3==arguments.length){var n=arguments[0],r=arguments[1],s=arguments[2];G.constructor_.call(this,n,r,G.NULL_ORDINATE),this._m=s}}}])}(G);tG.X=0,tG.Y=1,tG.Z=-1,tG.M=2;var tq=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case G.X:this.x=e;break;case G.Y:this.y=e;break;case G.Z:this.z=e;break;case G.M:this._m=e;break;default:throw new _("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getOrdinate",value:function(t){switch(t){case G.X:return this.x;case G.Y:return this.y;case G.Z:return this.getZ();case G.M:return this.getM()}throw new _("Invalid ordinate index: "+t)}},{key:"copy",value:function(){return new i(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0==arguments.length)G.constructor_.call(this),this._m=0;else if(1==arguments.length){if(arguments[0]instanceof i){var t=arguments[0];G.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof G){var e=arguments[0];G.constructor_.call(this,e),this._m=this.getM()}}else if(4==arguments.length){var n=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3];G.constructor_.call(this,n,r,s),this._m=o}}}])}(G),tY=function(){function t(){n(this,t)}return s(t,null,[{key:"measures",value:function(t){return t instanceof tF?0:+(t instanceof tG||t instanceof tq)}},{key:"dimension",value:function(t){return t instanceof tF?2:t instanceof tG?3:t instanceof tq?4:3}},{key:"create",value:function(){if(1==arguments.length){var e=arguments[0];return t.create(e,0)}if(2==arguments.length){var n=arguments[0],i=arguments[1];return 2===n?new tF:3===n&&0===i?new G:3===n&&1===i?new tG:4===n&&1===i?new tq:new G}}}])}(),tB=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"getCoordinate",value:function(t){return this.get(t)}},{key:"addAll",value:function(){if(2==arguments.length&&"boolean"==typeof arguments[1]&&tt(arguments[0],z)){for(var t=arguments[1],e=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),t),e=!0;return e}return f(i,"addAll",this,1).apply(this,arguments)}},{key:"clone",value:function(){for(var t=f(i,"clone",this,1).call(this),e=0;e=1&&this.get(this.size()-1).equals2D(r))return null;f(i,"add",this,1).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var s=arguments[0],o=arguments[1];return this.add(s,o),!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=0;h--)this.add(a[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof G){var c=arguments[0],g=arguments[1];if(!arguments[2]){var y=this.size();if(y>0&&(c>0&&this.get(c-1).equals2D(g)||c_&&(m=-1);for(var x=p;x!==_;x+=m)this.add(d[x],v);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_",value:function(){if(0==arguments.length);else if(1==arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}}])}(tc);tB.coordArrayType=[].fill(null);var tz=function(){function t(){n(this,t)}return s(t,null,[{key:"isRing",value:function(t){return!(t.lengtht.indexOf(r,n))return r}return null}},{key:"scroll",value:function(e,n){var i=t.indexOf(n,e);if(i=t?e:[]}},{key:"indexOf",value:function(t,e){for(var n=0;n0)&&(e=t[n]);return e}},{key:"extract",value:function(t,e,n){e=tv.clamp(e,0,t.length);var i=(n=tv.clamp(n,-1,t.length))-e+1;n=t.length&&(i=0),ne.length)return 1;if(0===t.length)return 0;var n=tz.compare(t,e);return tz.isEqualReversed(t,e)?0:n}},{key:"OLDcompare",value:function(t,e){if(t.lengthe.length)return 1;if(0===t.length)return 0;for(var n=tz.increasingDirection(t),i=tz.increasingDirection(e),r=n>0?0:t.length-1,s=i>0?0:t.length-1,o=0;o0){var t=new tH(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(t=3),t1&&(e=1),n>3&&(n=3),n=0?t:e}}])}(),t$=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"readResolve",value:function(){return t.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){this._name=null;var e=arguments[0];this._name=e,t.nameToTypeMap.put(e,this)}}])}();t$.nameToTypeMap=new tJ,tQ.Type=t$,tQ.FIXED=new t$("FIXED"),tQ.FLOATING=new t$("FLOATING"),tQ.FLOATING_SINGLE=new t$("FLOATING SINGLE"),tQ.maximumPreciseValue=0x20000000000000;var t0=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"copyInternal",value:function(){for(var t=Array(this._geometries.length).fill(null),e=0;e1){if(u instanceof tO)return this.createMultiPolygon(t.toPolygonArray(e));if(u instanceof tC)return this.createMultiLineString(t.toLineStringArray(e));if(u instanceof tT)return this.createMultiPoint(t.toPointArray(e));A.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}},{key:"createMultiPointFromCoords",value:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}},{key:"createPoint",value:function(){if(0==arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof G){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(tt(arguments[0],to))return new tT(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(0==arguments.length)return this.createPolygon(null,null);if(1==arguments.length){if(tt(arguments[0],to)){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 tU){var n=arguments[0];return this.createPolygon(n,null)}}else if(2==arguments.length)return new tO(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return 0==arguments.length?new tA(null,this):1==arguments.length?new tA(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(0==arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1==arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(tt(arguments[0],to))return new tU(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return 0==arguments.length?new tW(null,this):1==arguments.length?new tW(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(0==arguments.length)return new tD(null,this);if(1==arguments.length){if(arguments[0]instanceof Array)return new tD(arguments[0],this);if(tt(arguments[0],to)){var t=arguments[0];if(null===t)return this.createMultiPoint([].fill(null));for(var e=Array(t.size()).fill(null),n=0;n="a"&&t="A"&&t="0"&&t1?t.createPolygon(i[0],i.slice(1)):t.createPolygon(i[0])},r=this.token_;if(this.match(1)){var s=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==s){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(s){case"POINT":var a=this.parsePointText_();return a?t.createPoint(i(G,g(a))):t.createPoint();case"LINESTRING":var u=this.parseLineStringText_().map(e);return t.createLineString(u);case"LINEARRING":var l=this.parseLineStringText_().map(e);return t.createLinearRing(l);case"POLYGON":var h=this.parsePolygonText_();return h&&0!==h.length?n(h):t.createPolygon();case"MULTIPOINT":var c=this.parseMultiPointText_();if(!c||0===c.length)return t.createMultiPoint();var f=c.map(e).map(function(e){return t.createPoint(e)});return t.createMultiPoint(f);case"MULTILINESTRING":var y=this.parseMultiLineStringText_().map(function(n){return t.createLineString(n.map(e))});return t.createMultiLineString(y);case"MULTIPOLYGON":var d=this.parseMultiPolygonText_();if(!d||0===d.length)return t.createMultiPolygon();var v=d.map(n);return t.createMultiPolygon(v);default:throw Error("Invalid geometry type: "+s)}}throw Error(this.formatErrorMessage_())}}]);function t8(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")}function t7(t){for(var e=t.getCoordinates().map(function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e}),n=[],i=0,r=e.length;i0&&(e+=" "+i),t.isEmpty()?e+" "+t3:e+" ("+n(t)+")"}var en=s(function t(e){n(this,t),this.geometryFactory=e||new t1,this.precisionModel=this.geometryFactory.getPrecisionModel()},[{key:"read",value:function(t){return new t6(new t5(t),this.geometryFactory).parse()}},{key:"write",value:function(t){return ee(t)}}]),ei=s(function t(e){n(this,t),this.parser=new en(e)},[{key:"write",value:function(t){return this.parser.write(t)}}],[{key:"toLineString",value:function(t,e){if(2!=arguments.length)throw Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),er=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getIndexAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}},{key:"getTopologySummary",value:function(){var t=new tH;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}},{key:"computeIntersection",value:function(t,e,n,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)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value: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)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"isInteriorIntersection",value:function(){if(0==arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1==arguments.length){for(var t=arguments[0],e=0;er?i:r;else{var o=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(s=i>r?o:a)||t.equals(e)||(s=Math.max(o,a))}return A.isTrue(!(0===s&&!t.equals(e)),"Bad distance calculation"),s}},{key:"nonRobustComputeEdgeDistance",value:function(t,e,n){var i=t.x-e.x,r=t.y-e.y,s=Math.sqrt(i*i+r*r);return A.isTrue(!(0===s&&!t.equals(e)),"Invalid distance calculation"),s}}])}();er.DONT_INTERSECT=0,er.DO_INTERSECT=1,er.COLLINEAR=2,er.NO_INTERSECTION=0,er.POINT_INTERSECTION=1,er.COLLINEAR_INTERSECTION=2;var es=function(t){function i(){return n(this,i),e(this,i)}return l(i,t),s(i,[{key:"isInSegmentEnvelopes",value:function(t){var e=new q(this._inputLines[0][0],this._inputLines[0][1]),n=new q(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}},{key:"computeIntersection",value:function(){if(3!=arguments.length)return f(i,"computeIntersection",this,1).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,q.intersects(e,n,t)&&0===ta.index(e,n,t)&&0===ta.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=er.POINT_INTERSECTION,null;this._result=er.NO_INTERSECTION}},{key:"intersection",value:function(t,e,n,r){var s=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(s)||(s=new G(i.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(s),s}},{key:"checkDD",value:function(t,e,n,i,r){var s=ts.intersection(t,e,n,i),o=this.isInSegmentEnvelopes(s);td.out.println("DD in env = "+o+" --------------------- "+s),r.distance(s)>1e-4&&td.out.println("Distance = "+r.distance(s))}},{key:"intersectionSafe",value:function(t,e,n,r){var s=ty.intersection(t,e,n,r);return null===s&&(s=i.nearestEndpoint(t,e,n,r)),s}},{key:"computeCollinearIntersection",value:function(t,e,n,i){var r=q.intersects(t,e,n),s=q.intersects(t,e,i),o=q.intersects(n,i,t),a=q.intersects(n,i,e);return r&&s?(this._intPt[0]=n,this._intPt[1]=i,er.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=t,this._intPt[1]=e,er.COLLINEAR_INTERSECTION):r&&o?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||s||a?er.COLLINEAR_INTERSECTION:er.POINT_INTERSECTION):r&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||s||o?er.COLLINEAR_INTERSECTION:er.POINT_INTERSECTION):s&&o?(this._intPt[0]=i,this._intPt[1]=t,!i.equals(t)||r||a?er.COLLINEAR_INTERSECTION:er.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||r||o?er.COLLINEAR_INTERSECTION:er.POINT_INTERSECTION):er.NO_INTERSECTION}},{key:"computeIntersect",value:function(t,e,n,i){if(this._isProper=!1,!q.intersects(t,e,n,i))return er.NO_INTERSECTION;var r=ta.index(t,e,n),s=ta.index(t,e,i);if(r>0&&s>0||r0&&a>0||oi&&(n=e.x,i=t.x),this._p.x>=n&&this._p.xthis._p.y&&e.ythis._p.y&&t.ythis.location.length){var e=[,,,].fill(null);e[W.ON]=this.location[W.ON],e[W.LEFT]=B.NONE,e[W.RIGHT]=B.NONE,this.location=e}for(var n=0;n1&&t.append(B.toLocationSymbol(this.location[W.LEFT])),t.append(B.toLocationSymbol(this.location[W.ON])),this.location.length>1&&t.append(B.toLocationSymbol(this.location[W.RIGHT])),t.toString()}},{key:"setLocations",value:function(t,e,n){this.location[W.ON]=t,this.location[W.LEFT]=e,this.location[W.RIGHT]=n}},{key:"get",value:function(t){return t1}},{key:"isAnyNull",value:function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe)this._maxNodeDegree*=2}},{key:"addPoints",value:function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var s=r;s=0;a--)this._pts.add(i[a])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)}},{key:"containsPoint",value:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t)||!ea.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0}},{key:"addHole",value:function(t){this._holes.add(t)}},{key:"isShell",value:function(){return null===this._shell}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree=2,"found partial label"),this.computeIM(t)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0==arguments.length);else if(1==arguments.length){var t=arguments[0];this._label=t}}}]),ey=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"isIncidentEdgeInResult",value:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(t){t.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(t){}},{key:"computeMergedLocation",value:function(t,e){var n=B.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==B.BOUNDARY&&(n=i)}return n}},{key:"setLabel",value:function(){if(2!=arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return f(i,"setLabel",this,1).apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new el(t,e):this._label.setLocation(t,e)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof i){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof el)for(var e=arguments[0],n=0;n0))return e.value;e=e.right}}return null}},{key:"put",value:function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do if(n=r,(i=t.compareTo(r.key))0)){var s=r.value;return r.value=e,s}r=r.right}while(null!==r)var o={key:t,left:null,right:null,value:e,parent:n,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return i0))return!0;e=e.right}}return!1}}],[{key:"successor",value:function(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}])}(function(t){function i(){return n(this,i),e(this,i,arguments)}return l(i,t),s(i)}(tK)),ek=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"find",value:function(t){return this.nodeMap.get(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof G){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 ey){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return null===i?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}}},{key:"print",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(t){for(var e=new tc,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===B.BOUNDARY&&e.add(i)}return e}},{key:"add",value:function(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_",value:function(){this.nodeMap=new ex,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),eE=function(){function t(){n(this,t)}return s(t,null,[{key:"isNorthern",value:function(e){return e===t.NE||e===t.NW}},{key:"isOpposite",value:function(t,e){return t!==e&&2==(t-e+4)%4}},{key:"commonHalfPlane",value:function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return -1;var n=te?t:e)?3:n}},{key:"isInHalfPlane",value:function(e,n){return n===t.SE?e===t.SE||e===t.SW:e===n||e===n+1}},{key:"quadrant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];if(0===e&&0===n)throw new _("Cannot compute the quadrant for point ( "+e+", "+n+" )");return e>=0?n>=0?t.NE:t.SE:n>=0?t.NW:t.SW}if(arguments[0]instanceof G&&arguments[1]instanceof G){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new _("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?t.NE:t.SE:r.y>=i.y?t.NW:t.SW}}}])}();eE.NE=0,eE.NW=1,eE.SW=2,eE.SE=3;var eS=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"compareDirection",value:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){s.linkDirectedEdgesForMinimalEdgeRings();var o=s.buildMinimalRings(),a=this.findShell(o);null!==a?(this.placePolygonHoles(a,o),e.add(a)):n.addAll(o)}else i.add(s)}return i}},{key:"buildMaximalEdgeRings",value:function(t){for(var e=new tc,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new ef(i,this._geometryFactory);e.add(r),r.setInResult()}}return e}},{key:"placePolygonHoles",value:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return A.isTrue(ethis._items.get(e+1).compareTo(this._items.get(e))&&e++,0>this._items.get(e).compareTo(n));t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return 0===this._size}},{key:"add",value:function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);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)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new tc,this._items.add(null)}}]),eL=s(function t(){n(this,t)},[{key:"insert",value:function(t,e){}},{key:"remove",value:function(t,e){}},{key:"query",value:function(){}}]),eO=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(t){A.isTrue(null===this._bounds),this._childBoundables.add(t)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[eT,E]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new tc,this._bounds=null,this._level=null,0==arguments.length);else if(1==arguments.length){var t=arguments[0];this._level=t}}}]),eM={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return eM.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?tR.sort(n,e):tR.sort(n);for(var i=t.iterator(),r=0,s=n.length;rt.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,!1,e,n):this.expand(this._boundable2,this._boundable1,!0,e,n),null;if(i)return this.expand(this._boundable1,this._boundable2,!1,e,n),null;if(r)return this.expand(this._boundable2,this._boundable1,!0,e,n),null;throw new _("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(t.isComposite(this._boundable1)||t.isComposite(this._boundable2))}},{key:"compareTo",value:function(t){return this._distancet._distance)}},{key:"expand",value:function(e,n,i,r,s){for(var o=e.getChildBoundables().iterator();o.hasNext();){var a=o.next(),u=null;(u=i?new t(n,a,this._itemDistance):new t(a,n,this._itemDistance)).getDistance()=n.size()?null:n}}},{key:"insert",value:function(t,e){A.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new eb(t,e))}},{key:"boundablesAtLevel",value:function(){if(1==arguments.length){var t=arguments[0],e=new tc;return this.boundablesAtLevel(t,this._root,e),e}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(A.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var s=i.getChildBoundables().iterator();s.hasNext();){var o=s.next();o instanceof eO?this.boundablesAtLevel(n,o,r):(A.isTrue(o instanceof eb),-1===n&&r.add(o))}return null}}},{key:"query",value:function(){if(1==arguments.length){var t=arguments[0];this.build();var e=new tc;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t,this._root,e),e}if(2==arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root,i)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3==arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],s=this.removeItem(i,r);if(s)return!0;for(var o=null,a=i.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof eO&&(s=this.remove(n,u,r))){o=u;break}}return null!==o&&o.getChildBoundables().isEmpty()&&i.getChildBoundables().remove(o),s}}},{key:"createHigherLevels",value:function(t,e){A.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}},{key:"depth",value:function(){if(0==arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1==arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof eO){var i=this.depth(n);i>t&&(t=i)}}return t+1}}},{key:"createParentBoundables",value:function(t,e){A.isTrue(!t.isEmpty());var n=new tc;n.add(this.createNode(e));var i=new tc(t);eM.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var s=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(s)}return n}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new tc,this._nodeCapacity=null,0==arguments.length)t.constructor_.call(this,t.DEFAULT_NODE_CAPACITY);else if(1==arguments.length){var e=arguments[0];A.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}}},{key:"compareDoubles",value:function(t,e){return t>e?1:t0);for(var n=new tc,i=0;i=0;){var u=o.poll(),l=u.getDistance();if(l>=s)break;u.isLeaves()?a.size()l&&(a.poll(),a.add(u)),s=a.peek().getDistance()):u.expandToQueue(o,s)}return i.getItems(a)}}},{key:"createNode",value:function(t){return new eq(t)}},{key:"size",value:function(){return 0==arguments.length?f(i,"size",this,1).call(this):f(i,"size",this,1).apply(this,arguments)}},{key:"insert",value:function(){if(!(2==arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof q))return f(i,"insert",this,1).apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;f(i,"insert",this,1).call(this,t,e)}},{key:"getIntersectsOp",value:function(){return i.intersectsOp}},{key:"verticalSlices",value:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),i=Array(e).fill(null),r=t.iterator(),s=0;s0;){var o=s.poll(),a=o.getDistance();if(a>=i)break;o.isLeaves()?(i=a,r=o):o.expandToQueue(s,i)}return null===r?null:[r.getBoundable(0).getItem(),r.getBoundable(1).getItem()]}}else{if(2==arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var h=new eA(this.getRoot(),u.getRoot(),l);return this.nearestNeighbour(h)}if(3==arguments.length){var c=arguments[2],f=new eb(arguments[0],arguments[1]),g=new eA(this.getRoot(),f,c);return this.nearestNeighbour(g)[0]}if(4==arguments.length){var y=arguments[2],d=arguments[3],v=new eb(arguments[0],arguments[1]),p=new eA(this.getRoot(),v,y);return this.nearestNeighbourK(p,d)}}}},{key:"isWithinDistance",value:function(){if(2==arguments.length){var t=arguments[0],e=arguments[1],n=L.POSITIVE_INFINITY,i=new eR;for(i.add(t);!i.isEmpty();){var r=i.poll(),s=r.getDistance();if(s>e)break;if(r.maximumDistance()e)}},{key:"compare",value:function(e,n,i){if(n.equals2D(i))return 0;var r=t.relativeSign(n.x,i.x),s=t.relativeSign(n.y,i.y);switch(e){case 0:return t.compareValue(r,s);case 1:return t.compareValue(s,r);case 2:return t.compareValue(s,-r);case 3:return t.compareValue(-r,s);case 4:return t.compareValue(-r,-s);case 5:return t.compareValue(-s,-r);case 6:return t.compareValue(-s,r);case 7:return t.compareValue(r,-s)}return A.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(t,e){return t0?1:e0)}}])}(),eB=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(t){return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:this._isInterior?t._isInterior?eY.compare(this._segmentOctant,this.coord,t.coord):1:-1}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new G(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),ez=s(function t(){n(this,t)},[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),eX=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"getSplitCoordinates",value:function(){var t=new tB;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()}},{key:"addCollapsedNodes",value:function(){var t=new tc;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}}},{key:"createSplitEdgePts",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new G(t.coord),new G(e.coord)];var i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var s=Array(n).fill(null),o=0;s[o++]=new G(t.coord);for(var a=t.segmentIndex+1;a=0?n>=0?i>=r?0:1:i>=r?7:6:n>=0?i>=r?3:2:i>=r?4:5}if(arguments[0]instanceof G&&arguments[1]instanceof G){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(0===a&&0===u)throw new _("Cannot compute the octant for two identical points "+s);return t.octant(a,u)}}}])}(),eH=s(function t(){n(this,t)},[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(t){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(t){}},{key:"getData",value:function(){}}]),ej=s(function t(){n(this,t)},[{key:"addIntersection",value:function(t,e){}},{key:"interfaces_",get:function(){return[eH]}}]),eZ=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(t){return this._pts[t]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}},{key:"setData",value:function(t){this._data=t}},{key:"safeOctant",value:function(t,e){return t.equals2D(e)?0:eV.octant(t,e)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(2==arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4==arguments.length){var n=arguments[1],i=arguments[3],r=new G(arguments[0].getIntersection(i));this.addIntersection(r,n)}}},{key:"toString",value:function(){return ei.toLineString(new tj(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(t,e){var n=e,i=n+1;if(i=0&&i>=0||n=1&&o>=1||s1&&(a=this.p1);var u=this.project(r.p1);return o1&&(u=this.p1),new t(a,u)}}},{key:"normalize",value:function(){0>this.p1.compareTo(this.p0)&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(t){return 0===t?this.p0:this.p1}},{key:"distancePerpendicular",value:function(t){return tp.pointToLinePerpendicular(t,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return t.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;return i0&&e1||L.isNaN(e))&&(e=1),e}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),i=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),r=e*e+n*n,s=e*e-n*n,o=t.getX(),a=t.getY();return new G((-s*o-2*e*n*a-2*e*i)/r,(s*a-2*e*n*o-2*n*i)/r)}},{key:"distance",value:function(){if(arguments[0]instanceof t){var e=arguments[0];return tp.segmentToSegment(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof G){var n=arguments[0];return tp.pointToSegment(n,this.p0,this.p1)}}},{key:"pointAlong",value:function(t){var e=new G;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e}},{key:"hashCode",value:function(){var t=L.doubleToLongBits(this.p0.x),e=Math.trunc(t^=31*L.doubleToLongBits(this.p0.y))^Math.trunc(t>>32),n=L.doubleToLongBits(this.p1.x);return Math.trunc(n^=31*L.doubleToLongBits(this.p1.y))^Math.trunc(n>>32)^e}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,0==arguments.length)t.constructor_.call(this,new G,new G);else if(1==arguments.length){var e=arguments[0];t.constructor_.call(this,e.p0,e.p1)}else if(2==arguments.length){var n=arguments[0],i=arguments[1];this.p0=n,this.p1=i}else if(4==arguments.length){var r=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];t.constructor_.call(this,new G(r,s),new G(o,a))}}},{key:"midPoint",value:function(t,e){return new G((t.x+e.x)/2,(t.y+e.y)/2)}}])}(),eK=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"overlap",value:function(){if(2==arguments.length);else if(4==arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new eW,this._overlapSeg2=new eW}}]),eJ=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"getLineSegment",value:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}},{key:"computeSelect",value:function(t,e,n,i){var r=this._pts[e],s=this._pts[n];if(n-e==1)return i.select(this,e),null;if(!t.intersects(r,s))return null;var o=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var i=eE.quadrant(t[n],t[n+1]),r=e+1;rn.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new tc,this._index=new eG,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0==arguments.length);else if(1==arguments.length){var t=arguments[0];e0.constructor_.call(this,t)}}}])}(e0),e2=function(t){function i(){var t;return n(this,i),t=e(this,i),i.constructor_.apply(t,arguments),t}return l(i,t),s(i,[{key:"overlap",value:function(){if(4!=arguments.length)return f(i,"overlap",this,1).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),s=e.getContext();this._si.processIntersections(r,t,s,n)}}],[{key:"constructor_",value:function(){this._si=null;var t=arguments[0];this._si=t}}])}(eK);e1.SegmentOverlapAction=e2;var e3=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"isDeletable",value:function(t,e,n,i){var r=this._inputLine[t],s=this._inputLine[e],o=this._inputLine[n];return!!this.isConcave(r,s,o)&&!!this.isShallow(r,s,o,i)&&this.isShallowSampled(r,s,t,n,i)}},{key:"deleteShallowConcavities",value:function(){for(var e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),r=!1;i=0;i--)this.addPt(t[i])}},{key:"isRedundant",value:function(t){if(1>this._ptList.size())return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)this._ptList.size())return null;var t=new G(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)}},{key:"setMinimumVertexDistance",value:function(t){this._minimimVertexDistance=t}}],[{key:"constructor_",value:function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new tc}}])}();e4.COORDINATE_ARRAY_TYPE=[].fill(null);var e5=function(){function t(){n(this,t)}return s(t,null,[{key:"toDegrees",value:function(t){return 180*t/Math.PI}},{key:"normalize",value:function(e){for(;e>Math.PI;)e-=t.PI_TIMES_2;for(;e0}},{key:"isObtuse",value: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)=t.PI_TIMES_2&&(e=0)}else{for(;e>=t.PI_TIMES_2;)e-=t.PI_TIMES_2;eMath.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(t){return t*Math.PI/180}},{key:"getTurn",value:function(e,n){var i=Math.sin(n-e);return i>0?t.COUNTERCLOCKWISE:iMath.PI?s-t.PI_TIMES_2:s}}])}();e5.PI_TIMES_2=2*Math.PI,e5.PI_OVER_2=Math.PI/2,e5.PI_OVER_4=Math.PI/4,e5.COUNTERCLOCKWISE=ta.COUNTERCLOCKWISE,e5.CLOCKWISE=ta.CLOCKWISE,e5.NONE=ta.COLLINEAR;var e6=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"addNextSegment",value:function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ta.index(this._s0,this._s1,this._s2),i=n===ta.CLOCKWISE&&this._side===W.LEFT||n===ta.COUNTERCLOCKWISE&&this._side===W.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}},{key:"addLineEndCap",value:function(t,e){var n=new eW(t,e),i=new eW;this.computeOffsetSegment(n,W.LEFT,this._distance,i);var r=new eW;this.computeOffsetSegment(n,W.RIGHT,this._distance,r);var s=e.x-t.x,o=Math.atan2(e.y-t.y,s);switch(this._bufParams.getEndCapStyle()){case v.CAP_ROUND:this._segList.addPt(i.p1),this.addDirectedFillet(e,o+Math.PI/2,o-Math.PI/2,ta.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case v.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case v.CAP_SQUARE:var a=new G;a.x=Math.abs(this._distance)*Math.cos(o),a.y=Math.abs(this._distance)*Math.sin(o);var u=new G(i.p1.x+a.x,i.p1.y+a.y),l=new G(r.p1.x+a.x,r.p1.y+a.y);this._segList.addPt(u),this._segList.addPt(l)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(t,e,n,i){var r=ty.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==r&&(i=u&&(o-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,o,u,i,r),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(t,e,n,i){var r=this._seg0.p1,s=e5.angle(r,this._seg0.p0),o=e5.angleBetweenOriented(this._seg0.p0,r,this._seg1.p1)/2,a=e5.normalize(s+o),u=e5.normalize(a+Math.PI),l=i*n,h=n-l*Math.abs(Math.sin(o)),c=new G(r.x+l*Math.cos(u),r.y+l*Math.sin(u)),f=new eW(r,c),g=f.pointAlongOffset(1,h),y=f.pointAlongOffset(1,-h);this._side===W.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))}},{key:"addDirectedFillet",value:function(t,e,n,i,r){var s=i===ta.CLOCKWISE?-1:1,o=Math.abs(e-n),a=Math.trunc(o/this._filletAngleQuantum+.5);if(a0){var i=new G((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(i);var r=new G((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(t){var e=new G(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}},{key:"init",value:function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new e4,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*t.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===v.JOIN_BEVEL||this._bufParams.getJoinStyle()===v.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ta.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new eW,this._seg1=new eW,this._offset0=new eW,this._offset1=new eW,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 es,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===v.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)}}])}();e6.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,e6.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,e6.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,e6.MAX_CLOSING_SEG_LEN_FACTOR=80;var e8=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"getOffsetCurve",value:function(t,e){if(this._distance=e,0===e)return null;var n=e=0;o--)n.addNextSegment(r[o],!0)}else{n.addSegments(t,!1);var a=e3.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],W.LEFT),n.addFirstSegment();for(var l=2;l=0;u--)e.addNextSegment(o[u],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()}},{key:"computePointCurve",value:function(t,e){switch(this._bufParams.getEndCapStyle()){case v.CAP_ROUND:e.createCircle(t);break;case v.CAP_SQUARE:e.createSquare(t)}}},{key:"getLineCurve",value:function(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;var n=Math.abs(e),i=this.getSegGen(n);return t.length=0;o--)n.addNextSegment(r[o],!0)}else{var a=e3.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],W.LEFT),n.addFirstSegment();for(var l=2;lr.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3==arguments.length){if(tt(arguments[2],Q)&&arguments[0]instanceof G&&arguments[1]instanceof eI){for(var s=arguments[0],o=arguments[1],a=arguments[2],u=o.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||ta.index(this._seg.p0,this._seg.p1,s)===ta.RIGHT)){var h=o.getDepth(W.LEFT);this._seg.p0.equals(u[l])||(h=o.getDepth(W.RIGHT));var c=new e9(this._seg,h);a.add(c)}}else if(tt(arguments[2],Q)&&arguments[0]instanceof G&&tt(arguments[1],Q))for(var f=arguments[0],g=arguments[2],y=arguments[1].iterator();y.hasNext();){var d=y.next();d.isForward()&&this.findStabbedSegments(f,d,g)}}}},{key:"getDepth",value:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:eM.min(e)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new eW;var t=arguments[0];this._subgraphs=t}}]),e9=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"compareTo",value:function(t){if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()o&&(o=r),s>o&&(o=s),o}},{key:"circumcentreDD",value:function(t,e,n){var i=tr.valueOf(t.x).subtract(n.x),r=tr.valueOf(t.y).subtract(n.y),s=tr.valueOf(e.x).subtract(n.x),o=tr.valueOf(e.y).subtract(n.y),a=tr.determinant(i,r,s,o).multiply(2),u=i.sqr().add(r.sqr()),l=s.sqr().add(o.sqr()),h=tr.determinant(r,u,o,l),c=tr.determinant(i,u,s,l);return new G(tr.valueOf(n.x).subtract(h.divide(a)).doubleValue(),tr.valueOf(n.y).add(c.divide(a)).doubleValue())}},{key:"isAcute",value:function(t,e,n){return!!e5.isAcute(t,e,n)&&!!e5.isAcute(e,n,t)&&!!e5.isAcute(n,t,e)}},{key:"circumcentre",value:function(e,n,i){var r=i.x,s=i.y,o=e.x-r,a=e.y-s,u=n.x-r,l=n.y-s,h=2*t.det(o,a,u,l);return new G(r-t.det(a,o*o+a*a,l,u*u+l*l)/h,s+t.det(o,o*o+a*a,u,u*u+l*l)/h)}},{key:"perpendicularBisector",value:function(t,e){var n=e.x-t.x,i=e.y-t.y,r=new ne(t.x+n/2,t.y+i/2,1),s=new ne(t.x-i+n/2,t.y+n+i/2,1);return new ne(r,s)}},{key:"angleBisector",value:function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),s=n.x-t.x,o=n.y-t.y;return new G(t.x+r*s,t.y+r*o)}},{key:"area3D",value:function(t,e,n){var i=e.x-t.x,r=e.y-t.y,s=e.getZ()-t.getZ(),o=n.x-t.x,a=n.y-t.y,u=n.getZ()-t.getZ(),l=r*u-s*a,h=s*o-i*u,c=i*a-r*o;return Math.sqrt(l*l+h*h+c*c)/2}},{key:"centroid",value:function(t,e,n){return new G((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)}},{key:"inCentre",value:function(t,e,n){var i=e.distance(n),r=t.distance(n),s=t.distance(e),o=i+r+s;return new G((i*t.x+r*e.x+s*n.x)/o,(i*t.y+r*e.y+s*n.y)/o)}}])}(),ni=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"addRingSide",value:function(t,e,n,i,r){if(0===e&&t.length=tU.MINIMUM_VALID_SIZE&&ta.isCCW(t)&&(s=r,o=i,n=W.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,s,o)}},{key:"addRingBothSides",value:function(t,e){this.addRingSide(t,e,W.LEFT,B.EXTERIOR,B.INTERIOR),this.addRingSide(t,e,W.RIGHT,B.INTERIOR,B.EXTERIOR)}},{key:"addPoint",value:function(t){if(this._distance0&&this.isErodedCompletely(o,-this._distance)||this.addRingSide(a,e,W.opposite(n),B.INTERIOR,B.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(t,e){var n=new nn(t[0],t[1],t[2]),i=n.inCentre();return tp.pointToSegment(i,n.p0,n.p1)r}},{key:"addCollection",value:function(t){for(var e=0;e=this._max)throw new X;var e=this._parent.getGeometryN(this._index++);return e instanceof tA?(this._subcollectionIterator=new t(e),this._subcollectionIterator.next()):e}},{key:"remove",value:function(){throw new V(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[ez]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}},{key:"isAtomic",value:function(t){return!(t instanceof tA)}}])}(),no=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"locate",value:function(e){return t.locate(e,this._geom)}},{key:"interfaces_",get:function(){return[nr]}}],[{key:"constructor_",value:function(){this._geom=null;var t=arguments[0];this._geom=t}},{key:"locatePointInPolygon",value:function(e,n){if(n.isEmpty())return B.EXTERIOR;var i=n.getExteriorRing(),r=t.locatePointInRing(e,i);if(r!==B.INTERIOR)return r;for(var s=0;s=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)}},{key:"computeDepths",value:function(){if(1==arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(W.LEFT),i=t.getDepth(W.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new tl("depth mismatch at "+t.getCoordinate())}else if(3==arguments.length){for(var s=arguments[1],o=arguments[2],a=arguments[0];a=0;r--){var s=this._resultAreaEdgeList.get(r),o=s.getSym();switch(null===e&&s.getEdgeRing()===t&&(e=s),i){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;n.setNextMin(s),i=this._SCANNING_FOR_INCOMING}}i===this._LINKING_TO_OUTGOING&&(A.isTrue(null!==e,"found null for first outgoing dirEdge"),A.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))}},{key:"getOutgoingDegree",value:function(){if(0==arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1==arguments.length){for(var n=arguments[0],i=0,r=this.iterator();r.hasNext();)r.next().getEdgeRing()===n&&i++;return i}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var t=B.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=B.INTERIOR;break}if(i.isInResult()){t=B.EXTERIOR;break}}}if(t===B.NONE)return null;for(var r=t,s=this.iterator();s.hasNext();){var o=s.next(),a=o.getSym();o.isLineEdge()?o.getEdge().setCovered(r===B.INTERIOR):(o.isInResult()&&(r=B.EXTERIOR),a.isInResult()&&(r=B.INTERIOR))}}},{key:"computeLabelling",value:function(t){f(i,"computeLabelling",this,1).call(this,t),this._label=new el(B.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),r=0;r=e.size())return!0;var n=e.size()-1,i=e.get(n).getLabel().getLocation(t,W.LEFT);A.isTrue(i!==B.NONE,"Found unlabelled area edge");for(var r=i,s=this.iterator();s.hasNext();){var o=s.next().getLabel();A.isTrue(o.isArea(t),"Found non-area edge");var a=o.getLocation(t,W.LEFT),u=o.getLocation(t,W.RIGHT);if(a===u||u!==r)return!1;r=a}return!0}},{key:"findIndex",value:function(t){this.iterator();for(var e=0;e0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")}},{key:"addAll",value:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}},{key:"findEdgeIndex",value:function(t){for(var e=0;et?1:this.diste)}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new G(t),this.segmentIndex=e,this.dist=n}}]),ny=s(function t(){n(this,t),t.constructor_.apply(this,arguments)},[{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}}},{key:"addEndpoints",value:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}},{key:"createSplitEdge",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var s=Array(n).fill(null),o=0;s[o++]=new G(t.coord);for(var a=t.segmentIndex+1;a=0&&e>=0&&this.setAtLeast(t,e,n)}},{key:"isWithin",value:function(){return t.isTrue(this._matrix[B.INTERIOR][B.INTERIOR])&&this._matrix[B.INTERIOR][B.EXTERIOR]===tS.FALSE&&this._matrix[B.BOUNDARY][B.EXTERIOR]===tS.FALSE}},{key:"isTouches",value:function(e,n){return e>n?this.isTouches(n,e):(e===tS.A&&n===tS.A||e===tS.L&&n===tS.L||e===tS.L&&n===tS.A||e===tS.P&&n===tS.A||e===tS.P&&n===tS.L)&&this._matrix[B.INTERIOR][B.INTERIOR]===tS.FALSE&&(t.isTrue(this._matrix[B.INTERIOR][B.BOUNDARY])||t.isTrue(this._matrix[B.BOUNDARY][B.INTERIOR])||t.isTrue(this._matrix[B.BOUNDARY][B.BOUNDARY]))}},{key:"isOverlaps",value:function(e,n){return e===tS.P&&n===tS.P||e===tS.A&&n===tS.A?t.isTrue(this._matrix[B.INTERIOR][B.INTERIOR])&&t.isTrue(this._matrix[B.INTERIOR][B.EXTERIOR])&&t.isTrue(this._matrix[B.EXTERIOR][B.INTERIOR]):e===tS.L&&n===tS.L&&1===this._matrix[B.INTERIOR][B.INTERIOR]&&t.isTrue(this._matrix[B.INTERIOR][B.EXTERIOR])&&t.isTrue(this._matrix[B.EXTERIOR][B.INTERIOR])}},{key:"isEquals",value:function(e,n){return e===n&&t.isTrue(this._matrix[B.INTERIOR][B.INTERIOR])&&this._matrix[B.INTERIOR][B.EXTERIOR]===tS.FALSE&&this._matrix[B.BOUNDARY][B.EXTERIOR]===tS.FALSE&&this._matrix[B.EXTERIOR][B.INTERIOR]===tS.FALSE&&this._matrix[B.EXTERIOR][B.BOUNDARY]===tS.FALSE}},{key:"toString",value:function(){for(var t=new tH("123456789"),e=0;e=0||e===tS.TRUE)||n===tS.SYM_FALSE&&e===tS.FALSE||n===tS.SYM_P&&e===tS.P||n===tS.SYM_L&&e===tS.L||n===tS.SYM_A&&e===tS.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var i=arguments[1];return new t(arguments[0]).matches(i)}}},{key:"isTrue",value:function(t){return t>=0||t===tS.TRUE}}])}(),nv=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),td.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}},{key:"ensureCapacity",value:function(t){if(tn?e:n}},{key:"getMinX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(i=1),this._depth[t][n]=i}}}},{key:"getDelta",value:function(t){return this._depth[t][W.RIGHT]-this._depth[t][W.LEFT]}},{key:"getLocation",value:function(t,e){return this._depth[t][e]0?this.pts[0]:null;if(1==arguments.length){var t=arguments[0];return this.pts[t]}}},{key:"print",value:function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(t){i.updateIM(this._label,t)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}},{key:"getMonotoneChainEdge",value:function(){return null===this._mce&&(this._mce=new n_(this)),this._mce}},{key:"getEnvelope",value:function(){if(null===this._env){this._env=new q;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()}},{key:"isPointwiseEqual",value:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e=i.size())return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new eC(new nu),this._graph.addEdges(this._edgeList.getEdges());var r=this.createSubgraphs(this._graph),s=new ew(this._geomFact);this.buildSubgraphs(r,s);var o=s.getPolygons();return 0>=o.size()?this.createEmptyResultGeometry():this._geomFact.buildGeometry(o)}},{key:"computeNodedEdges",value:function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings().iterator();i.hasNext();){var r=i.next(),s=r.getCoordinates();if(2!==s.length||!s[0].equals2D(s[1])){var o=r.getData(),a=new nx(r.getCoordinates(),new el(o));this.insertUniqueEdge(a)}}}},{key:"setNoder",value:function(t){this._workingNoder=t}}],[{key:"constructor_",value:function(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new nh;var t=arguments[0];this._bufParams=t}},{key:"depthDelta",value:function(t){var e=t.getLocation(0,W.LEFT),n=t.getLocation(0,W.RIGHT);return e===B.INTERIOR&&n===B.EXTERIOR?1:e===B.EXTERIOR&&n===B.INTERIOR?-1:0}},{key:"convertSegStrings",value:function(t){for(var e=new t1,n=new tc;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)}}])}(),nE=function(){function t(){n(this,t),t.constructor_.apply(this,arguments)}return s(t,[{key:"rescale",value:function(){if(tt(arguments[0],z))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;ii||this._maxys;if(o)return!1;var a=this.intersectsToleranceSquare(t,e);return A.isTrue(!(o&&a),"Found bad envelope test"),a}},{key:"initCorners",value: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 G(this._maxx,this._maxy),this._corner[1]=new G(this._minx,this._maxy),this._corner[2]=new G(this._minx,this._miny),this._corner[3]=new G(this._maxx,this._miny)}},{key:"intersects",value:function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(t){return Math.round(t*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}},{key:"getSafeEnvelope",value:function(){if(null===this._safeEnv){var e=t.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new q(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}},{key:"intersectsToleranceSquare",value:function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!i)||!!t.equals(this._pt)||!!e.equals(this._pt))))}},{key:"addSnappedNode",value:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=[,,,,].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;e--){try{this.bufferReducedPrecision(e)}catch(t){if(!(t instanceof tl))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1==arguments.length){var n=arguments[0],i=new tQ(t.precisionScaleFactor(this._argGeom,this._distance,n));this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===tQ.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(t){this._bufParams.setQuadrantSegments(t)}},{key:"bufferOriginalPrecision",value:function(){try{var t=new nk(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof M))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new v,this._resultGeometry=null,this._saveException=null,1==arguments.length){var t=arguments[0];this._argGeom=t}else if(2==arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}}},{key:"bufferOp",value:function(){if(2==arguments.length){var e=arguments[1];return new t(arguments[0]).getResultGeometry(e)}if(3==arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var n=arguments[1],i=arguments[2],r=new t(arguments[0]);return r.setQuadrantSegments(i),r.getResultGeometry(n)}if(arguments[2]instanceof v&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var s=arguments[1];return new t(arguments[0],arguments[2]).getResultGeometry(s)}}else if(4==arguments.length){var o=arguments[1],a=arguments[2],u=arguments[3],l=new t(arguments[0]);return l.setQuadrantSegments(a),l.setEndCapStyle(u),l.getResultGeometry(o)}}},{key:"precisionScaleFactor",value:function(t,e,n){var i=t.getEnvelopeInternal();return Math.pow(10,n-Math.trunc(Math.log(tv.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))}}])}();nR.CAP_ROUND=v.CAP_ROUND,nR.CAP_BUTT=v.CAP_FLAT,nR.CAP_FLAT=v.CAP_FLAT,nR.CAP_SQUARE=v.CAP_SQUARE,nR.MAX_PRECISION_DIGITS=12;var nL=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],nO=s(function t(e){n(this,t),this.geometryFactory=e||new t1},[{key:"read",value:function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!nM[n])throw Error("Unknown GeoJSON type: "+e.type);return -1!==nL.indexOf(n)?nM[n].call(this,e.coordinates):"GeometryCollection"===n?nM[n].call(this,e.geometries):nM[n].call(this,e)}},{key:"write",value:function(t){var e=t.getGeometryType();if(!nP[e])throw Error("Geometry is not supported");return nP[e].call(this,t)}}]),nM={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){if(!nM[t.geometry.type])throw Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=nM.bbox.call(this,t.bbox)),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n{"use strict";var e,n=t.i(878331),i=t.i(885246);function r(t,e,s={}){if(!t)throw Error("point is required");if(!e)throw Error("polygon is required");let o=(0,i.getCoord)(t),a=(0,i.getGeom)(e),u=a.type,l=e.bbox,h=a.coordinates;if(l&&!1==(c=o,(f=l)[0]=c[0]&&f[3]>=c[1]))return!1;"Polygon"===u&&(h=[h]);for(var c,f,g=0;g0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;let t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:n}=this,i=e[t];for(;t>0;){let r=t-1>>1,s=e[r];if(n(i,s)>=0)break;e[t]=s,t=r}e[t]=i}_down(t){let{data:e,compare:n}=this,i=this.length>>1,r=e[t];for(;tn(e[o],s)&&(i=o,s=e[o]),n(s,r)>=0)break;e[t]=s,t=i}e[t]=r}}function a(t,e){return te)}let u=(3+8881784197001252e-31)*11102230246251565e-32;function l(t,e,n,i,r){let s,o,a,u,l=e[0],h=i[0],c=0,f=0;h>l==h>-l?(s=l,l=e[++c]):(s=h,h=i[++f]);let g=0;if(cl==h>-l?(o=l+s,a=s-(o-l),l=e[++c]):(o=h+s,a=s-(o-h),h=i[++f]),s=o,0!==a&&(r[g++]=a);cl==h>-l?(u=(o=s+l)-s,a=s-(o-u)+(l-u),l=e[++c]):(u=(o=s+h)-s,a=s-(o-u)+(h-u),h=i[++f]),s=o,0!==a&&(r[g++]=a);for(;c0!=a>0)return h;let m=Math.abs(o+a);return Math.abs(h)>=c*m?h:-function(t,e,n,i,r,s,o){let a,h,c,m,x,k,E,S,I,N,C,w,T,b,R,L,O,M,P=t-r,A=n-r,D=e-s,U=i-s;b=P*U,E=(k=0x8000001*P)-(k-P),S=P-E,I=(k=0x8000001*U)-(k-U),R=S*(N=U-I)-(b-E*I-S*I-E*N),L=D*A,E=(k=0x8000001*D)-(k-D),S=D-E,I=(k=0x8000001*A)-(k-A),C=R-(O=S*(N=A-I)-(L-E*I-S*I-E*N)),x=R-C,y[0]=R-(C+x)+(x-O),x=(w=b+C)-b,C=(T=b-(w-x)+(C-x))-L,x=T-C,y[1]=T-(C+x)+(x-L),x=(M=w+C)-w,y[2]=w-(M-x)+(C-x),y[3]=M;let F=function(t){let e=t[0];for(let n=1;n=G||-F>=G||(x=t-P,a=t-(P+x)+(x-r),x=n-A,c=n-(A+x)+(x-r),x=e-D,h=e-(D+x)+(x-s),x=i-U,m=i-(U+x)+(x-s),0===a&&0===h&&0===c&&0===m)||(G=g*o+u*Math.abs(F),(F+=P*m+U*a-(D*c+A*h))>=G||-F>=G))return F;b=a*U,E=(k=0x8000001*a)-(k-a),S=a-E,I=(k=0x8000001*U)-(k-U),R=S*(N=U-I)-(b-E*I-S*I-E*N),L=h*A,E=(k=0x8000001*h)-(k-h),S=h-E,I=(k=0x8000001*A)-(k-A),C=R-(O=S*(N=A-I)-(L-E*I-S*I-E*N)),x=R-C,_[0]=R-(C+x)+(x-O),x=(w=b+C)-b,C=(T=b-(w-x)+(C-x))-L,x=T-C,_[1]=T-(C+x)+(x-L),x=(M=w+C)-w,_[2]=w-(M-x)+(C-x),_[3]=M;let q=l(4,y,4,_,d);b=P*m,E=(k=0x8000001*P)-(k-P),S=P-E,I=(k=0x8000001*m)-(k-m),R=S*(N=m-I)-(b-E*I-S*I-E*N),L=D*c,E=(k=0x8000001*D)-(k-D),S=D-E,I=(k=0x8000001*c)-(k-c),C=R-(O=S*(N=c-I)-(L-E*I-S*I-E*N)),x=R-C,_[0]=R-(C+x)+(x-O),x=(w=b+C)-b,C=(T=b-(w-x)+(C-x))-L,x=T-C,_[1]=T-(C+x)+(x-L),x=(M=w+C)-w,_[2]=w-(M-x)+(C-x),_[3]=M;let Y=l(q,d,4,_,v);b=a*m,E=(k=0x8000001*a)-(k-a),S=a-E,I=(k=0x8000001*m)-(k-m),R=S*(N=m-I)-(b-E*I-S*I-E*N),L=h*c,E=(k=0x8000001*h)-(k-h),S=h-E,I=(k=0x8000001*c)-(k-c),C=R-(O=S*(N=c-I)-(L-E*I-S*I-E*N)),x=R-C,_[0]=R-(C+x)+(x-O),x=(w=b+C)-b,C=(T=b-(w-x)+(C-x))-L,x=T-C,_[1]=T-(C+x)+(x-L),x=(M=w+C)-w,_[2]=w-(M-x)+(C-x),_[3]=M;let B=l(Y,v,4,_,p);return p[B-1]}(t,e,n,i,r,s,m)}function x(t,e){return t.p.x>e.p.x?1:t.p.xe.p.y?1:-1:1}function k(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x0?(u.isLeftEndpoint=!0,a.isLeftEndpoint=!1):(a.isLeftEndpoint=!0,u.isLeftEndpoint=!1),e.push(a),e.push(u),r=s,I+=1}}E+=1}var C=class{constructor(t,e,n,i){this.p={x:t[0],y:t[1]},this.featureId=e,this.ringId=n,this.eventId=i,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(t){return this.p.x===t.p.x&&this.p.y===t.p.y}asNewXY(){return[this.p.x,this.p.y]}},w=class{constructor(t){this.leftSweepEvent=t,this.rightSweepEvent=t.otherEvent}};function T(t,e,n={}){var i;let r,{removeDuplicates:a=!0,ignoreSelfIntersections:u=!0}=n,l=[];"FeatureCollection"===t.type?l=l.concat(t.features):"Feature"===t.type?l.push(t):("LineString"===t.type||"Polygon"===t.type||"MultiLineString"===t.type||"MultiPolygon"===t.type)&&l.push((0,s.feature)(t)),"FeatureCollection"===e.type?l=l.concat(e.features):"Feature"===e.type?l.push(e):("LineString"===e.type||"Polygon"===e.type||"MultiLineString"===e.type||"MultiPolygon"===e.type)&&l.push((0,s.feature)(e));let h=(i=(0,s.featureCollection)(l),function(t,e){if("FeatureCollection"===t.type){let n=t.features;for(let t=0;t0&&c>0||h=0&&d=0&&v{let n=e.join(",");t[n]||(t[n]=!0,c.push(e))})}else c=h;return(0,s.featureCollection)(c.map(t=>(0,s.point)(t)))}function b(t,e,n){if(null!==t)for(var i,r,s,o,a,u,l,h,c=0,f=0,g=t.type,y="FeatureCollection"===g,d="Feature"===g,v=y?t.features.length:1,p=0;p{o.push(P(t,r))}),(0,s.featureCollection)(o)}(n,e);default:throw Error("invalid poly")}}function P(t,e){return t.length>1?(0,s.multiLineString)(t,e):(0,s.lineString)(t[0],e)}function A(t,e){for(let n=0;n=Math.abs(o))if(s>0)return t[0]0?t[1]0}t.s(["coordEach",0,b,"featureEach",0,R,"flattenEach",0,O,"geomEach",0,L],119354),t.s(["booleanIntersects",0,function(t,e,{ignoreSelfIntersections:n=!0}={}){return!function(t,e,{ignoreSelfIntersections:n=!0}={ignoreSelfIntersections:!0}){let i=!0;return O(t,t=>{O(e,e=>{if(!1===i)return!1;i=function(t,e,n){switch(t.type){case"Point":switch(e.type){case"Point":var i,s;return i=t.coordinates,s=e.coordinates,i[0]!==s[0]||i[1]!==s[1];case"LineString":return!A(e,t);case"Polygon":return!r(t,e)}break;case"LineString":switch(e.type){case"Point":return!A(t,e);case"LineString":return!function(t,e,n){if(T(t,e,{ignoreSelfIntersections:n}).features.length>0)return!0;for(let n of t.coordinates)if(A(e,{type:"Point",coordinates:n}))return!0;for(let n of e.coordinates)if(A(t,{type:"Point",coordinates:n}))return!0;return!1}(t,e,n);case"Polygon":return!D(e,t,n)}break;case"Polygon":switch(e.type){case"Point":return!r(e,t);case"LineString":return!D(t,e,n);case"Polygon":return!function(t,e,n){for(let n of t.coordinates[0])if(r(n,e))return!0;for(let n of e.coordinates[0])if(r(n,t))return!0;return T(M(t),M(e),{ignoreSelfIntersections:n}).features.length>0}(e,t,n)}}return!1}(t.geometry,e.geometry,n)})}),i}(t,e,{ignoreSelfIntersections:n})}],80457);var U=t.i(811828),F=Math.PI,G=F/2,q=F/4,Y=2*F,B=180/F,z=F/180,X=Math.abs,V=Math.atan,H=Math.atan2,j=Math.cos,Z=Math.sin,W=Math.sign||function(t){return t>0?1:t1?0:t1?G:t1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function te(t,e){return 1e-6>X(t[0]-e[0])&&1e-6>X(t[1]-e[1])}function tn(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function ti(t,e,n,i,r){var s,o,a=[],u=[];if(t.forEach(function(t){if(!((e=t.length-1)=0;--s)r.point((h=l[s])[0],h[1]);else i(f.x,f.p.x,-1,r);f=f.p}l=(f=f.o).z,g=!g}while(!f.v)r.lineEnd()}}}function tr(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i0){for(s=t[--e];e>0&&(s=(n=s)+(i=t[--e]),!(r=i-(s-n))););e>0&&(r0&&t[e-1]>0)&&(n=s+(i=2*r),i==n-s&&(s=n))}return s}}function to(t){return[H(t[1],t[0]),Q(t[2])]}function ta(t){var e=t[0],n=t[1],i=j(n);return[i*j(e),i*Z(e),Z(n)]}function tu(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function th(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function tc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function tf(t){var e=K(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function tg(t){return X(t[0])=0?1:-1,C=N*I,w=C>F,T=v*E;if(u.add(H(T*N*Z(C),p*S+T*j(C))),o+=w?I+N*Y:I,w^y>=n^x>=n){var b=tl(ta(g),ta(m));tf(b);var R=tl(s,b);tf(R);var L=(w^I>=0?-1:1)*Q(R[2]);(i>L||i===L&&(b[0]||b[1]))&&(a+=w^I>=0?1:-1)}}return(o0){for(c||(r.polygonStart(),c=!0),r.lineStart(),t=0;t1&&2&u&&f.push(f.pop().concat(f.shift())),o.push(f.filter(tv))}}return f}}function tv(t){return t.length>1}function tp(t,e){return((t=t.x)[0]0?F:-F,d=X(s-n);1e-6>X(d-F)?(t.point(n,i=(i+o)/2>0?G:-G),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(y,i),t.point(s,i),e=0):r!==y&&d>=F&&(1e-6>X(n-r)&&(n-=1e-6*r),1e-6>X(s-y)&&(s-=1e-6*y),a=n,u=i,l=s,h=o,i=X(g=Z(a-l))>1e-6?V((Z(u)*(f=j(h))*Z(l)-Z(h)*(c=j(u))*Z(a))/(c*f*g)):(u+h)/2,t.point(r,i),t.lineEnd(),t.lineStart(),t.point(y,i),e=0),t.point(n=s,i=o),r=y},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*G,i.point(-F,r),i.point(0,r),i.point(F,r),i.point(F,0),i.point(F,-r),i.point(0,-r),i.point(-F,-r),i.point(-F,0),i.point(-F,r);else if(X(t[0]-e[0])>1e-6){var s=t[0]F?t+Math.round(-t/Y)*Y:t,e]}function tk(t){return function(e,n){return[(e+=t)>F?e-Y:e-e[2]?-n:n)+Y-1e-6)%Y}tx.invert=tx;let tN=t=>t;function tC(t){return function(e){var n=new tw;for(var i in t)n[i]=t[i];return n.stream=e,n}}function tw(){}function tT(t,e){t&&tR.hasOwnProperty(t.type)&&tR[t.type](t,e)}tw.prototype={constructor:tw,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var tb={Feature:function(t,e){tT(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++itA&&(tA=t),etD&&(tD=e)},lineStart:$,lineEnd:$,polygonStart:$,polygonEnd:$,result:function(){var t=[[tM,tP],[tA,tD]];return tA=tD=-(tP=tM=1/0),t}};function tF(t,e,n){var i,r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),i=t.stream(tU),n&&tb.hasOwnProperty(n.type)?tb[n.type](n,i):tT(n,i),e(tU.result()),null!=r&&t.clipExtent(r),t}function tG(t,e,n){return tF(t,function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([o,a])},n)}var tq=j(30*z);function tY(t,e){var n;return+e?function(t,e){function n(i,r,s,o,a,u,l,h,c,f,g,y,d,v){var p=l-i,_=h-r,m=p*p+_*_;if(m>4*e&&d--){var x=o+f,k=a+g,E=u+y,S=K(x*x+k*k+E*E),I=Q(E/=S),N=1e-6>X(X(E)-1)||1e-6>X(s-c)?(s+c)/2:H(k,x),C=t(N,I),w=C[0],T=C[1],b=w-i,R=T-r,L=_*b-p*R;(L*L/m>e||X((p*b+_*R)/m-.5)>.3||o*f+a*g+u*y{n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]0,r=X(e)>1e-6;function s(t,n){return j(t)*j(n)>e}function o(t,n,i){var r=ta(t),s=ta(n),o=[1,0,0],a=tl(r,s),u=tu(a,a),l=a[0],h=u-l*l;if(!h)return!i&&t;var c=tl(o,a),f=tc(o,e*u/h);th(f,tc(a,-e*l/h));var g=tu(f,c),y=tu(c,c),d=g*g-y*(tu(f,f)-1);if(!(dX(S-F);if(!I&&E0^p[1]X(p[0]-m)?k:E):kF^(mr&&(s|=2),nr&&(s|=8),s}return td(s,function(t){var e,n,u,l,h;return{lineStart:function(){l=u=!1,h=1},point:function(c,f){var g,y,d=[c,f],v=s(c,f),p=i?v?0:a(c,f):v?a(c+(c0?rs)&&(r+=i*Y));for(var l,h=r;i>0?h>s:hu(r,s)^a>0)do l.point(0===h||3===h?t:n,h>1?i:e);while((h=(h+a+4)%4)!==c)else l.point(s[0],s[1])}function o(i,r){return 1e-6>X(i[0]-t)?r>0?0:3:1e-6>X(i[0]-n)?r>0?2:1:1e-6>X(i[1]-e)?+(r>0):r>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var u,l,h,c,f,g,y,d,v,p,_,m=o,x=tt(),k={point:E,lineStart:function(){k.point=S,l&&l.push(h=[]),p=!0,v=!1,y=d=NaN},lineEnd:function(){u&&(S(c,f),g&&v&&x.rejoin(),u.push(x.result())),k.point=E,v&&m.lineEnd()},polygonStart:function(){m=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=l.length;ni&&(f-s)*(i-o)>(g-o)*(t-s)&&++e:g0)return;if(o/=g,g0){if(o>f)return;o>c&&(c=o)}if(o=r-a,g||!(of)return;o>c&&(c=o)}else if(g>0){if(o0)){if(o/=y,y0){if(o>f)return;o>c&&(c=o)}if(o=s-u,y||!(of)return;o>c&&(c=o)}else if(y>0){if(o0&&(t[0]=a+c*g,t[1]=u+c*y),f2?t[2]%360*z:0,b()):[v*B,p*B,_*B]},w.angle=function(t){return arguments.length?(m=t%360*z,b()):m*B},w.reflectX=function(t){return arguments.length?(x=t?-1:1,b()):x{"use strict";var e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,r="[BigNumber Error] ",s=r+"Number primitive has more than 15 significant digits: ",o=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function a(t){var e=0|t;return t>0||t===e?e:e-1}function u(t){for(var e,n,i=1,r=t.length,s=t[0]+"";il^n?1:-1;for(a=(u=r.length)s[o]^n?1:-1;return u==l?0:u>l^n?1:-1}function h(t,e,n,s){if(tn||t!==i(t))throw Error(r+(s||"Argument")+("number"==typeof t?tn?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function c(t){var e=t.c.length-1;return a(t.e/14)==e&&t.c[e]%2!=0}function f(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(ei){for(r=n,e-=i;--e;r+=n);t+=r}else eL?y.c=y.e=null:t.e=10;l/=10,u++);u>L?y.c=y.e=null:(y.e=u,y.c=[t]);return}g=String(t)}else{if(!e.test(g=String(t)))return S(y,g,c);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(u15)throw Error(s+t)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=D.slice(0,n),u=l=0,f=g.length;lr.indexOf(o=g.charAt(l))){if("."==o){if(l>u){u=f;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,l=-1,u=0;continue}return S(y,String(t),c,n)}c=!1,(u=(g=E(g,n,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(l=0;48===g.charCodeAt(l);l++);for(f=g.length;48===g.charCodeAt(--f););if(g=g.slice(l,++f)){if(f-=l,c&&F.DEBUG&&f>15&&(t>0x1fffffffffffff||t!==i(t)))throw Error(s+y.s*t);if((u=u-l-1)>L)y.c=y.e=null;else if(u=b)?f(l,o):g(l,o,"0");else if(s=(t=B(new F(t),e,n)).e,a=(l=u(t.c)).length,1==i||2==i&&(eo),l=g(l,s,"0"),s+1>a){if(--e>0)for(l+=".";e--;l+="0");}else if((e+=s-a)>0)for(s+1==a&&(l+=".");e--;l+="0");return t.s=10;r/=10,i++);return(n=i+14*n-1)>L?t.c=t.e=null:n=10;h/=10,a++);if((u=e-a)=y.length)if(s){for(;y.length=10;h/=10,a++);u%=14,g=(l=u-14+a)5||5==g&&(4==r||s||6==r&&(u>0?l>0?c/o[a-l]:0:y[f-1])%10&1||r==(t.s0?i(c/o[a-l]%o[l])*h:0),s)for(;;)if(0==f){for(u=1,l=y[0];l>=10;l/=10,u++);for(l=y[0]+=h,h=1;l>=10;l/=10,h++);u!=h&&(t.e++,1e14==y[0]&&(y[0]=1));break}else{if(y[f]+=h,1e14!=y[f])break;y[f--]=0,h=1}for(u=y.length;0===y[--u];y.pop());}t.e>L?t.c=t.e=null:t.e=b?f(e,n):g(e,n,"0"),t.stypeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))O=n;else throw O=!n,Error(r+"crypto unavailable");else O=n;else throw Error(r+e+" not true or false: "+n);if(t.hasOwnProperty(e="MODULO_MODE")&&(h(n=t[e],0,9,e),M=n),t.hasOwnProperty(e="POW_PRECISION")&&(h(n=t[e],0,1e9,e),P=n),t.hasOwnProperty(e="FORMAT"))if("object"==typeof(n=t[e]))A=n;else throw Error(r+e+" not an object: "+n);if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(r+e+" invalid: "+n);U="0123456789"==n.slice(0,10),D=n}}else throw Error(r+"Object expected: "+t);return{DECIMAL_PLACES:C,ROUNDING_MODE:w,EXPONENTIAL_AT:[T,b],RANGE:[R,L],CRYPTO:O,MODULO_MODE:M,POW_PRECISION:P,FORMAT:A,ALPHABET:D}},F.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!F.DEBUG)return!0;var e,n,s=t.c,o=t.e,a=t.s;t:if("[object Array]"==({}).toString.call(s)){if((1===a||-1===a)&&o>=-1e9&&o=1e14||n!==i(n))break t;if(0!==n)return!0}}}else if(null===s&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(r+"Invalid BigNumber: "+t)},F.maximum=F.max=function(){return q(arguments,-1)},F.minimum=F.min=function(){return q(arguments,1)},d=0x20000000000000*Math.random()&2097151?function(){return i(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},F.random=function(t){var e,s,a,u,l,c=0,f=[],g=new F(N);if(null==t?t=C:h(t,0,1e9),u=n(t/14),O)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(u*=2));c>>11))>=9e15?(s=crypto.getRandomValues(new Uint32Array(2)),e[c]=s[0],e[c+1]=s[1]):(f.push(l%1e14),c+=2);c=u/2}else if(crypto.randomBytes){for(e=crypto.randomBytes(u*=7);c=9e15?crypto.randomBytes(7).copy(e,c):(f.push(l%1e14),c+=7);c=u/7}else throw O=!1,Error(r+"crypto unavailable");if(!O)for(;c=10;l/=10,c++);cn-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}return function(n,i,r,s,o){var a,l,h,c,f,y,d,v,p=n.indexOf("."),_=C,m=w;for(p>=0&&(c=P,P=0,n=n.replace(".",""),y=(v=new F(i)).pow(n.length-p),P=c,v.c=e(g(u(y.c),y.e,"0"),10,r,t),v.e=v.c.length),h=c=(d=e(n,i,r,o?(a=D,t):(a=t,D))).length;0==d[--c];d.pop());if(!d[0])return a.charAt(0);if(pc||p==c&&(4==m||f||6==m&&1&d[l-1]||m==(y.sr;)d[l]=0,l||(++h,d=[1].concat(d));for(c=d.length;!d[--c];);for(p=0,n="";pi?1:-1;else for(r=s=0;re[r]?1:-1;break}return s}function n(t,e,n,i){for(var r=0;n--;)t[n]-=r,r=+(t[n]1;t.splice(0,1));}return function(r,s,o,u,l){var h,c,f,g,y,d,v,p,_,m,x,k,E,S,I,N,C,w=r.s==s.s?1:-1,T=r.c,b=s.c;if(!T||!T[0]||!b||!b[0])return new F(!r.s||!s.s||(T?b&&T[0]==b[0]:!b)?NaN:T&&0==T[0]||!b?0*w:w/0);for(_=(p=new F(w)).c=[],w=o+(c=r.e-s.e)+1,l||(l=1e14,c=a(r.e/14)-a(s.e/14),w=w/14|0),f=0;b[f]==(T[f]||0);f++);if(b[f]>(T[f]||0)&&c--,w1&&(b=t(b,y,l),T=t(T,y,l),N=b.length,S=T.length),E=N,x=(m=T.slice(0,N)).length;x=l/2&&I++;do{if(y=0,(h=e(b,m,N,x))1)for(y>=l&&(y=l-1),v=(d=t(b,y,l)).length,x=m.length;1==e(d,m,v,x);)y--,n(d,Ne(b,m,N,x);)y++,n(m,N=10;w/=10,f++);B(p,o+(p.e=f+14*c-1)+1,u,g)}else p.e=c,p.r=+g;return p}}(),v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,p=/^([^.]+)\.$/,_=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,S=function(t,e,n,i){var s,o=n?e:e.replace(x,"");if(m.test(o))t.s=isNaN(o)?null:o14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return y=new F(Math.pow(+z(d),h?t.s*(2-c(t)):+z(t))),e?y.mod(e):y;if(f=t.s9&&(d.e>0||d.e1||h&&d.c[1]>=24e7:d.c[0]-1&&(u=1/u),new F(f?1/u:u);P&&(u=n(P/14+2))}for(h?(s=new F(.5),f&&(t.s=1),g=c(t)):g=(a=Math.abs(+z(t)))%2,y=new F(N);;){if(g){if(!(y=y.times(d)).c)break;u?y.c.length>u&&(y.c.length=u):o&&(y=y.mod(e))}if(a){if(0===(a=i(a/2)))break;g=a%2}else if(B(t=t.times(s),t.e+1,1),t.e>14)g=c(t);else{if(0==(a=+z(t)))break;g=a%2}d=d.times(d),u?d.c&&d.c.length>u&&(d.c.length=u):o&&(d=d.mod(e))}return o?y:(f&&(y=N.div(y)),e?y.mod(e):u?B(y,P,w,l):y)},I.integerValue=function(t){var e=new F(this);return null==t?t=w:h(t,0,8),B(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===l(this,new F(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return l(this,new F(t,e))>0},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=l(this,new F(t,e)))||0===e},I.isInteger=function(){return!!this.c&&a(this.e/14)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return 0>l(this,new F(t,e))},I.isLessThanOrEqualTo=I.lte=function(t,e){return -1===(e=l(this,new F(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.minus=function(t,e){var n,i,r,s,o=this.s;if(e=(t=new F(t,e)).s,!o||!e)return new F(NaN);if(o!=e)return t.s=-e,this.plus(t);var u=this.e/14,l=t.e/14,h=this.c,c=t.c;if(!u||!l){if(!h||!c)return h?(t.s=-e,t):new F(c?this:NaN);if(!h[0]||!c[0])return c[0]?(t.s=-e,t):new F(h[0]?this:3==w?-0:0)}if(u=a(u),l=a(l),h=h.slice(),o=u-l){for((s=o0)for(;e--;h[n++]=0);for(e=1e14-1;i>o;){if(h[--i]=0;){for(n=0,g=p[r]%1e7,y=p[r]/1e7|0,s=r+(o=l);s>r;)u=y*(h=v[--o]%1e7)+(c=v[o]/1e7|0)*g,n=((h=g*h+u%1e7*1e7+d[s]+n)/1e14|0)+(u/1e7|0)+y*c,d[s--]=h%1e14;d[s]=n}return n?++i:d.splice(0,1),Y(t,d,i)},I.negated=function(){var t=new F(this);return t.s=-t.s||null,t},I.plus=function(t,e){var n,i=this.s;if(e=(t=new F(t,e)).s,!i||!e)return new F(NaN);if(i!=e)return t.s=-e,this.minus(t);var r=this.e/14,s=t.e/14,o=this.c,u=t.c;if(!r||!s){if(!o||!u)return new F(i/0);if(!o[0]||!u[0])return u[0]?t:new F(o[0]?this:0*i)}if(r=a(r),s=a(s),o=o.slice(),i=r-s){for(i>0?(s=r,n=u):(i=-i,n=o),n.reverse();i--;n.push(0));n.reverse()}for((i=o.length)-(e=u.length)=10;r/=10,i++);}return t&&this.e+1>i&&(i=this.e+1),i},I.shiftedBy=function(t){return h(t,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,n,i,r,s=this.c,o=this.s,l=this.e,h=C+4,c=new F("0.5");if(1!==o||!s||!s[0])return new F(!o||o0&&y>0){for(s=y%a||a,h=g.substr(0,s);s0&&(h+=l+g.slice(s)),f&&(h="-"+h)}i=c?h+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?c.replace(RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):c):h}return(n.prefix||"")+i+(n.suffix||"")},I.toFraction=function(t){var e,n,i,s,a,l,h,c,f,g,y,d,v=this.c;if(null!=t&&(!(h=new F(t)).isInteger()&&(h.c||1!==h.s)||h.lt(N)))throw Error(r+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+z(h));if(!v)return new F(this);for(e=new F(N),f=n=new F(N),i=c=new F(N),d=u(v),a=e.e=d.length-this.e-1,e.c[0]=o[(l=a%14)0?a>0?e:f:h,l=L,L=1/0,h=new F(d),c.c[0]=0;g=k(h,e,0,1),1!=(s=n.plus(g.times(i))).comparedTo(t);)n=i,i=s,f=c.plus(g.times(s=f)),c=s,e=h.minus(g.times(s=e)),h=s;return s=k(t.minus(n),i,0,1),c=c.plus(s.times(f)),n=n.plus(s.times(i)),c.s=f.s=this.s,a*=2,y=1>k(f,i,a,w).minus(this).abs().comparedTo(k(c,n,a,w).minus(this).abs())?[f,i]:[c,n],L=l,y},I.toNumber=function(){return+z(this)},I.toPrecision=function(t,e){return null!=t&&h(t,1,1e9),G(this,t,e,2)},I.toString=function(t){var e,n=this,i=n.s,r=n.e;return null===r?i?(e="Infinity",i=b?f(u(n.c),r):g(u(n.c),r,"0"):10===t&&U?e=g(u((n=B(new F(n),C+r+1,w)).c),n.e,"0"):(h(t,2,D.length,"Base"),e=E(g(u(n.c),r,"0"),10,t,i,!0)),i0){let n=a.left;if(null==n||(e=u(n.key,t))>0&&(a.left=n.right,n.right=a,null==(n=(a=n).left)))break;null==i?r=a:i.left=a,i=a,a=n}else if(ete)}wrap(){return{getRoot:()=>this.root,setRoot:t=>{this.root=t},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:t=>{this.splayCount=t},splay:t=>this.splay(t),has:t=>this.has(t)}}},_=class t extends p{root=null;compare;validKey;constructor(t,e){super(),this.compare=t??this.defaultCompare(),this.validKey=e??(t=>null!=t&&void 0!=t)}delete(t){return!!this.validKey(t)&&null!=this._delete(t)}deleteAll(t){for(let e of t)this.delete(e)}forEach(t){let e,n=this[Symbol.iterator]();for(;!(e=n.next()).done;)t(e.value,e.value,this)}add(t){let e=this.splay(t);return 0!=e&&this.addNewRoot(new v(t),e),this}addAndReturn(t){let e=this.splay(t);return 0!=e&&this.addNewRoot(new v(t),e),this.root.key}addAll(t){for(let e of t)this.add(e)}isEmpty(){return null==this.root}isNotEmpty(){return null!=this.root}single(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(0==this.size)throw"Bad state: No element";return this._first().key}last(){if(0==this.size)throw"Bad state: No element";return this._last().key}lastBefore(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(0>this.splay(t))return this.root.key;let e=this.root.left;if(null==e)return null;let n=e.right;for(;null!=n;)n=(e=n).right;return e.key}firstAfter(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)>0)return this.root.key;let e=this.root.right;if(null==e)return null;let n=e.left;for(;null!=n;)n=(e=n).left;return e.key}retainAll(e){let n=new t(this.compare,this.validKey),i=this.modificationCount;for(let t of e){if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(t)&&0==this.splay(t)&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return this.validKey(t)&&0==this.splay(t)?this.root.key:null}intersection(e){let n=new t(this.compare,this.validKey);for(let t of this)e.has(t)&&n.add(t);return n}difference(e){let n=new t(this.compare,this.validKey);for(let t of this)e.has(t)||n.add(t);return n}union(t){let e=this.clone();return e.addAll(t),e}clone(){let e=new t(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(t){if(null==t)return null;let e=new v(t.key);return!function t(e,n){let i,r;do{if(i=e.left,r=e.right,null!=i){let e=new v(i.key);n.left=e,t(i,e)}if(null!=r){let t=new v(r.key);n.right=t,e=r,n=t}}while(null!=r)}(t,e),e}toSet(){return this.clone()}entries(){return new k(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new x(this.wrap())}[Symbol.toStringTag]="[object Set]"},m=class{tree;path=[];modificationCount=null;splayCount;constructor(t){this.tree=t,this.splayCount=t.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let t=this.path[this.path.length-1];return this.getValue(t)}rebuildPath(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(t){for(;null!=t;)this.path.push(t),t=t.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;null!=t;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let t=this.path[this.path.length-1],e=t.right;if(null!=e){for(;null!=e;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===t;)t=this.path.pop();return this.path.length>0}},x=class extends m{getValue(t){return t.key}},k=class extends m{getValue(t){return[t.key,t.key]}},E=t=>()=>t,S=t=>{let e=t?(e,n)=>n.minus(e).abs().isLessThanOrEqualTo(t):E(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)},I=t=>t,N=t=>{let e;return{set:t=>{C=N(t)},reset:()=>N(t),compare:S(t),snap:(t=>{if(t){let e=new _(S(t)),n=new _(S(t)),i=t=>{let i,r;return{x:(i=t.x,e.addAndReturn(i)),y:(r=t.y,n.addAndReturn(r))}};return i({x:new y(0),y:new y(0)}),i}return I})(t),orient:(e=t?(e,n,i,r,s)=>e.exponentiatedBy(2).isLessThanOrEqualTo(r.minus(n).exponentiatedBy(2).plus(s.minus(i).exponentiatedBy(2)).times(t)):E(!1),(t,n,i)=>{let r=t.x,s=t.y,o=i.x,a=i.y,u=s.minus(a).times(n.x.minus(o)).minus(r.minus(o).times(n.y.minus(a)));return e(u,r,s,o,a)?0:u.comparedTo(0)})}},C=N(),w=(t,e)=>t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y),T=(t,e)=>{if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;let n=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,i=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y},ur:{x:i,y:t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y}}},b=(t,e)=>t.x.times(e.y).minus(t.y.times(e.x)),R=(t,e)=>t.x.times(e.x).plus(t.y.times(e.y)),L=t=>R(t,t).sqrt(),O=(t,e,n)=>e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(n.minus(t.y))),y:n},M=(t,e,n)=>e.x.isZero()?null:{x:n,y:t.y.plus(e.y.div(e.x).times(n.minus(t.x)))},P=class t{point;isLeft;segment;otherSE;consumedBy;static compare(e,n){let i=t.comparePoints(e.point,n.point);return 0!==i?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft)?e.isLeft?1:-1:Y.compare(e.segment,n.segment)}static comparePoints(t,e){return t.x.isLessThan(e.x)?-1:t.x.isGreaterThan(e.x)?1:t.y.isLessThan(e.y)?-1:+!!t.y.isGreaterThan(e.y)}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw Error("Tried to link already linked events");let e=t.point.events;for(let t=0,n=e.length;t{var i,r,s,o,a,u;let l,h,c,f,g=n.otherSE;e.set(n,{sine:(i=this.point,r=t.point,s=g.point,l={x:r.x.minus(i.x),y:r.y.minus(i.y)},b(h={x:s.x.minus(i.x),y:s.y.minus(i.y)},l).div(L(h)).div(L(l))),cosine:(o=this.point,a=t.point,u=g.point,c={x:a.x.minus(o.x),y:a.y.minus(o.y)},R(f={x:u.x.minus(o.x),y:u.y.minus(o.y)},c).div(L(f)).div(L(c)))})};return(t,i)=>{e.has(t)||n(t),e.has(i)||n(i);let{sine:r,cosine:s}=e.get(t),{sine:o,cosine:a}=e.get(i);return r.isGreaterThanOrEqualTo(0)&&o.isGreaterThanOrEqualTo(0)?s.isLessThan(a)?1:s.isGreaterThan(a)?-1:0:r.isLessThan(0)&&o.isLessThan(0)?s.isLessThan(a)?-1:+!!s.isGreaterThan(a):o.isLessThan(r)?-1:+!!o.isGreaterThan(r)}}},A=class t{events;poly;_isExteriorRing;_enclosingRing;static factory(e){let n=[];for(let i=0,r=e.length;i0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)if(n.ringOut?.enclosingRing()!==e.ringOut)return e.ringOut;else return e.ringOut?.enclosingRing();n=(e=n.prevInResult())?e.prevInResult():null}}},D=class{exteriorRing;interiorRings;constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){let t=this.exteriorRing.getGeom();if(null===t)return null;let e=[t];for(let t=0,n=this.interiorRings.length;t=P.comparePoints(s,o)?s:o,this.queue.delete(e.rightSE),n.push(e.rightSE);let i=e.split(t);for(let t=0,e=i.length;t0?(this.tree.delete(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&r){let t=i.getIntersection(r);if(null!==t){if(!i.isAnEndpoint(t)){let e=this._splitSafely(i,t);for(let t=0,i=e.length;t0)return -1;let i=e.comparePoint(t.rightSE.point);return 0!==i?i:-1}if(n.isGreaterThan(i)){if(o.isLessThan(a)&&o.isLessThan(l))return -1;if(o.isGreaterThan(a)&&o.isGreaterThan(l))return 1;let n=e.comparePoint(t.leftSE.point);if(0!==n)return n;let i=t.comparePoint(e.rightSE.point);return i0?-1:1}if(o.isLessThan(a))return -1;if(o.isGreaterThan(a))return 1;if(r.isLessThan(s)){let n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(r.isGreaterThan(s)){let n=t.comparePoint(e.rightSE.point);if(n0)return -1}if(!r.eq(s)){let t=u.minus(o),e=r.minus(n),h=l.minus(a),c=s.minus(i);if(t.isGreaterThan(e)&&h.isLessThan(c))return 1;if(t.isLessThan(e)&&h.isGreaterThan(c))return -1}return r.isGreaterThan(s)?1:r.isLessThan(s)||u.isLessThan(l)?-1:u.isGreaterThan(l)?1:t.ide.id)}constructor(t,e,n,i){this.id=++q,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(e,n,i){let r,s,o,a=P.comparePoints(e,n);if(a0)r=n,s=e,o=-1;else throw Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);return new t(new P(r,!0),new P(s,!1),[i],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(e)?t:e},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(e)?t:e}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return C.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let e=this.bbox(),n=t.bbox(),i=T(e,n);if(null===i)return null;let r=this.leftSE.point,s=this.rightSE.point,o=t.leftSE.point,a=t.rightSE.point,u=w(e,o)&&0===this.comparePoint(o),l=w(n,r)&&0===t.comparePoint(r),h=w(e,a)&&0===this.comparePoint(a),c=w(n,s)&&0===t.comparePoint(s);if(l&&u)return c&&!h?s:!c&&h?a:null;if(l)return h&&r.x.eq(a.x)&&r.y.eq(a.y)?null:r;if(u)return c&&s.x.eq(o.x)&&s.y.eq(o.y)?null:o;if(c&&h)return null;if(c)return s;if(h)return a;let f=((t,e,n,i)=>{if(e.x.isZero())return M(n,i,t.x);if(i.x.isZero())return M(t,e,n.x);if(e.y.isZero())return O(n,i,t.y);if(i.y.isZero())return O(t,e,n.y);let r=b(e,i);if(r.isZero())return null;let s={x:n.x.minus(t.x),y:n.y.minus(t.y)},o=b(s,e).div(r),a=b(s,i).div(r),u=t.x.plus(a.times(e.x)),l=n.x.plus(o.times(i.x)),h=t.y.plus(a.times(e.y)),c=n.y.plus(o.times(i.y));return{x:u.plus(l).div(2),y:h.plus(c).div(2)}})(r,this.vector(),o,t.vector());return null!==f&&w(i,f)?C.snap(f):null}split(e){let n=[],i=void 0!==e.events,r=new P(e,!0),s=new P(e,!1),o=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(r);let a=new t(r,o,this.rings.slice(),this.windings.slice());return P.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),P.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),s.checkForConsuming()),n}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t0){let t=n;n=i,i=t}if(n.prev===i){let t=n;n=i,i=t}for(let t=0,e=i.rings.length;t1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e)}}return this._isInResult}},B=class{poly;isExterior;segments;bbox;constructor(t,e,n){if(!Array.isArray(t)||0===t.length||(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1]))throw Error("Input geometry is not a valid Polygon or MultiPolygon");const i=C.snap({x:new y(t[0][0]),y:new y(t[0][1])});this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let r=i;for(let e=1,n=t.length;e{n.push(t.coordinates)}),n.lengthG.run("union",t,e))(n[0],...n.slice(1));return 0===i.length?null:1===i.length?(0,V.polygon)(i[0],e.properties):(0,V.multiPolygon)(i,e.properties)}],36947)},878331,t=>{"use strict";let e=(3+8881784197001252e-31)*11102230246251565e-32;function n(t,e,n,i,r){let s,o,a,u,l=e[0],h=i[0],c=0,f=0;h>l==h>-l?(s=l,l=e[++c]):(s=h,h=i[++f]);let g=0;if(cl==h>-l?(o=l+s,a=s-(o-l),l=e[++c]):(o=h+s,a=s-(o-h),h=i[++f]),s=o,0!==a&&(r[g++]=a);cl==h>-l?(u=(o=s+l)-s,a=s-(o-u)+(l-u),l=e[++c]):(u=(o=s+h)-s,a=s-(o-u)+(h-u),h=i[++f]),s=o,0!==a&&(r[g++]=a);for(;c=0||d=0)return 0}else if(_>=0&&v=0){if(0===(y=function(t,i,f,g){let y=(i-0)*(f-0),d=(t-0)*(g-0),v=y-d,p=Math.abs(y+d);return Math.abs(v)>=r*p?v:-function(t,i,r,f,g){let y,d,v,p,_,m,x,k,E,S,I,N,C,w,T,b,R,L,O=t-0,M=r-0,P=i-0,A=f-0;w=O*A,x=(m=0x8000001*O)-(m-O),k=O-x,E=(m=0x8000001*A)-(m-A),T=k*(S=A-E)-(w-x*E-k*E-x*S),b=P*M,x=(m=0x8000001*P)-(m-P),k=P-x,E=(m=0x8000001*M)-(m-M),I=T-(R=k*(S=M-E)-(b-x*E-k*E-x*S)),_=T-I,a[0]=T-(I+_)+(_-R),_=(N=w+I)-w,I=(C=w-(N-_)+(I-_))-b,_=C-I,a[1]=C-(I+_)+(_-b),_=(L=N+I)-N,a[2]=N-(L-_)+(I-_),a[3]=L;let D=function(t){let e=t[0];for(let n=1;n=U||-D>=U||(_=t-O,y=t-(O+_)+(_-0),_=r-M,v=r-(M+_)+(_-0),_=i-P,d=i-(P+_)+(_-0),_=f-A,p=f-(A+_)+(_-0),0===y&&0===d&&0===v&&0===p)||(U=o*g+e*Math.abs(D),(D+=O*p+A*y-(P*v+M*d))>=U||-D>=U))return D;w=y*A,x=(m=0x8000001*y)-(m-y),k=y-x,E=(m=0x8000001*A)-(m-A),T=k*(S=A-E)-(w-x*E-k*E-x*S),b=d*M,x=(m=0x8000001*d)-(m-d),k=d-x,E=(m=0x8000001*M)-(m-M),I=T-(R=k*(S=M-E)-(b-x*E-k*E-x*S)),_=T-I,c[0]=T-(I+_)+(_-R),_=(N=w+I)-w,I=(C=w-(N-_)+(I-_))-b,_=C-I,c[1]=C-(I+_)+(_-b),_=(L=N+I)-N,c[2]=N-(L-_)+(I-_),c[3]=L;let F=n(4,a,4,c,u);w=O*p,x=(m=0x8000001*O)-(m-O),k=O-x,E=(m=0x8000001*p)-(m-p),T=k*(S=p-E)-(w-x*E-k*E-x*S),b=P*v,x=(m=0x8000001*P)-(m-P),k=P-x,E=(m=0x8000001*v)-(m-v),I=T-(R=k*(S=v-E)-(b-x*E-k*E-x*S)),_=T-I,c[0]=T-(I+_)+(_-R),_=(N=w+I)-w,I=(C=w-(N-_)+(I-_))-b,_=C-I,c[1]=C-(I+_)+(_-b),_=(L=N+I)-N,c[2]=N-(L-_)+(I-_),c[3]=L;let G=n(F,u,4,c,l);w=y*p,x=(m=0x8000001*y)-(m-y),k=y-x,E=(m=0x8000001*p)-(m-p),T=k*(S=p-E)-(w-x*E-k*E-x*S),b=d*v,x=(m=0x8000001*d)-(m-d),k=d-x,E=(m=0x8000001*v)-(m-v),I=T-(R=k*(S=v-E)-(b-x*E-k*E-x*S)),_=T-I,c[0]=T-(I+_)+(_-R),_=(N=w+I)-w,I=(C=w-(N-_)+(I-_))-b,_=C-I,c[1]=C-(I+_)+(_-b),_=(L=N+I)-N,c[2]=N-(L-_)+(I-_),c[3]=L;let q=n(G,l,4,c,h);return h[q-1]}(t,i,f,g,p)}(d,p,v,_)))return 0;(y>0&&_>0&&v0)&&k++}m=x,v=_,d=p}}return k%2!=0}],878331)},910481,t=>{"use strict";t.s(["distributionChannelOptions",0,[{label:"weather.com Web",value:"weather-com-web"},{label:"weather.com Mobile Web",value:"weather-com-mobile-web"},{label:"weather.com Mobile Web Samsung",value:"weather-com-mobile-web-samsung"},{label:"weather.com iOS",value:"weather-com-ios"},{label:"weather.com Android",value:"weather-com-android"},{label:"RSS - Connatix",value:"rss-connatix"},{label:"RSS - Yahoo",value:"rss-yahoo"},{label:"RSS - Flatplan (Apple News)",value:"rss-flatplan"},{label:"RSS - SmartNews",value:"rss-smartnews"},{label:"RSS - VideoElephant (MSN)",value:"rss-videoelephant"},{label:"RSS - Carrot",value:"rss-carrot"},{label:"RSS - Taboola",value:"rss-taboola"},{label:"RSS - MSN",value:"rss-msn"},{label:"RSS - Samsung",value:"rss-samsung"},{label:"RSS - NewsBreak",value:"rss-newsbreak"},{label:"RSS - AOL",value:"rss-aol"},{label:"RSS - Primis",value:"rss-primis"},{label:"RSS - Kalshi",value:"rss-kalshi"},{label:"SnowCast App",value:"twc-snowcast"}]])},254821,t=>{"use strict";var e=t.i(80457),n=t.i(182163),i=t.i(346888),r=t.i(31513),s=t.i(710596),o=t.i(36947),a=t.i(966518);let u={500:{lat:44.34394556,long:-70.5796275,countryCode:"US"},501:{lat:41.16030046,long:-74.31726173,countryCode:"US"},502:{lat:42.20531475,long:-74.96203454,countryCode:"US"},503:{lat:32.57216429,long:-83.33286582,countryCode:"US"},504:{lat:39.91547509,long:-75.29061719,countryCode:"US"},505:{lat:42.70916968,long:-83.26985878,countryCode:"US"},506:{lat:42.75322714,long:-71.61677284,countryCode:"US"},507:{lat:32.12060162,long:-81.68797062,countryCode:"US"},508:{lat:40.45249464,long:-79.72019469,countryCode:"US"},509:{lat:41.01832774,long:-85.13014489,countryCode:"US"},510:{lat:41.06629733,long:-81.69124784,countryCode:"US"},511:{lat:38.98734089,long:-77.8660894,countryCode:"US"},512:{lat:39.4237559,long:-76.91046627,countryCode:"US"},513:{lat:43.21129488,long:-83.84733056,countryCode:"US"},514:{lat:42.37659498,long:-78.50467879,countryCode:"US"},515:{lat:39.06201907,long:-84.37615438,countryCode:"US"},516:{lat:41.80511913,long:-80.11855326,countryCode:"US"},517:{lat:35.34207351,long:-80.90021125,countryCode:"US"},518:{lat:36.12015586,long:-80.18188048,countryCode:"US"},519:{lat:33.1661311,long:-80.00633288,countryCode:"US"},520:{lat:33.31796092,long:-82.04156069,countryCode:"US"},521:{lat:41.68675545,long:-71.62537583,countryCode:"US"},522:{lat:32.28086801,long:-84.9488217,countryCode:"US"},523:{lat:44.2489962,long:-72.9288287,countryCode:"US"},524:{lat:33.90631848,long:-84.31426892,countryCode:"US"},525:{lat:31.48777876,long:-83.71333132,countryCode:"US"},526:{lat:43.12071391,long:-75.03554171,countryCode:"US"},527:{lat:39.92745969,long:-86.1667533,countryCode:"US"},528:{lat:25.7495729,long:-80.64045477,countryCode:"US"},529:{lat:38.09820644,long:-85.77800218,countryCode:"US"},530:{lat:30.55298052,long:-83.69571536,countryCode:"US"},531:{lat:36.70569408,long:-82.40984603,countryCode:"US"},532:{lat:42.99028358,long:-73.90370288,countryCode:"US"},533:{lat:41.67343412,long:-72.62702357,countryCode:"US"},534:{lat:28.72041551,long:-81.44452449,countryCode:"US"},535:{lat:39.98556042,long:-82.65474506,countryCode:"US"},536:{lat:41.04943746,long:-80.81547703,countryCode:"US"},537:{lat:45.38485433,long:-68.96285086,countryCode:"US"},538:{lat:42.92766152,long:-77.41280176,countryCode:"US"},539:{lat:27.84117738,long:-81.89546703,countryCode:"US"},540:{lat:44.59760454,long:-84.94860309,countryCode:"US"},541:{lat:37.61853623,long:-84.10842296,countryCode:"US"},542:{lat:40.06086081,long:-84.27011562,countryCode:"US"},543:{lat:42.36485931,long:-72.6256632,countryCode:"US"},544:{lat:36.58396295,long:-76.5912337,countryCode:"US"},545:{lat:35.14265685,long:-77.62067813,countryCode:"US"},546:{lat:33.95808848,long:-80.8726005,countryCode:"US"},547:{lat:41.39147126,long:-83.7698829,countryCode:"US"},548:{lat:27.03526717,long:-80.56037162,countryCode:"US"},549:{lat:44.51837976,long:-74.98695633,countryCode:"US"},550:{lat:34.25873822,long:-78.30266909,countryCode:"US"},551:{lat:42.4400122,long:-84.56068251,countryCode:"US"},552:{lat:46.65893075,long:-68.59876428,countryCode:"US"},553:{lat:46.39187647,long:-87.84097233,countryCode:"US"},554:{lat:39.97480203,long:-80.86439761,countryCode:"US"},555:{lat:42.99185697,long:-76.14273356,countryCode:"US"},556:{lat:37.46729794,long:-77.6218551,countryCode:"US"},557:{lat:36.18437616,long:-84.06338367,countryCode:"US"},558:{lat:40.80046931,long:-84.15139258,countryCode:"US"},559:{lat:37.66075199,long:-81.06618562,countryCode:"US"},560:{lat:35.78927629,long:-78.48357878,countryCode:"US"},561:{lat:30.47467615,long:-81.99567866,countryCode:"US"},563:{lat:42.78708754,long:-85.59435268,countryCode:"US"},564:{lat:38.42846537,long:-82.1169566,countryCode:"US"},565:{lat:42.09535742,long:-77.20805025,countryCode:"US"},566:{lat:40.1642638,long:-77.01142636,countryCode:"US"},567:{lat:35.05242613,long:-82.54849067,countryCode:"US"},569:{lat:38.4215533,long:-79.1035751,countryCode:"US"},570:{lat:34.28866385,long:-79.39046477,countryCode:"US"},571:{lat:26.58736494,long:-81.44720644,countryCode:"US"},573:{lat:37.32634258,long:-79.81001465,countryCode:"US"},574:{lat:40.74326198,long:-78.28061261,countryCode:"US"},575:{lat:35.17926383,long:-85.01572181,countryCode:"US"},576:{lat:38.44595372,long:-75.59171534,countryCode:"US"},577:{lat:41.2967749,long:-76.34830783,countryCode:"US"},581:{lat:39.08931995,long:-87.45931131,countryCode:"US"},582:{lat:40.38825729,long:-86.90255778,countryCode:"US"},583:{lat:44.84686417,long:-83.60985537,countryCode:"US"},584:{lat:38.10083665,long:-78.43352843,countryCode:"US"},588:{lat:41.49561956,long:-86.15996193,countryCode:"US"},592:{lat:29.54072947,long:-82.72252657,countryCode:"US"},596:{lat:39.96542426,long:-81.94438738,countryCode:"US"},597:{lat:39.36498394,long:-81.50261216,countryCode:"US"},598:{lat:39.01388655,long:-80.30476907,countryCode:"US"},600:{lat:27.65850937,long:-97.9840956,countryCode:"US"},602:{lat:41.58266689,long:-87.98705286,countryCode:"US"},603:{lat:37.41028554,long:-94.86110513,countryCode:"US"},604:{lat:38.83377035,long:-92.3106699,countryCode:"US"},605:{lat:39.21354814,long:-96.33700311,countryCode:"US"},606:{lat:31.32137779,long:-85.50601762,countryCode:"US"},609:{lat:38.513147,long:-90.31743349,countryCode:"US"},610:{lat:42.11001421,long:-89.30500274,countryCode:"US"},611:{lat:43.5049314,long:-92.8928614,countryCode:"US"},612:{lat:32.86030646,long:-93.87838038,countryCode:"US"},613:{lat:45.60841057,long:-94.13467743,countryCode:"US"},616:{lat:38.89911833,long:-94.2089936,countryCode:"US"},617:{lat:43.13623183,long:-88.35507052,countryCode:"US"},618:{lat:29.64238151,long:-95.64598264,countryCode:"US"},619:{lat:37.11395676,long:-92.74785101,countryCode:"US"},622:{lat:30.05161582,long:-90.17099988,countryCode:"US"},623:{lat:32.67017132,long:-96.86245113,countryCode:"US"},624:{lat:42.61235648,long:-96.26515412,countryCode:"US"},625:{lat:31.12643923,long:-97.13708799,countryCode:"US"},626:{lat:28.79637616,long:-96.97150853,countryCode:"US"},627:{lat:34.01044605,long:-98.79446374,countryCode:"US"},628:{lat:32.44836486,long:-92.00344741,countryCode:"US"},630:{lat:33.51333945,long:-86.93918399,countryCode:"US"},631:{lat:40.45642212,long:-92.50513741,countryCode:"US"},632:{lat:37.10944872,long:-89.33954607,countryCode:"US"},633:{lat:30.88101836,long:-102.964805,countryCode:"US"},634:{lat:35.5317158,long:-101.9717692,countryCode:"US"},635:{lat:30.36841279,long:-98.01149066,countryCode:"US"},636:{lat:26.3955211,long:-98.13340111,countryCode:"US"},637:{lat:42.36067297,long:-91.83699519,countryCode:"US"},638:{lat:39.84851227,long:-94.67081101,countryCode:"US"},639:{lat:35.66575719,long:-88.56546248,countryCode:"US"},640:{lat:35.04987564,long:-89.87818641,countryCode:"US"},641:{lat:29.28301985,long:-99.23788506,countryCode:"US"},642:{lat:30.23549317,long:-92.18075542,countryCode:"US"},643:{lat:30.27869062,long:-93.20853295,countryCode:"US"},644:{lat:31.20824666,long:-92.63481229,countryCode:"US"},647:{lat:33.55030489,long:-90.48939066,countryCode:"US"},648:{lat:39.74950907,long:-88.84546756,countryCode:"US"},649:{lat:37.92583795,long:-87.47267948,countryCode:"US"},650:{lat:35.7774256,long:-98.23390973,countryCode:"US"},651:{lat:33.46247164,long:-101.8507169,countryCode:"US"},652:{lat:41.24012832,long:-95.9655042,countryCode:"US"},656:{lat:30.60553494,long:-85.88170283,countryCode:"US"},657:{lat:34.20695745,long:-96.32197089,countryCode:"US"},658:{lat:44.66640379,long:-88.30313423,countryCode:"US"},659:{lat:36.06702887,long:-86.80902399,countryCode:"US"},661:{lat:31.05022411,long:-100.5160806,countryCode:"US"},662:{lat:32.54614603,long:-99.76636971,countryCode:"US"},669:{lat:43.16066122,long:-89.87118605,countryCode:"US"},670:{lat:35.48268707,long:-94.17362434,countryCode:"US"},671:{lat:36.08422876,long:-95.69865298,countryCode:"US"},673:{lat:33.83784036,long:-88.82698472,countryCode:"US"},675:{lat:40.66986577,long:-89.35844292,countryCode:"US"},676:{lat:47.82669357,long:-93.07039876,countryCode:"US"},678:{lat:38.32472543,long:-99.39903938,countryCode:"US"},679:{lat:41.77430855,long:-93.81896523,countryCode:"US"},682:{lat:41.47720917,long:-90.46371644,countryCode:"US"},686:{lat:31.08771267,long:-87.62768465,countryCode:"US"},687:{lat:47.42244516,long:-102.3035973,countryCode:"US"},691:{lat:34.67078165,long:-86.81486314,countryCode:"US"},692:{lat:30.4727764,long:-94.11870227,countryCode:"US"},693:{lat:34.65712691,long:-92.36235069,countryCode:"US"},698:{lat:32.15053429,long:-86.58557268,countryCode:"US"},702:{lat:44.35995407,long:-91.12300514,countryCode:"US"},705:{lat:45.2292668,long:-89.6975373,countryCode:"US"},709:{lat:31.87114038,long:-94.95125268,countryCode:"US"},710:{lat:31.49103022,long:-89.20957122,countryCode:"US"},711:{lat:32.41109831,long:-88.61159506,countryCode:"US"},716:{lat:30.57485798,long:-91.14258423,countryCode:"US"},717:{lat:40.02004372,long:-91.35646431,countryCode:"US"},718:{lat:32.21358437,long:-90.26259137,countryCode:"US"},722:{lat:41.06155103,long:-98.93128246,countryCode:"US"},724:{lat:47.56953575,long:-97.25585485,countryCode:"US"},725:{lat:44.46857647,long:-98.73622153,countryCode:"US"},734:{lat:36.14034456,long:-90.86317423,countryCode:"US"},736:{lat:37.10262691,long:-86.16455714,countryCode:"US"},737:{lat:43.97295359,long:-94.45957342,countryCode:"US"},740:{lat:41.23434436,long:-100.7756701,countryCode:"US"},743:{lat:62.08557018,long:-148.5084674,countryCode:"US"},744:{lat:19.60131495,long:-155.5212357,countryCode:"US"},745:{lat:64.11727592,long:-144.8346326,countryCode:"US"},746:{lat:30.63523851,long:-89.10480733,countryCode:"US"},747:{lat:57.19666373,long:-133.2904897,countryCode:"US"},749:{lat:27.58053565,long:-99.29288454,countryCode:"US"},751:{lat:40.02693358,long:-102.8946975,countryCode:"US"},752:{lat:37.75925945,long:-104.0271566,countryCode:"US"},753:{lat:34.78986149,long:-111.6568536,countryCode:"US"},754:{lat:45.64341914,long:-112.3642028,countryCode:"US"},755:{lat:48.12083085,long:-109.6890287,countryCode:"US"},756:{lat:45.81901751,long:-108.1442273,countryCode:"US"},757:{lat:43.47606884,long:-116.4635735,countryCode:"US"},758:{lat:43.89710325,long:-112.572555,countryCode:"US"},759:{lat:41.80658665,long:-104.3210841,countryCode:"US"},760:{lat:42.78284762,long:-114.0808881,countryCode:"US"},762:{lat:47.39602937,long:-114.2229433,countryCode:"US"},764:{lat:44.37874199,long:-103.1693202,countryCode:"US"},765:{lat:31.35235056,long:-104.8433106,countryCode:"US"},766:{lat:46.91781387,long:-112.1587854,countryCode:"US"},767:{lat:43.15396635,long:-107.5234554,countryCode:"US"},770:{lat:40.06640974,long:-112.1564151,countryCode:"US"},771:{lat:32.85966602,long:-114.0264768,countryCode:"US"},773:{lat:38.75979106,long:-108.6395621,countryCode:"US"},789:{lat:31.97378741,long:-110.9591759,countryCode:"US"},790:{lat:34.50786724,long:-106.4120008,countryCode:"US"},798:{lat:47.09569257,long:-105.1006719,countryCode:"US"},800:{lat:35.34290566,long:-118.7298087,countryCode:"US"},801:{lat:43.59057664,long:-123.176712,countryCode:"US"},802:{lat:40.93180016,long:-123.878808,countryCode:"US"},803:{lat:35.22927453,long:-116.8480578,countryCode:"US"},804:{lat:33.69653671,long:-116.2274005,countryCode:"US"},807:{lat:38.55084577,long:-122.6381803,countryCode:"US"},810:{lat:46.6917307,long:-120.6361836,countryCode:"US"},811:{lat:40.12238337,long:-118.6841075,countryCode:"US"},813:{lat:42.65183394,long:-121.6321186,countryCode:"US"},819:{lat:47.69368524,long:-121.8419617,countryCode:"US"},820:{lat:44.9568069,long:-120.4497922,countryCode:"US"},821:{lat:44.00502252,long:-121.4760974,countryCode:"US"},825:{lat:33.03590675,long:-116.7327828,countryCode:"US"},828:{lat:36.3957165,long:-121.2613926,countryCode:"US"},839:{lat:37.53511459,long:-115.6988268,countryCode:"US"},855:{lat:35.10037135,long:-120.2386713,countryCode:"US"},862:{lat:38.77924251,long:-120.9115099,countryCode:"US"},866:{lat:36.73286229,long:-119.5876101,countryCode:"US"},868:{lat:40.90250381,long:-122.0975534,countryCode:"US"},881:{lat:47.2983517,long:-117.1895343,countryCode:"US"}},l={500:101,501:129,502:84,503:67,504:79,505:76,506:134,507:77,508:91,509:54,510:88,511:107,512:85,513:94,514:78,515:71,516:64,517:97,518:77,519:65,520:74,521:43,522:69,523:103,524:103,525:67,526:68,527:91,528:111,529:87,530:88,531:72,532:89,533:52,534:85,535:87,536:53,537:106,538:46,539:96,540:152,541:85,542:55,543:35,544:125,545:107,546:66,547:59,548:58,549:85,550:53,551:53,552:78,553:128,554:50,555:58,556:82,557:86,558:35,559:67,560:93,561:83,563:83,564:94,565:44,566:66,567:106,569:40,570:57,571:65,573:116,574:92,575:75,576:41,577:91,581:74,582:41,583:28,584:37,588:57,592:43,596:20,597:29,598:62,600:92,602:78,603:77,604:79,605:93,606:52,609:114,610:42,611:69,612:133,613:214,616:128,617:61,618:132,619:106,622:95,623:144,624:111,625:118,626:22,627:108,628:105,630:108,631:64,632:108,633:155,634:164,635:97,636:69,637:88,638:32,639:57,640:96,641:167,642:75,643:60,644:60,647:84,648:112,649:82,650:140,651:97,652:103,656:104,657:86,658:102,659:112,661:111,662:91,669:79,670:81,671:104,673:88,675:67,676:227,678:201,679:124,682:80,686:88,687:197,691:83,692:65,693:134,698:91,702:95,705:110,709:107,710:54,711:58,716:77,717:69,718:106,722:171,724:165,725:234,734:50,736:44,737:42,740:48,743:317,744:343,745:195,746:47,747:430,749:71,751:388,752:124,753:222,754:145,755:221,756:184,757:148,758:156,759:75,760:93,762:134,764:237,765:175,766:82,767:140,770:287,771:126,773:78,789:144,790:268,798:50,800:88,801:83,802:77,803:229,804:43,807:135,810:156,811:190,813:150,819:145,820:234,821:84,825:57,828:81,839:185,855:133,862:120,866:110,868:133,881:207},h={units:"miles"},c=Math.max(...Object.values(l));function f(t){let e=t[0];return!e||t.lengthMath.round(10*t)/10,d=(t,e)=>(0,r.circle)(t,Math.max(e,.1),{...h,steps:64}).geometry,v=new WeakMap;function p(t){switch(t.type){case"Point":return[t.coordinates];case"MultiPoint":case"LineString":return t.coordinates;case"MultiLineString":case"Polygon":return t.coordinates.flat();case"MultiPolygon":return t.coordinates.flat(2);case"GeometryCollection":return t.geometries.flatMap(p)}}function _(t){let e=v.get(t);if(e)return e;let n=[1/0,1/0,-1/0,-1/0];for(let[e=0,i=0]of p(t))n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],i),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],i);return v.set(t,n),n}let m=(t,e)=>t[0]0?i:null},"candidateDmaCodes",0,function(t,e){return Object.entries(u).filter(([n,i])=>(0,s.distance)(t,[i.long,i.lat],h)t).sort()},"circlePolygon",0,d,"clampMarginMi",0,t=>Math.min(50,Math.max(-25,y(Number(t)||0))),"clampRadiusMi",0,(t,e)=>Math.min(e,Math.max(.1,Math.floor(10*(Number(t)||0))/10)),"coverageCircle",0,(t,e)=>d(t,Math.max(e,.1)+1),"edgeSegments",0,function(t,e){if(t.length=3?t.length:t.length-1,i=[];for(let e=0;e[...t.slice(0,e+1),n,...t.slice(e+1)],"intersectingDmaCodes",0,function(t,n){let i=_(t);return n.filter(n=>m(i,_(n.geometry))&&(0,e.booleanIntersects)(t,n.geometry)).map(t=>t.dmaCode).sort()},"isBroadShape",0,function(t){let{enclosingMi:e}=g(t);return e>30||0!==e&&function(t){let e=t.coordinates[0]??[],n=(e[0]?.[1]??0)*Math.PI/180,i=0;for(let t=0;tMath.hypot(e.x-t.x,e.y-t.y)>3,"mergeTouchingRings",0,function(t){let n=t.flatMap((t,e)=>{let n=f(t);return n?[{polygon:n,index:e}]:[]}),i=[];for(let r of function(t){let n=t.map((t,e)=>e),i=t=>{for(;n[t]!==t;)t=n[t]=n[n[t]];return t};for(let r=0;r{let n=i(e);r.set(n,[...r.get(n)??[],e])}),[...r.values()]}(n.map(t=>t.polygon))){let s=[];for(let i of r){let{polygon:r,index:u}=n[i];s.some(t=>{if(!(0,e.booleanIntersects)(t.polygon,r))return!1;let n=function(t,e){let n={type:"FeatureCollection",features:[t,e].map(t=>({type:"Feature",properties:{},geometry:t}))},i=(0,o.union)(n)?.geometry;if(i?.type!=="Polygon"||1!==i.coordinates.length)return null;let r=(0,a.toStoredRing)((i.coordinates[0]??[]).map(([t=0,e=0])=>[t,e]));return r.length>=3&&r.length1&&i.push({ring:t,members:e})}return i},"moveVertex",0,(t,e,n)=>e>=0&&ei===e?n:t):t,"ringToPolygon",0,f,"shapeTarget",0,function(t,e){if("pin"===t){let t=e[0];return t?{center:t,initialRadiusMi:1}:null}let n=f(e);if(!n)return null;let{center:i,enclosingMi:r}=g(n);return{center:i,initialRadiusMi:Math.max(.1,Math.ceil(10*r-1e-9)/10)}},"toGeocodeString",0,([t,e])=>`${e.toFixed(4)},${t.toFixed(4)}`,"viewRadiusMi",0,function(t){let e=(t.south+t.north)/2,n=(t.west+t.east)/2;return Math.max(.1,y(.4*Math.min((0,s.distance)([t.west,e],[t.east,e],h),(0,s.distance)([n,t.south],[n,t.north],h))))}],254821)},966518,t=>{"use strict";t.i(710596),t.i(910481).distributionChannelOptions.map(t=>t.value);let e=t=>{var e,n;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&(e=t[1],n=t[0],Number.isFinite(e)&&Number.isFinite(n)&&e>=-90&&e=-180&&nt[0]===e[0]&&t[1]===e[1];function i(t){let e=[];for(let i of t){let t=e[e.length-1];t&&n(t,i)||e.push(i)}let i=e[0],r=e[e.length-1];return e.length>1&&i&&r&&n(i,r)&&e.pop(),e}let r=(t,e,n)=>(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0]),s=(t,e,n)=>Math.min(t[0],n[0])2e3||!t.every(e))return null;let n=i(t);return n.length{let r=e[(i+1)%n];return{index:i,a:t,b:r,west:Math.min(t[0],r[0]),east:Math.max(t[0],r[0]),south:Math.min(t[1],r[1]),north:Math.max(t[1],r[1])}}).sort((t,e)=>t.west-e.west);for(let t=0;te.east)break;if(t.south>e.north||t.north0&&a0)&&(u>0&&l0)||0===o&&s(n,t,i)||0===a&&s(n,e,i)||0===u&&s(t,n,e)||0===l&&s(t,i,e)}(e.a,e.b,t.a,t.b))return!0}}return!1},"toStoredRing",0,t=>i(t.map(([t,e])=>[Math.round(1e5*t)/1e5,Math.round(1e5*e)/1e5]))],966518)}]);