earthsdk3 3.5.0-beta.12 → 3.5.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3.iife.js +4 -4
- package/dist/earthsdk3.js +72 -7
- package/dist/earthsdk3.umd.cjs +4 -4
- package/dist/types/ESJTypes/properties/ESJEditingMode.d.ts +2 -2
- package/dist/types/ESJTypes/properties/ESJEditingMode.d.ts.map +1 -1
- package/dist/types/ESObjects/base/ESGeoVector.d.ts.map +1 -1
- package/dist/types/ESObjects/base/ESObjectWithLocation.d.ts.map +1 -1
- package/dist/types/ESObjects/general/ESGeoJson/index.d.ts +1 -0
- package/dist/types/ESObjects/general/ESGeoJson/index.d.ts.map +1 -1
- package/dist/types/ESViewer/ESViewer.d.ts +199 -4
- package/dist/types/ESViewer/ESViewer.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/xbsj-base/xr-utils/gif/gifuct-js/index.d.ts +0 -101
package/dist/earthsdk3.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(g,Gn){typeof exports=="object"&&typeof module<"u"?Gn(exports,require("js-binary-schema-parser"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","proj4","@turf/turf"],Gn):(g=typeof globalThis<"u"?globalThis:g||self,Gn(g.EarthSDK3={},g.jsBinarySchemaParser,g.proj4,g.turf))})(this,function(g,Gn,Xs,jy){"use strict";var xb=Object.defineProperty;var Tb=(g,Gn,Xs)=>Gn in g?xb(g,Gn,{enumerable:!0,configurable:!0,writable:!0,value:Xs}):g[Gn]=Xs;var d=(g,Gn,Xs)=>Tb(g,typeof Gn!="symbol"?Gn+"":Gn,Xs);var ei;function zy(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ke=zy(jy);function Uy(){const r=navigator.userAgent;let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Gy=Date.now();function lp(r){const{os:e,arch:t}=Uy(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}g.copyright=void 0;try{const r="earthsdk3",e="3.5.0-beta.
|
|
1
|
+
(function(g,Gn){typeof exports=="object"&&typeof module<"u"?Gn(exports,require("js-binary-schema-parser"),require("proj4"),require("@turf/turf")):typeof define=="function"&&define.amd?define(["exports","js-binary-schema-parser","proj4","@turf/turf"],Gn):(g=typeof globalThis<"u"?globalThis:g||self,Gn(g.EarthSDK3={},g.jsBinarySchemaParser,g.proj4,g.turf))})(this,function(g,Gn,Xs,jy){"use strict";var xb=Object.defineProperty;var Tb=(g,Gn,Xs)=>Gn in g?xb(g,Gn,{enumerable:!0,configurable:!0,writable:!0,value:Xs}):g[Gn]=Xs;var d=(g,Gn,Xs)=>Tb(g,typeof Gn!="symbol"?Gn+"":Gn,Xs);var ei;function zy(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ke=zy(jy);function Uy(){const r=navigator.userAgent;let e="Unknown";/Windows/.test(r)?e="Windows":/Macintosh/.test(r)?e="MacOS":/Linux/.test(r)?e="Linux":/Android/.test(r)?e="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?t="x64":/x86|i686|Win32/.test(r)?t="x86":/arm64|aarch64/.test(r)?t="arm64":/arm/.test(r)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const Gy=Date.now();function lp(r){const{os:e,arch:t}=Uy(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-Gy)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}g.copyright=void 0;try{const r="earthsdk3",e="3.5.0-beta.14",t="2025-10-16T01:53:04.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cbb61ed7b700d1e5bd8462a564ea9ca208503e89",a=((Date.now()-1760579584e3)/36e5).toFixed(1),u=`%c🌏 ${r}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
|
|
2
2
|
%c${i?i+`
|
|
3
3
|
`:""}当前网站正在使用${r},此软件版权归${n}所有
|
|
4
|
-
`;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4
|
+
`;g.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cbb61ed7b700d1e5bd8462a564ea9ca208503e89")},get info(){return u},get date(){return"2025-10-16T01:53:04.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.14"},get name(){return"earthsdk3"},get commitId(){return"cbb61ed7b700d1e5bd8462a564ea9ca208503e89"},print(){console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|
|
@@ -39,7 +39,7 @@ ${u.map(c=>`${c.id} ${c.typeName}
|
|
|
39
39
|
]
|
|
40
40
|
\`\`\`
|
|
41
41
|
`,sn=class sn extends V{constructor(){super();d(this,"_ratio",this.dv(B(0)));d(this,"_subPlayers",this.dv(new Su));const t=this.dv(new Vl);{const o=()=>{t.loop=this.loop??sn.defaults.loop};o(),this.d(this.loopChanged.don(o))}{const o=()=>{(this.loop??sn.defaults.loop)!==t.loop&&(this.loop=t.loop)};o(),this.d(t.loopChangedEvent.don(o))}{const o=()=>{t.currentTime=this.currentTime??sn.defaults.currentTime};o(),this.d(this.currentTimeChanged.don(o))}{const o=()=>{(this.currentTime??sn.defaults.currentTime)!==t.currentTime&&(this.currentTime=t.currentTime)};o(),this.d(t.currentTimeChangedEvent.don(o))}{const o=()=>{t.duration=this.duration??sn.defaults.duration};o(),this.d(this.durationChanged.don(o))}{const o=()=>{(this.duration??sn.defaults.duration)!==t.duration&&(this.duration=t.duration)};o(),this.d(t.durationChangedEvent.don(o))}{const o=()=>{t.speed=this.speed??sn.defaults.speed};o(),this.d(this.speedChanged.don(o))}{const o=()=>{(this.speed??sn.defaults.speed)!==t.speed&&(this.speed=t.speed)};o(),this.d(t.speedChangedEvent.don(o))}{const o=()=>{t.playing=this.playing??sn.defaults.playing};o(),this.d(this.playingChanged.don(o))}{const o=()=>{(this.playing??sn.defaults.playing)!==t.playing&&(this.playing=t.playing)};o(),this.d(t.playingChangedEvent.don(o))}const n=()=>{const o=this.duration??sn.defaults.duration;o>0&&(this._ratio.value=(this.currentTime??sn.defaults.currentTime)/o)};n();const i=this.dv(Pe(this.currentTimeChanged,this.durationChanged));this.d(i.don(n)),this.d(()=>{const{length:o}=this._subPlayers;for(let a=0;a<o;++a)this._subPlayers.get(a).destroy();this._subPlayers.length=0});const s=()=>{for(let a of this._subPlayers)a.destroy();if(this._subPlayers.length=0,!this.channels)return;const o=this.channels.map(a=>{const[u,l,c]=a;return new hw(u,l,c,this)});this._subPlayers.splice(0,0,...o)};s(),this.d(this.channelsChanged.don(s))}get ratio(){return this._ratio.value}set ratio(t){Math.abs(this._ratio.value-t)<.001||(this.currentTime=(this.duration??sn.defaults.duration)*t)}get ratioChanged(){return this._ratio.changed}};d(sn,"defaults",{loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:!0,ratio:0}),d(sn,"channelsReadMe",dw);let Lr=sn;(r=>{r.createDefaultProps=()=>({loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,channels:fs(void 0,(e,t)=>e==null?void 0:e.every((n,i)=>n===t[i]),e=>[...e])})})(Lr||(Lr={})),Vi(Lr.prototype,Lr.createDefaultProps);class fw extends V{constructor(e,t,n,i){super(),this.disposeVar(new we(e.sceneObjectChanged,()=>{let s;i.debug&&console.log("正在获取Event事件...");const o=e.sceneObject;if(o&&t){const a=t.split(".");if(a.length===0)i.debug&&console.warn("propNames.length === 0");else{let u=hh(o,!1,...a);(!u||!(u instanceof N))&&(a[a.length-1]=a[a.length-1]+"Changed",i.debug&&console.warn(`event未能获取,那么将属性名的最后一项加上Changed(${a[a.length-1]})再试试!`),u=hh(o,!1,...a),i.debug&&u&&console.warn("event仍然获取不到!")),u?u instanceof N?(s=u,i.debug&&console.log(`Event获取成功 propChangedName: ${t}`,s)):i.debug&&console.warn(`the prop is not event from ${o.id}-${o.name}-${o.ref}-${t}`):i.debug&&console.warn(`cannot get changed from ${o.id}-${o.name}-${o.ref}-${t}`)}}if(s){const a=new V;return a.d(s.dwon(()=>n.emit())),a}else{i.debug&&console.log(`未获取到Event!propChangedName: ${t}`);return}}))}}const Lg=Object.freeze(Object.defineProperty({__proto__:null,WatcherObjects:class extends V{constructor(t,n,i){super();d(this,"_doEvalEvent",this.dv(new N));const s=this._doEvalEvent,o=this.disposeVar(Pe(s)),a=t.map(([u,l])=>{const c=new Uh(u),h=l&&new fw(c,l,s,n)||void 0;return[c,h]});this.d(()=>{a.forEach(([u,l])=>{l==null||l.destroy(),u.destroy()}),a.length=0}),this.d(s.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="Immediate"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}})),this.d(o.don(()=>{const{evalMode:u="NextAnimateFrame",evalOnlyWhenObjsAllExist:l=!0}=n;if(u==="NextAnimateFrame"){const c=a.map(([h])=>h.sceneObject);(!l||c.every(h=>h!==void 0))&&i(c)}}))}forceExecute(){this._doEvalEvent.emit()}}},Symbol.toStringTag,{value:"Module"})),{WatcherObjects:pw}=Lg;class Mu extends V{constructor(){super();d(this,"_evalFunc");d(this,"_forceExecute",new N);const t=this.dv(B(void 0)),n=()=>{try{t.value=this.evalFuncStr&&Function('"use strict";return ('+this.evalFuncStr+")")(),this.debug&&console.log("evalFunc成功构建",t.value)}catch(o){console.error(`evalFunc get error! ${o}`),t.value=void 0}};n(),this.dispose(this.evalFuncStrChanged.disposableOn(n));const i=o=>{this.enabled&&(this.debug&&console.log("执行evalFunc..."),this._evalFunc&&this._evalFunc(o),t.value&&t.value(o))},s=this.disposeVar(new we(this.objIdAndPropChangedNamesChanged,()=>{if(this.objIdAndPropChangedNames.length>0)return this.debug&&console.log("监视对象发生变化,重新创建WatcherObjects"),new pw(this.objIdAndPropChangedNames,this,i)}));this.dispose(this._forceExecute.disposableOn(()=>{var o;(o=s.obj)==null||o.forceExecute()}))}get evalFunc(){return this._evalFunc}set evalFunc(t){this._evalFunc=t}forceExecute(){this._forceExecute.emit()}}(r=>{r.createDefaultProps=()=>({enabled:!1,objIdAndPropChangedNames:Pl([],(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[e[0],e[1]]),evalFuncStr:"",evalMode:"NextAnimateFrame",evalOnlyWhenObjsAllExist:!0,debug:!1,name:"未命名场景对象",ref:void 0,extras:_t(void 0),devTags:ne(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})})(Mu||(Mu={})),Vi(Mu.prototype,Mu.createDefaultProps);const Ag=Xs("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=geocent +datum=WGS84");function fi(r){return Ag.forward(r)}function Fg(r){return Ag.inverse(r)}const kg=Xs("+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs");function gw(r){const e=kg.forward([r[0],r[1]]);return[e[0],e[1],r[2]]}function mw(r){const e=kg.inverse([r[0],r[1]]);return[e[0],e[1],r[2]]}function vw(r,e){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1])&&r.push(r[0]);const t=Ke.point(e),n=Ke.polygon([r]);return Ke.booleanPointInPolygon(t,n)}var Qe=63710088e-1,Vg={centimeters:Qe*100,centimetres:Qe*100,degrees:Qe/111325,feet:Qe*3.28084,inches:Qe*39.37,kilometers:Qe/1e3,kilometres:Qe/1e3,meters:Qe,metres:Qe,miles:Qe/1609.344,millimeters:Qe*1e3,millimetres:Qe*1e3,nauticalmiles:Qe/1852,radians:1,yards:Qe*1.0936};function Ar(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function Jt(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Bg(r[0])||!Bg(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Ar(n,e,t)}function Sn(r,e,t){t===void 0&&(t={});for(var n=0,i=r;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<s[s.length-1].length;o++)if(s[s.length-1][o]!==s[0][o])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return Ar(a,e,t)}function Fr(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return Ar(n,e,t)}function na(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}function Gh(r,e,t){t===void 0&&(t={});var n={type:"MultiPolygon",coordinates:r};return Ar(n,e,t)}function Wh(r,e){e===void 0&&(e="kilometers");var t=Vg[e];if(!t)throw new Error(e+" units is invalid");return r*t}function qh(r,e){e===void 0&&(e="kilometers");var t=Vg[e];if(!t)throw new Error(e+" units is invalid");return r/t}function Wl(r){var e=r%(2*Math.PI);return e*180/Math.PI}function ln(r){var e=r%360;return e*Math.PI/180}function Hh(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Wh(qh(r,e),t)}function Bg(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function bn(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function no(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function jg(r,e,t){if(!r)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}function Hn(r){return r.type==="Feature"?r.geometry:r}function yw(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}function Ru(r,e,t){if(t===void 0&&(t={}),t.final===!0)return _w(r,e);var n=bn(r),i=bn(e),s=ln(n[0]),o=ln(i[0]),a=ln(n[1]),u=ln(i[1]),l=Math.sin(o-s)*Math.cos(u),c=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(o-s);return Wl(Math.atan2(l,c))}function _w(r,e){var t=Ru(e,r);return t=(t+180)%360,t}function ra(r,e,t,n){n===void 0&&(n={});var i=bn(r),s=ln(i[0]),o=ln(i[1]),a=ln(t),u=qh(e,n.units),l=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(a)),c=s+Math.atan2(Math.sin(a)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(l)),h=Wl(c),f=Wl(l);return Jt([h,f],n.properties)}function Ui(r,e,t){t===void 0&&(t={});var n=bn(r),i=bn(e),s=ln(i[1]-n[1]),o=ln(i[0]-n[0]),a=ln(n[1]),u=ln(i[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(u);return Wh(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),t.units)}function ww(r,e,t){t===void 0&&(t={});for(var n=Hn(r),i=n.coordinates,s=0,o=0;o<i.length&&!(e>=s&&o===i.length-1);o++)if(s>=e){var a=e-s;if(a){var u=Ru(i[o],i[o-1])-180,l=ra(i[o],a,u,t);return l}else return Jt(i[o])}else s+=Ui(i[o],i[o+1],t);return Jt(i[i.length-1])}function Ew(r,e){const t=Fr(r);return ww(t,e,{units:"meters"}).geometry.coordinates}function ia(r,e,t){if(r!==null)for(var n,i,s,o,a,u,l,c=0,h=0,f,p=r.type,v=p==="FeatureCollection",C=p==="Feature",S=v?r.features.length:1,P=0;P<S;P++){l=v?r.features[P].geometry:C?r.geometry:r,f=l?l.type==="GeometryCollection":!1,a=f?l.geometries.length:1;for(var y=0;y<a;y++){var _=0,m=0;if(o=f?l.geometries[y]:l,o!==null){u=o.coordinates;var w=o.type;switch(c=t&&(w==="Polygon"||w==="MultiPolygon")?1:0,w){case null:break;case"Point":if(e(u,h,P,_,m)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],h,P,_,m)===!1)return!1;h++,w==="MultiPoint"&&_++}w==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(e(u[n][i],h,P,_,m)===!1)return!1;h++}w==="MultiLineString"&&_++,w==="Polygon"&&m++}w==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(m=0,i=0;i<u[n].length;i++){for(s=0;s<u[n][i].length-c;s++){if(e(u[n][i][s],h,P,_,m)===!1)return!1;h++}m++}_++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(ia(o.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ql(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}function Hl(r,e){var t,n,i,s,o,a,u,l,c,h,f=0,p=r.type==="FeatureCollection",v=r.type==="Feature",C=p?r.features.length:1;for(t=0;t<C;t++){for(a=p?r.features[t].geometry:v?r.geometry:r,l=p?r.features[t].properties:v?r.properties:{},c=p?r.features[t].bbox:v?r.bbox:void 0,h=p?r.features[t].id:v?r.id:void 0,u=a?a.type==="GeometryCollection":!1,o=u?a.geometries.length:1,i=0;i<o;i++){if(s=u?a.geometries[i]:a,s===null){if(e(null,f,l,c,h)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,f,l,c,h)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(e(s.geometries[n],f,l,c,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Cw(r,e,t){var n=t;return Hl(r,function(i,s,o,a,u){n=e(n,i,s,o,a,u)}),n}function Xh(r,e){Hl(r,function(t,n,i,s,o){var a=t===null?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(Ar(t,i,{bbox:s,id:o}),n,0)===!1?!1:void 0}var u;switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l],h={type:u,coordinates:c};if(e(Ar(h,i),n,l)===!1)return!1}})}function Sw(r,e){Xh(r,function(t,n,i){var s=0;if(t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,u=0,l=0,c=0;if(ia(t,function(h,f,p,v,C){if(a===void 0||n>u||v>l||C>c){a=h,u=n,l=v,c=C,s=0;return}var S=Fr([a,h],t.properties);if(e(S,n,i,C,s)===!1)return!1;s++,a=h})===!1)return!1}}})}var zg=6378137;function bw(r){return Cw(r,function(e,t){return e+Pw(t)},0)}function Pw(r){var e=0,t;switch(r.type){case"Polygon":return Ug(r.coordinates);case"MultiPolygon":for(t=0;t<r.coordinates.length;t++)e+=Ug(r.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Ug(r){var e=0;if(r&&r.length>0){e+=Math.abs(Gg(r[0]));for(var t=1;t<r.length;t++)e-=Math.abs(Gg(r[t]))}return e}function Gg(r){var e,t,n,i,s,o,a,u=0,l=r.length;if(l>2){for(a=0;a<l;a++)a===l-2?(i=l-2,s=l-1,o=0):a===l-1?(i=l-1,s=0,o=1):(i=a,s=a+1,o=a+2),e=r[i],t=r[s],n=r[o],u+=(Yh(n[0])-Yh(e[0]))*Math.sin(Yh(t[1]));u=u*zg*zg/2}return u}function Yh(r){return r*Math.PI/180}function Jh(r){if((r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]),r.length<=3)return 0;const e=Sn([r]);return bw(e)}var Xl={exports:{}},Yl={exports:{}},Iw=Yl.exports,Wg;function qg(){return Wg||(Wg=1,function(r,e){(function(t,n){r.exports=n()})(Iw,function(){function t(y,_,m,w,E){(function b(I,T,D,x,O){for(;x>D;){if(x-D>600){var L=x-D+1,F=T-D+1,J=Math.log(L),q=.5*Math.exp(2*J/3),Q=.5*Math.sqrt(J*q*(L-q)/L)*(F-L/2<0?-1:1),ct=Math.max(D,Math.floor(T-F*q/L+Q)),mt=Math.min(x,Math.floor(T+(L-F)*q/L+Q));b(I,T,ct,mt,O)}var X=I[T],Z=D,K=x;for(n(I,D,T),O(I[x],X)>0&&n(I,D,x);Z<K;){for(n(I,Z,K),Z++,K--;O(I[Z],X)<0;)Z++;for(;O(I[K],X)>0;)K--}O(I[D],X)===0?n(I,D,K):n(I,++K,x),K<=T&&(D=K+1),T<=K&&(x=K-1)}})(y,_,m||0,w||y.length-1,E||i)}function n(y,_,m){var w=y[_];y[_]=y[m],y[m]=w}function i(y,_){return y<_?-1:y>_?1:0}var s=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(y,_,m){if(!m)return _.indexOf(y);for(var w=0;w<_.length;w++)if(m(y,_[w]))return w;return-1}function a(y,_){u(y,0,y.children.length,_,y)}function u(y,_,m,w,E){E||(E=S(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var b=_;b<m;b++){var I=y.children[b];l(E,y.leaf?w(I):I)}return E}function l(y,_){return y.minX=Math.min(y.minX,_.minX),y.minY=Math.min(y.minY,_.minY),y.maxX=Math.max(y.maxX,_.maxX),y.maxY=Math.max(y.maxY,_.maxY),y}function c(y,_){return y.minX-_.minX}function h(y,_){return y.minY-_.minY}function f(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function p(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,_){return y.minX<=_.minX&&y.minY<=_.minY&&_.maxX<=y.maxX&&_.maxY<=y.maxY}function C(y,_){return _.minX<=y.maxX&&_.minY<=y.maxY&&_.maxX>=y.minX&&_.maxY>=y.minY}function S(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(y,_,m,w,E){for(var b=[_,m];b.length;)if(!((m=b.pop())-(_=b.pop())<=w)){var I=_+Math.ceil((m-_)/w/2)*w;t(y,I,_,m,E),b.push(_,I,I,m)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(y){var _=this.data,m=[];if(!C(y,_))return m;for(var w=this.toBBox,E=[];_;){for(var b=0;b<_.children.length;b++){var I=_.children[b],T=_.leaf?w(I):I;C(y,T)&&(_.leaf?m.push(I):v(y,T)?this._all(I,m):E.push(I))}_=E.pop()}return m},s.prototype.collides=function(y){var _=this.data;if(!C(y,_))return!1;for(var m=[];_;){for(var w=0;w<_.children.length;w++){var E=_.children[w],b=_.leaf?this.toBBox(E):E;if(C(y,b)){if(_.leaf||v(y,b))return!0;m.push(E)}}_=m.pop()}return!1},s.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var _=0;_<y.length;_++)this.insert(y[_]);return this}var m=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var w=this.data;this.data=m,m=w}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},s.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},s.prototype.clear=function(){return this.data=S([]),this},s.prototype.remove=function(y,_){if(!y)return this;for(var m,w,E,b=this.data,I=this.toBBox(y),T=[],D=[];b||T.length;){if(b||(b=T.pop(),w=T[T.length-1],m=D.pop(),E=!0),b.leaf){var x=o(y,b.children,_);if(x!==-1)return b.children.splice(x,1),T.push(b),this._condense(T),this}E||b.leaf||!v(b,I)?w?(m++,b=w.children[m],E=!1):b=null:(T.push(b),D.push(m),m=0,w=b,b=b.children[0])}return this},s.prototype.toBBox=function(y){return y},s.prototype.compareMinX=function(y,_){return y.minX-_.minX},s.prototype.compareMinY=function(y,_){return y.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(y){return this.data=y,this},s.prototype._all=function(y,_){for(var m=[];y;)y.leaf?_.push.apply(_,y.children):m.push.apply(m,y.children),y=m.pop();return _},s.prototype._build=function(y,_,m,w){var E,b=m-_+1,I=this._maxEntries;if(b<=I)return a(E=S(y.slice(_,m+1)),this.toBBox),E;w||(w=Math.ceil(Math.log(b)/Math.log(I)),I=Math.ceil(b/Math.pow(I,w-1))),(E=S([])).leaf=!1,E.height=w;var T=Math.ceil(b/I),D=T*Math.ceil(Math.sqrt(I));P(y,_,m,D,this.compareMinX);for(var x=_;x<=m;x+=D){var O=Math.min(x+D-1,m);P(y,x,O,T,this.compareMinY);for(var L=x;L<=O;L+=T){var F=Math.min(L+T-1,O);E.children.push(this._build(y,L,F,w-1))}}return a(E,this.toBBox),E},s.prototype._chooseSubtree=function(y,_,m,w){for(;w.push(_),!_.leaf&&w.length-1!==m;){for(var E=1/0,b=1/0,I=void 0,T=0;T<_.children.length;T++){var D=_.children[T],x=f(D),O=(L=y,F=D,(Math.max(F.maxX,L.maxX)-Math.min(F.minX,L.minX))*(Math.max(F.maxY,L.maxY)-Math.min(F.minY,L.minY))-x);O<b?(b=O,E=x<E?x:E,I=D):O===b&&x<E&&(E=x,I=D)}_=I||_.children[0]}var L,F;return _},s.prototype._insert=function(y,_,m){var w=m?y:this.toBBox(y),E=[],b=this._chooseSubtree(w,this.data,_,E);for(b.children.push(y),l(b,w);_>=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(w,E,_)},s.prototype._split=function(y,_){var m=y[_],w=m.children.length,E=this._minEntries;this._chooseSplitAxis(m,E,w);var b=this._chooseSplitIndex(m,E,w),I=S(m.children.splice(b,m.children.length-b));I.height=m.height,I.leaf=m.leaf,a(m,this.toBBox),a(I,this.toBBox),_?y[_-1].children.push(I):this._splitRoot(m,I)},s.prototype._splitRoot=function(y,_){this.data=S([y,_]),this.data.height=y.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(y,_,m){for(var w,E,b,I,T,D,x,O=1/0,L=1/0,F=_;F<=m-_;F++){var J=u(y,0,F,this.toBBox),q=u(y,F,m,this.toBBox),Q=(E=J,b=q,I=void 0,T=void 0,D=void 0,x=void 0,I=Math.max(E.minX,b.minX),T=Math.max(E.minY,b.minY),D=Math.min(E.maxX,b.maxX),x=Math.min(E.maxY,b.maxY),Math.max(0,D-I)*Math.max(0,x-T)),ct=f(J)+f(q);Q<O?(O=Q,w=F,L=ct<L?ct:L):Q===O&&ct<L&&(L=ct,w=F)}return w||m-_},s.prototype._chooseSplitAxis=function(y,_,m){var w=y.leaf?this.compareMinX:c,E=y.leaf?this.compareMinY:h;this._allDistMargin(y,_,m,w)<this._allDistMargin(y,_,m,E)&&y.children.sort(w)},s.prototype._allDistMargin=function(y,_,m,w){y.children.sort(w);for(var E=this.toBBox,b=u(y,0,_,E),I=u(y,m-_,m,E),T=p(b)+p(I),D=_;D<m-_;D++){var x=y.children[D];l(b,y.leaf?E(x):x),T+=p(b)}for(var O=m-_-1;O>=_;O--){var L=y.children[O];l(I,y.leaf?E(L):L),T+=p(I)}return T},s.prototype._adjustParentBBoxes=function(y,_,m){for(var w=m;w>=0;w--)l(_[w],y)},s.prototype._condense=function(y){for(var _=y.length-1,m=void 0;_>=0;_--)y[_].children.length===0?_>0?(m=y[_-1].children).splice(m.indexOf(y[_]),1):this.clear():a(y[_],this.toBBox)},s})}(Yl)),Yl.exports}class xw{constructor(e=[],t=Tw){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(n(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:n}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1,a=t[o];const u=o+1;if(u<this.length&&n(t[u],a)<0&&(o=u,a=t[u]),n(a,s)>=0)break;t[e]=a,e=o}t[e]=s}}function Tw(r,e){return r<e?-1:r>e?1:0}const Nw=p0(Object.freeze(Object.defineProperty({__proto__:null,default:xw},Symbol.toStringTag,{value:"Module"})));var Lu={exports:{}},Zh,Hg;function Ow(){return Hg||(Hg=1,Zh=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=(i-n)/2,l=0,c=u-1;l<u;c=l++){var h=t[n+l*2+0],f=t[n+l*2+1],p=t[n+c*2+0],v=t[n+c*2+1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),Zh}var Kh,Xg;function Dw(){return Xg||(Xg=1,Kh=function(e,t,n,i){var s=e[0],o=e[1],a=!1;n===void 0&&(n=0),i===void 0&&(i=t.length);for(var u=i-n,l=0,c=u-1;l<u;c=l++){var h=t[l+n][0],f=t[l+n][1],p=t[c+n][0],v=t[c+n][1],C=f>o!=v>o&&s<(p-h)*(o-f)/(v-f)+h;C&&(a=!a)}return a}),Kh}var Yg;function Mw(){if(Yg)return Lu.exports;Yg=1;var r=Ow(),e=Dw();return Lu.exports=function(n,i,s,o){return i.length>0&&Array.isArray(i[0])?e(n,i,s,o):r(n,i,s,o)},Lu.exports.nested=e,Lu.exports.flat=r,Lu.exports}var Au={exports:{}},Rw=Au.exports,Jg;function Lw(){return Jg||(Jg=1,function(r,e){(function(t,n){n(e)})(Rw,function(t){const i=33306690738754706e-32;function s(C,S,P,y,_){let m,w,E,b,I=S[0],T=y[0],D=0,x=0;T>I==T>-I?(m=I,I=S[++D]):(m=T,T=y[++x]);let O=0;if(D<C&&x<P)for(T>I==T>-I?(E=m-((w=I+m)-I),I=S[++D]):(E=m-((w=T+m)-T),T=y[++x]),m=w,E!==0&&(_[O++]=E);D<C&&x<P;)T>I==T>-I?(E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D]):(E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x]),m=w,E!==0&&(_[O++]=E);for(;D<C;)E=m-((w=m+I)-(b=w-m))+(I-b),I=S[++D],m=w,E!==0&&(_[O++]=E);for(;x<P;)E=m-((w=m+T)-(b=w-m))+(T-b),T=y[++x],m=w,E!==0&&(_[O++]=E);return m===0&&O!==0||(_[O++]=m),O}function o(C){return new Float64Array(C)}const a=33306690738754716e-32,u=22204460492503146e-32,l=11093356479670487e-47,c=o(4),h=o(8),f=o(12),p=o(16),v=o(4);t.orient2d=function(C,S,P,y,_,m){const w=(S-m)*(P-_),E=(C-_)*(y-m),b=w-E;if(w===0||E===0||w>0!=E>0)return b;const I=Math.abs(w+E);return Math.abs(b)>=a*I?b:-function(T,D,x,O,L,F,J){let q,Q,ct,mt,X,Z,K,wt,Ft,Tt,Nt,jt,ve,Qt,En,Cn,j,G;const ft=T-L,kt=x-L,ee=D-F,_e=O-F;X=(En=(wt=ft-(K=(Z=134217729*ft)-(Z-ft)))*(Tt=_e-(Ft=(Z=134217729*_e)-(Z-_e)))-((Qt=ft*_e)-K*Ft-wt*Ft-K*Tt))-(Nt=En-(j=(wt=ee-(K=(Z=134217729*ee)-(Z-ee)))*(Tt=kt-(Ft=(Z=134217729*kt)-(Z-kt)))-((Cn=ee*kt)-K*Ft-wt*Ft-K*Tt))),c[0]=En-(Nt+X)+(X-j),X=(ve=Qt-((jt=Qt+Nt)-(X=jt-Qt))+(Nt-X))-(Nt=ve-Cn),c[1]=ve-(Nt+X)+(X-Cn),X=(G=jt+Nt)-jt,c[2]=jt-(G-X)+(Nt-X),c[3]=G;let Hs=function(Ib,Vy){let By=Vy[0];for(let up=1;up<Ib;up++)By+=Vy[up];return By}(4,c),Sl=u*J;if(Hs>=Sl||-Hs>=Sl||(q=T-(ft+(X=T-ft))+(X-L),ct=x-(kt+(X=x-kt))+(X-L),Q=D-(ee+(X=D-ee))+(X-F),mt=O-(_e+(X=O-_e))+(X-F),q===0&&Q===0&&ct===0&&mt===0)||(Sl=l*J+i*Math.abs(Hs),(Hs+=ft*mt+_e*q-(ee*ct+kt*Q))>=Sl||-Hs>=Sl))return Hs;X=(En=(wt=q-(K=(Z=134217729*q)-(Z-q)))*(Tt=_e-(Ft=(Z=134217729*_e)-(Z-_e)))-((Qt=q*_e)-K*Ft-wt*Ft-K*Tt))-(Nt=En-(j=(wt=Q-(K=(Z=134217729*Q)-(Z-Q)))*(Tt=kt-(Ft=(Z=134217729*kt)-(Z-kt)))-((Cn=Q*kt)-K*Ft-wt*Ft-K*Tt))),v[0]=En-(Nt+X)+(X-j),X=(ve=Qt-((jt=Qt+Nt)-(X=jt-Qt))+(Nt-X))-(Nt=ve-Cn),v[1]=ve-(Nt+X)+(X-Cn),X=(G=jt+Nt)-jt,v[2]=jt-(G-X)+(Nt-X),v[3]=G;const Sb=s(4,c,4,v,h);X=(En=(wt=ft-(K=(Z=134217729*ft)-(Z-ft)))*(Tt=mt-(Ft=(Z=134217729*mt)-(Z-mt)))-((Qt=ft*mt)-K*Ft-wt*Ft-K*Tt))-(Nt=En-(j=(wt=ee-(K=(Z=134217729*ee)-(Z-ee)))*(Tt=ct-(Ft=(Z=134217729*ct)-(Z-ct)))-((Cn=ee*ct)-K*Ft-wt*Ft-K*Tt))),v[0]=En-(Nt+X)+(X-j),X=(ve=Qt-((jt=Qt+Nt)-(X=jt-Qt))+(Nt-X))-(Nt=ve-Cn),v[1]=ve-(Nt+X)+(X-Cn),X=(G=jt+Nt)-jt,v[2]=jt-(G-X)+(Nt-X),v[3]=G;const bb=s(Sb,h,4,v,f);X=(En=(wt=q-(K=(Z=134217729*q)-(Z-q)))*(Tt=mt-(Ft=(Z=134217729*mt)-(Z-mt)))-((Qt=q*mt)-K*Ft-wt*Ft-K*Tt))-(Nt=En-(j=(wt=Q-(K=(Z=134217729*Q)-(Z-Q)))*(Tt=ct-(Ft=(Z=134217729*ct)-(Z-ct)))-((Cn=Q*ct)-K*Ft-wt*Ft-K*Tt))),v[0]=En-(Nt+X)+(X-j),X=(ve=Qt-((jt=Qt+Nt)-(X=jt-Qt))+(Nt-X))-(Nt=ve-Cn),v[1]=ve-(Nt+X)+(X-Cn),X=(G=jt+Nt)-jt,v[2]=jt-(G-X)+(Nt-X),v[3]=G;const Pb=s(bb,f,4,v,p);return p[Pb-1]}(C,S,P,y,_,m,I)},t.orient2dfast=function(C,S,P,y,_,m){return(S-m)*(P-_)-(C-_)*(y-m)},Object.defineProperty(t,"__esModule",{value:!0})})}(Au,Au.exports)),Au.exports}var Zg;function Aw(){if(Zg)return Xl.exports;Zg=1;var r=qg(),e=Nw,t=Mw(),n=Lw().orient2d;e.default&&(e=e.default),Xl.exports=i,Xl.exports.default=i;function i(m,w,E){w=Math.max(0,w===void 0?2:w),E=E||0;var b=p(m),I=new r(16);I.toBBox=function(K){return{minX:K[0],minY:K[1],maxX:K[0],maxY:K[1]}},I.compareMinX=function(K,wt){return K[0]-wt[0]},I.compareMinY=function(K,wt){return K[1]-wt[1]},I.load(m);for(var T=[],D=0,x;D<b.length;D++){var O=b[D];I.remove(O),x=v(O,x),T.push(x)}var L=new r(16);for(D=0;D<T.length;D++)L.insert(f(T[D]));for(var F=w*w,J=E*E;T.length;){var q=T.shift(),Q=q.p,ct=q.next.p,mt=C(Q,ct);if(!(mt<J)){var X=mt/F;O=s(I,q.prev.p,Q,ct,q.next.next.p,X,L),O&&Math.min(C(O,Q),C(O,ct))<=X&&(T.push(q),T.push(v(O,q)),I.remove(O),L.remove(q),L.insert(f(q)),L.insert(f(q.next)))}}q=x;var Z=[];do Z.push(q.p),q=q.next;while(q!==x);return Z.push(q.p),Z}function s(m,w,E,b,I,T,D){for(var x=new e([],o),O=m.data;O;){for(var L=0;L<O.children.length;L++){var F=O.children[L],J=O.leaf?S(F,E,b):a(E,b,F);J>T||x.push({node:F,dist:J})}for(;x.length&&!x.peek().node.children;){var q=x.pop(),Q=q.node,ct=S(Q,w,E),mt=S(Q,b,I);if(q.dist<ct&&q.dist<mt&&l(E,Q,D)&&l(b,Q,D))return Q}O=x.pop(),O&&(O=O.node)}return null}function o(m,w){return m.dist-w.dist}function a(m,w,E){if(u(m,E)||u(w,E))return 0;var b=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.maxX,E.minY);if(b===0)return 0;var I=P(m[0],m[1],w[0],w[1],E.minX,E.minY,E.minX,E.maxY);if(I===0)return 0;var T=P(m[0],m[1],w[0],w[1],E.maxX,E.minY,E.maxX,E.maxY);if(T===0)return 0;var D=P(m[0],m[1],w[0],w[1],E.minX,E.maxY,E.maxX,E.maxY);return D===0?0:Math.min(b,I,T,D)}function u(m,w){return m[0]>=w.minX&&m[0]<=w.maxX&&m[1]>=w.minY&&m[1]<=w.maxY}function l(m,w,E){for(var b=Math.min(m[0],w[0]),I=Math.min(m[1],w[1]),T=Math.max(m[0],w[0]),D=Math.max(m[1],w[1]),x=E.search({minX:b,minY:I,maxX:T,maxY:D}),O=0;O<x.length;O++)if(h(x[O].p,x[O].next.p,m,w))return!1;return!0}function c(m,w,E){return n(m[0],m[1],w[0],w[1],E[0],E[1])}function h(m,w,E,b){return m!==b&&w!==E&&c(m,w,E)>0!=c(m,w,b)>0&&c(E,b,m)>0!=c(E,b,w)>0}function f(m){var w=m.p,E=m.next.p;return m.minX=Math.min(w[0],E[0]),m.minY=Math.min(w[1],E[1]),m.maxX=Math.max(w[0],E[0]),m.maxY=Math.max(w[1],E[1]),m}function p(m){for(var w=m[0],E=m[0],b=m[0],I=m[0],T=0;T<m.length;T++){var D=m[T];D[0]<w[0]&&(w=D),D[0]>b[0]&&(b=D),D[1]<E[1]&&(E=D),D[1]>I[1]&&(I=D)}var x=[w,E,b,I],O=x.slice();for(T=0;T<m.length;T++)t(m[T],x)||O.push(m[T]);return _(O)}function v(m,w){var E={p:m,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return w?(E.next=w.next,E.prev=w,w.next.prev=E,w.next=E):(E.prev=E,E.next=E),E}function C(m,w){var E=m[0]-w[0],b=m[1]-w[1];return E*E+b*b}function S(m,w,E){var b=w[0],I=w[1],T=E[0]-b,D=E[1]-I;if(T!==0||D!==0){var x=((m[0]-b)*T+(m[1]-I)*D)/(T*T+D*D);x>1?(b=E[0],I=E[1]):x>0&&(b+=T*x,I+=D*x)}return T=m[0]-b,D=m[1]-I,T*T+D*D}function P(m,w,E,b,I,T,D,x){var O=E-m,L=b-w,F=D-I,J=x-T,q=m-I,Q=w-T,ct=O*O+L*L,mt=O*F+L*J,X=F*F+J*J,Z=O*q+L*Q,K=F*q+J*Q,wt=ct*X-mt*mt,Ft,Tt,Nt,jt,ve=wt,Qt=wt;wt===0?(Tt=0,ve=1,jt=K,Qt=X):(Tt=mt*K-X*Z,jt=ct*K-mt*Z,Tt<0?(Tt=0,jt=K,Qt=X):Tt>ve&&(Tt=ve,jt=K+mt,Qt=X)),jt<0?(jt=0,-Z<0?Tt=0:-Z>ct?Tt=ve:(Tt=-Z,ve=ct)):jt>Qt&&(jt=Qt,-Z+mt<0?Tt=0:-Z+mt>ct?Tt=ve:(Tt=-Z+mt,ve=ct)),Ft=Tt===0?0:Tt/ve,Nt=jt===0?0:jt/Qt;var En=(1-Ft)*m+Ft*E,Cn=(1-Ft)*w+Ft*b,j=(1-Nt)*I+Nt*D,G=(1-Nt)*T+Nt*x,ft=j-En,kt=G-Cn;return ft*ft+kt*kt}function y(m,w){return m[0]===w[0]?m[1]-w[1]:m[0]-w[0]}function _(m){m.sort(y);for(var w=[],E=0;E<m.length;E++){for(;w.length>=2&&c(w[w.length-2],w[w.length-1],m[E])<=0;)w.pop();w.push(m[E])}for(var b=[],I=m.length-1;I>=0;I--){for(;b.length>=2&&c(b[b.length-2],b[b.length-1],m[I])<=0;)b.pop();b.push(m[I])}return b.pop(),w.pop(),w.concat(b)}return Xl.exports}var Fw=Aw();const kw=Lh(Fw);function Vw(r,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(ia(r,function(i){t.push([i[0],i[1]])}),!t.length)return null;var n=kw(t,e.concavity);return n.length>3?Sn([n]):null}function Kg(r,e){e===void 0&&(e={});var t=0,n=0,i=0;return ia(r,function(s){t+=s[0],n+=s[1],i++},!0),Jt([t/i,n/i],e.properties)}function Qg(r,e){switch(e===void 0&&(e={}),yw(r)){case"Point":return Jt(bn(r),e.properties);case"Polygon":var t=[];ia(r,function(m){t.push(m)});var n=Kg(r,{properties:e.properties}),i=n.geometry.coordinates,s=0,o=0,a=0,u,l,c,h,f,p,v,C,S=t.map(function(m){return[m[0]-i[0],m[1]-i[1]]});for(u=0;u<t.length-1;u++)l=S[u],h=l[0],p=l[1],c=S[u+1],f=c[0],v=c[1],C=h*v-f*p,a+=C,s+=(h+f)*C,o+=(p+v)*C;if(a===0)return n;var P=a*.5,y=1/(6*P);return Jt([i[0]+y*s,i[1]+y*o],e.properties);default:var _=Vw(r);return _?Qg(_,{properties:e.properties}):Kg(r,{properties:e.properties})}}function Bw(r){(r[0][0]!==r[r.length-1][0]||r[0][1]!==r[r.length-1][1]||r[0][2]!==r[r.length-1][2])&&r.push(r[0]);const e=Sn([r]),n=Qg(e).geometry.coordinates;return[n[0],n[1],n[2]??r[0][2]??0]}function $g(r,e,t,n){const[i,s,o]=r,a=ra(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function Jl(r,e){return Ui(Jt(r),Jt(e),{units:"meters"})}function Fu(r,e){return Ru(Jt(r),Jt(e))}function tm(r){if(!r)throw new Error("geojson is required");var e=[];return Xh(r,function(t){jw(t,e)}),na(e)}function jw(r,e){var t=[],n=r.geometry;if(n!==null){switch(n.type){case"Polygon":t=no(n);break;case"LineString":t=[no(n)]}t.forEach(function(i){var s=zw(i,r.properties);s.forEach(function(o){o.id=e.length,e.push(o)})})}}function zw(r,e){var t=[];return r.reduce(function(n,i){var s=Fr([n,i],e);return s.bbox=Uw(n,i),t.push(s),i}),t}function Uw(r,e){var t=r[0],n=r[1],i=e[0],s=e[1],o=t<i?t:i,a=n<s?n:s,u=t>i?t:i,l=n>s?n:s;return[o,a,u,l]}var Zl={exports:{}},Qh={},em;function nm(){return em||(em=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=63710088e-1,r.factors={centimeters:r.earthRadius*100,centimetres:r.earthRadius*100,degrees:r.earthRadius/111325,feet:r.earthRadius*3.28084,inches:r.earthRadius*39.37,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:r.earthRadius*1e3,millimetres:r.earthRadius*1e3,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius*1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function e(x,O,L){L===void 0&&(L={});var F={type:"Feature"};return(L.id===0||L.id)&&(F.id=L.id),L.bbox&&(F.bbox=L.bbox),F.properties=O||{},F.geometry=x,F}r.feature=e;function t(x,O,L){switch(x){case"Point":return n(O).geometry;case"LineString":return a(O).geometry;case"Polygon":return s(O).geometry;case"MultiPoint":return h(O).geometry;case"MultiLineString":return c(O).geometry;case"MultiPolygon":return f(O).geometry;default:throw new Error(x+" is invalid")}}r.geometry=t;function n(x,O,L){if(L===void 0&&(L={}),!x)throw new Error("coordinates is required");if(!Array.isArray(x))throw new Error("coordinates must be an Array");if(x.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(x[0])||!b(x[1]))throw new Error("coordinates must contain numbers");var F={type:"Point",coordinates:x};return e(F,O,L)}r.point=n;function i(x,O,L){return L===void 0&&(L={}),l(x.map(function(F){return n(F,O)}),L)}r.points=i;function s(x,O,L){L===void 0&&(L={});for(var F=0,J=x;F<J.length;F++){var q=J[F];if(q.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var Q=0;Q<q[q.length-1].length;Q++)if(q[q.length-1][Q]!==q[0][Q])throw new Error("First and last Position are not equivalent.")}var ct={type:"Polygon",coordinates:x};return e(ct,O,L)}r.polygon=s;function o(x,O,L){return L===void 0&&(L={}),l(x.map(function(F){return s(F,O)}),L)}r.polygons=o;function a(x,O,L){if(L===void 0&&(L={}),x.length<2)throw new Error("coordinates must be an array of two or more positions");var F={type:"LineString",coordinates:x};return e(F,O,L)}r.lineString=a;function u(x,O,L){return L===void 0&&(L={}),l(x.map(function(F){return a(F,O)}),L)}r.lineStrings=u;function l(x,O){O===void 0&&(O={});var L={type:"FeatureCollection"};return O.id&&(L.id=O.id),O.bbox&&(L.bbox=O.bbox),L.features=x,L}r.featureCollection=l;function c(x,O,L){L===void 0&&(L={});var F={type:"MultiLineString",coordinates:x};return e(F,O,L)}r.multiLineString=c;function h(x,O,L){L===void 0&&(L={});var F={type:"MultiPoint",coordinates:x};return e(F,O,L)}r.multiPoint=h;function f(x,O,L){L===void 0&&(L={});var F={type:"MultiPolygon",coordinates:x};return e(F,O,L)}r.multiPolygon=f;function p(x,O,L){L===void 0&&(L={});var F={type:"GeometryCollection",geometries:x};return e(F,O,L)}r.geometryCollection=p;function v(x,O){if(O===void 0&&(O=0),O&&!(O>=0))throw new Error("precision must be a positive number");var L=Math.pow(10,O||0);return Math.round(x*L)/L}r.round=v;function C(x,O){O===void 0&&(O="kilometers");var L=r.factors[O];if(!L)throw new Error(O+" units is invalid");return x*L}r.radiansToLength=C;function S(x,O){O===void 0&&(O="kilometers");var L=r.factors[O];if(!L)throw new Error(O+" units is invalid");return x/L}r.lengthToRadians=S;function P(x,O){return _(S(x,O))}r.lengthToDegrees=P;function y(x){var O=x%360;return O<0&&(O+=360),O}r.bearingToAzimuth=y;function _(x){var O=x%(2*Math.PI);return O*180/Math.PI}r.radiansToDegrees=_;function m(x){var O=x%360;return O*Math.PI/180}r.degreesToRadians=m;function w(x,O,L){if(O===void 0&&(O="kilometers"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("length must be a positive number");return C(S(x,O),L)}r.convertLength=w;function E(x,O,L){if(O===void 0&&(O="meters"),L===void 0&&(L="kilometers"),!(x>=0))throw new Error("area must be a positive number");var F=r.areaFactors[O];if(!F)throw new Error("invalid original units");var J=r.areaFactors[L];if(!J)throw new Error("invalid final units");return x/F*J}r.convertArea=E;function b(x){return!isNaN(x)&&x!==null&&!Array.isArray(x)}r.isNumber=b;function I(x){return!!x&&x.constructor===Object}r.isObject=I;function T(x){if(!x)throw new Error("bbox is required");if(!Array.isArray(x))throw new Error("bbox must be an Array");if(x.length!==4&&x.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");x.forEach(function(O){if(!b(O))throw new Error("bbox must only contain numbers")})}r.validateBBox=T;function D(x){if(!x)throw new Error("id is required");if(["string","number"].indexOf(typeof x)===-1)throw new Error("id must be a number or a string")}r.validateId=D}(Qh)),Qh}var Ie={},rm;function im(){if(rm)return Ie;rm=1,Object.defineProperty(Ie,"__esModule",{value:!0});var r=nm();function e(y,_,m){if(y!==null)for(var w,E,b,I,T,D,x,O=0,L=0,F,J=y.type,q=J==="FeatureCollection",Q=J==="Feature",ct=q?y.features.length:1,mt=0;mt<ct;mt++){x=q?y.features[mt].geometry:Q?y.geometry:y,F=x?x.type==="GeometryCollection":!1,T=F?x.geometries.length:1;for(var X=0;X<T;X++){var Z=0,K=0;if(I=F?x.geometries[X]:x,I!==null){D=I.coordinates;var wt=I.type;switch(O=m&&(wt==="Polygon"||wt==="MultiPolygon")?1:0,wt){case null:break;case"Point":if(_(D,L,mt,Z,K)===!1)return!1;L++,Z++;break;case"LineString":case"MultiPoint":for(w=0;w<D.length;w++){if(_(D[w],L,mt,Z,K)===!1)return!1;L++,wt==="MultiPoint"&&Z++}wt==="LineString"&&Z++;break;case"Polygon":case"MultiLineString":for(w=0;w<D.length;w++){for(E=0;E<D[w].length-O;E++){if(_(D[w][E],L,mt,Z,K)===!1)return!1;L++}wt==="MultiLineString"&&Z++,wt==="Polygon"&&K++}wt==="Polygon"&&Z++;break;case"MultiPolygon":for(w=0;w<D.length;w++){for(K=0,E=0;E<D[w].length;E++){for(b=0;b<D[w][E].length-O;b++){if(_(D[w][E][b],L,mt,Z,K)===!1)return!1;L++}K++}Z++}break;case"GeometryCollection":for(w=0;w<I.geometries.length;w++)if(e(I.geometries[w],_,m)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function t(y,_,m,w){var E=m;return e(y,function(b,I,T,D,x){I===0&&m===void 0?E=b:E=_(E,b,I,T,D,x)},w),E}function n(y,_){var m;switch(y.type){case"FeatureCollection":for(m=0;m<y.features.length&&_(y.features[m].properties,m)!==!1;m++);break;case"Feature":_(y.properties,0);break}}function i(y,_,m){var w=m;return n(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function s(y,_){if(y.type==="Feature")_(y,0);else if(y.type==="FeatureCollection")for(var m=0;m<y.features.length&&_(y.features[m],m)!==!1;m++);}function o(y,_,m){var w=m;return s(y,function(E,b){b===0&&m===void 0?w=E:w=_(w,E,b)}),w}function a(y){var _=[];return e(y,function(m){_.push(m)}),_}function u(y,_){var m,w,E,b,I,T,D,x,O,L,F=0,J=y.type==="FeatureCollection",q=y.type==="Feature",Q=J?y.features.length:1;for(m=0;m<Q;m++){for(T=J?y.features[m].geometry:q?y.geometry:y,x=J?y.features[m].properties:q?y.properties:{},O=J?y.features[m].bbox:q?y.bbox:void 0,L=J?y.features[m].id:q?y.id:void 0,D=T?T.type==="GeometryCollection":!1,I=D?T.geometries.length:1,E=0;E<I;E++){if(b=D?T.geometries[E]:T,b===null){if(_(null,F,x,O,L)===!1)return!1;continue}switch(b.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(b,F,x,O,L)===!1)return!1;break}case"GeometryCollection":{for(w=0;w<b.geometries.length;w++)if(_(b.geometries[w],F,x,O,L)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}F++}}function l(y,_,m){var w=m;return u(y,function(E,b,I,T,D){b===0&&m===void 0?w=E:w=_(w,E,b,I,T,D)}),w}function c(y,_){u(y,function(m,w,E,b,I){var T=m===null?null:m.type;switch(T){case null:case"Point":case"LineString":case"Polygon":return _(r.feature(m,E,{bbox:b,id:I}),w,0)===!1?!1:void 0}var D;switch(T){case"MultiPoint":D="Point";break;case"MultiLineString":D="LineString";break;case"MultiPolygon":D="Polygon";break}for(var x=0;x<m.coordinates.length;x++){var O=m.coordinates[x],L={type:D,coordinates:O};if(_(r.feature(L,E),w,x)===!1)return!1}})}function h(y,_,m){var w=m;return c(y,function(E,b,I){b===0&&I===0&&m===void 0?w=E:w=_(w,E,b,I)}),w}function f(y,_){c(y,function(m,w,E){var b=0;if(m.geometry){var I=m.geometry.type;if(!(I==="Point"||I==="MultiPoint")){var T,D=0,x=0,O=0;if(e(m,function(L,F,J,q,Q){if(T===void 0||w>D||q>x||Q>O){T=L,D=w,x=q,O=Q,b=0;return}var ct=r.lineString([T,L],m.properties);if(_(ct,w,E,Q,b)===!1)return!1;b++,T=L})===!1)return!1}}})}function p(y,_,m){var w=m,E=!1;return f(y,function(b,I,T,D,x){E===!1&&m===void 0?w=b:w=_(w,b,I,T,D,x),E=!0}),w}function v(y,_){if(!y)throw new Error("geojson is required");c(y,function(m,w,E){if(m.geometry!==null){var b=m.geometry.type,I=m.geometry.coordinates;switch(b){case"LineString":if(_(m,w,E,0,0)===!1)return!1;break;case"Polygon":for(var T=0;T<I.length;T++)if(_(r.lineString(I[T],m.properties),w,E,T)===!1)return!1;break}}})}function C(y,_,m){var w=m;return v(y,function(E,b,I,T){b===0&&m===void 0?w=E:w=_(w,E,b,I,T)}),w}function S(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.segmentIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":case"MultiPoint":return null;case"LineString":return b<0&&(b=D.length+b-1),r.lineString([D[b],D[b+1]],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b-1),r.lineString([D[E][b],D[E][b+1]],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b-1),r.lineString([D[w][b],D[w][b+1]],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b-1),r.lineString([D[w][E][b],D[w][E][b+1]],I,_)}throw new Error("geojson is invalid")}function P(y,_){if(_=_||{},!r.isObject(_))throw new Error("options is invalid");var m=_.featureIndex||0,w=_.multiFeatureIndex||0,E=_.geometryIndex||0,b=_.coordIndex||0,I=_.properties,T;switch(y.type){case"FeatureCollection":m<0&&(m=y.features.length+m),I=I||y.features[m].properties,T=y.features[m].geometry;break;case"Feature":I=I||y.properties,T=y.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":T=y;break;default:throw new Error("geojson is invalid")}if(T===null)return null;var D=T.coordinates;switch(T.type){case"Point":return r.point(D,I,_);case"MultiPoint":return w<0&&(w=D.length+w),r.point(D[w],I,_);case"LineString":return b<0&&(b=D.length+b),r.point(D[b],I,_);case"Polygon":return E<0&&(E=D.length+E),b<0&&(b=D[E].length+b),r.point(D[E][b],I,_);case"MultiLineString":return w<0&&(w=D.length+w),b<0&&(b=D[w].length+b),r.point(D[w][b],I,_);case"MultiPolygon":return w<0&&(w=D.length+w),E<0&&(E=D[w].length+E),b<0&&(b=D[w][E].length-b),r.point(D[w][E][b],I,_)}throw new Error("geojson is invalid")}return Ie.coordAll=a,Ie.coordEach=e,Ie.coordReduce=t,Ie.featureEach=s,Ie.featureReduce=o,Ie.findPoint=P,Ie.findSegment=S,Ie.flattenEach=c,Ie.flattenReduce=h,Ie.geomEach=u,Ie.geomReduce=l,Ie.lineEach=v,Ie.lineReduce=C,Ie.propEach=n,Ie.propReduce=i,Ie.segmentEach=f,Ie.segmentReduce=p,Ie}var Kl={},sm;function Gw(){if(sm)return Kl;sm=1,Object.defineProperty(Kl,"__esModule",{value:!0});var r=im();function e(t){var n=[1/0,1/0,-1/0,-1/0];return r.coordEach(t,function(i){n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]<i[0]&&(n[2]=i[0]),n[3]<i[1]&&(n[3]=i[1])}),n}return e.default=e,Kl.default=e,Kl}var om;function Ww(){if(om)return Zl.exports;om=1;var r=qg(),e=nm(),t=im(),n=Gw().default,i=t.featureEach;t.coordEach,e.polygon;var s=e.featureCollection;function o(a){var u=new r(a);return u.insert=function(l){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.insert.call(this,l)},u.load=function(l){var c=[];return Array.isArray(l)?l.forEach(function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}):i(l,function(h){if(h.type!=="Feature")throw new Error("invalid features");h.bbox=h.bbox?h.bbox:n(h),c.push(h)}),r.prototype.load.call(this,c)},u.remove=function(l,c){if(l.type!=="Feature")throw new Error("invalid feature");return l.bbox=l.bbox?l.bbox:n(l),r.prototype.remove.call(this,l,c)},u.clear=function(){return r.prototype.clear.call(this)},u.search=function(l){var c=r.prototype.search.call(this,this.toBBox(l));return s(c)},u.collides=function(l){return r.prototype.collides.call(this,this.toBBox(l))},u.all=function(){var l=r.prototype.all.call(this);return s(l)},u.toJSON=function(){return r.prototype.toJSON.call(this)},u.fromJSON=function(l){return r.prototype.fromJSON.call(this,l)},u.toBBox=function(l){var c;if(l.bbox)c=l.bbox;else if(Array.isArray(l)&&l.length===4)c=l;else if(Array.isArray(l)&&l.length===6)c=[l[0],l[1],l[3],l[4]];else if(l.type==="Feature")c=n(l);else if(l.type==="FeatureCollection")c=n(l);else throw new Error("invalid geojson");return{minX:c[0],minY:c[1],maxX:c[2],maxY:c[3]}},u}return Zl.exports=o,Zl.exports.default=o,Zl.exports}var qw=Ww();const Hw=Lh(qw);function am(r,e){var t={},n=[];if(r.type==="LineString"&&(r=Ar(r)),e.type==="LineString"&&(e=Ar(e)),r.type==="Feature"&&e.type==="Feature"&&r.geometry!==null&&e.geometry!==null&&r.geometry.type==="LineString"&&e.geometry.type==="LineString"&&r.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=um(r,e);return i&&n.push(i),na(n)}var s=Hw();return s.load(tm(e)),ql(tm(r),function(o){ql(s.search(o),function(a){var u=um(o,a);if(u){var l=no(u).join(",");t[l]||(t[l]=!0,n.push(u))}})}),na(n)}function um(r,e){var t=no(r),n=no(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=t[0][0],s=t[0][1],o=t[1][0],a=t[1][1],u=n[0][0],l=n[0][1],c=n[1][0],h=n[1][1],f=(h-l)*(o-i)-(c-u)*(a-s),p=(c-u)*(s-l)-(h-l)*(i-u),v=(o-i)*(s-l)-(a-s)*(i-u);if(f===0)return null;var C=p/f,S=v/f;if(C>=0&&C<=1&&S>=0&&S<=1){var P=i+C*(o-i),y=s+C*(a-s);return Jt([P,y])}return null}function Xw(r,e){return am(Fr(r),Fr(e))}function Yw(r,e){var t=Ui(r,e),n=Ru(r,e),i=ra(r,t/2,n);return i}function Jw(r,e){const t=Jt(r),n=Jt(e),i=Yw(t,n),s=(r[2]+e[2])/2;return[...i.geometry.coordinates,s]}function Zw(r,e,t){t===void 0&&(t={});var n=Jt([1/0,1/0],{dist:1/0}),i=0;return Xh(r,function(s){for(var o=no(s),a=0;a<o.length-1;a++){var u=Jt(o[a]);u.properties.dist=Ui(e,u,t);var l=Jt(o[a+1]);l.properties.dist=Ui(e,l,t);var c=Ui(u,l,t),h=Math.max(u.properties.dist,l.properties.dist),f=Ru(u,l),p=ra(e,h,f+90,t),v=ra(e,h,f-90,t),C=am(Fr([p.geometry.coordinates,v.geometry.coordinates]),Fr([u.geometry.coordinates,l.geometry.coordinates])),S=null;C.features.length>0&&(S=C.features[0],S.properties.dist=Ui(e,S,t),S.properties.location=i+Ui(u,S,t)),u.properties.dist<n.properties.dist&&(n=u,n.properties.index=a,n.properties.location=i),l.properties.dist<n.properties.dist&&(n=l,n.properties.index=a+1,n.properties.location=i+c),S&&S.properties.dist<n.properties.dist&&(n=S,n.properties.index=a),i+=c}}),n}function Kw(r,e){const t=Jt(e),n=Fr(r);return Zw(n,t,{units:"meters"})}function lm(r,e,t){t===void 0&&(t={});var n=bn(r),i=bn(e);i[0]+=i[0]-n[0]>180?-360:n[0]-i[0]>180?360:0;var s=Qw(n,i),o=Hh(s,"meters",t.units);return o}function Qw(r,e,t){t=t===void 0?Qe:Number(t);var n=t,i=r[1]*Math.PI/180,s=e[1]*Math.PI/180,o=s-i,a=Math.abs(e[0]-r[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?o/u:Math.cos(i),c=Math.sqrt(o*o+l*l*a*a),h=c*n;return h}function $w(r,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!r)throw new Error("pt is required");if(Array.isArray(r)?r=Jt(r):r.type==="Point"?r=Ar(r):jg(r,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Fr(e):e.type==="LineString"?e=Ar(e):jg(e,"LineString","line");var n=1/0,i=r.geometry.coordinates;return Sw(e,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],u=tE(i,o,a,t);u<n&&(n=u)}),Hh(n,"degrees",t.units)}function tE(r,e,t,n){var i=[t[0]-e[0],t[1]-e[1]],s=[r[0]-e[0],r[1]-e[1]],o=cm(s,i);if(o<=0)return $h(r,e,{method:n.method,units:"degrees"});var a=cm(i,i);if(a<=o)return $h(r,t,{method:n.method,units:"degrees"});var u=o/a,l=[e[0]+u*i[0],e[1]+u*i[1]];return $h(r,l,{method:n.method,units:"degrees"})}function cm(r,e){return r[0]*e[0]+r[1]*e[1]}function $h(r,e,t){return t.method==="planar"?lm(r,e,t):Ui(r,e,t)}function eE(r,e){const t=Jt(r),n=Fr(e);return $w(t,n,{units:"meters"})}function nE(r,e,t,n){n===void 0&&(n={});var i=e<0,s=Hh(Math.abs(e),n.units,"meters");i&&(s=-Math.abs(s));var o=bn(r),a=rE(o,s,t);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Jt(a,n.properties)}function rE(r,e,t,n){n=n===void 0?Qe:Number(n);var i=e/n,s=r[0]*Math.PI/180,o=ln(r[1]),a=ln(t),u=i*Math.cos(a),l=o+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(o),f=i*Math.sin(a)/h,p=s+f;return[(p*180/Math.PI+540)%360-180,l*180/Math.PI]}function iE(r,e,t,n){const[i,s,o]=r,a=nE(Jt([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return n=n||[0,0,0],n[0]=a.geometry.coordinates[0],n[1]=a.geometry.coordinates[1],n[2]=o,n}function hm(r,e){return lm(Jt(r),Jt(e),{units:"meters"})}function sE(r,e,t){t===void 0&&(t={});var n;t.final?n=dm(bn(e),bn(r)):n=dm(bn(r),bn(e));var i=n>180?-(360-n):n;return i}function dm(r,e){var t=ln(r[1]),n=ln(e[1]),i=ln(e[0]-r[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,s);return(Wl(o)+360)%360}function oE(r,e){return sE(Jt(r),Jt(e))}function kr(r){var e=[1/0,1/0,-1/0,-1/0];return ia(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}kr.default=kr;function Vr(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=bn(r),i=Hn(e),s=i.type,o=e.bbox,a=i.coordinates;if(o&&aE(n,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var u=!1,l=0;l<a.length&&!u;l++)if(fm(n,a[l][0],t.ignoreBoundary)){for(var c=!1,h=1;h<a[l].length&&!c;)fm(n,a[l][h],!t.ignoreBoundary)&&(c=!0),h++;c||(u=!0)}return u}function fm(r,e,t){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,s=e.length-1;i<e.length;s=i++){var o=e[i][0],a=e[i][1],u=e[s][0],l=e[s][1],c=r[1]*(o-u)+a*(u-r[0])+l*(r[0]-o)===0&&(o-r[0])*(u-r[0])<=0&&(a-r[1])*(l-r[1])<=0;if(c)return!t;var h=a>r[1]!=l>r[1]&&r[0]<(u-o)*(r[1]-a)/(l-a)+o;h&&(n=!n)}return n}function aE(r,e){return e[0]<=r[0]&&e[1]<=r[1]&&e[2]>=r[0]&&e[3]>=r[1]}function Gi(r,e,t){t===void 0&&(t={});for(var n=bn(r),i=no(e),s=0;s<i.length-1;s++){var o=!1;if(t.ignoreEndVertices&&(s===0&&(o="start"),s===i.length-2&&(o="end"),s===0&&s+1===i.length-1&&(o="both")),uE(i[s],i[s+1],n,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function uE(r,e,t,n,i){var s=t[0],o=t[1],a=r[0],u=r[1],l=e[0],c=e[1],h=t[0]-a,f=t[1]-u,p=l-a,v=c-u,C=h*v-f*p;if(i!==null){if(Math.abs(C)>i)return!1}else if(C!==0)return!1;if(n){if(n==="start")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<=l:l<=s&&s<a:v>0?u<o&&o<=c:c<=o&&o<u;if(n==="end")return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<l:l<s&&s<=a:v>0?u<=o&&o<c:c<o&&o<=u;if(n==="both")return Math.abs(p)>=Math.abs(v)?p>0?a<s&&s<l:l<s&&s<a:v>0?u<o&&o<c:c<o&&o<u}else return Math.abs(p)>=Math.abs(v)?p>0?a<=s&&s<=l:l<=s&&s<=a:v>0?u<=o&&o<=c:c<=o&&o<=u;return!1}function lE(r,e){var t=Hn(r),n=Hn(e),i=t.type,s=n.type,o=t.coordinates,a=n.coordinates;switch(i){case"Point":switch(s){case"Point":return td(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return cE(t,n);case"MultiPoint":return hE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Gi(n,t,{ignoreEndVertices:!0});case"LineString":return pE(t,n);case"MultiPoint":return dE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Vr(n,t,{ignoreBoundary:!0});case"LineString":return gE(t,n);case"Polygon":return mE(t,n);case"MultiPoint":return fE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function cE(r,e){var t,n=!1;for(t=0;t<r.coordinates.length;t++)if(td(r.coordinates[t],e.coordinates)){n=!0;break}return n}function hE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){for(var i=n[t],s=!1,o=0,a=r.coordinates;o<a.length;o++){var u=a[o];if(td(i,u)){s=!0;break}}if(!s)return!1}return!0}function dE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Gi(s,r,{ignoreEndVertices:!0})&&(t=!0),!Gi(s,r))return!1}return!!t}function fE(r,e){for(var t=0,n=e.coordinates;t<n.length;t++){var i=n[t];if(!Vr(i,r,{ignoreBoundary:!0}))return!1}return!0}function pE(r,e){for(var t=!1,n=0,i=e.coordinates;n<i.length;n++){var s=i[n];if(Gi({type:"Point",coordinates:s},r,{ignoreEndVertices:!0})&&(t=!0),!Gi({type:"Point",coordinates:s},r,{ignoreEndVertices:!1}))return!1}return t}function gE(r,e){var t=!1,n=0,i=kr(r),s=kr(e);if(!pm(i,s))return!1;for(n;n<e.coordinates.length-1;n++){var o=vE(e.coordinates[n],e.coordinates[n+1]);if(Vr({type:"Point",coordinates:o},r,{ignoreBoundary:!0})){t=!0;break}}return t}function mE(r,e){if(r.type==="Feature"&&r.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=kr(r),n=kr(e);if(!pm(t,n))return!1;for(var i=Hn(e).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],u=0,l=a;u<l.length;u++){var c=l[u];if(!Vr(c,r))return!1}return!0}function pm(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function td(r,e){return r[0]===e[0]&&r[1]===e[1]}function vE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function yE(r,e){var t=Hn(r),n=Hn(e),i=t.type,s=n.type;switch(i){case"Point":switch(s){case"MultiPoint":return _E(t,n);case"LineString":return Gi(t,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Vr(t,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return wE(t,n);case"LineString":return EE(t,n);case"Polygon":case"MultiPolygon":return CE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return SE(t,n);case"Polygon":case"MultiPolygon":return bE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return PE(t,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function _E(r,e){var t,n=!1;for(t=0;t<e.coordinates.length;t++)if(mm(e.coordinates[t],r.coordinates)){n=!0;break}return n}function wE(r,e){for(var t=0;t<r.coordinates.length;t++){for(var n=!1,i=0;i<e.coordinates.length;i++)mm(r.coordinates[t],e.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function EE(r,e){for(var t=!1,n=0;n<r.coordinates.length;n++){if(!Gi(r.coordinates[n],e))return!1;t||(t=Gi(r.coordinates[n],e,{ignoreEndVertices:!0}))}return t}function CE(r,e){for(var t=!0,n=!1,i=0;i<r.coordinates.length;i++){if(n=Vr(r.coordinates[1],e),!n){t=!1;break}n=Vr(r.coordinates[1],e,{ignoreBoundary:!0})}return t&&n}function SE(r,e){for(var t=0;t<r.coordinates.length;t++)if(!Gi(r.coordinates[t],e))return!1;return!0}function bE(r,e){var t=kr(e),n=kr(r);if(!gm(t,n))return!1;for(var i=!1,s=0;s<r.coordinates.length-1;s++){if(!Vr(r.coordinates[s],e))return!1;if(i||(i=Vr(r.coordinates[s],e,{ignoreBoundary:!0})),!i){var o=IE(r.coordinates[s],r.coordinates[s+1]);i=Vr(o,e,{ignoreBoundary:!0})}}return i}function PE(r,e){var t=kr(r),n=kr(e);if(!gm(n,t))return!1;for(var i=0;i<r.coordinates[0].length;i++)if(!Vr(r.coordinates[0][i],e))return!1;return!0}function gm(r,e){return!(r[0]>e[0]||r[2]<e[2]||r[1]>e[1]||r[3]<e[3])}function mm(r,e){return r[0]===e[0]&&r[1]===e[1]}function IE(r,e){return[(r[0]+e[0])/2,(r[1]+e[1])/2]}function xE(r,e){e===void 0&&(e={});var t=kr(r),n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Jt([n,i],e.properties,e)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var t=Object(this),n=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(s=s<0?Math.max(n+arguments[2],0):Math.min(s,n);i<s;)t[i]=e,++i;return t},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var ro=function(){};ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},ro.prototype.equalsWithTolerance=function(e,t,n){return Math.abs(e-t)<=n};var Xt=function(r){function e(t){r.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),ht=function(){},vm={MAX_VALUE:{configurable:!0}};ht.isNaN=function(e){return Number.isNaN(e)},ht.doubleToLongBits=function(e){return e},ht.longBitsToDouble=function(e){return e},ht.isInfinite=function(e){return!Number.isFinite(e)},vm.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ht,vm);var Ln=function(){},Ql=function(){},sa=function(){};function An(){}var M=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},io={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};M.prototype.setOrdinate=function(e,t){switch(e){case M.X:this.x=t;break;case M.Y:this.y=t;break;case M.Z:this.z=t;break;default:throw new Xt("Invalid ordinate index: "+e)}},M.prototype.equals2D=function(){if(arguments.length===1){var e=arguments[0];return!(this.x!==e.x||this.y!==e.y)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return!(!ro.equalsWithTolerance(this.x,t.x,n)||!ro.equalsWithTolerance(this.y,t.y,n))}},M.prototype.getOrdinate=function(e){switch(e){case M.X:return this.x;case M.Y:return this.y;case M.Z:return this.z}throw new Xt("Invalid ordinate index: "+e)},M.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ht.isNaN(this.z))&&ht.isNaN(e.z)},M.prototype.equals=function(e){return e instanceof M?this.equals2D(e):!1},M.prototype.equalInZ=function(e,t){return ro.equalsWithTolerance(this.z,e.z,t)},M.prototype.compareTo=function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},M.prototype.clone=function(){},M.prototype.copy=function(){return new M(this)},M.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},M.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+n*n+i*i)},M.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},M.prototype.hashCode=function(){var e=17;return e=37*e+M.hashCode(this.x),e=37*e+M.hashCode(this.y),e},M.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},M.prototype.interfaces_=function(){return[Ln,Ql,An]},M.prototype.getClass=function(){return M},M.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ht.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},io.DimensionalComparator.get=function(){return Wi},io.serialVersionUID.get=function(){return 6683108902428367e3},io.NULL_ORDINATE.get=function(){return ht.NaN},io.X.get=function(){return 0},io.Y.get=function(){return 1},io.Z.get=function(){return 2},Object.defineProperties(M,io);var Wi=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Xt("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};Wi.prototype.compare=function(e,t){var n=e,i=t,s=Wi.compare(n.x,i.x);if(s!==0)return s;var o=Wi.compare(n.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Wi.compare(n.z,i.z);return a},Wi.prototype.interfaces_=function(){return[sa]},Wi.prototype.getClass=function(){return Wi},Wi.compare=function(e,t){return e<t?-1:e>t?1:ht.isNaN(e)?ht.isNaN(t)?0:-1:ht.isNaN(t)?1:0};var oa=function(){};oa.prototype.create=function(){},oa.prototype.interfaces_=function(){return[]},oa.prototype.getClass=function(){return oa};var A=function(){},ku={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};A.prototype.interfaces_=function(){return[]},A.prototype.getClass=function(){return A},A.toLocationSymbol=function(e){switch(e){case A.EXTERIOR:return"e";case A.BOUNDARY:return"b";case A.INTERIOR:return"i";case A.NONE:return"-"}throw new Xt("Unknown location value: "+e)},ku.INTERIOR.get=function(){return 0},ku.BOUNDARY.get=function(){return 1},ku.EXTERIOR.get=function(){return 2},ku.NONE.get=function(){return-1},Object.defineProperties(A,ku);var at=function(r,e){return r.interfaces_&&r.interfaces_().indexOf(e)>-1},Pn=function(){},ym={LOG_10:{configurable:!0}};Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.log10=function(e){var t=Math.log(e);return ht.isInfinite(t)||ht.isNaN(t)?t:t/Pn.LOG_10},Pn.min=function(e,t,n,i){var s=e;return t<s&&(s=t),n<s&&(s=n),i<s&&(s=i),s},Pn.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],n=arguments[2];return e<t?t:e>n?n:e}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1],o=arguments[2];return i<s?s:i>o?o:i}},Pn.wrap=function(e,t){return e<0?t- -e%t:e%t},Pn.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2],i=e;return t>i&&(i=t),n>i&&(i=n),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=s;return o>l&&(l=o),a>l&&(l=a),u>l&&(l=u),l}},Pn.average=function(e,t){return(e+t)/2},ym.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pn,ym);var or=function(e){this.str=e};or.prototype.append=function(e){this.str+=e},or.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},or.prototype.toString=function(e){return this.str};var ar=function(e){this.value=e};ar.prototype.intValue=function(){return this.value},ar.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},ar.isNaN=function(e){return Number.isNaN(e)};var Vu=function(){};Vu.isWhitespace=function(e){return e<=32&&e>=0||e===127},Vu.toUpperCase=function(e){return e.toUpperCase()};var k=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},Xn={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};k.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},k.prototype.extractSignificantDigits=function(e,t){var n=this.abs(),i=k.magnitude(n._hi),s=k.TEN.pow(i);n=n.divide(s),n.gt(k.TEN)?(n=n.divide(k.TEN),i+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),i-=1);for(var o=i+1,a=new or,u=k.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){e&&l===o&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,f=0;c>9?(h=!0,f="9"):f="0"+c,a.append(f),n=n.subtract(k.valueOf(c)).multiply(k.TEN),h&&n.selfAdd(k.TEN);var p=!0,v=k.magnitude(n._hi);if(v<0&&Math.abs(v)>=u-l&&(p=!1),!p)break}return t[0]=i,a.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}},k.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},k.prototype.isZero=function(){return this._hi===0&&this._lo===0},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(e){return this.le(e)?this:e},k.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfDivide(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/n,c=k.SPLIT*l,s=c-l,f=k.SPLIT*n,s=c-s,o=l-s,a=f-n,h=l*n,a=f-a,u=n-a,f=s*a-h+s*u+o*a+o*u,c=(this._hi-h-f+this._lo-l*i)/n,f=l+c,this._hi=f,this._lo=l-f+c,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var e=arguments[0],t=null,n=null,i=null,s=null,o=null,a=null,u=null,l=null;o=this._hi/e._hi,a=k.SPLIT*o,t=a-o,l=k.SPLIT*e._hi,t=a-t,n=o-t,i=l-e._hi,u=o*e._hi,i=l-i,s=e._hi-i,l=t*i-u+t*s+n*i+n*s,a=(this._hi-u-l+this._lo-o*e._lo)/e._hi,l=o+a;var c=l,h=o-l+a;return new k(c,h)}else if(typeof arguments[0]=="number"){var f=arguments[0];return ht.isNaN(f)?k.createNaN():k.copy(this).selfDivide(f,0)}},k.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},k.prototype.pow=function(e){if(e===0)return k.valueOf(1);var t=new k(this),n=k.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new k(e,t)},k.prototype.compareTo=function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0},k.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}},k.prototype.max=function(e){return this.ge(e)?this:e},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=k.valueOf(t),i=this.subtract(n.sqr()),s=i._hi*(e*.5);return n.add(s)},k.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],n=null,i=null,s=null,o=null,a=null,u=null;return s=this._hi+t,a=s-this._hi,o=s-a,o=t-a+(this._hi-o),u=o+this._lo,n=s+u,i=u+(s-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],h=null,f=null,p=null,v=null,C=null,S=null,P=null,y=null;C=this._hi+l,p=this._lo+c,P=C-this._hi,y=p-this._lo,S=C-P,v=p-y,S=l-P+(this._hi-S),v=c-y+(this._lo-v),P=S+p,h=C+P,f=P+(C-h),P=v+f;var _=h+P,m=P+(h-_);return this._hi=_,this._lo=m,this}},k.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof k){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.selfMultiply(t,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=null,o=null,a=null,u=null,l=null,c=null;l=k.SPLIT*this._hi,s=l-this._hi,c=k.SPLIT*n,s=l-s,o=this._hi-s,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=s*a-l+s*u+o*a+o*u+(this._hi*i+this._lo*n);var h=l+c;s=l-h;var f=c+s;return this._hi=h,this._lo=f,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new k(e,t)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var e=arguments[0];return e.isNaN()?k.createNaN():k.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ht.isNaN(t)?k.createNaN():k.copy(this).selfMultiply(t,0)}},k.prototype.isNaN=function(){return ht.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var e=k.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),i=t[0]+1,s=n;if(n.charAt(0)===".")s="0"+n;else if(i<0)s="0."+k.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var o=i-n.length,a=k.stringOfChar("0",o);s=n+a+".0"}return this.isNegative()?"-"+s:s},k.prototype.reciprocal=function(){var e=null,t=null,n=null,i=null,s=null,o=null,a=null,u=null;s=1/this._hi,o=k.SPLIT*s,e=o-s,u=k.SPLIT*this._hi,e=o-e,t=s-e,n=u-this._hi,a=s*this._hi,n=u-n,i=this._hi-n,u=e*n-a+e*i+t*n+t*i,o=(1-a-u-s*this._lo)/this._hi;var l=s+o,c=s-l+o;return new k(l,c)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),i=k.SCI_NOT_EXPONENT_CHAR+t[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var s="";n.length>1&&(s=n.substring(1));var o=n.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},k.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var e=arguments[0];return k.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return k.copy(this).selfAdd(t)}},k.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof k){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},k.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},k.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[An,Ln,Ql]},k.prototype.getClass=function(){return k},k.sqr=function(e){return k.valueOf(e).selfMultiply(e)},k.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return k.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new k(t)}},k.sqrt=function(e){return k.valueOf(e).sqrt()},k.parse=function(e){for(var t=0,n=e.length;Vu.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<n){var s=e.charAt(t);(s==="-"||s==="+")&&(t++,s==="-"&&(i=!0))}for(var o=new k,a=0,u=0,l=0;!(t>=n);){var c=e.charAt(t);if(t++,Vu.isDigit(c)){var h=c-"0";o.selfMultiply(k.TEN),o.selfAdd(h),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var f=e.substring(t);try{l=ar.parseInt(f)}catch(P){throw P instanceof Error?new Error("Invalid exponent "+f+" in string "+e):P}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+t+" in string "+e)}var p=o,v=a-u-l;if(v===0)p=o;else if(v>0){var C=k.TEN.pow(v);p=o.divide(C)}else if(v<0){var S=k.TEN.pow(-v);p=o.multiply(S)}return i?p.negate():p},k.createNaN=function(){return new k(ht.NaN,ht.NaN)},k.copy=function(e){return new k(e)},k.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(n)),s=Math.pow(10,i);return s*10<=t&&(i+=1),i},k.stringOfChar=function(e,t){for(var n=new or,i=0;i<t;i++)n.append(e);return n.toString()},Xn.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},Xn.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},Xn.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},Xn.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},Xn.NaN.get=function(){return new k(ht.NaN,ht.NaN)},Xn.EPS.get=function(){return 123259516440783e-46},Xn.SPLIT.get=function(){return 134217729},Xn.MAX_PRINT_DIGITS.get=function(){return 32},Xn.TEN.get=function(){return k.valueOf(10)},Xn.ONE.get=function(){return k.valueOf(1)},Xn.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Xn.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,Xn);var $e=function(){},_m={DP_SAFE_EPSILON:{configurable:!0}};$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.orientationIndex=function(e,t,n){var i=$e.orientationIndexFilter(e,t,n);if(i<=1)return i;var s=k.valueOf(t.x).selfAdd(-e.x),o=k.valueOf(t.y).selfAdd(-e.y),a=k.valueOf(n.x).selfAdd(-t.x),u=k.valueOf(n.y).selfAdd(-t.y);return s.selfMultiply(u).selfSubtract(o.selfMultiply(a)).signum()},$e.signOfDet2x2=function(e,t,n,i){var s=e.multiply(i).selfSubtract(t.multiply(n));return s.signum()},$e.intersection=function(e,t,n,i){var s=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(e.x)),o=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(e.y)),a=s.subtract(o),u=k.valueOf(i.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),l=k.valueOf(i.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),c=u.subtract(l),h=c.selfDivide(a).doubleValue(),f=k.valueOf(e.x).selfAdd(k.valueOf(t.x).selfSubtract(e.x).selfMultiply(h)).doubleValue(),p=k.valueOf(t.x).selfSubtract(e.x).selfMultiply(k.valueOf(e.y).selfSubtract(n.y)),v=k.valueOf(t.y).selfSubtract(e.y).selfMultiply(k.valueOf(e.x).selfSubtract(n.x)),C=p.subtract(v),S=C.selfDivide(a).doubleValue(),P=k.valueOf(n.y).selfAdd(k.valueOf(i.y).selfSubtract(n.y).selfMultiply(S)).doubleValue();return new M(f,P)},$e.orientationIndexFilter=function(e,t,n){var i=null,s=(e.x-n.x)*(t.y-n.y),o=(e.y-n.y)*(t.x-n.x),a=s-o;if(s>0){if(o<=0)return $e.signum(a);i=s+o}else if(s<0){if(o>=0)return $e.signum(a);i=-s-o}else return $e.signum(a);var u=$e.DP_SAFE_EPSILON*i;return a>=u||-a>=u?$e.signum(a):2},$e.signum=function(e){return e>0?1:e<0?-1:0},_m.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties($e,_m);var xt=function(){},Bu={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Bu.X.get=function(){return 0},Bu.Y.get=function(){return 1},Bu.Z.get=function(){return 2},Bu.M.get=function(){return 3},xt.prototype.setOrdinate=function(e,t,n){},xt.prototype.size=function(){},xt.prototype.getOrdinate=function(e,t){},xt.prototype.getCoordinate=function(){},xt.prototype.getCoordinateCopy=function(e){},xt.prototype.getDimension=function(){},xt.prototype.getX=function(e){},xt.prototype.clone=function(){},xt.prototype.expandEnvelope=function(e){},xt.prototype.copy=function(){},xt.prototype.getY=function(e){},xt.prototype.toCoordinateArray=function(){},xt.prototype.interfaces_=function(){return[Ql]},xt.prototype.getClass=function(){return xt},Object.defineProperties(xt,Bu);var wm=function(){},aa=function(r){function e(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wm),xe=function(){};xe.arraycopy=function(e,t,n,i,s){for(var o=0,a=t;a<t+s;a++)n[i+o]=e[a],o++},xe.getProperty=function(e){return{"line.separator":`
|
|
42
|
-
`}[e]};var Yn=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var h=arguments[0],f=arguments[1],p=arguments[2],v=arguments[3],C=h.y-f.y,S=f.x-h.x,P=h.x*f.y-f.x*h.y,y=p.y-v.y,_=v.x-p.x,m=p.x*v.y-v.x*p.y;this.x=S*m-_*P,this.y=y*P-C*m,this.w=C*_-y*S}};Yn.prototype.getY=function(){var e=this.y/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new aa;return e},Yn.prototype.getX=function(){var e=this.x/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new aa;return e},Yn.prototype.getCoordinate=function(){var e=new M;return e.x=this.getX(),e.y=this.getY(),e},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.intersection=function(e,t,n,i){var s=e.y-t.y,o=t.x-e.x,a=e.x*t.y-t.x*e.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=o*c-l*a,f=u*a-s*c,p=s*l-u*o,v=h/p,C=f/p;if(ht.isNaN(v)||ht.isInfinite(v)||ht.isNaN(C)||ht.isInfinite(C))throw new aa;return new M(v,C)};var $=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},Em={serialVersionUID:{configurable:!0}};$.prototype.getArea=function(){return this.getWidth()*this.getHeight()},$.prototype.equals=function(e){if(!(e instanceof $))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()},$.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new $;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,i=this._maxx<e._maxx?this._maxx:e._maxx,s=this._maxy<e._maxy?this._maxy:e._maxy;return new $(t,i,n,s)},$.prototype.isNull=function(){return this._maxx<this._minx},$.prototype.getMaxX=function(){return this._maxx},$.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];return this.covers(e.x,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];return this.isNull()||t.isNull()?!1:t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},$.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof $){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}else if(arguments[0]instanceof M){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},$.prototype.getMinY=function(){return this._miny},$.prototype.getMinX=function(){return this._minx},$.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},$.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},$.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},$.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0},$.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},$.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},$.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},$.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},$.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},$.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},$.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof $){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof M){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},$.prototype.centre=function(){return this.isNull()?null:new M((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},$.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},$.prototype.getMaxY=function(){return this._maxy},$.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)},$.prototype.hashCode=function(){var e=17;return e=37*e+M.hashCode(this._minx),e=37*e+M.hashCode(this._maxx),e=37*e+M.hashCode(this._miny),e=37*e+M.hashCode(this._maxy),e},$.prototype.interfaces_=function(){return[Ln,An]},$.prototype.getClass=function(){return $},$.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),c=Math.min(i.x,s.x),h=Math.max(i.x,s.x);return!(c>l||h<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),c=Math.min(i.y,s.y),h=Math.max(i.y,s.y),c>l)||h<u)}},Em.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties($,Em);var ur={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},$l=function(e){this.geometryFactory=e||new Ct};$l.prototype.read=function(e){var t,n,i;e=e.replace(/[\n\r]/g," ");var s=ur.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(s=ur.emptyTypeStr.exec(e),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],ua[n]&&(t=ua[n].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t},$l.prototype.write=function(e){return this.extractGeometry(e)},$l.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!pi[t])return null;var n=t.toUpperCase(),i;return e.isEmpty()?i=n+" EMPTY":i=n+"("+pi[t].apply(this,[e])+")",i};var pi={coordinate:function(e){return e.x+" "+e.y},point:function(e){return pi.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.point.apply(t,[e._geometries[i]])+")");return n.join(",")},linestring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(pi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},linearring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(pi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},multilinestring:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.linestring.apply(t,[e._geometries[i]])+")");return n.join(",")},polygon:function(e){var t=this,n=[];n.push("("+pi.linestring.apply(this,[e._shell])+")");for(var i=0,s=e._holes.length;i<s;++i)n.push("("+pi.linestring.apply(t,[e._holes[i]])+")");return n.join(",")},multipolygon:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.polygon.apply(t,[e._geometries[i]])+")");return n.join(",")},geometrycollection:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push(t.extractGeometry(e._geometries[i]));return n.join(",")}},ua={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(ur.spaces);return this.geometryFactory.createPoint(new M(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=e.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.point.apply(t,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ur.spaces),n.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ur.spaces),n.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=e.trim().split(ur.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.linestring.apply(t,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=e.trim().split(ur.parenComma),a,u=[],l=0,c=o.length;l<c;++l)n=o[l].replace(ur.trimParens,"$1"),i=ua.linestring.apply(t,[n]),s=t.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=e.trim().split(ur.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.polygon.apply(t,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(e){var t=this;if(e===void 0)return this.geometryFactory.createGeometryCollection();e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=e.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(t.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},Jn=function(e){this.parser=new $l(e)};Jn.prototype.write=function(e){return this.parser.write(e)},Jn.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var gi=function(r){function e(t){r.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),tc=function(r){function e(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var t=arguments[0];r.call(this,t)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gi),vt=function(){};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.shouldNeverReachHere=function(){if(arguments.length===0)vt.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new tc("Should never reach here"+(e!==null?": "+e:""))}},vt.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],vt.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new tc:new tc(t)},vt.equals=function(){var e,t,n;if(arguments.length===2)e=arguments[0],t=arguments[1],vt.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],n=arguments[2],!t.equals(e)))throw new tc("Expected "+e+" but encountered "+t+(n!==null?": "+n:""))};var Zt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new M,this._intPt[1]=new M,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},so={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Zt.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},Zt.prototype.getTopologySummary=function(){var e=new or;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},Zt.prototype.computeIntersection=function(e,t,n,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,n,i)},Zt.prototype.getIntersectionNum=function(){return this._result},Zt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},Zt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Zt.prototype.setPrecisionModel=function(e){this._precisionModel=e},Zt.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;n<this._result;n++)if(!(e._intPt[n].equals2D(e._inputLines[t][0])||e._intPt[n].equals2D(e._inputLines[t][1])))return!0;return!1}},Zt.prototype.getIntersection=function(e){return this._intPt[e]},Zt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Zt.prototype.hasIntersection=function(){return this._result!==Zt.NO_INTERSECTION},Zt.prototype.getEdgeDistance=function(e,t){var n=Zt.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return n},Zt.prototype.isCollinear=function(){return this._result===Zt.COLLINEAR_INTERSECTION},Zt.prototype.toString=function(){return Jn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Jn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Zt.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},Zt.prototype.isIntersection=function(e){for(var t=this,n=0;n<this._result;n++)if(t._intPt[n].equals2D(e))return!0;return!1},Zt.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.computeEdgeDistance=function(e,t,n){var i=Math.abs(n.x-t.x),s=Math.abs(n.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(n))i>s?o=i:o=s;else{var a=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y);i>s?o=a:o=u,o===0&&!e.equals(t)&&(o=Math.max(a,u))}return vt.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o},Zt.nonRobustComputeEdgeDistance=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=Math.sqrt(i*i+s*s);return vt.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o},so.DONT_INTERSECT.get=function(){return 0},so.DO_INTERSECT.get=function(){return 1},so.COLLINEAR.get=function(){return 2},so.NO_INTERSECTION.get=function(){return 0},so.POINT_INTERSECTION.get=function(){return 1},so.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Zt,so);var ys=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var i=new $(this._inputLines[0][0],this._inputLines[0][1]),s=new $(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,$.intersects(i,s,n)&&H.orientationIndex(i,s,n)===0&&H.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=Yn.intersection(n,i,s,o)}catch(u){if(u instanceof aa)a=e.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},e.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new M(e.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},e.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},e.prototype.checkDD=function(n,i,s,o,a){var u=$e.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);xe.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&xe.out.println("Distance = "+a.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new M(n),u=new M(i),l=new M(s),c=new M(o),h=new M;this.normalizeToEnvCentre(a,u,l,c,h);var f=this.safeHCoordinateIntersection(a,u,l,c);return f.x+=h.x,f.y+=h.y,f},e.prototype.computeCollinearIntersection=function(n,i,s,o){var a=$.intersects(n,i,s),u=$.intersects(n,i,o),l=$.intersects(s,o,n),c=$.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,h=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,C=s.y>o.y?s.y:o.y,S=u>f?u:f,P=c<v?c:v,y=l>p?l:p,_=h<C?h:C,m=(S+P)/2,w=(y+_)/2;a.x=m,a.y=w,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!$.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=H.orientationIndex(n,i,s),u=H.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=H.orientationIndex(s,o,n),c=H.orientationIndex(s,o,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var h=a===0&&u===0&&l===0&&c===0;return h?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new M(s):u===0?this._intPt[0]=new M(o):l===0?this._intPt[0]=new M(n):c===0&&(this._intPt[0]=new M(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,i,s,o){var a=n,u=H.distancePointLine(n,s,o),l=H.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=H.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=H.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},e}(Zt),oo=function(){};oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.orientationIndex=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-t.x,a=n.y-t.y;return oo.signOfDet2x2(i,s,o,a)},oo.signOfDet2x2=function(e,t,n,i){var s=null,o=null,a=null;if(s=1,e===0||i===0)return t===0||n===0?0:t>0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return i>0?e>0?s:-s:e>0?-s:s;if(t>0?i>0?t<=i||(s=-s,o=e,e=n,n=o,o=t,t=i,i=o):t<=-i?(s=-s,n=-n,i=-i):(o=e,e=-n,n=o,o=t,t=-i,i=o):i>0?-t<=i?(s=-s,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,n=-n,i=-i):(s=-s,o=-e,e=-n,n=o,o=-t,t=-i,i=o),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(a=Math.floor(n/e),n=n-a*e,i=i-a*t,i<0)return-s;if(i>t)return s;if(e>n+n){if(t<i+i)return s}else{if(t>i+i)return-s;n=e-n,i=t-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(e/n),e=e-a*n,t=t-a*i,t<0))return s;if(t>i)return-s;if(n>e+e){if(i<t+t)return-s}else{if(i>t+t)return s;e=n-e,t=i-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var lr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};lr.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,i=t.x;return n>i&&(n=t.x,i=e.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var s=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,u=t.y-this._p.y,l=oo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},lr.prototype.isPointInPolygon=function(){return this.getLocation()!==A.EXTERIOR},lr.prototype.getLocation=function(){return this._isPointOnSegment?A.BOUNDARY:this._crossingCount%2===1?A.INTERIOR:A.EXTERIOR},lr.prototype.isOnSegment=function(){return this._isPointOnSegment},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.locatePointInRing=function(){if(arguments[0]instanceof M&&at(arguments[1],xt)){for(var e=arguments[0],t=arguments[1],n=new lr(e),i=new M,s=new M,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof M&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new lr(a),c=1;c<u.length;c++){var h=u[c],f=u[c-1];if(l.countSegment(h,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var H=function(){},ao={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.orientationIndex=function(e,t,n){return $e.orientationIndex(e,t,n)},H.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,i=1;i<e.length-1;i++){var s=e[i].x-n,o=e[i+1].y,a=e[i-1].y;t+=s*(a-o)}return t/2}else if(at(arguments[0],xt)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new M,h=new M,f=new M;u.getCoordinate(0,h),u.getCoordinate(1,f);var p=h.x;f.x-=p;for(var v=0,C=1;C<l-1;C++)c.y=h.y,h.x=f.x,h.y=f.y,u.getCoordinate(C+1,f),f.x-=p,v+=h.x*(c.y-f.y);return v/2}},H.distanceLineLine=function(e,t,n,i){if(e.equals(t))return H.distancePointLine(e,n,i);if(n.equals(i))return H.distancePointLine(i,e,t);var s=!1;if(!$.intersects(e,t,n,i))s=!0;else{var o=(t.x-e.x)*(i.y-n.y)-(t.y-e.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(e.y-n.y)*(i.x-n.x)-(e.x-n.x)*(i.y-n.y),u=(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y),l=u/o,c=a/o;(c<0||c>1||l<0||l>1)&&(s=!0)}}return s?Pn.min(H.distancePointLine(e,n,i),H.distancePointLine(t,n,i),H.distancePointLine(n,e,t),H.distancePointLine(i,e,t)):0},H.isPointInRing=function(e,t){return H.locatePointInRing(e,t)!==A.EXTERIOR},H.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,i=new M;e.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<t;a++){e.getCoordinate(a,i);var u=i.x,l=i.y,c=u-s,h=l-o;n+=Math.sqrt(c*c+h*h),s=u,o=l}return n},H.isCCW=function(e){var t=e.length-1;if(t<3)throw new Xt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],i=0,s=1;s<=t;s++){var o=e[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=t);while(e[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%t;while(e[u].equals2D(n)&&u!==i);var l=e[a],c=e[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=H.computeOrientation(l,n,c),f=!1;return h===0?f=l.x>c.x:f=h>0,f},H.locatePointInRing=function(e,t){return lr.locatePointInRing(e,t)},H.distancePointLinePerpendicular=function(e,t,n){var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(s)*Math.sqrt(i)},H.computeOrientation=function(e,t,n){return H.orientationIndex(e,t,n)},H.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Xt("Line array must contain at least one vertex");for(var n=e.distance(t[0]),i=0;i<t.length-1;i++){var s=H.distancePointLine(e,t[i],t[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(c<=0)return o.distance(a);if(c>=1)return o.distance(u);var h=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},H.isOnLine=function(e,t){for(var n=new ys,i=1;i<t.length;i++){var s=t[i-1],o=t[i];if(n.computeIntersection(e,s,o),n.hasIntersection())return!0}return!1},ao.CLOCKWISE.get=function(){return-1},ao.RIGHT.get=function(){return H.CLOCKWISE},ao.COUNTERCLOCKWISE.get=function(){return 1},ao.LEFT.get=function(){return H.COUNTERCLOCKWISE},ao.COLLINEAR.get=function(){return 0},ao.STRAIGHT.get=function(){return H.COLLINEAR},Object.defineProperties(H,ao);var mi=function(){};mi.prototype.filter=function(e){},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var ot=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},Br={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ot.prototype.isGeometryCollection=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION},ot.prototype.getFactory=function(){return this._factory},ot.prototype.getGeometryN=function(e){return this},ot.prototype.getArea=function(){return 0},ot.prototype.isRectangle=function(){return!1},ot.prototype.equals=function(){if(arguments[0]instanceof ot){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof ot))return!1;var n=t;return this.equalsExact(n)}},ot.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},ot.prototype.geometryChanged=function(){this.apply(ot.geometryChangedFilter)},ot.prototype.geometryChangedAction=function(){this._envelope=null},ot.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())},ot.prototype.getLength=function(){return 0},ot.prototype.getNumGeometries=function(){return 1},ot.prototype.compareTo=function(){if(arguments.length===1){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},ot.prototype.getUserData=function(){return this._userData},ot.prototype.getSRID=function(){return this._SRID},ot.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ot.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION)throw new Xt("This method does not support GeometryCollection arguments")},ot.prototype.equal=function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n},ot.prototype.norm=function(){var e=this.copy();return e.normalize(),e},ot.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ot.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new $(this._envelope)},ot.prototype.setSRID=function(e){this._SRID=e},ot.prototype.setUserData=function(e){this._userData=e},ot.prototype.compare=function(e,t){for(var n=e.iterator(),i=t.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},ot.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ot.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ot.SORTINDEX_MULTIPOINT||this.getSortIndex()===ot.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ot.SORTINDEX_MULTIPOLYGON},ot.prototype.interfaces_=function(){return[Ql,Ln,An]},ot.prototype.getClass=function(){return ot},ot.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},ot.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1},Br.serialVersionUID.get=function(){return 8763622679187377e3},Br.SORTINDEX_POINT.get=function(){return 0},Br.SORTINDEX_MULTIPOINT.get=function(){return 1},Br.SORTINDEX_LINESTRING.get=function(){return 2},Br.SORTINDEX_LINEARRING.get=function(){return 3},Br.SORTINDEX_MULTILINESTRING.get=function(){return 4},Br.SORTINDEX_POLYGON.get=function(){return 5},Br.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Br.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Br.geometryChangedFilter.get=function(){return ed},Object.defineProperties(ot,Br);var ed=function(){};ed.interfaces_=function(){return[mi]},ed.filter=function(e){e.geometryChangedAction()};var jr=function(){};jr.prototype.filter=function(e){},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Fn=function(){},vi={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Fn.prototype.isInBoundary=function(e){},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},vi.Mod2BoundaryNodeRule.get=function(){return la},vi.EndPointBoundaryNodeRule.get=function(){return ca},vi.MultiValentEndPointBoundaryNodeRule.get=function(){return ha},vi.MonoValentEndPointBoundaryNodeRule.get=function(){return da},vi.MOD2_BOUNDARY_RULE.get=function(){return new la},vi.ENDPOINT_BOUNDARY_RULE.get=function(){return new ca},vi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ha},vi.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new da},vi.OGC_SFS_BOUNDARY_RULE.get=function(){return Fn.MOD2_BOUNDARY_RULE},Object.defineProperties(Fn,vi);var la=function(){};la.prototype.isInBoundary=function(e){return e%2===1},la.prototype.interfaces_=function(){return[Fn]},la.prototype.getClass=function(){return la};var ca=function(){};ca.prototype.isInBoundary=function(e){return e>0},ca.prototype.interfaces_=function(){return[Fn]},ca.prototype.getClass=function(){return ca};var ha=function(){};ha.prototype.isInBoundary=function(e){return e>1},ha.prototype.interfaces_=function(){return[Fn]},ha.prototype.getClass=function(){return ha};var da=function(){};da.prototype.isInBoundary=function(e){return e===1},da.prototype.interfaces_=function(){return[Fn]},da.prototype.getClass=function(){return da};var de=function(){};de.prototype.add=function(){},de.prototype.addAll=function(){},de.prototype.isEmpty=function(){},de.prototype.iterator=function(){},de.prototype.size=function(){},de.prototype.toArray=function(){},de.prototype.remove=function(){};function nd(r){this.message=r||""}nd.prototype=new Error,nd.prototype.name="IndexOutOfBoundsException";var fa=function(){};fa.prototype.hasNext=function(){},fa.prototype.next=function(){},fa.prototype.remove=function(){};var Zn=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(de);function pa(r){this.message=r||""}pa.prototype=new Error,pa.prototype.name="NoSuchElementException";var W=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[r,de]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},e.prototype.iterator=function(){return new TE(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new nd;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},e}(Zn),TE=function(r){function e(t){r.call(this),this.arrayList_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new pa;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(fa),ju=function(r){function e(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(i){return this.get(i)},e.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof M&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var h=arguments[0],f=arguments[1];return this.add(h,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],v=arguments[1],C=arguments[2];if(C)for(var S=0;S<p.length;S++)i.add(p[S],v);else for(var P=p.length-1;P>=0;P--)i.add(p[P],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof M){var y=arguments[0],_=arguments[1],m=arguments[2];if(!m){var w=this.size();if(w>0){if(y>0){var E=this.get(y-1);if(E.equals2D(_))return null}if(y<w){var b=this.get(y);if(b.equals2D(_))return null}}}r.prototype.add.call(this,y,_)}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],D=arguments[2],x=arguments[3],O=1;D>x&&(O=-1);for(var L=D;L!==x;L+=O)i.add(I[L],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new M(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(W),Et=function(){},ec={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ec.ForwardComparator.get=function(){return zu},ec.BidirectionalComparator.get=function(){return ga},ec.coordArrayType.get=function(){return new Array(0).fill(null)},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},Et.ptNotInList=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(Et.indexOf(i,t)<0)return i}return null},Et.scroll=function(e,t){var n=Et.indexOf(t,e);if(n<0)return null;var i=new Array(e.length).fill(null);xe.arraycopy(e,n,i,0,e.length-n),xe.arraycopy(e,0,i,e.length-n,n),xe.arraycopy(i,0,e,0,e.length)},Et.equals=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Et.intersection=function(e,t){for(var n=new ju,i=0;i<e.length;i++)t.intersects(e[i])&&n.add(e[i],!0);return n.toCoordinateArray()},Et.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},Et.removeRepeatedPoints=function(e){if(!Et.hasRepeatedPoints(e))return e;var t=new ju(e,!1);return t.toCoordinateArray()},Et.reverse=function(e){for(var t=e.length-1,n=Math.trunc(t/2),i=0;i<=n;i++){var s=e[i];e[i]=e[t-i],e[t-i]=s}},Et.removeNull=function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var s=0,o=0;o<e.length;o++)e[o]!==null&&(i[s++]=e[o]);return i},Et.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=new M(e[n]);return t}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new M(i[s+l])},Et.isEqualReversed=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],s=t[e.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},Et.envelope=function(e){for(var t=new $,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t},Et.toCoordinateArray=function(e){return e.toArray(Et.coordArrayType)},Et.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},Et.indexOf=function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1},Et.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,i=e[t].compareTo(e[n]);if(i!==0)return i}return 1},Et.compare=function(e,t){for(var n=0;n<e.length&&n<t.length;){var i=e[n].compareTo(t[n]);if(i!==0)return i;n++}return n<t.length?-1:n<e.length?1:0},Et.minCoordinate=function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t},Et.extract=function(e,t,n){t=Pn.clamp(t,0,e.length),n=Pn.clamp(n,-1,e.length);var i=n-t+1;n<0&&(i=0),t>=e.length&&(i=0),n<t&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=t;a<=n;a++)s[o++]=e[a];return s},Object.defineProperties(Et,ec);var zu=function(){};zu.prototype.compare=function(e,t){var n=e,i=t;return Et.compare(n,i)},zu.prototype.interfaces_=function(){return[sa]},zu.prototype.getClass=function(){return zu};var ga=function(){};ga.prototype.compare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=Et.compare(n,i),o=Et.isEqualReversed(n,i);return o?0:s},ga.prototype.OLDcompare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=Et.increasingDirection(n),o=Et.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=s,u+=o}return 0},ga.prototype.interfaces_=function(){return[sa]},ga.prototype.getClass=function(){return ga};var uo=function(){};uo.prototype.get=function(){},uo.prototype.put=function(){},uo.prototype.size=function(){},uo.prototype.values=function(){},uo.prototype.entrySet=function(){};var NE=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(uo);function Uu(r){this.message=r||""}Uu.prototype=new Error,Uu.prototype.name="OperationNotSupported";function nc(){}nc.prototype=new de,nc.prototype.contains=function(){};var rd=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},e.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.remove=function(n){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.iterator=function(){return new OE(this)},e}(nc),OE=function(r){function e(t){r.call(this),this.hashSet_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new pa;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Uu},e}(fa),yi=0,_s=1;function Cm(r){return r===null?yi:r.color}function Ut(r){return r===null?null:r.parent}function _i(r,e){r!==null&&(r.color=e)}function id(r){return r===null?null:r.left}function Sm(r){return r===null?null:r.right}function Fe(){this.root_=null,this.size_=0}Fe.prototype=new NE,Fe.prototype.get=function(r){for(var e=this.root_;e!==null;){var t=r.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null},Fe.prototype.put=function(r,e){if(this.root_===null)return this.root_={key:r,value:e,left:null,right:null,parent:null,color:yi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,n,i;do if(n=t,i=r.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var s=t.value;return t.value=e,s}while(t!==null);var o={key:r,left:null,right:null,value:e,parent:n,color:yi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},Fe.prototype.fixAfterInsertion=function(r){var e=this;for(r.color=_s;r!=null&&r!==this.root_&&r.parent.color===_s;)if(Ut(r)===id(Ut(Ut(r)))){var t=Sm(Ut(Ut(r)));Cm(t)===_s?(_i(Ut(r),yi),_i(t,yi),_i(Ut(Ut(r)),_s),r=Ut(Ut(r))):(r===Sm(Ut(r))&&(r=Ut(r),e.rotateLeft(r)),_i(Ut(r),yi),_i(Ut(Ut(r)),_s),e.rotateRight(Ut(Ut(r))))}else{var n=id(Ut(Ut(r)));Cm(n)===_s?(_i(Ut(r),yi),_i(n,yi),_i(Ut(Ut(r)),_s),r=Ut(Ut(r))):(r===id(Ut(r))&&(r=Ut(r),e.rotateRight(r)),_i(Ut(r),yi),_i(Ut(Ut(r)),_s),e.rotateLeft(Ut(Ut(r))))}this.root_.color=yi},Fe.prototype.values=function(){var r=new W,e=this.getFirstEntry();if(e!==null)for(r.add(e.value);(e=Fe.successor(e))!==null;)r.add(e.value);return r},Fe.prototype.entrySet=function(){var r=new rd,e=this.getFirstEntry();if(e!==null)for(r.add(e);(e=Fe.successor(e))!==null;)r.add(e);return r},Fe.prototype.rotateLeft=function(r){if(r!=null){var e=r.right;r.right=e.left,e.left!=null&&(e.left.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.left===r?r.parent.left=e:r.parent.right=e,e.left=r,r.parent=e}},Fe.prototype.rotateRight=function(r){if(r!=null){var e=r.left;r.left=e.right,e.right!=null&&(e.right.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.right===r?r.parent.right=e:r.parent.left=e,e.right=r,r.parent=e}},Fe.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Fe.successor=function(r){if(r===null)return null;if(r.right!==null){for(var e=r.right;e.left!==null;)e=e.left;return e}else{for(var t=r.parent,n=r;t!==null&&n===t.right;)n=t,t=t.parent;return t}},Fe.prototype.size=function(){return this.size_};var Gu=function(){};Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu};function bm(){}bm.prototype=new nc;function cr(){this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}cr.prototype=new bm,cr.prototype.contains=function(r){for(var e=this,t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===0)return!0}return!1},cr.prototype.add=function(r){var e=this;if(this.contains(r))return!1;for(var t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===1)return e.array_.splice(t,0,r),!0}return this.array_.push(r),!0},cr.prototype.addAll=function(r){for(var e=this,t=r.iterator();t.hasNext();)e.add(t.next());return!0},cr.prototype.remove=function(r){throw new Uu},cr.prototype.size=function(){return this.array_.length},cr.prototype.isEmpty=function(){return this.array_.length===0},cr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e},cr.prototype.iterator=function(){return new rc(this)};var rc=function(r){this.treeSet_=r,this.position_=0};rc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new pa;return this.treeSet_.array_[this.position_++]},rc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},rc.prototype.remove=function(){throw new Uu};var ws=function(){};ws.sort=function(){var e=arguments[0],t,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},e.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},e.sort(s);else if(arguments.length===3){n=e.slice(arguments[1],arguments[2]),n.sort();var o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));for(e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])}else if(arguments.length===4)for(n=e.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])},ws.asList=function(e){for(var t=new W,n=0,i=e.length;n<i;n++)t.add(e[n]);return t};var Mt=function(){},Kn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Kn.P.get=function(){return 0},Kn.L.get=function(){return 1},Kn.A.get=function(){return 2},Kn.FALSE.get=function(){return-1},Kn.TRUE.get=function(){return-2},Kn.DONTCARE.get=function(){return-3},Kn.SYM_FALSE.get=function(){return"F"},Kn.SYM_TRUE.get=function(){return"T"},Kn.SYM_DONTCARE.get=function(){return"*"},Kn.SYM_P.get=function(){return"0"},Kn.SYM_L.get=function(){return"1"},Kn.SYM_A.get=function(){return"2"},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.toDimensionSymbol=function(e){switch(e){case Mt.FALSE:return Mt.SYM_FALSE;case Mt.TRUE:return Mt.SYM_TRUE;case Mt.DONTCARE:return Mt.SYM_DONTCARE;case Mt.P:return Mt.SYM_P;case Mt.L:return Mt.SYM_L;case Mt.A:return Mt.SYM_A}throw new Xt("Unknown dimension value: "+e)},Mt.toDimensionValue=function(e){switch(Vu.toUpperCase(e)){case Mt.SYM_FALSE:return Mt.FALSE;case Mt.SYM_TRUE:return Mt.TRUE;case Mt.SYM_DONTCARE:return Mt.DONTCARE;case Mt.SYM_P:return Mt.P;case Mt.SYM_L:return Mt.L;case Mt.SYM_A:return Mt.A}throw new Xt("Unknown dimension symbol: "+e)},Object.defineProperties(Mt,Kn);var hr=function(){};hr.prototype.filter=function(e){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var Qn=function(){};Qn.prototype.filter=function(e,t){},Qn.prototype.isDone=function(){},Qn.prototype.isGeometryChanged=function(){},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var Ue=function(r){function e(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new Xt("geometries must not contain null elements")}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new $,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},e.prototype.getGeometryN=function(i){return this._geometries[i]},e.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},e.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();ws.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,s=Mt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},e.prototype.getDimension=function(){for(var i=this,s=Mt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},e.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new cr(ws.asList(this._geometries)),a=new cr(ws.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,h=this.getNumGeometries(),f=c.getNumGeometries(),p=0;p<h&&p<f;){var v=i.getGeometryN(p),C=c.getGeometryN(p),S=v.compareToSameClass(C,l);if(S!==0)return S;p++}return p<h?1:p<f?-1:0}},e.prototype.apply=function(){var i=this;if(at(arguments[0],jr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(at(arguments[0],Qn)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(at(arguments[0],mi)){var h=arguments[0];h.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(h)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),vt.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,t),e}(ot),Es=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new kn(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Gu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Ue),kn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Fn.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};kn.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return t.length===1?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)},kn.prototype.getBoundary=function(){return this._geom instanceof $t?this.boundaryLineString(this._geom):this._geom instanceof Es?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},kn.prototype.boundaryLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(e.isClosed()){var t=this._bnRule.isInBoundary(2);return t?e.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},kn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},kn.prototype.computeBoundaryCoordinates=function(e){var t=this,n=new W;this._endpointMap=new Fe;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);s.getNumPoints()!==0&&(t.addEndpoint(s.getCoordinateN(0)),t.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;t._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Et.toCoordinateArray(n)},kn.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new ic,this._endpointMap.put(e,t)),t.count++},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new kn(e);return t.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new kn(n,i);return s.getBoundary()}};var ic=function(){this.count=null};ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic};function DE(){}function ME(){}var RE=function(){};function LE(){}function AE(){}function FE(){}var Vn=function(){},sd={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.chars=function(e,t){for(var n=new Array(t).fill(null),i=0;i<t;i++)n[i]=e;return String(n)},Vn.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new LE,n=new DE;return e.printStackTrace(n),t.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new ME(Vn.getStackTrace(i));for(var a=new FE,u=0;u<s;u++)try{o+=a.readLine()+Vn.NEWLINE}catch(l){if(l instanceof AE)vt.shouldNeverReachHere();else throw l}finally{}return o}},Vn.split=function(e,t){for(var n=t.length,i=new W,s=""+e,o=s.indexOf(t);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(t)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Vn.toString=function(){if(arguments.length===1){var e=arguments[0];return Vn.SIMPLE_ORDINATE_FORMAT.format(e)}},Vn.spaces=function(e){return Vn.chars(" ",e)},sd.NEWLINE.get=function(){return xe.getProperty("line.separator")},sd.SIMPLE_ORDINATE_FORMAT.get=function(){return new RE},Object.defineProperties(Vn,sd);var re=function(){};re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.copyCoord=function(e,t,n,i){for(var s=Math.min(e.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,e.getOrdinate(t,o))},re.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,xt.X)===e.getOrdinate(t-1,xt.X)&&e.getOrdinate(0,xt.Y)===e.getOrdinate(t-1,xt.Y)},re.isEqual=function(e,t){var n=e.size(),i=t.size();if(n!==i)return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=e.getOrdinate(o,a),l=t.getOrdinate(o,a);if(e.getOrdinate(o,a)!==t.getOrdinate(o,a)&&!(ht.isNaN(u)&&ht.isNaN(l)))return!1}return!0},re.extend=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();if(re.copy(t,0,i,0,s),s>0)for(var o=s;o<n;o++)re.copy(t,s-1,i,o,1);return i},re.reverse=function(e){for(var t=e.size()-1,n=Math.trunc(t/2),i=0;i<=n;i++)re.swap(e,i,t-i)},re.swap=function(e,t,n){if(t===n)return null;for(var i=0;i<e.getDimension();i++){var s=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(n,i)),e.setOrdinate(n,i,s)}},re.copy=function(e,t,n,i,s){for(var o=0;o<s;o++)re.copyCoord(e,t+o,n,i+o)},re.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var n=e.getDimension(),i=new or;i.append("(");for(var s=0;s<t;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Vn.toString(e.getOrdinate(s,o)))}return i.append(")"),i.toString()}},re.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return re.createClosedRing(e,t,4);var i=t.getOrdinate(0,xt.X)===t.getOrdinate(n-1,xt.X)&&t.getOrdinate(0,xt.Y)===t.getOrdinate(n-1,xt.Y);return i?t:re.createClosedRing(e,t,n+1)},re.createClosedRing=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();re.copy(t,0,i,0,s);for(var o=s;o<n;o++)re.copy(t,0,i,o,1);return i};var $t=function(r){function e(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new $:this._points.expandEnvelope(new $)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&re.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return H.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();re.reverse(i);var s=this.getFactory().createLineString(i);return s},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=c;return h.compare(this._points,f._points)}},e.prototype.apply=function(){var i=this;if(at(arguments[0],jr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(at(arguments[0],Qn)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var l=arguments[0];l.filter(this)}else if(at(arguments[0],mi)){var c=arguments[0];c.filter(this)}},e.prototype.getBoundary=function(){return new kn(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},e.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Xt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},e.prototype.interfaces_=function(){return[Gu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(ot),Wu=function(){};Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var cn=function(r){function e(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new $;var i=new $;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},e.prototype.apply=function(){if(at(arguments[0],jr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(at(arguments[0],Qn)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var o=arguments[0];o.filter(this)}else if(at(arguments[0],mi)){var a=arguments[0];a.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),vt.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Wu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(ot),qi=function(){};qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi};var fe=function(r){function e(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new Xt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new Xt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),h=0;h<c.length;h++)o++,s[o]=c[h];return s},e.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(H.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(H.signedArea(i._holes[o].getCoordinateSequence()));return s},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),h=1;h<=4;h++){var f=i.getX(h),p=i.getY(h),v=f!==l,C=p!==c;if(v===C)return!1;l=f,c=p}return!0},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);ws.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);xe.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Et.minCoordinate(o.getCoordinates());Et.scroll(u,l),xe.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],H.isCCW(o.getCoordinates())===a&&Et.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},e.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,h=this._shell,f=c._shell,p=h.compareToSameClass(f,l);if(p!==0)return p;for(var v=this.getNumInteriorRing(),C=c.getNumInteriorRing(),S=0;S<v&&S<C;){var P=i.getInteriorRingN(S),y=c.getInteriorRingN(S),_=P.compareToSameClass(y,l);if(_!==0)return _;S++}return S<v?1:S<C?-1:0}},e.prototype.apply=function(i){var s=this;if(at(i,jr)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(at(i,Qn)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(at(i,hr))i.filter(this);else if(at(i,mi)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new e(s,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(i){return this._holes[i]},e.prototype.interfaces_=function(){return[qi]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(ot),ma=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Wu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Ue),zr=function(r){function e(n,i){n instanceof M&&i instanceof Ct&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();re.reverse(i);var s=this.getFactory().createLinearRing(i);return s},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new Xt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Xt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}($t),Ur=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new W,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var c=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(c))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[qi]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Ue),Bn=function(e){this._factory=e||null,this._isUserDataCopied=!1},sc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Bn.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},Bn.prototype.edit=function(e,t){if(e===null)return null;var n=this.editInternal(e,t);return this._isUserDataCopied&&n.setUserData(e.getUserData()),n},Bn.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Ue?this.editGeometryCollection(e,t):e instanceof fe?this.editPolygon(e,t):e instanceof cn?t.edit(e,this._factory):e instanceof $t?t.edit(e,this._factory):(vt.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},Bn.prototype.editGeometryCollection=function(e,t){for(var n=this,i=t.edit(e,this._factory),s=new W,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),t);a===null||a.isEmpty()||s.add(a)}return i.getClass()===ma?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Es?this._factory.createMultiLineString(s.toArray([])):i.getClass()===Ur?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Bn.prototype.editPolygon=function(e,t){var n=this,i=t.edit(e,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),t);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new W,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),t);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.GeometryEditorOperation=function(){},sc.NoOpGeometryOperation.get=function(){return qu},sc.CoordinateOperation.get=function(){return Hu},sc.CoordinateSequenceOperation.get=function(){return Xu},Object.defineProperties(Bn,sc);var qu=function(){};qu.prototype.edit=function(e,t){return e},qu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},qu.prototype.getClass=function(){return qu};var Hu=function(){};Hu.prototype.edit=function(e,t){var n=this.editCoordinates(e.getCoordinates(),e);return n===null?e:e instanceof zr?t.createLinearRing(n):e instanceof $t?t.createLineString(n):e instanceof cn?n.length>0?t.createPoint(n[0]):t.createPoint():e},Hu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},Hu.prototype.getClass=function(){return Hu};var Xu=function(){};Xu.prototype.edit=function(e,t){return e instanceof zr?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof $t?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof cn?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},Xu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},Xu.prototype.getClass=function(){return Xu};var ie=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)e._coordinates[n]=new M}else if(at(arguments[0],xt)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)e._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)e._coordinates[c]=new M}}},Pm={serialVersionUID:{configurable:!0}};ie.prototype.setOrdinate=function(e,t,n){switch(t){case xt.X:this._coordinates[e].x=n;break;case xt.Y:this._coordinates[e].y=n;break;case xt.Z:this._coordinates[e].z=n;break;default:throw new Xt("invalid ordinateIndex")}},ie.prototype.size=function(){return this._coordinates.length},ie.prototype.getOrdinate=function(e,t){switch(t){case xt.X:return this._coordinates[e].x;case xt.Y:return this._coordinates[e].y;case xt.Z:return this._coordinates[e].z}return ht.NaN},ie.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],n=arguments[1];n.x=this._coordinates[t].x,n.y=this._coordinates[t].y,n.z=this._coordinates[t].z}},ie.prototype.getCoordinateCopy=function(e){return new M(this._coordinates[e])},ie.prototype.getDimension=function(){return this._dimension},ie.prototype.getX=function(e){return this._coordinates[e].x},ie.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].clone();return new ie(t,this._dimension)},ie.prototype.expandEnvelope=function(e){for(var t=this,n=0;n<this._coordinates.length;n++)e.expandToInclude(t._coordinates[n]);return e},ie.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].copy();return new ie(t,this._dimension)},ie.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new or(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)t.append(", "),t.append(e._coordinates[n]);return t.append(")"),t.toString()}else return"()"},ie.prototype.getY=function(e){return this._coordinates[e].y},ie.prototype.toCoordinateArray=function(){return this._coordinates},ie.prototype.interfaces_=function(){return[xt,An]},ie.prototype.getClass=function(){return ie},Pm.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ie,Pm);var Gr=function(){},od={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Gr.prototype.readResolve=function(){return Gr.instance()},Gr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new ie(e)}else if(at(arguments[0],xt)){var t=arguments[0];return new ie(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new ie(n):new ie(n,i)}},Gr.prototype.interfaces_=function(){return[oa,An]},Gr.prototype.getClass=function(){return Gr},Gr.instance=function(){return Gr.instanceObject},od.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},od.instanceObject.get=function(){return new Gr},Object.defineProperties(Gr,od);var Im=function(r){function e(){r.call(this),this.map_=new Map}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,i){return this.map_.set(n,i),i},e.prototype.values=function(){for(var n=new W,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},e.prototype.entrySet=function(){var n=new rd;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(uo),Rt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof dr){var e=arguments[0];this._modelType=e,e===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=r.FIXED,this.setScale(t)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},ad={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Rt.prototype.equals=function(e){if(!(e instanceof Rt))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Rt.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new ar(n).compareTo(new ar(i))},Rt.prototype.getScale=function(){return this._scale},Rt.prototype.isFloating=function(){return this._modelType===Rt.FLOATING||this._modelType===Rt.FLOATING_SINGLE},Rt.prototype.getType=function(){return this._modelType},Rt.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Rt.FLOATING?e="Floating":this._modelType===Rt.FLOATING_SINGLE?e="Floating-Single":this._modelType===Rt.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Rt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ht.isNaN(e))return e;if(this._modelType===Rt.FLOATING_SINGLE){var t=e;return t}return this._modelType===Rt.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof M){var n=arguments[0];if(this._modelType===Rt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Rt.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Rt.FLOATING?e=16:this._modelType===Rt.FLOATING_SINGLE?e=6:this._modelType===Rt.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Rt.prototype.setScale=function(e){this._scale=Math.abs(e)},Rt.prototype.interfaces_=function(){return[An,Ln]},Rt.prototype.getClass=function(){return Rt},Rt.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},ad.serialVersionUID.get=function(){return 7777263578777804e3},ad.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Rt,ad);var dr=function r(e){this._name=e||null,r.nameToTypeMap.put(e,this)},ud={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dr.prototype.readResolve=function(){return dr.nameToTypeMap.get(this._name)},dr.prototype.toString=function(){return this._name},dr.prototype.interfaces_=function(){return[An]},dr.prototype.getClass=function(){return dr},ud.serialVersionUID.get=function(){return-552860263173159e4},ud.nameToTypeMap.get=function(){return new Im},Object.defineProperties(dr,ud),Rt.Type=dr,Rt.FIXED=new dr("FIXED"),Rt.FLOATING=new dr("FLOATING"),Rt.FLOATING_SINGLE=new dr("FLOATING SINGLE");var Ct=function r(){this._precisionModel=new Rt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?at(arguments[0],oa)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Rt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},xm={serialVersionUID:{configurable:!0}};Ct.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new M(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new M(e.getMinX(),e.getMinY()),new M(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new M(e.getMinX(),e.getMinY()),new M(e.getMinX(),e.getMaxY()),new M(e.getMaxX(),e.getMaxY()),new M(e.getMaxX(),e.getMinY()),new M(e.getMinX(),e.getMinY())]),null)},Ct.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new $t(this.getCoordinateSequenceFactory().create(e),this);if(at(e,xt))return new $t(e,this)}else return new $t(this.getCoordinateSequenceFactory().create([]),this)},Ct.prototype.createMultiLineString=function(){if(arguments.length===0)return new Es(null,this);if(arguments.length===1){var e=arguments[0];return new Es(e,this)}},Ct.prototype.buildGeometry=function(e){for(var t=null,n=!1,i=!1,s=e.iterator();s.hasNext();){var o=s.next(),a=o.getClass();t===null&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(Ct.toGeometryArray(e));var u=e.iterator().next(),l=e.size()>1;if(l){if(u instanceof fe)return this.createMultiPolygon(Ct.toPolygonArray(e));if(u instanceof $t)return this.createMultiLineString(Ct.toLineStringArray(e));if(u instanceof cn)return this.createMultiPoint(Ct.toPointArray(e));vt.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},Ct.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)},Ct.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(at(arguments[0],xt)){var t=arguments[0];return new cn(t,this)}}},Ct.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ct.prototype.createPolygon=function(){if(arguments.length===0)return new fe(null,null,this);if(arguments.length===1){if(at(arguments[0],xt)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof zr){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new fe(i,s,this)}},Ct.prototype.getSRID=function(){return this._SRID},Ct.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ue(null,this);if(arguments.length===1){var e=arguments[0];return new Ue(e,this)}},Ct.prototype.createGeometry=function(e){var t=new Bn(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},Ct.prototype.getPrecisionModel=function(){return this._precisionModel},Ct.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(at(arguments[0],xt)){var t=arguments[0];return new zr(t,this)}}},Ct.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ur(null,this);if(arguments.length===1){var e=arguments[0];return new Ur(e,this)}},Ct.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new ma(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new ma(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(at(arguments[0],xt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=e.getCoordinateSequenceFactory().create(1,i.getDimension());re.copy(i,o,a,0,1),s[o]=e.createPoint(a)}return this.createMultiPoint(s)}}},Ct.prototype.interfaces_=function(){return[An]},Ct.prototype.getClass=function(){return Ct},Ct.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.getDefaultCoordinateSequenceFactory=function(){return Gr.instance()},Ct.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},xm.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ct,xm);var kE=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],oc=function(e){this.geometryFactory=e||new Ct};oc.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var n=t.type;if(!fr[n])throw new Error("Unknown GeoJSON type: "+t.type);return kE.indexOf(n)!==-1?fr[n].apply(this,[t.coordinates]):n==="GeometryCollection"?fr[n].apply(this,[t.geometries]):fr[n].apply(this,[t])},oc.prototype.write=function(e){var t=e.getGeometryType();if(!wi[t])throw new Error("Geometry is not supported");return wi[t].apply(this,[e])};var fr={Feature:function(r){var e={};for(var t in r)e[t]=r[t];if(r.geometry){var n=r.geometry.type;if(!fr[n])throw new Error("Unknown GeoJSON type: "+r.type);e.geometry=this.read(r.geometry)}return r.bbox&&(e.bbox=fr.bbox.apply(this,[r.bbox])),e},FeatureCollection:function(r){var e=this,t={};if(r.features){t.features=[];for(var n=0;n<r.features.length;++n)t.features.push(e.read(r.features[n]))}return r.bbox&&(t.bbox=this.parse.bbox.apply(this,[r.bbox])),t},coordinates:function(r){for(var e=[],t=0;t<r.length;++t){var n=r[t];e.push(new M(n[0],n[1]))}return e},bbox:function(r){return this.geometryFactory.createLinearRing([new M(r[0],r[1]),new M(r[2],r[1]),new M(r[2],r[3]),new M(r[0],r[3]),new M(r[0],r[1])])},Point:function(r){var e=new M(r[0],r[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(fr.Point.apply(e,[r[n]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(r){var e=fr.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(e)},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(fr.LineString.apply(e,[r[n]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(r){for(var e=this,t=fr.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(t),i=[],s=1;s<r.length;++s){var o=r[s],a=fr.coordinates.apply(e,[o]),u=e.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(fr.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},wi={coordinate:function(r){return[r.x,r.y]},Point:function(r){var e=wi.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.Point.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(r){for(var e=this,t=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];t.push(wi.coordinate.apply(e,[s]))}return{type:"LineString",coordinates:t}},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.LineString.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(r){var e=this,t=[],n=wi.LineString.apply(this,[r._shell]);t.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=wi.LineString.apply(e,[s]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.Polygon.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();t.push(wi[s].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},ld=function(e){this.geometryFactory=e||new Ct,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new oc(this.geometryFactory)};ld.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Rt.FIXED&&this.reducePrecision(t),t},ld.prototype.reducePrecision=function(e){var t=this,n,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(n=0,i=e.points.length;n<i;n++)t.precisionModel.makePrecise(e.points[n]);else if(e.geometries)for(n=0,i=e.geometries.length;n<i;n++)t.reducePrecision(e.geometries[n])};var Tm=function(){this.parser=new oc(this.geometryFactory)};Tm.prototype.write=function(e){return this.parser.write(e)};var U=function(){},ac={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(e){return e===U.LEFT?U.RIGHT:e===U.RIGHT?U.LEFT:e},ac.ON.get=function(){return 0},ac.LEFT.get=function(){return 1},ac.RIGHT.get=function(){return 2},Object.defineProperties(U,ac);function uc(r){this.message=r||""}uc.prototype=new Error,uc.prototype.name="EmptyStackException";function pr(){this.array_=[]}pr.prototype=new Zn,pr.prototype.add=function(r){return this.array_.push(r),!0},pr.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},pr.prototype.push=function(r){return this.array_.push(r),r},pr.prototype.pop=function(r){if(this.array_.length===0)throw new uc;return this.array_.pop()},pr.prototype.peek=function(){if(this.array_.length===0)throw new uc;return this.array_[this.array_.length-1]},pr.prototype.empty=function(){return this.array_.length===0},pr.prototype.isEmpty=function(){return this.empty()},pr.prototype.search=function(r){return this.array_.indexOf(r)},pr.prototype.size=function(){return this.array_.length},pr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e};var gr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};gr.prototype.getCoordinate=function(){return this._minCoord},gr.prototype.getRightmostSide=function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n},gr.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();vt.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],i=H.computeOrientation(this._minCoord,n,t),s=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&i===H.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&i===H.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},gr.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),i=n.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var s=U.LEFT;return i[t].y<i[t+1].y&&(s=U.RIGHT),s},gr.prototype.getEdge=function(){return this._orientedDe},gr.prototype.checkForRightmostCoordinate=function(e){for(var t=this,n=e.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(t._minCoord===null||n[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=n[i])},gr.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},gr.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();i.isForward()&&t.checkForRightmostCoordinate(i)}vt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===U.LEFT&&(this._orientedDe=this._minDe.getSym())},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Ei=function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new M(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},e}(gi),lc=function(){this.array_=[]};lc.prototype.addLast=function(e){this.array_.push(e)},lc.prototype.removeFirst=function(){return this.array_.shift()},lc.prototype.isEmpty=function(){return this.array_.length===0};var Ge=function(){this._finder=null,this._dirEdgeList=new W,this._nodes=new W,this._rightMostCoord=null,this._env=null,this._finder=new gr};Ge.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}},Ge.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ge.prototype.computeNodeDepth=function(e){for(var t=this,n=null,i=e.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ei("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),t.copySymDepths(a)}},Ge.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(U.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},Ge.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ge.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(U.RIGHT)>=1&&t.getDepth(U.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},Ge.prototype.computeDepths=function(e){var t=this,n=new rd,i=new lc,s=e.getNode();for(i.addLast(s),n.add(s),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),t.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},Ge.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},Ge.prototype.getEnvelope=function(){if(this._env===null){for(var e=new $,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)e.expandToInclude(i[s]);this._env=e}return this._env},Ge.prototype.addReachable=function(e){var t=this,n=new pr;for(n.add(e);!n.empty();){var i=n.pop();t.add(i,n)}},Ge.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(U.LEFT,e.getDepth(U.RIGHT)),t.setDepth(U.RIGHT,e.getDepth(U.LEFT))},Ge.prototype.add=function(e,t){var n=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||t.push(a)}},Ge.prototype.getNodes=function(){return this._nodes},Ge.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ge.prototype.interfaces_=function(){return[Ln]},Ge.prototype.getClass=function(){return Ge};var Gt=function r(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)e.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=o,this.location[U.LEFT]=a,this.location[U.RIGHT]=u}};Gt.prototype.setAllLocations=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]=e},Gt.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==A.NONE)return!1;return!0},Gt.prototype.setAllLocationsIfNull=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]===A.NONE&&(t.location[n]=e)},Gt.prototype.isLine=function(){return this.location.length===1},Gt.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=A.NONE,n[U.RIGHT]=A.NONE,this.location=n}for(var i=0;i<this.location.length;i++)t.location[i]===A.NONE&&i<e.location.length&&(t.location[i]=e.location[i])},Gt.prototype.getLocations=function(){return this.location},Gt.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=e},Gt.prototype.toString=function(){var e=new or;return this.location.length>1&&e.append(A.toLocationSymbol(this.location[U.LEFT])),e.append(A.toLocationSymbol(this.location[U.ON])),this.location.length>1&&e.append(A.toLocationSymbol(this.location[U.RIGHT])),e.toString()},Gt.prototype.setLocations=function(e,t,n){this.location[U.ON]=e,this.location[U.LEFT]=t,this.location[U.RIGHT]=n},Gt.prototype.get=function(e){return e<this.location.length?this.location[e]:A.NONE},Gt.prototype.isArea=function(){return this.location.length>1},Gt.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===A.NONE)return!0;return!1},Gt.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(U.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}},Gt.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(A.NONE)},Gt.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},Gt.prototype.allPositionsEqual=function(e){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]!==e)return!1;return!0},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var Vt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Gt(e),this.elt[1]=new Gt(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.elt[0]=new Gt(t.elt[0]),this.elt[1]=new Gt(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Gt(A.NONE),this.elt[1]=new Gt(A.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Gt(s,o,a),this.elt[1]=new Gt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Gt(A.NONE,A.NONE,A.NONE),this.elt[1]=new Gt(A.NONE,A.NONE,A.NONE),this.elt[u].setLocations(l,c,h)}};Vt.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},Vt.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},Vt.prototype.isNull=function(e){return this.elt[e].isNull()},Vt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}},Vt.prototype.isLine=function(e){return this.elt[e].isLine()},Vt.prototype.merge=function(e){for(var t=this,n=0;n<2;n++)t.elt[n]===null&&e.elt[n]!==null?t.elt[n]=new Gt(e.elt[n]):t.elt[n].merge(e.elt[n])},Vt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Vt.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(U.ON)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}},Vt.prototype.toString=function(){var e=new or;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},Vt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}},Vt.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},Vt.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(U.ON,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},Vt.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},Vt.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},Vt.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Gt(this.elt[e].location[0]))},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.toLineLabel=function(e){for(var t=new Vt(A.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t};var ue=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new W,this._pts=new W,this._label=new Vt(A.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new W,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};ue.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)t[n]=e._pts.get(n);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=H.isCCW(this._ring.getCoordinates())},ue.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},ue.prototype.computePoints=function(e){var t=this;this._startDe=e;var n=e,i=!0;do{if(n===null)throw new Ei("Found null DirectedEdge");if(n.getEdgeRing()===t)throw new Ei("Directed Edge visited twice during ring-building at "+n.getCoordinate());t._edges.add(n);var s=n.getLabel();vt.isTrue(s.isArea()),t.mergeLabel(s),t.addPoints(n.getEdge(),n.isForward(),i),i=!1,t.setEdgeRing(n,t),n=t.getNext(n)}while(n!==this._startDe)},ue.prototype.getLinearRing=function(){return this._ring},ue.prototype.getCoordinate=function(e){return this._pts.get(e)},ue.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var n=t.getNode(),i=n.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},ue.prototype.addPoints=function(e,t,n){var i=this,s=e.getCoordinates();if(t){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},ue.prototype.isHole=function(){return this._isHole},ue.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},ue.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!H.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(e))return!1}return!0},ue.prototype.addHole=function(e){this._holes.add(e)},ue.prototype.isShell=function(){return this._shell===null},ue.prototype.getLabel=function(){return this._label},ue.prototype.getEdges=function(){return this._edges},ue.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ue.prototype.getShell=function(){return this._shell},ue.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=t.getLocation(n,U.RIGHT);if(i===A.NONE)return null;if(this._label.getLocation(n)===A.NONE)return this._label.setLocation(n,i),null}},ue.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)},ue.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=t._holes.get(i).getLinearRing();var s=e.createPolygon(this.getLinearRing(),n);return s},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue};var VE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},e.prototype.getNext=function(n){return n.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ue),BE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var n=this,i=new W,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new VE(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},e.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(n){return n.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ue),In=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}};In.prototype.setVisited=function(e){this._isVisited=e},In.prototype.setInResult=function(e){this._isInResult=e},In.prototype.isCovered=function(){return this._isCovered},In.prototype.isCoveredSet=function(){return this._isCoveredSet},In.prototype.setLabel=function(e){this._label=e},In.prototype.getLabel=function(){return this._label},In.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},In.prototype.updateIM=function(e){vt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},In.prototype.isInResult=function(){return this._isInResult},In.prototype.isVisited=function(){return this._isVisited},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var cc=function(r){function e(){r.call(this),this._coord=null,this._edges=null;var t=arguments[0],n=arguments[1];this._coord=t,this._edges=n,this._label=new Vt(0,A.NONE)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,i){var s=A.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==A.BOUNDARY&&(s=o)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new Vt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof Vt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===A.NONE&&n._label.setLocation(o,a)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=A.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case A.BOUNDARY:s=A.INTERIOR;break;case A.INTERIOR:s=A.BOUNDARY;break;default:s=A.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(In),mr=function(){this.nodeMap=new Fe,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};mr.prototype.find=function(e){return this.nodeMap.get(e)},mr.prototype.addNode=function(){if(arguments[0]instanceof M){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof cc){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},mr.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},mr.prototype.iterator=function(){return this.nodeMap.values().iterator()},mr.prototype.values=function(){return this.nodeMap.values()},mr.prototype.getBoundaryNodes=function(e){for(var t=new W,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(e)===A.BOUNDARY&&t.add(i)}return t},mr.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var Bt=function(){},Yu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.isNorthern=function(e){return e===Bt.NE||e===Bt.NW},Bt.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2},Bt.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var i=e<t?e:t,s=e>t?e:t;return i===0&&s===3?3:i},Bt.isInHalfPlane=function(e,t){return t===Bt.SE?e===Bt.SE||e===Bt.SW:e===t||e===t+1},Bt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Xt("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Bt.NE:Bt.SE:t>=0?Bt.NW:Bt.SW}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new Xt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Bt.NE:Bt.SE:i.y>=n.y?Bt.NW:Bt.SW}},Yu.NE.get=function(){return 0},Yu.NW.get=function(){return 1},Yu.SW.get=function(){return 2},Yu.SE.get=function(){return 3},Object.defineProperties(Bt,Yu);var ke=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=t,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};ke.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:H.computeOrientation(e._p0,e._p1,this._p1)},ke.prototype.getDy=function(){return this._dy},ke.prototype.getCoordinate=function(){return this._p0},ke.prototype.setNode=function(e){this._node=e},ke.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);e.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},ke.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},ke.prototype.getDirectedCoordinate=function(){return this._p1},ke.prototype.getDx=function(){return this._dx},ke.prototype.getLabel=function(){return this._label},ke.prototype.getEdge=function(){return this._edge},ke.prototype.getQuadrant=function(){return this._quadrant},ke.prototype.getNode=function(){return this._node},ke.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf("."),i=t.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},ke.prototype.computeLabel=function(e){},ke.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Bt.quadrant(this._dx,this._dy),vt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ke.prototype.interfaces_=function(){return[Ln]},ke.prototype.getClass=function(){return ke};var cd=function(r){function e(){var t=arguments[0],n=arguments[1];if(r.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var i=t.getNumPoints()-1;this.init(t.getCoordinate(i),t.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(n){return this._depth[n]},e.prototype.setVisited=function(n){this._isVisited=n},e.prototype.computeDirectedLabel=function(){this._label=new Vt(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Ei("assigned depths do not match",this.getCoordinate());this._depth[n]=i},e.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,U.LEFT)===A.INTERIOR&&n._label.getLocation(s,U.RIGHT)===A.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(n){this._nextMin=n},e.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},e.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},e.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,A.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,A.EXTERIOR);return n&&i&&s},e.prototype.setEdgeRing=function(n){this._edgeRing=n},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},e.prototype.setInResult=function(n){this._isInResult=n},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},e.prototype.setSym=function(n){this._sym=n},e.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},e.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===U.LEFT&&(o=-1);var a=U.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(n){this._next=n},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(n,i){return n===A.EXTERIOR&&i===A.INTERIOR?1:n===A.INTERIOR&&i===A.EXTERIOR?-1:0},e}(ke),va=function(){};va.prototype.createNode=function(e){return new cc(e,null)},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var Kt=function(){if(this._edges=new W,this._nodes=null,this._edgeEndList=new W,arguments.length===0)this._nodes=new mr(new va);else if(arguments.length===1){var e=arguments[0];this._nodes=new mr(e)}};Kt.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var n=0;n<this._edges.size();n++){e.println("edge "+n+":");var i=t._edges.get(n);i.print(e),i.eiList.print(e)}},Kt.prototype.find=function(e){return this._nodes.find(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof cc){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof M){var t=arguments[0];return this._nodes.addNode(t)}},Kt.prototype.getNodeIterator=function(){return this._nodes.iterator()},Kt.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}},Kt.prototype.debugPrintln=function(e){xe.out.println(e)},Kt.prototype.isBoundaryNode=function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(e)===A.BOUNDARY},Kt.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}},Kt.prototype.matchInSameDirection=function(e,t,n,i){return e.equals(n)?H.computeOrientation(e,t,i)===H.COLLINEAR&&Bt.quadrant(e,t)===Bt.quadrant(n,i):!1},Kt.prototype.getEdgeEnds=function(){return this._edgeEndList},Kt.prototype.debugPrint=function(e){xe.out.print(e)},Kt.prototype.getEdgeIterator=function(){return this._edges.iterator()},Kt.prototype.findEdgeInSameDirection=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(e,t,o[0],o[1])||n.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return s}return null},Kt.prototype.insertEdge=function(e){this._edges.add(e)},Kt.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null},Kt.prototype.addEdges=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();t._edges.add(i);var s=new cd(i,!0),o=new cd(i,!1);s.setSym(o),o.setSym(s),t.add(s),t.add(o)}},Kt.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},Kt.prototype.getNodes=function(){return this._nodes.values()},Kt.prototype.findEdge=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return s}return null},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.getEdges().linkResultDirectedEdges()}};var hn=function(){this._geometryFactory=null,this._shellList=new W;var e=arguments[0];this._geometryFactory=e};hn.prototype.sortShellsAndHoles=function(e,t,n){for(var i=e.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):t.add(s)}},hn.prototype.computePolygons=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(t._geometryFactory);n.add(o)}return n},hn.prototype.placeFreeHoles=function(e,t){for(var n=this,i=t.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,e);if(o===null)throw new Ei("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},hn.prototype.buildMinimalEdgeRings=function(e,t,n){for(var i=this,s=new W,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),t.add(l)):n.addAll(u)}else s.add(a)}return s},hn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1},hn.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new BE(s,t._geometryFactory);n.add(o),o.setInResult()}}return n},hn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(e)}},hn.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e},hn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=t.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),h=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;h.contains(i)&&H.isPointInRing(s,c.getCoordinates())&&(f=!0),f&&(o===null||a.contains(h))&&(o=l)}return o},hn.prototype.findShell=function(e){for(var t=0,n=null,i=e.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,t++)}return vt.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},hn.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];Kt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(t),s=new W,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var ya=function(){};ya.prototype.getBounds=function(){},ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya};var $n=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};$n.prototype.getItem=function(){return this._item},$n.prototype.getBounds=function(){return this._bounds},$n.prototype.interfaces_=function(){return[ya,An]},$n.prototype.getClass=function(){return $n};var Ci=function(){this._size=null,this._items=null,this._size=0,this._items=new W,this._items.add(null)};Ci.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},Ci.prototype.size=function(){return this._size},Ci.prototype.reorder=function(e){for(var t=this,n=null,i=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(i)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,i)},Ci.prototype.clear=function(){this._size=0,this._items.clear()},Ci.prototype.isEmpty=function(){return this._size===0},Ci.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Hi=function(){};Hi.prototype.visitItem=function(e){},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var lo=function(){};lo.prototype.insert=function(e,t){},lo.prototype.remove=function(e,t){},lo.prototype.query=function(){},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var pe=function(){if(this._childBoundables=new W,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},Nm={serialVersionUID:{configurable:!0}};pe.prototype.getLevel=function(){return this._level},pe.prototype.size=function(){return this._childBoundables.size()},pe.prototype.getChildBoundables=function(){return this._childBoundables},pe.prototype.addChildBoundable=function(e){vt.isTrue(this._bounds===null),this._childBoundables.add(e)},pe.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},pe.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},pe.prototype.interfaces_=function(){return[ya,An]},pe.prototype.getClass=function(){return pe},Nm.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(pe,Nm);var tr=function(){};tr.reverseOrder=function(){return{compare:function(t,n){return n.compareTo(t)}}},tr.min=function(e){return tr.sort(e),e.get(0)},tr.sort=function(e,t){var n=e.toArray();t?ws.sort(n,t):ws.sort(n);for(var i=e.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},tr.singletonList=function(e){var t=new W;return t.add(e),t};var le=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()};le.prototype.expandToQueue=function(e,t){var n=le.isComposite(this._boundable1),i=le.isComposite(this._boundable2);if(n&&i)return le.area(this._boundable1)>le.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Xt("neither boundable is composite")},le.prototype.isLeaves=function(){return!(le.isComposite(this._boundable1)||le.isComposite(this._boundable2))},le.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},le.prototype.expand=function(e,t,n,i){for(var s=this,o=e.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new le(u,t,s._itemDistance);l.getDistance()<i&&n.add(l)}},le.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2},le.prototype.getDistance=function(){return this._distance},le.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},le.prototype.interfaces_=function(){return[Ln]},le.prototype.getClass=function(){return le},le.area=function(e){return e.getBounds().getArea()},le.isComposite=function(e){return e instanceof pe};var Ce=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new W,this._nodeCapacity=null,arguments.length===0){var e=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];vt.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},hc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Ce.prototype.getNodeCapacity=function(){return this._nodeCapacity},Ce.prototype.lastNode=function(e){return e.get(e.size()-1)},Ce.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof pe?n+=e.size(s):s instanceof $n&&(n+=1)}return n}},Ce.prototype.removeItem=function(e,t){for(var n=null,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof $n&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1},Ce.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new W:t}else if(arguments.length===1){for(var n=arguments[0],i=new W,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof pe){var a=e.itemsTree(o);a!==null&&i.add(a)}else o instanceof $n?i.add(o.getItem()):vt.shouldNeverReachHere()}return i.size()<=0?null:i}},Ce.prototype.insert=function(e,t){vt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new $n(e,t))},Ce.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new W;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(vt.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof pe?e.boundablesAtLevel(i,u,o):(vt.isTrue(u instanceof $n),i===-1&&o.add(u))}return null}},Ce.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new W;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(at(arguments[2],Hi)&&arguments[0]instanceof Object&&arguments[1]instanceof pe)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var h=l.get(c);e.getIntersectsOp().intersects(h.getBounds(),o)&&(h instanceof pe?e.query(o,h,u):h instanceof $n?u.visitItem(h.getItem()):vt.shouldNeverReachHere())}else if(at(arguments[2],Zn)&&arguments[0]instanceof Object&&arguments[1]instanceof pe)for(var f=arguments[0],p=arguments[1],v=arguments[2],C=p.getChildBoundables(),S=0;S<C.size();S++){var P=C.get(S);e.getIntersectsOp().intersects(P.getBounds(),f)&&(P instanceof pe?e.query(f,P,v):P instanceof $n?v.add(P.getItem()):vt.shouldNeverReachHere())}}},Ce.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Ce.prototype.getRoot=function(){return this.build(),this._root},Ce.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(e.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof pe&&(a=e.remove(i,c,o),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Ce.prototype.createHigherLevels=function(e,t){vt.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)},Ce.prototype.depth=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof pe){var o=e.depth(s);o>n&&(n=o)}}return n+1}},Ce.prototype.createParentBoundables=function(e,t){var n=this;vt.isTrue(!e.isEmpty());var i=new W;i.add(this.createNode(t));var s=new W(e);tr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(t)),n.lastNode(i).addChildBoundable(a)}return i},Ce.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Ce.prototype.interfaces_=function(){return[An]},Ce.prototype.getClass=function(){return Ce},Ce.compareDoubles=function(e,t){return e>t?1:e<t?-1:0},hc.IntersectsOp.get=function(){return jE},hc.serialVersionUID.get=function(){return-3886435814360241e3},hc.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Ce,hc);var jE=function(){},_a=function(){};_a.prototype.distance=function(e,t){},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a};var Om=function(r){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;vt.isTrue(i.length>0);for(var a=new W,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},e.prototype.createNode=function(i){return new Dm(i)},e.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new W;for(var c=0;u.hasNext()&&c<o;){var h=u.next();a[l].add(h),c++}}return a},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(at(arguments[2],Hi)&&arguments[0]instanceof Object&&arguments[1]instanceof pe){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(at(arguments[2],Zn)&&arguments[0]instanceof Object&&arguments[1]instanceof pe){var c=arguments[0],h=arguments[1],f=arguments[2];r.prototype.query.call(this,c,h,f)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,s){vt.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new W(i);tr.sort(a,e.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(at(arguments[0],_a)){var i=arguments[0],s=new le(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof le){var o=arguments[0];return this.nearestNeighbour(o,ht.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&at(arguments[1],_a)){var a=arguments[0],u=arguments[1],l=new le(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof le&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=h,p=null,v=new Ci;for(v.add(c);!v.isEmpty()&&f>0;){var C=v.poll(),S=C.getDistance();if(S>=f)break;C.isLeaves()?(f=S,p=C):C.expandToQueue(v,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],y=arguments[1],_=arguments[2],m=new $n(P,y),w=new le(this.getRoot(),m,_);return this.nearestNeighbour(w)[0]}},e.prototype.interfaces_=function(){return[lo,An]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,s){return(i+s)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return Dm},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[sa]},compare:function(n,i){return r.compareDoubles(e.centreX(n.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[sa]},compare:function(n,i){return r.compareDoubles(e.centreY(n.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(Ce),Dm=function(r){function e(){var t=arguments[0];r.call(this,t)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new $(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pe),tn=function(){};tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},tn.relativeSign=function(e,t){return e<t?-1:e>t?1:0},tn.compare=function(e,t,n){if(t.equals2D(n))return 0;var i=tn.relativeSign(t.x,n.x),s=tn.relativeSign(t.y,n.y);switch(e){case 0:return tn.compareValue(i,s);case 1:return tn.compareValue(s,i);case 2:return tn.compareValue(s,-i);case 3:return tn.compareValue(-i,s);case 4:return tn.compareValue(-i,-s);case 5:return tn.compareValue(-s,-i);case 6:return tn.compareValue(-s,i);case 7:return tn.compareValue(i,-s)}return vt.shouldNeverReachHere("invalid octant value"),0},tn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var Xi=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._segString=e,this.coord=new M(t),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(n))};Xi.prototype.getCoordinate=function(){return this.coord},Xi.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},Xi.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:tn.compare(this._segmentOctant,this.coord,t.coord)},Xi.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e},Xi.prototype.isInterior=function(){return this._isInterior},Xi.prototype.interfaces_=function(){return[Ln]},Xi.prototype.getClass=function(){return Xi};var We=function(){this._nodeMap=new Fe,this._edge=null;var e=arguments[0];this._edge=e};We.prototype.getSplitCoordinates=function(){var e=this,t=new ju;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()},We.prototype.addCollapsedNodes=function(){var e=this,t=new W;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var i=n.next().intValue();e.add(e._edge.getCoordinate(i),i)}},We.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},We.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n<this._edge.size()-2;n++){var i=t._edge.getCoordinate(n),s=t._edge.getCoordinate(n+2);i.equals2D(s)&&e.add(new ar(n+1))}},We.prototype.addEdgeCoordinates=function(e,t,n){var i=this,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);n.add(new M(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new M(t.coord))},We.prototype.iterator=function(){return this._nodeMap.values().iterator()},We.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},We.prototype.findCollapseIndex=function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(n[0]=e.segmentIndex+1,!0):!1},We.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=t.findCollapseIndex(s,o,n);a&&e.add(new ar(n[0])),s=o}},We.prototype.getEdge=function(){return this._edge},We.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},We.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new M(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new M(t.coord)),new se(a,this._edge.getData())},We.prototype.add=function(e,t){var n=new Xi(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(n);return i!==null?(vt.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},We.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),n=e.get(0),i=n.getCoordinate(0);if(!i.equals2D(t[0]))throw new gi("bad split edge start point at "+i);var s=e.get(e.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(t[t.length-1]))throw new gi("bad split edge end point at "+a)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var co=function(){};co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co},co.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Xt("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?n>=i?0:1:n>=i?7:6:t>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new Xt("Cannot compute the octant for two identical points "+s);return co.octant(a,u)}};var Wr=function(){};Wr.prototype.getCoordinates=function(){},Wr.prototype.size=function(){},Wr.prototype.getCoordinate=function(e){},Wr.prototype.isClosed=function(){},Wr.prototype.setData=function(e){},Wr.prototype.getData=function(){},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Ju=function(){};Ju.prototype.addIntersection=function(e,t){},Ju.prototype.interfaces_=function(){return[Wr]},Ju.prototype.getClass=function(){return Ju};var se=function(){this._nodeList=new We(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};se.prototype.getCoordinates=function(){return this._pts},se.prototype.size=function(){return this._pts.length},se.prototype.getCoordinate=function(e){return this._pts[e]},se.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},se.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},se.prototype.setData=function(e){this._data=e},se.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:co.octant(e,t)},se.prototype.getData=function(){return this._data},se.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new M(n.getIntersection(s));this.addIntersection(o,i)}},se.prototype.toString=function(){return Jn.toLineString(new ie(this._pts))},se.prototype.getNodeList=function(){return this._nodeList},se.prototype.addIntersectionNode=function(e,t){var n=t,i=n+1;if(i<this._pts.length){var s=this._pts[i];e.equals2D(s)&&(n=i)}var o=this._nodeList.add(e,n);return o},se.prototype.addIntersections=function(e,t,n){for(var i=this,s=0;s<e.getIntersectionNum();s++)i.addIntersection(e,t,n,s)},se.prototype.interfaces_=function(){return[Ju]},se.prototype.getClass=function(){return se},se.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new W;return se.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var tt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new M,this.p1=new M;else if(arguments.length===1){var e=arguments[0];this.p0=new M(e.p0),this.p1=new M(e.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var t=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new M(t,n),this.p1=new M(i,s)}},Mm={serialVersionUID:{configurable:!0}};tt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},tt.prototype.orientationIndex=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=H.orientationIndex(this.p0,this.p1,e.p0),n=H.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof M){var i=arguments[0];return H.orientationIndex(this.p0,this.p1,i)}},tt.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},tt.prototype.isVertical=function(){return this.p0.x===this.p1.x},tt.prototype.equals=function(e){if(!(e instanceof tt))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},tt.prototype.intersection=function(e){var t=new ys;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},tt.prototype.project=function(){if(arguments[0]instanceof M){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new M(e);var t=this.projectionFactor(e),n=new M;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof tt){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new tt(a,u)}},tt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},tt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},tt.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1},tt.prototype.distancePerpendicular=function(e){return H.distancePointLinePerpendicular(e,this.p0,this.p1)},tt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},tt.prototype.midPoint=function(){return tt.midPoint(this.p0,this.p1)},tt.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=t*t+n*n;if(i<=0)return ht.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/i;return s},tt.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),i=ht.MAX_VALUE,s=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);s=a.distance(e.p1),s<i&&(i=s,n[0]=a,n[1]=e.p1);var u=e.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=e.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},tt.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var n=this.p0.distance(e),i=this.p1.distance(e);return n<i?this.p0:this.p1},tt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},tt.prototype.getLength=function(){return this.p0.distance(this.p1)},tt.prototype.compareTo=function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)},tt.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},tt.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},tt.prototype.lineIntersection=function(e){try{var t=Yn.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(n){if(!(n instanceof aa))throw n}finally{}return null},tt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},tt.prototype.pointAlongOffset=function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(t!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=t*s/a,l=t*o/a}var c=n-l,h=i+u,f=new M(c,h);return f},tt.prototype.setCoordinates=function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}},tt.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ht.isNaN(t))&&(t=1),t},tt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},tt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},tt.prototype.distance=function(){if(arguments[0]instanceof tt){var e=arguments[0];return H.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof M){var t=arguments[0];return H.distancePointLine(t,this.p0,this.p1)}},tt.prototype.pointAlong=function(e){var t=new M;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},tt.prototype.hashCode=function(){var e=ht.doubleToLongBits(this.p0.x);e^=ht.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=ht.doubleToLongBits(this.p1.x);n^=ht.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return t^i},tt.prototype.interfaces_=function(){return[Ln,An]},tt.prototype.getClass=function(){return tt},tt.midPoint=function(e,t){return new M((e.x+t.x)/2,(e.y+t.y)/2)},Mm.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(tt,Mm);var Zu=function(){this.tempEnv1=new $,this.tempEnv2=new $,this._overlapSeg1=new tt,this._overlapSeg2=new tt};Zu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu};var dn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=i};dn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},dn.prototype.computeSelect=function(e,t,n,i){var s=this._pts[t],o=this._pts[n];if(i.tempEnv1.init(s,o),n-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var a=Math.trunc((t+n)/2);t<a&&this.computeSelect(e,t,a,i),a<n&&this.computeSelect(e,a,n,i)},dn.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)t[n++]=e._pts[i];return t},dn.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},dn.prototype.setId=function(e){this._id=e},dn.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},dn.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new $(e,t)}return this._env},dn.prototype.getEndIndex=function(){return this._end},dn.prototype.getStartIndex=function(){return this._start},dn.prototype.getContext=function(){return this._context},dn.prototype.getId=function(){return this._id},dn.prototype.computeOverlapsInternal=function(e,t,n,i,s,o){var a=this._pts[e],u=this._pts[t],l=n._pts[i],c=n._pts[s];if(t-e===1&&s-i===1)return o.overlap(this,e,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((e+t)/2),f=Math.trunc((i+s)/2);e<h&&(i<f&&this.computeOverlapsInternal(e,h,n,i,f,o),f<s&&this.computeOverlapsInternal(e,h,n,f,s,o)),h<t&&(i<f&&this.computeOverlapsInternal(h,t,n,i,f,o),f<s&&this.computeOverlapsInternal(h,t,n,f,s,o))},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var vr=function(){};vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.getChainStartIndices=function(e){var t=0,n=new W;n.add(new ar(t));do{var i=vr.findChainEnd(e,t);n.add(new ar(i)),t=i}while(t<e.length-1);var s=vr.toIntArray(n);return s},vr.findChainEnd=function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var i=Bt.quadrant(e[n],e[n+1]),s=t+1;s<e.length;){if(!e[s-1].equals2D(e[s])){var o=Bt.quadrant(e[s-1],e[s]);if(o!==i)break}s++}return s-1},vr.getChains=function(){if(arguments.length===1){var e=arguments[0];return vr.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],n=arguments[1],i=new W,s=vr.getChainStartIndices(t),o=0;o<s.length-1;o++){var a=new dn(t,s[o],s[o+1],n);i.add(a)}return i}},vr.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Cs=function(){};Cs.prototype.computeNodes=function(e){},Cs.prototype.getNodedSubstrings=function(){},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var Ku=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};Ku.prototype.setSegmentIntersector=function(e){this._segInt=e},Ku.prototype.interfaces_=function(){return[Cs]},Ku.prototype.getClass=function(){return Ku};var hd=function(r){function e(n){n?r.call(this,n):r.call(this),this._monoChains=new W,this._index=new Om,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return se.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var s=this,o=vr.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},e.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var i=this,s=new Rm(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return Rm},Object.defineProperties(e,t),e}(Ku),Rm=function(r){function e(){r.call(this),this._si=null;var t=arguments[0];this._si=t}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zu),Lt=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Si={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Lt.prototype.getEndCapStyle=function(){return this._endCapStyle},Lt.prototype.isSingleSided=function(){return this._isSingleSided},Lt.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Lt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Lt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Lt.JOIN_ROUND&&(this._quadrantSegments=Lt.DEFAULT_QUADRANT_SEGMENTS)},Lt.prototype.getJoinStyle=function(){return this._joinStyle},Lt.prototype.setJoinStyle=function(e){this._joinStyle=e},Lt.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Lt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Lt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Lt.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Lt.prototype.getMitreLimit=function(){return this._mitreLimit},Lt.prototype.setMitreLimit=function(e){this._mitreLimit=e},Lt.prototype.setSingleSided=function(e){this._isSingleSided=e},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Si.CAP_ROUND.get=function(){return 1},Si.CAP_FLAT.get=function(){return 2},Si.CAP_SQUARE.get=function(){return 3},Si.JOIN_ROUND.get=function(){return 1},Si.JOIN_MITRE.get=function(){return 2},Si.JOIN_BEVEL.get=function(){return 3},Si.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Si.DEFAULT_MITRE_LIMIT.get=function(){return 5},Si.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Lt,Si);var te=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=H.COUNTERCLOCKWISE,this._inputLine=e||null},Qu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};te.prototype.isDeletable=function(e,t,n,i){var s=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,e,n,i)},te.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,n,i,e._distanceTol)&&(e._isDeleted[n]=te.DELETE,o=!0,s=!0),o?t=i:t=n,n=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(n)}return s},te.prototype.isShallowConcavity=function(e,t,n,i){var s=H.computeOrientation(e,t,n),o=s===this._angleOrientation;if(!o)return!1;var a=H.distancePointLine(t,e,n);return a<i},te.prototype.isShallowSampled=function(e,t,n,i,s){var o=this,a=Math.trunc((i-n)/te.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(e,t,o._inputLine[u],s))return!1;return!0},te.prototype.isConcave=function(e,t,n){var i=H.computeOrientation(e,t,n),s=i===this._angleOrientation;return s},te.prototype.simplify=function(e){var t=this;this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=H.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=t.deleteShallowConcavities();while(n);return this.collapseLine()},te.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===te.DELETE;)t++;return t},te.prototype.isShallow=function(e,t,n,i){var s=H.distancePointLine(t,e,n);return s<i},te.prototype.collapseLine=function(){for(var e=this,t=new ju,n=0;n<this._inputLine.length;n++)e._isDeleted[n]!==te.DELETE&&t.add(e._inputLine[n]);return t.toCoordinateArray()},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.simplify=function(e,t){var n=new te(e);return n.simplify(t)},Qu.INIT.get=function(){return 0},Qu.DELETE.get=function(){return 1},Qu.KEEP.get=function(){return 1},Qu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(te,Qu);var xn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new W},Lm={COORDINATE_ARRAY_TYPE:{configurable:!0}};xn.prototype.getCoordinates=function(){var e=this._ptList.toArray(xn.COORDINATE_ARRAY_TYPE);return e},xn.prototype.setPrecisionModel=function(e){this._precisionModel=e},xn.prototype.addPt=function(e){var t=new M(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},xn.prototype.revere=function(){},xn.prototype.addPts=function(e,t){var n=this;if(t)for(var i=0;i<e.length;i++)n.addPt(e[i]);else for(var s=e.length-1;s>=0;s--)n.addPt(e[s])},xn.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return n<this._minimimVertexDistance},xn.prototype.toString=function(){var e=new Ct,t=e.createLineString(this.getCoordinates());return t.toString()},xn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new M(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)},xn.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},Lm.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(xn,Lm);var bt=function(){},ho={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt},bt.toDegrees=function(e){return e*180/Math.PI},bt.normalize=function(e){for(;e>Math.PI;)e-=bt.PI_TIMES_2;for(;e<=-Math.PI;)e+=bt.PI_TIMES_2;return e},bt.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=n.x-t.x,s=n.y-t.y;return Math.atan2(s,i)}},bt.isAcute=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u>0},bt.isObtuse=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u<0},bt.interiorAngle=function(e,t,n){var i=bt.angle(t,e),s=bt.angle(t,n);return Math.abs(s-i)},bt.normalizePositive=function(e){if(e<0){for(;e<0;)e+=bt.PI_TIMES_2;e>=bt.PI_TIMES_2&&(e=0)}else{for(;e>=bt.PI_TIMES_2;)e-=bt.PI_TIMES_2;e<0&&(e=0)}return e},bt.angleBetween=function(e,t,n){var i=bt.angle(t,e),s=bt.angle(t,n);return bt.diff(i,s)},bt.diff=function(e,t){var n=null;return e<t?n=t-e:n=e-t,n>Math.PI&&(n=2*Math.PI-n),n},bt.toRadians=function(e){return e*Math.PI/180},bt.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?bt.COUNTERCLOCKWISE:n<0?bt.CLOCKWISE:bt.NONE},bt.angleBetweenOriented=function(e,t,n){var i=bt.angle(t,e),s=bt.angle(t,n),o=s-i;return o<=-Math.PI?o+bt.PI_TIMES_2:o>Math.PI?o-bt.PI_TIMES_2:o},ho.PI_TIMES_2.get=function(){return 2*Math.PI},ho.PI_OVER_2.get=function(){return Math.PI/2},ho.PI_OVER_4.get=function(){return Math.PI/4},ho.COUNTERCLOCKWISE.get=function(){return H.COUNTERCLOCKWISE},ho.CLOCKWISE.get=function(){return H.CLOCKWISE},ho.NONE.get=function(){return H.COLLINEAR},Object.defineProperties(bt,ho);var qt=function r(){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 tt,this._seg1=new tt,this._offset0=new tt,this._offset1=new tt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new ys,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===Lt.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},$u={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qt.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,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=H.computeOrientation(this._s0,this._s1,this._s2),i=n===H.CLOCKWISE&&this._side===U.LEFT||n===H.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(t):i?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},qt.prototype.addLineEndCap=function(e,t){var n=new tt(e,t),i=new tt;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var s=new tt;this.computeOffsetSegment(n,U.RIGHT,this._distance,s);var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Lt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,u+Math.PI/2,u-Math.PI/2,H.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Lt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Lt.CAP_SQUARE:var l=new M;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new M(i.p1.x+l.x,i.p1.y+l.y),h=new M(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(h);break}},qt.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e},qt.prototype.addMitreJoin=function(e,t,n,i){var s=!0,o=null;try{o=Yn.intersection(t.p0,t.p1,n.p0,n.p1);var a=i<=0?1:o.distance(e)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof aa)o=new M(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,i,this._bufParams.getMitreLimit())},qt.prototype.addFilletCorner=function(e,t,n,i,s){var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o),l=n.x-e.x,c=n.y-e.y,h=Math.atan2(c,l);i===H.CLOCKWISE?u<=h&&(u+=2*Math.PI):u>=h&&(u-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,u,h,i,s),this._segList.addPt(n)},qt.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Lt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Lt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},qt.prototype.createSquare=function(e){this._segList.addPt(new M(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new M(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new M(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new M(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},qt.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},qt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qt.prototype.initSideSegments=function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},qt.prototype.addLimitedMitreJoin=function(e,t,n,i){var s=this._seg0.p1,o=bt.angle(s,this._seg0.p0),a=bt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=bt.normalize(o+u),c=bt.normalize(l+Math.PI),h=i*n,f=h*Math.abs(Math.sin(u)),p=n-f,v=s.x+h*Math.cos(c),C=s.y+h*Math.sin(c),S=new M(v,C),P=new tt(s,S),y=P.pointAlongOffset(1,p),_=P.pointAlongOffset(1,-p);this._side===U.LEFT?(this._segList.addPt(y),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(y))},qt.prototype.computeOffsetSegment=function(e,t,n,i){var s=t===U.LEFT?1:-1,o=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,c=s*n*a/u;i.p0.x=e.p0.x-c,i.p0.y=e.p0.y+l,i.p1.x=e.p1.x-c,i.p1.y=e.p1.y+l},qt.prototype.addFilletArc=function(e,t,n,i,s){var o=this,a=i===H.CLOCKWISE?-1:1,u=Math.abs(t-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,h=u/l,f=c,p=new M;f<u;){var v=t+a*f;p.x=e.x+s*Math.cos(v),p.y=e.y+s*Math.sin(v),o._segList.addPt(p),f+=h}},qt.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new M((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new M((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qt.prototype.createCircle=function(e){var t=new M(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qt.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},qt.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new xn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*qt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qt.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===Lt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Lt.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,H.CLOCKWISE,this._distance))},qt.prototype.closeRing=function(){this._segList.closeRing()},qt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},$u.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},$u.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},$u.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},$u.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qt,$u);var en=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};en.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,i=Math.abs(t),s=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var o=s.getCoordinates();return n&&Et.reverse(o),o},en.prototype.computeSingleSidedBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=te.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(e,!1);var u=te.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},en.prototype.computeRingBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);t===U.RIGHT&&(i=-i);var s=te.simplify(e,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],t);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},en.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),i=te.simplify(e,n),s=i.length-1;t.initSideSegments(i[0],i[1],U.LEFT);for(var o=2;o<=s;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[s-1],i[s]);var a=te.simplify(e,-n),u=a.length-1;t.initSideSegments(a[u],a[u-1],U.LEFT);for(var l=u-2;l>=0;l--)t.addNextSegment(a[l],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},en.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Lt.CAP_ROUND:t.createCircle(e);break;case Lt.CAP_SQUARE:t.createSquare(e);break}},en.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),i=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o},en.prototype.getBufferParameters=function(){return this._bufParams},en.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},en.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return en.copyCoordinates(e);var i=this.getSegGen(n);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()},en.prototype.computeOffsetCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){var s=te.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=te.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},en.prototype.getSegGen=function(e){return new qt(this._precisionModel,this._bufParams,e)},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new M(e[n]);return t};var fo=function(){this._subgraphs=null,this._seg=new tt,this._cga=new H;var e=arguments[0];this._subgraphs=e},Am={DepthSegment:{configurable:!0}};fo.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=new W,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();t.y<o.getMinY()||t.y>o.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(at(arguments[2],Zn)&&arguments[0]instanceof M&&arguments[1]instanceof cd)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),h=0;h<c.length-1;h++){e._seg.p0=c[h],e._seg.p1=c[h+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(f<a.x)&&!e._seg.isHorizontal()&&!(a.y<e._seg.p0.y||a.y>e._seg.p1.y)&&H.computeOrientation(e._seg.p0,e._seg.p1,a)!==H.RIGHT){var p=u.getDepth(U.LEFT);e._seg.p0.equals(c[h])||(p=u.getDepth(U.RIGHT));var v=new Ss(e._seg,p);l.add(v)}}else if(at(arguments[2],Zn)&&arguments[0]instanceof M&&at(arguments[1],Zn))for(var C=arguments[0],S=arguments[1],P=arguments[2],y=S.iterator();y.hasNext();){var _=y.next();_.isForward()&&e.findStabbedSegments(C,_,P)}}},fo.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=tr.min(t);return n._leftDepth},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo},Am.DepthSegment.get=function(){return Ss},Object.defineProperties(fo,Am);var Ss=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new tt(e),this._leftDepth=t};Ss.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)},Ss.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)},Ss.prototype.toString=function(){return this._upwardSeg.toString()},Ss.prototype.interfaces_=function(){return[Ln]},Ss.prototype.getClass=function(){return Ss};var At=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};At.prototype.area=function(){return At.area(this.p0,this.p1,this.p2)},At.prototype.signedArea=function(){return At.signedArea(this.p0,this.p1,this.p2)},At.prototype.interpolateZ=function(e){if(e===null)throw new Xt("Supplied point is null.");return At.interpolateZ(e,this.p0,this.p1,this.p2)},At.prototype.longestSideLength=function(){return At.longestSideLength(this.p0,this.p1,this.p2)},At.prototype.isAcute=function(){return At.isAcute(this.p0,this.p1,this.p2)},At.prototype.circumcentre=function(){return At.circumcentre(this.p0,this.p1,this.p2)},At.prototype.area3D=function(){return At.area3D(this.p0,this.p1,this.p2)},At.prototype.centroid=function(){return At.centroid(this.p0,this.p1,this.p2)},At.prototype.inCentre=function(){return At.inCentre(this.p0,this.p1,this.p2)},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},At.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},At.det=function(e,t,n,i){return e*i-t*n},At.interpolateZ=function(e,t,n,i){var s=t.x,o=t.y,a=n.x-s,u=i.x-s,l=n.y-o,c=i.y-o,h=a*c-u*l,f=e.x-s,p=e.y-o,v=(c*f-u*p)/h,C=(-l*f+a*p)/h,S=t.z+v*(n.z-t.z)+C*(i.z-t.z);return S},At.longestSideLength=function(e,t,n){var i=e.distance(t),s=t.distance(n),o=n.distance(e),a=i;return s>a&&(a=s),o>a&&(a=o),a},At.isAcute=function(e,t,n){return!(!bt.isAcute(e,t,n)||!bt.isAcute(t,n,e)||!bt.isAcute(n,e,t))},At.circumcentre=function(e,t,n){var i=n.x,s=n.y,o=e.x-i,a=e.y-s,u=t.x-i,l=t.y-s,c=2*At.det(o,a,u,l),h=At.det(a,o*o+a*a,l,u*u+l*l),f=At.det(o,o*o+a*a,u,u*u+l*l),p=i-h/c,v=s+f/c;return new M(p,v)},At.perpendicularBisector=function(e,t){var n=t.x-e.x,i=t.y-e.y,s=new Yn(e.x+n/2,e.y+i/2,1),o=new Yn(e.x-i+n/2,e.y+n+i/2,1);return new Yn(s,o)},At.angleBisector=function(e,t,n){var i=t.distance(e),s=t.distance(n),o=i/(i+s),a=n.x-e.x,u=n.y-e.y,l=new M(e.x+o*a,e.y+o*u);return l},At.area3D=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=t.z-e.z,a=n.x-e.x,u=n.y-e.y,l=n.z-e.z,c=s*l-o*u,h=o*a-i*l,f=i*u-s*a,p=c*c+h*h+f*f,v=Math.sqrt(p)/2;return v},At.centroid=function(e,t,n){var i=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new M(i,s)},At.inCentre=function(e,t,n){var i=t.distance(n),s=e.distance(n),o=e.distance(t),a=i+s+o,u=(i*e.x+s*t.x+o*n.x)/a,l=(i*e.y+s*t.y+o*n.y)/a;return new M(u,l)};var jn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};jn.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,A.EXTERIOR,A.INTERIOR)},jn.prototype.addPolygon=function(e){var t=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var s=e.getExteriorRing(),o=Et.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,A.EXTERIOR,A.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var u=e.getInteriorRingN(a),l=Et.removeRepeatedPoints(u.getCoordinates());t._distance>0&&t.isErodedCompletely(u,-t._distance)||t.addPolygonRing(l,n,U.opposite(i),A.INTERIOR,A.EXTERIOR)}},jn.prototype.isTriangleErodedCompletely=function(e,t){var n=new At(e[0],e[1],e[2]),i=n.inCentre(),s=H.distancePointLine(i,n.p0,n.p1);return s<Math.abs(t)},jn.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=Et.removeRepeatedPoints(e.getCoordinates()),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,A.EXTERIOR,A.INTERIOR)},jn.prototype.addCurve=function(e,t,n){if(e===null||e.length<2)return null;var i=new se(e,new Vt(0,A.BOUNDARY,t,n));this._curveList.add(i)},jn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},jn.prototype.addPolygonRing=function(e,t,n,i,s){if(t===0&&e.length<zr.MINIMUM_VALID_SIZE)return null;var o=i,a=s;e.length>=zr.MINIMUM_VALID_SIZE&&H.isCCW(e)&&(o=s,a=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(u,o,a)},jn.prototype.add=function(e){if(e.isEmpty())return null;e instanceof fe?this.addPolygon(e):e instanceof $t?this.addLineString(e):e instanceof cn?this.addPoint(e):e instanceof ma?this.addCollection(e):e instanceof Es?this.addCollection(e):e instanceof Ur?this.addCollection(e):e instanceof Ue&&this.addCollection(e)},jn.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var i=e.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>s},jn.prototype.addCollection=function(e){for(var t=this,n=0;n<e.getNumGeometries();n++){var i=e.getGeometryN(n);t.add(i)}},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var wa=function(){};wa.prototype.locate=function(e){},wa.prototype.interfaces_=function(){return[]},wa.prototype.getClass=function(){return wa};var qr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};qr.prototype.next=function(){if(this._atStart)return this._atStart=!1,qr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new pa;var e=this._parent.getGeometryN(this._index++);return e instanceof Ue?(this._subcollectionIterator=new qr(e),this._subcollectionIterator.next()):e},qr.prototype.remove=function(){throw new Error(this.getClass().getName())},qr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},qr.prototype.interfaces_=function(){return[fa]},qr.prototype.getClass=function(){return qr},qr.isAtomic=function(e){return!(e instanceof Ue)};var Tn=function(){this._geom=null;var e=arguments[0];this._geom=e};Tn.prototype.locate=function(e){return Tn.locate(e,this._geom)},Tn.prototype.interfaces_=function(){return[wa]},Tn.prototype.getClass=function(){return Tn},Tn.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.isPointInRing(e,t.getCoordinates()):!1},Tn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Tn.isPointInRing(e,n))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i);if(Tn.isPointInRing(e,s))return!1}return!0},Tn.containsPoint=function(e,t){if(t instanceof fe)return Tn.containsPointInPolygon(e,t);if(t instanceof Ue)for(var n=new qr(t);n.hasNext();){var i=n.next();if(i!==t&&Tn.containsPoint(e,i))return!0}return!1},Tn.locate=function(e,t){return t.isEmpty()?A.EXTERIOR:Tn.containsPoint(e,t)?A.INTERIOR:A.EXTERIOR};var Ve=function(){this._edgeMap=new Fe,this._edgeList=null,this._ptInAreaLocation=[A.NONE,A.NONE]};Ve.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Ve.prototype.propagateSideLabels=function(e){for(var t=A.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(e)&&s.getLocation(e,U.LEFT)!==A.NONE&&(t=s.getLocation(e,U.LEFT))}if(t===A.NONE)return null;for(var o=t,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(e,U.ON)===A.NONE&&l.setLocation(e,U.ON,o),l.isArea(e)){var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(h!==A.NONE){if(h!==o)throw new Ei("side location conflict",u.getCoordinate());c===A.NONE&&vt.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=c}else vt.isTrue(l.getLocation(e,U.LEFT)===A.NONE,"found single null side"),l.setLocation(e,U.RIGHT,o),l.setLocation(e,U.LEFT,o)}}},Ve.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()},Ve.prototype.print=function(e){xe.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},Ve.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ve.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,i=t.get(n).getLabel(),s=i.getLocation(e,U.LEFT);vt.isTrue(s!==A.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();vt.isTrue(l.isArea(e),"Found non-area edge");var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(c===h||h!==o)return!1;o=c}return!0},Ve.prototype.findIndex=function(e){var t=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=t._edgeList.get(n);if(i===e)return n}return-1},Ve.prototype.iterator=function(){return this.getEdges().iterator()},Ve.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new W(this._edgeMap.values())),this._edgeList},Ve.prototype.getLocation=function(e,t,n){return this._ptInAreaLocation[e]===A.NONE&&(this._ptInAreaLocation[e]=Tn.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]},Ve.prototype.toString=function(){var e=new or;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
|
|
42
|
+
`}[e]};var Yn=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],n=arguments[1];this.x=t,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],s=arguments[1];this.x=i.y*s.w-s.y*i.w,this.y=s.x*i.w-i.x*s.w,this.w=i.x*s.y-s.x*i.y}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var o=arguments[0],a=arguments[1];this.x=o.y-a.y,this.y=a.x-o.x,this.w=o.x*a.y-a.x*o.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var h=arguments[0],f=arguments[1],p=arguments[2],v=arguments[3],C=h.y-f.y,S=f.x-h.x,P=h.x*f.y-f.x*h.y,y=p.y-v.y,_=v.x-p.x,m=p.x*v.y-v.x*p.y;this.x=S*m-_*P,this.y=y*P-C*m,this.w=C*_-y*S}};Yn.prototype.getY=function(){var e=this.y/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new aa;return e},Yn.prototype.getX=function(){var e=this.x/this.w;if(ht.isNaN(e)||ht.isInfinite(e))throw new aa;return e},Yn.prototype.getCoordinate=function(){var e=new M;return e.x=this.getX(),e.y=this.getY(),e},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn},Yn.intersection=function(e,t,n,i){var s=e.y-t.y,o=t.x-e.x,a=e.x*t.y-t.x*e.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,h=o*c-l*a,f=u*a-s*c,p=s*l-u*o,v=h/p,C=f/p;if(ht.isNaN(v)||ht.isInfinite(v)||ht.isNaN(C)||ht.isInfinite(C))throw new aa;return new M(v,C)};var $=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof r){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];this.init(s,o,a,u)}},Em={serialVersionUID:{configurable:!0}};$.prototype.getArea=function(){return this.getWidth()*this.getHeight()},$.prototype.equals=function(e){if(!(e instanceof $))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()},$.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new $;var t=this._minx>e._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,i=this._maxx<e._maxx?this._maxx:e._maxx,s=this._maxy<e._maxy?this._maxy:e._maxy;return new $(t,i,n,s)},$.prototype.isNull=function(){return this._maxx<this._minx},$.prototype.getMaxX=function(){return this._maxx},$.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];return this.covers(e.x,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];return this.isNull()||t.isNull()?!1:t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},$.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof $){var e=arguments[0];return this.isNull()||e.isNull()?!1:!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}else if(arguments[0]instanceof M){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},$.prototype.getMinY=function(){return this._miny},$.prototype.getMinX=function(){return this._minx},$.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},$.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},$.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},$.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0},$.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},$.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},$.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},$.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},$.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},$.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},$.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof $){var e=arguments[0];return this.covers(e)}else if(arguments[0]instanceof M){var t=arguments[0];return this.covers(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},$.prototype.centre=function(){return this.isNull()?null:new M((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},$.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof $){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},$.prototype.getMaxY=function(){return this._maxy},$.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxy<e._miny?n=e._miny-this._maxy:this._miny>e._maxy&&(n=this._miny-e._maxy),t===0?n:n===0?t:Math.sqrt(t*t+n*n)},$.prototype.hashCode=function(){var e=17;return e=37*e+M.hashCode(this._minx),e=37*e+M.hashCode(this._maxx),e=37*e+M.hashCode(this._miny),e=37*e+M.hashCode(this._maxy),e},$.prototype.interfaces_=function(){return[Ln,An]},$.prototype.getClass=function(){return $},$.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.x<t.x?e.x:t.x)&&n.x<=(e.x>t.x?e.x:t.x)&&n.y>=(e.y<t.y?e.y:t.y)&&n.y<=(e.y>t.y?e.y:t.y)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=Math.min(o.x,a.x),l=Math.max(o.x,a.x),c=Math.min(i.x,s.x),h=Math.max(i.x,s.x);return!(c>l||h<u||(u=Math.min(o.y,a.y),l=Math.max(o.y,a.y),c=Math.min(i.y,s.y),h=Math.max(i.y,s.y),c>l)||h<u)}},Em.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties($,Em);var ur={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},$l=function(e){this.geometryFactory=e||new Ct};$l.prototype.read=function(e){var t,n,i;e=e.replace(/[\n\r]/g," ");var s=ur.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(s=ur.emptyTypeStr.exec(e),s[2]=void 0),s&&(n=s[1].toLowerCase(),i=s[2],ua[n]&&(t=ua[n].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t},$l.prototype.write=function(e){return this.extractGeometry(e)},$l.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!pi[t])return null;var n=t.toUpperCase(),i;return e.isEmpty()?i=n+" EMPTY":i=n+"("+pi[t].apply(this,[e])+")",i};var pi={coordinate:function(e){return e.x+" "+e.y},point:function(e){return pi.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.point.apply(t,[e._geometries[i]])+")");return n.join(",")},linestring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(pi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},linearring:function(e){for(var t=this,n=[],i=0,s=e._points._coordinates.length;i<s;++i)n.push(pi.coordinate.apply(t,[e._points._coordinates[i]]));return n.join(",")},multilinestring:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.linestring.apply(t,[e._geometries[i]])+")");return n.join(",")},polygon:function(e){var t=this,n=[];n.push("("+pi.linestring.apply(this,[e._shell])+")");for(var i=0,s=e._holes.length;i<s;++i)n.push("("+pi.linestring.apply(t,[e._holes[i]])+")");return n.join(",")},multipolygon:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push("("+pi.polygon.apply(t,[e._geometries[i]])+")");return n.join(",")},geometrycollection:function(e){for(var t=this,n=[],i=0,s=e._geometries.length;i<s;++i)n.push(t.extractGeometry(e._geometries[i]));return n.join(",")}},ua={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(ur.spaces);return this.geometryFactory.createPoint(new M(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=e.trim().split(","),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.point.apply(t,[n]));return this.geometryFactory.createMultiPoint(s)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ur.spaces),n.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),n=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ur.spaces),n.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=e.trim().split(ur.parenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.linestring.apply(t,[n]));return this.geometryFactory.createMultiLineString(s)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var n,i,s,o=e.trim().split(ur.parenComma),a,u=[],l=0,c=o.length;l<c;++l)n=o[l].replace(ur.trimParens,"$1"),i=ua.linestring.apply(t,[n]),s=t.geometryFactory.createLinearRing(i._points),l===0?a=s:u.push(s);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=e.trim().split(ur.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)n=i[o].replace(ur.trimParens,"$1"),s.push(ua.polygon.apply(t,[n]));return this.geometryFactory.createMultiPolygon(s)},geometrycollection:function(e){var t=this;if(e===void 0)return this.geometryFactory.createGeometryCollection();e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=e.trim().split("|"),i=[],s=0,o=n.length;s<o;++s)i.push(t.read(n[s]));return this.geometryFactory.createGeometryCollection(i)}},Jn=function(e){this.parser=new $l(e)};Jn.prototype.write=function(e){return this.parser.write(e)},Jn.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var gi=function(r){function e(t){r.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new r().stack}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(Error),tc=function(r){function e(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var t=arguments[0];r.call(this,t)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gi),vt=function(){};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.shouldNeverReachHere=function(){if(arguments.length===0)vt.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new tc("Should never reach here"+(e!==null?": "+e:""))}},vt.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],vt.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new tc:new tc(t)},vt.equals=function(){var e,t,n;if(arguments.length===2)e=arguments[0],t=arguments[1],vt.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],n=arguments[2],!t.equals(e)))throw new tc("Expected "+e+" but encountered "+t+(n!==null?": "+n:""))};var Zt=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new M,this._intPt[1]=new M,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},so={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Zt.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},Zt.prototype.getTopologySummary=function(){var e=new or;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},Zt.prototype.computeIntersection=function(e,t,n,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,n,i)},Zt.prototype.getIntersectionNum=function(){return this._result},Zt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var e=arguments[0],t=this.getEdgeDistance(e,0),n=this.getEdgeDistance(e,1);t>n?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},Zt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Zt.prototype.setPrecisionModel=function(e){this._precisionModel=e},Zt.prototype.isInteriorIntersection=function(){var e=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var t=arguments[0],n=0;n<this._result;n++)if(!(e._intPt[n].equals2D(e._inputLines[t][0])||e._intPt[n].equals2D(e._inputLines[t][1])))return!0;return!1}},Zt.prototype.getIntersection=function(e){return this._intPt[e]},Zt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Zt.prototype.hasIntersection=function(){return this._result!==Zt.NO_INTERSECTION},Zt.prototype.getEdgeDistance=function(e,t){var n=Zt.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return n},Zt.prototype.isCollinear=function(){return this._result===Zt.COLLINEAR_INTERSECTION},Zt.prototype.toString=function(){return Jn.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Jn.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Zt.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},Zt.prototype.isIntersection=function(e){for(var t=this,n=0;n<this._result;n++)if(t._intPt[n].equals2D(e))return!0;return!1},Zt.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.computeEdgeDistance=function(e,t,n){var i=Math.abs(n.x-t.x),s=Math.abs(n.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(n))i>s?o=i:o=s;else{var a=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y);i>s?o=a:o=u,o===0&&!e.equals(t)&&(o=Math.max(a,u))}return vt.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o},Zt.nonRobustComputeEdgeDistance=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=Math.sqrt(i*i+s*s);return vt.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o},so.DONT_INTERSECT.get=function(){return 0},so.DO_INTERSECT.get=function(){return 1},so.COLLINEAR.get=function(){return 2},so.NO_INTERSECTION.get=function(){return 0},so.POINT_INTERSECTION.get=function(){return 1},so.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Zt,so);var ys=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var i=new $(this._inputLines[0][0],this._inputLines[0][1]),s=new $(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&s.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,$.intersects(i,s,n)&&H.orientationIndex(i,s,n)===0&&H.orientationIndex(s,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(s))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,i,s,o,a){a.x=this.smallestInAbsValue(n.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(n.y,i.y,s.y,o.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.safeHCoordinateIntersection=function(n,i,s,o){var a=null;try{a=Yn.intersection(n,i,s,o)}catch(u){if(u instanceof aa)a=e.nearestEndpoint(n,i,s,o);else throw u}finally{}return a},e.prototype.intersection=function(n,i,s,o){var a=this.intersectionWithNormalization(n,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new M(e.nearestEndpoint(n,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},e.prototype.smallestInAbsValue=function(n,i,s,o){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(s)<u&&(a=s,u=Math.abs(s)),Math.abs(o)<u&&(a=o),a},e.prototype.checkDD=function(n,i,s,o,a){var u=$e.intersection(n,i,s,o),l=this.isInSegmentEnvelopes(u);xe.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&xe.out.println("Distance = "+a.distance(u))},e.prototype.intersectionWithNormalization=function(n,i,s,o){var a=new M(n),u=new M(i),l=new M(s),c=new M(o),h=new M;this.normalizeToEnvCentre(a,u,l,c,h);var f=this.safeHCoordinateIntersection(a,u,l,c);return f.x+=h.x,f.y+=h.y,f},e.prototype.computeCollinearIntersection=function(n,i,s,o){var a=$.intersects(n,i,s),u=$.intersects(n,i,o),l=$.intersects(s,o,n),c=$.intersects(s,o,i);return a&&u?(this._intPt[0]=s,this._intPt[1]=o,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,i,s,o,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,h=n.y>i.y?n.y:i.y,f=s.x<o.x?s.x:o.x,p=s.y<o.y?s.y:o.y,v=s.x>o.x?s.x:o.x,C=s.y>o.y?s.y:o.y,S=u>f?u:f,P=c<v?c:v,y=l>p?l:p,_=h<C?h:C,m=(S+P)/2,w=(y+_)/2;a.x=m,a.y=w,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,s.x-=a.x,s.y-=a.y,o.x-=a.x,o.y-=a.y},e.prototype.computeIntersect=function(n,i,s,o){if(this._isProper=!1,!$.intersects(n,i,s,o))return r.NO_INTERSECTION;var a=H.orientationIndex(n,i,s),u=H.orientationIndex(n,i,o);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=H.orientationIndex(s,o,n),c=H.orientationIndex(s,o,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var h=a===0&&u===0&&l===0&&c===0;return h?this.computeCollinearIntersection(n,i,s,o):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(s)||n.equals2D(o)?this._intPt[0]=n:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new M(s):u===0?this._intPt[0]=new M(o):l===0?this._intPt[0]=new M(n):c===0&&(this._intPt[0]=new M(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,s,o)),r.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,i,s,o){var a=n,u=H.distancePointLine(n,s,o),l=H.distancePointLine(i,s,o);return l<u&&(u=l,a=i),l=H.distancePointLine(s,n,i),l<u&&(u=l,a=s),l=H.distancePointLine(o,n,i),l<u&&(u=l,a=o),a},e}(Zt),oo=function(){};oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.orientationIndex=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=n.x-t.x,a=n.y-t.y;return oo.signOfDet2x2(i,s,o,a)},oo.signOfDet2x2=function(e,t,n,i){var s=null,o=null,a=null;if(s=1,e===0||i===0)return t===0||n===0?0:t>0?n>0?-s:s:n>0?s:-s;if(t===0||n===0)return i>0?e>0?s:-s:e>0?-s:s;if(t>0?i>0?t<=i||(s=-s,o=e,e=n,n=o,o=t,t=i,i=o):t<=-i?(s=-s,n=-n,i=-i):(o=e,e=-n,n=o,o=t,t=-i,i=o):i>0?-t<=i?(s=-s,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,n=-n,i=-i):(s=-s,o=-e,e=-n,n=o,o=-t,t=-i,i=o),e>0)if(n>0){if(!(e<=n))return s}else return s;else{if(n>0)return-s;if(e>=n)s=-s,e=-e,n=-n;else return-s}for(;;){if(a=Math.floor(n/e),n=n-a*e,i=i-a*t,i<0)return-s;if(i>t)return s;if(e>n+n){if(t<i+i)return s}else{if(t>i+i)return-s;n=e-n,i=t-i,s=-s}if(i===0)return n===0?0:-s;if(n===0||(a=Math.floor(e/n),e=e-a*n,t=t-a*i,t<0))return s;if(t>i)return-s;if(n>e+e){if(i<t+t)return-s}else{if(i>t+t)return s;e=n-e,t=i-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var lr=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};lr.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var n=e.x,i=t.x;return n>i&&(n=t.x,i=e.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var s=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,u=t.y-this._p.y,l=oo.signOfDet2x2(s,o,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<o&&(l=-l),l>0&&this._crossingCount++}},lr.prototype.isPointInPolygon=function(){return this.getLocation()!==A.EXTERIOR},lr.prototype.getLocation=function(){return this._isPointOnSegment?A.BOUNDARY:this._crossingCount%2===1?A.INTERIOR:A.EXTERIOR},lr.prototype.isOnSegment=function(){return this._isPointOnSegment},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},lr.locatePointInRing=function(){if(arguments[0]instanceof M&&at(arguments[1],xt)){for(var e=arguments[0],t=arguments[1],n=new lr(e),i=new M,s=new M,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,s),n.countSegment(i,s),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof M&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new lr(a),c=1;c<u.length;c++){var h=u[c],f=u[c-1];if(l.countSegment(h,f),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var H=function(){},ao={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.orientationIndex=function(e,t,n){return $e.orientationIndex(e,t,n)},H.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,n=e[0].x,i=1;i<e.length-1;i++){var s=e[i].x-n,o=e[i+1].y,a=e[i-1].y;t+=s*(a-o)}return t/2}else if(at(arguments[0],xt)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new M,h=new M,f=new M;u.getCoordinate(0,h),u.getCoordinate(1,f);var p=h.x;f.x-=p;for(var v=0,C=1;C<l-1;C++)c.y=h.y,h.x=f.x,h.y=f.y,u.getCoordinate(C+1,f),f.x-=p,v+=h.x*(c.y-f.y);return v/2}},H.distanceLineLine=function(e,t,n,i){if(e.equals(t))return H.distancePointLine(e,n,i);if(n.equals(i))return H.distancePointLine(i,e,t);var s=!1;if(!$.intersects(e,t,n,i))s=!0;else{var o=(t.x-e.x)*(i.y-n.y)-(t.y-e.y)*(i.x-n.x);if(o===0)s=!0;else{var a=(e.y-n.y)*(i.x-n.x)-(e.x-n.x)*(i.y-n.y),u=(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y),l=u/o,c=a/o;(c<0||c>1||l<0||l>1)&&(s=!0)}}return s?Pn.min(H.distancePointLine(e,n,i),H.distancePointLine(t,n,i),H.distancePointLine(n,e,t),H.distancePointLine(i,e,t)):0},H.isPointInRing=function(e,t){return H.locatePointInRing(e,t)!==A.EXTERIOR},H.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,i=new M;e.getCoordinate(0,i);for(var s=i.x,o=i.y,a=1;a<t;a++){e.getCoordinate(a,i);var u=i.x,l=i.y,c=u-s,h=l-o;n+=Math.sqrt(c*c+h*h),s=u,o=l}return n},H.isCCW=function(e){var t=e.length-1;if(t<3)throw new Xt("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=e[0],i=0,s=1;s<=t;s++){var o=e[s];o.y>n.y&&(n=o,i=s)}var a=i;do a=a-1,a<0&&(a=t);while(e[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%t;while(e[u].equals2D(n)&&u!==i);var l=e[a],c=e[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var h=H.computeOrientation(l,n,c),f=!1;return h===0?f=l.x>c.x:f=h>0,f},H.locatePointInRing=function(e,t){return lr.locatePointInRing(e,t)},H.distancePointLinePerpendicular=function(e,t,n){var i=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),s=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/i;return Math.abs(s)*Math.sqrt(i)},H.computeOrientation=function(e,t,n){return H.orientationIndex(e,t,n)},H.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Xt("Line array must contain at least one vertex");for(var n=e.distance(t[0]),i=0;i<t.length-1;i++){var s=H.distancePointLine(e,t[i],t[i+1]);s<n&&(n=s)}return n}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return o.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((o.x-a.x)*(u.x-a.x)+(o.y-a.y)*(u.y-a.y))/l;if(c<=0)return o.distance(a);if(c>=1)return o.distance(u);var h=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(h)*Math.sqrt(l)}},H.isOnLine=function(e,t){for(var n=new ys,i=1;i<t.length;i++){var s=t[i-1],o=t[i];if(n.computeIntersection(e,s,o),n.hasIntersection())return!0}return!1},ao.CLOCKWISE.get=function(){return-1},ao.RIGHT.get=function(){return H.CLOCKWISE},ao.COUNTERCLOCKWISE.get=function(){return 1},ao.LEFT.get=function(){return H.COUNTERCLOCKWISE},ao.COLLINEAR.get=function(){return 0},ao.STRAIGHT.get=function(){return H.COLLINEAR},Object.defineProperties(H,ao);var mi=function(){};mi.prototype.filter=function(e){},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var ot=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},Br={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ot.prototype.isGeometryCollection=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION},ot.prototype.getFactory=function(){return this._factory},ot.prototype.getGeometryN=function(e){return this},ot.prototype.getArea=function(){return 0},ot.prototype.isRectangle=function(){return!1},ot.prototype.equals=function(){if(arguments[0]instanceof ot){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof ot))return!1;var n=t;return this.equalsExact(n)}},ot.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},ot.prototype.geometryChanged=function(){this.apply(ot.geometryChangedFilter)},ot.prototype.geometryChangedAction=function(){this._envelope=null},ot.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())},ot.prototype.getLength=function(){return 0},ot.prototype.getNumGeometries=function(){return 1},ot.prototype.compareTo=function(){if(arguments.length===1){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},ot.prototype.getUserData=function(){return this._userData},ot.prototype.getSRID=function(){return this._SRID},ot.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ot.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION)throw new Xt("This method does not support GeometryCollection arguments")},ot.prototype.equal=function(e,t,n){return n===0?e.equals(t):e.distance(t)<=n},ot.prototype.norm=function(){var e=this.copy();return e.normalize(),e},ot.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ot.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new $(this._envelope)},ot.prototype.setSRID=function(e){this._SRID=e},ot.prototype.setUserData=function(e){this._userData=e},ot.prototype.compare=function(e,t){for(var n=e.iterator(),i=t.iterator();n.hasNext()&&i.hasNext();){var s=n.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},ot.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ot.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ot.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ot.SORTINDEX_MULTIPOINT||this.getSortIndex()===ot.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ot.SORTINDEX_MULTIPOLYGON},ot.prototype.interfaces_=function(){return[Ql,Ln,An]},ot.prototype.getClass=function(){return ot},ot.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},ot.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1},Br.serialVersionUID.get=function(){return 8763622679187377e3},Br.SORTINDEX_POINT.get=function(){return 0},Br.SORTINDEX_MULTIPOINT.get=function(){return 1},Br.SORTINDEX_LINESTRING.get=function(){return 2},Br.SORTINDEX_LINEARRING.get=function(){return 3},Br.SORTINDEX_MULTILINESTRING.get=function(){return 4},Br.SORTINDEX_POLYGON.get=function(){return 5},Br.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Br.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Br.geometryChangedFilter.get=function(){return ed},Object.defineProperties(ot,Br);var ed=function(){};ed.interfaces_=function(){return[mi]},ed.filter=function(e){e.geometryChangedAction()};var jr=function(){};jr.prototype.filter=function(e){},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr};var Fn=function(){},vi={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Fn.prototype.isInBoundary=function(e){},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},vi.Mod2BoundaryNodeRule.get=function(){return la},vi.EndPointBoundaryNodeRule.get=function(){return ca},vi.MultiValentEndPointBoundaryNodeRule.get=function(){return ha},vi.MonoValentEndPointBoundaryNodeRule.get=function(){return da},vi.MOD2_BOUNDARY_RULE.get=function(){return new la},vi.ENDPOINT_BOUNDARY_RULE.get=function(){return new ca},vi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ha},vi.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new da},vi.OGC_SFS_BOUNDARY_RULE.get=function(){return Fn.MOD2_BOUNDARY_RULE},Object.defineProperties(Fn,vi);var la=function(){};la.prototype.isInBoundary=function(e){return e%2===1},la.prototype.interfaces_=function(){return[Fn]},la.prototype.getClass=function(){return la};var ca=function(){};ca.prototype.isInBoundary=function(e){return e>0},ca.prototype.interfaces_=function(){return[Fn]},ca.prototype.getClass=function(){return ca};var ha=function(){};ha.prototype.isInBoundary=function(e){return e>1},ha.prototype.interfaces_=function(){return[Fn]},ha.prototype.getClass=function(){return ha};var da=function(){};da.prototype.isInBoundary=function(e){return e===1},da.prototype.interfaces_=function(){return[Fn]},da.prototype.getClass=function(){return da};var de=function(){};de.prototype.add=function(){},de.prototype.addAll=function(){},de.prototype.isEmpty=function(){},de.prototype.iterator=function(){},de.prototype.size=function(){},de.prototype.toArray=function(){},de.prototype.remove=function(){};function nd(r){this.message=r||""}nd.prototype=new Error,nd.prototype.name="IndexOutOfBoundsException";var fa=function(){};fa.prototype.hasNext=function(){},fa.prototype.next=function(){},fa.prototype.remove=function(){};var Zn=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(de);function pa(r){this.message=r||""}pa.prototype=new Error,pa.prototype.name="NoSuchElementException";var W=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[r,de]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(n,i){var s=this.array_[n];return this.array_[n]=i,s},e.prototype.iterator=function(){return new TE(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new nd;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.remove=function(n){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===n){i.array_.splice(o,1),s=!0;break}return s},e}(Zn),TE=function(r){function e(t){r.call(this),this.arrayList_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new pa;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(fa),ju=function(r){function e(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(i){return this.get(i)},e.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=!1,u=s.iterator();u.hasNext();)i.add(u.next(),o),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,s=r.prototype.clone.call(this),o=0;o<this.size();o++)s.add(o,i.get(o).copy());return s},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var i=this;if(arguments.length===1){var s=arguments[0];r.prototype.add.call(this,s)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1];return this.add(o,a,!0),!0}else if(arguments[0]instanceof M&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var h=arguments[0],f=arguments[1];return this.add(h,f),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var p=arguments[0],v=arguments[1],C=arguments[2];if(C)for(var S=0;S<p.length;S++)i.add(p[S],v);else for(var P=p.length-1;P>=0;P--)i.add(p[P],v);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof M){var y=arguments[0],_=arguments[1],m=arguments[2];if(!m){var w=this.size();if(w>0){if(y>0){var E=this.get(y-1);if(E.equals2D(_))return null}if(y<w){var b=this.get(y);if(b.equals2D(_))return null}}}r.prototype.add.call(this,y,_)}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],D=arguments[2],x=arguments[3],O=1;D>x&&(O=-1);for(var L=D;L!==x;L+=O)i.add(I[L],T);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new M(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(W),Et=function(){},ec={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};ec.ForwardComparator.get=function(){return zu},ec.BidirectionalComparator.get=function(){return ga},ec.coordArrayType.get=function(){return new Array(0).fill(null)},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},Et.ptNotInList=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(Et.indexOf(i,t)<0)return i}return null},Et.scroll=function(e,t){var n=Et.indexOf(t,e);if(n<0)return null;var i=new Array(e.length).fill(null);xe.arraycopy(e,n,i,0,e.length-n),xe.arraycopy(e,0,i,e.length-n,n),xe.arraycopy(i,0,e,0,e.length)},Et.equals=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(e===null||t===null||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].equals(t[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(i===s)return!0;if(i===null||s===null||i.length!==s.length)return!1;for(var a=0;a<i.length;a++)if(o.compare(i[a],s[a])!==0)return!1;return!0}},Et.intersection=function(e,t){for(var n=new ju,i=0;i<e.length;i++)t.intersects(e[i])&&n.add(e[i],!0);return n.toCoordinateArray()},Et.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},Et.removeRepeatedPoints=function(e){if(!Et.hasRepeatedPoints(e))return e;var t=new ju(e,!1);return t.toCoordinateArray()},Et.reverse=function(e){for(var t=e.length-1,n=Math.trunc(t/2),i=0;i<=n;i++){var s=e[i];e[i]=e[t-i],e[t-i]=s}},Et.removeNull=function(e){for(var t=0,n=0;n<e.length;n++)e[n]!==null&&t++;var i=new Array(t).fill(null);if(t===0)return i;for(var s=0,o=0;o<e.length;o++)e[o]!==null&&(i[s++]=e[o]);return i},Et.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),n=0;n<e.length;n++)t[n]=new M(e[n]);return t}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)o[a+l]=new M(i[s+l])},Et.isEqualReversed=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],s=t[e.length-n-1];if(i.compareTo(s)!==0)return!1}return!0},Et.envelope=function(e){for(var t=new $,n=0;n<e.length;n++)t.expandToInclude(e[n]);return t},Et.toCoordinateArray=function(e){return e.toArray(Et.coordArrayType)},Et.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},Et.indexOf=function(e,t){for(var n=0;n<t.length;n++)if(e.equals(t[n]))return n;return-1},Et.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var n=e.length-1-t,i=e[t].compareTo(e[n]);if(i!==0)return i}return 1},Et.compare=function(e,t){for(var n=0;n<e.length&&n<t.length;){var i=e[n].compareTo(t[n]);if(i!==0)return i;n++}return n<t.length?-1:n<e.length?1:0},Et.minCoordinate=function(e){for(var t=null,n=0;n<e.length;n++)(t===null||t.compareTo(e[n])>0)&&(t=e[n]);return t},Et.extract=function(e,t,n){t=Pn.clamp(t,0,e.length),n=Pn.clamp(n,-1,e.length);var i=n-t+1;n<0&&(i=0),t>=e.length&&(i=0),n<t&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=t;a<=n;a++)s[o++]=e[a];return s},Object.defineProperties(Et,ec);var zu=function(){};zu.prototype.compare=function(e,t){var n=e,i=t;return Et.compare(n,i)},zu.prototype.interfaces_=function(){return[sa]},zu.prototype.getClass=function(){return zu};var ga=function(){};ga.prototype.compare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var s=Et.compare(n,i),o=Et.isEqualReversed(n,i);return o?0:s},ga.prototype.OLDcompare=function(e,t){var n=e,i=t;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var s=Et.increasingDirection(n),o=Et.increasingDirection(i),a=s>0?0:n.length-1,u=o>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=s,u+=o}return 0},ga.prototype.interfaces_=function(){return[sa]},ga.prototype.getClass=function(){return ga};var uo=function(){};uo.prototype.get=function(){},uo.prototype.put=function(){},uo.prototype.size=function(){},uo.prototype.values=function(){},uo.prototype.entrySet=function(){};var NE=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e}(uo);function Uu(r){this.message=r||""}Uu.prototype=new Error,Uu.prototype.name="OperationNotSupported";function nc(){}nc.prototype=new de,nc.prototype.contains=function(){};var rd=function(r){function e(){r.call(this),this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.contains=function(n){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===n)return!0}return!1},e.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},e.prototype.addAll=function(n){for(var i=this,s=n.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.remove=function(n){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.toArray=function(){for(var n=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(n.array_[s]);return i},e.prototype.iterator=function(){return new OE(this)},e}(nc),OE=function(r){function e(t){r.call(this),this.hashSet_=t,this.position_=0}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new pa;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Uu},e}(fa),yi=0,_s=1;function Cm(r){return r===null?yi:r.color}function Ut(r){return r===null?null:r.parent}function _i(r,e){r!==null&&(r.color=e)}function id(r){return r===null?null:r.left}function Sm(r){return r===null?null:r.right}function Fe(){this.root_=null,this.size_=0}Fe.prototype=new NE,Fe.prototype.get=function(r){for(var e=this.root_;e!==null;){var t=r.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null},Fe.prototype.put=function(r,e){if(this.root_===null)return this.root_={key:r,value:e,left:null,right:null,parent:null,color:yi,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,n,i;do if(n=t,i=r.compareTo(t.key),i<0)t=t.left;else if(i>0)t=t.right;else{var s=t.value;return t.value=e,s}while(t!==null);var o={key:r,left:null,right:null,value:e,parent:n,color:yi,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},Fe.prototype.fixAfterInsertion=function(r){var e=this;for(r.color=_s;r!=null&&r!==this.root_&&r.parent.color===_s;)if(Ut(r)===id(Ut(Ut(r)))){var t=Sm(Ut(Ut(r)));Cm(t)===_s?(_i(Ut(r),yi),_i(t,yi),_i(Ut(Ut(r)),_s),r=Ut(Ut(r))):(r===Sm(Ut(r))&&(r=Ut(r),e.rotateLeft(r)),_i(Ut(r),yi),_i(Ut(Ut(r)),_s),e.rotateRight(Ut(Ut(r))))}else{var n=id(Ut(Ut(r)));Cm(n)===_s?(_i(Ut(r),yi),_i(n,yi),_i(Ut(Ut(r)),_s),r=Ut(Ut(r))):(r===id(Ut(r))&&(r=Ut(r),e.rotateRight(r)),_i(Ut(r),yi),_i(Ut(Ut(r)),_s),e.rotateLeft(Ut(Ut(r))))}this.root_.color=yi},Fe.prototype.values=function(){var r=new W,e=this.getFirstEntry();if(e!==null)for(r.add(e.value);(e=Fe.successor(e))!==null;)r.add(e.value);return r},Fe.prototype.entrySet=function(){var r=new rd,e=this.getFirstEntry();if(e!==null)for(r.add(e);(e=Fe.successor(e))!==null;)r.add(e);return r},Fe.prototype.rotateLeft=function(r){if(r!=null){var e=r.right;r.right=e.left,e.left!=null&&(e.left.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.left===r?r.parent.left=e:r.parent.right=e,e.left=r,r.parent=e}},Fe.prototype.rotateRight=function(r){if(r!=null){var e=r.left;r.left=e.right,e.right!=null&&(e.right.parent=r),e.parent=r.parent,r.parent===null?this.root_=e:r.parent.right===r?r.parent.right=e:r.parent.left=e,e.right=r,r.parent=e}},Fe.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Fe.successor=function(r){if(r===null)return null;if(r.right!==null){for(var e=r.right;e.left!==null;)e=e.left;return e}else{for(var t=r.parent,n=r;t!==null&&n===t.right;)n=t,t=t.parent;return t}},Fe.prototype.size=function(){return this.size_};var Gu=function(){};Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu};function bm(){}bm.prototype=new nc;function cr(){this.array_=[],arguments[0]instanceof de&&this.addAll(arguments[0])}cr.prototype=new bm,cr.prototype.contains=function(r){for(var e=this,t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===0)return!0}return!1},cr.prototype.add=function(r){var e=this;if(this.contains(r))return!1;for(var t=0,n=this.array_.length;t<n;t++){var i=e.array_[t];if(i.compareTo(r)===1)return e.array_.splice(t,0,r),!0}return this.array_.push(r),!0},cr.prototype.addAll=function(r){for(var e=this,t=r.iterator();t.hasNext();)e.add(t.next());return!0},cr.prototype.remove=function(r){throw new Uu},cr.prototype.size=function(){return this.array_.length},cr.prototype.isEmpty=function(){return this.array_.length===0},cr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e},cr.prototype.iterator=function(){return new rc(this)};var rc=function(r){this.treeSet_=r,this.position_=0};rc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new pa;return this.treeSet_.array_[this.position_++]},rc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},rc.prototype.remove=function(){throw new Uu};var ws=function(){};ws.sort=function(){var e=arguments[0],t,n,i,s;if(arguments.length===1)s=function(a,u){return a.compareTo(u)},e.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,u){return i.compare(a,u)},e.sort(s);else if(arguments.length===3){n=e.slice(arguments[1],arguments[2]),n.sort();var o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length));for(e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])}else if(arguments.length===4)for(n=e.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,u){return i.compare(a,u)},n.sort(s),o=e.slice(0,arguments[1]).concat(n,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])},ws.asList=function(e){for(var t=new W,n=0,i=e.length;n<i;n++)t.add(e[n]);return t};var Mt=function(){},Kn={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Kn.P.get=function(){return 0},Kn.L.get=function(){return 1},Kn.A.get=function(){return 2},Kn.FALSE.get=function(){return-1},Kn.TRUE.get=function(){return-2},Kn.DONTCARE.get=function(){return-3},Kn.SYM_FALSE.get=function(){return"F"},Kn.SYM_TRUE.get=function(){return"T"},Kn.SYM_DONTCARE.get=function(){return"*"},Kn.SYM_P.get=function(){return"0"},Kn.SYM_L.get=function(){return"1"},Kn.SYM_A.get=function(){return"2"},Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.toDimensionSymbol=function(e){switch(e){case Mt.FALSE:return Mt.SYM_FALSE;case Mt.TRUE:return Mt.SYM_TRUE;case Mt.DONTCARE:return Mt.SYM_DONTCARE;case Mt.P:return Mt.SYM_P;case Mt.L:return Mt.SYM_L;case Mt.A:return Mt.SYM_A}throw new Xt("Unknown dimension value: "+e)},Mt.toDimensionValue=function(e){switch(Vu.toUpperCase(e)){case Mt.SYM_FALSE:return Mt.FALSE;case Mt.SYM_TRUE:return Mt.TRUE;case Mt.SYM_DONTCARE:return Mt.DONTCARE;case Mt.SYM_P:return Mt.P;case Mt.SYM_L:return Mt.L;case Mt.SYM_A:return Mt.A}throw new Xt("Unknown dimension symbol: "+e)},Object.defineProperties(Mt,Kn);var hr=function(){};hr.prototype.filter=function(e){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var Qn=function(){};Qn.prototype.filter=function(e,t){},Qn.prototype.isDone=function(){},Qn.prototype.isGeometryChanged=function(){},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var Ue=function(r){function e(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new Xt("geometries must not contain null elements")}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new $,o=0;o<this._geometries.length;o++)s.expandToInclude(i._geometries[o].getEnvelopeInternal());return s},e.prototype.getGeometryN=function(i){return this._geometries[i]},e.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var i=this,s=new Array(this.getNumPoints()).fill(null),o=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)o++,s[o]=u[l];return s},e.prototype.getArea=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getArea();return s},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();ws.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,s=Mt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getBoundaryDimension());return s},e.prototype.getDimension=function(){for(var i=this,s=Mt.FALSE,o=0;o<this._geometries.length;o++)s=Math.max(s,i._geometries[o].getDimension());return s},e.prototype.getLength=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=0,o=0;o<this._geometries.length;o++)s+=i._geometries[o].getNumPoints();return s},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(o)},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=new cr(ws.asList(this._geometries)),a=new cr(ws.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,h=this.getNumGeometries(),f=c.getNumGeometries(),p=0;p<h&&p<f;){var v=i.getGeometryN(p),C=c.getGeometryN(p),S=v.compareToSameClass(C,l);if(S!==0)return S;p++}return p<h?1:p<f?-1:0}},e.prototype.apply=function(){var i=this;if(at(arguments[0],jr))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(at(arguments[0],Qn)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(at(arguments[0],mi)){var h=arguments[0];h.filter(this);for(var f=0;f<this._geometries.length;f++)i._geometries[f].apply(h)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),vt.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._geometries=new Array(this._geometries.length).fill(null);for(var o=0;o<this._geometries.length;o++)s._geometries[o]=i._geometries[o].clone();return s},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.isEmpty=function(){for(var i=this,s=0;s<this._geometries.length;s++)if(!i._geometries[s].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(e,t),e}(ot),Es=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var s=0;s<this._geometries.length;s++)if(!i._geometries[s].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[s-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(o)},e.prototype.getBoundary=function(){return new kn(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Gu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Ue),kn=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Fn.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};kn.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return t.length===1?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)},kn.prototype.getBoundary=function(){return this._geom instanceof $t?this.boundaryLineString(this._geom):this._geom instanceof Es?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},kn.prototype.boundaryLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(e.isClosed()){var t=this._bnRule.isInBoundary(2);return t?e.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},kn.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},kn.prototype.computeBoundaryCoordinates=function(e){var t=this,n=new W;this._endpointMap=new Fe;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);s.getNumPoints()!==0&&(t.addEndpoint(s.getCoordinateN(0)),t.addEndpoint(s.getCoordinateN(s.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var a=o.next(),u=a.getValue(),l=u.count;t._bnRule.isInBoundary(l)&&n.add(a.getKey())}return Et.toCoordinateArray(n)},kn.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new ic,this._endpointMap.put(e,t)),t.count++},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new kn(e);return t.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new kn(n,i);return s.getBoundary()}};var ic=function(){this.count=null};ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic};function DE(){}function ME(){}var RE=function(){};function LE(){}function AE(){}function FE(){}var Vn=function(){},sd={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.chars=function(e,t){for(var n=new Array(t).fill(null),i=0;i<t;i++)n[i]=e;return String(n)},Vn.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new LE,n=new DE;return e.printStackTrace(n),t.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new ME(Vn.getStackTrace(i));for(var a=new FE,u=0;u<s;u++)try{o+=a.readLine()+Vn.NEWLINE}catch(l){if(l instanceof AE)vt.shouldNeverReachHere();else throw l}finally{}return o}},Vn.split=function(e,t){for(var n=t.length,i=new W,s=""+e,o=s.indexOf(t);o>=0;){var a=s.substring(0,o);i.add(a),s=s.substring(o+n),o=s.indexOf(t)}s.length>0&&i.add(s);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},Vn.toString=function(){if(arguments.length===1){var e=arguments[0];return Vn.SIMPLE_ORDINATE_FORMAT.format(e)}},Vn.spaces=function(e){return Vn.chars(" ",e)},sd.NEWLINE.get=function(){return xe.getProperty("line.separator")},sd.SIMPLE_ORDINATE_FORMAT.get=function(){return new RE},Object.defineProperties(Vn,sd);var re=function(){};re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.copyCoord=function(e,t,n,i){for(var s=Math.min(e.getDimension(),n.getDimension()),o=0;o<s;o++)n.setOrdinate(i,o,e.getOrdinate(t,o))},re.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,xt.X)===e.getOrdinate(t-1,xt.X)&&e.getOrdinate(0,xt.Y)===e.getOrdinate(t-1,xt.Y)},re.isEqual=function(e,t){var n=e.size(),i=t.size();if(n!==i)return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),o=0;o<n;o++)for(var a=0;a<s;a++){var u=e.getOrdinate(o,a),l=t.getOrdinate(o,a);if(e.getOrdinate(o,a)!==t.getOrdinate(o,a)&&!(ht.isNaN(u)&&ht.isNaN(l)))return!1}return!0},re.extend=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();if(re.copy(t,0,i,0,s),s>0)for(var o=s;o<n;o++)re.copy(t,s-1,i,o,1);return i},re.reverse=function(e){for(var t=e.size()-1,n=Math.trunc(t/2),i=0;i<=n;i++)re.swap(e,i,t-i)},re.swap=function(e,t,n){if(t===n)return null;for(var i=0;i<e.getDimension();i++){var s=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(n,i)),e.setOrdinate(n,i,s)}},re.copy=function(e,t,n,i,s){for(var o=0;o<s;o++)re.copyCoord(e,t+o,n,i+o)},re.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var n=e.getDimension(),i=new or;i.append("(");for(var s=0;s<t;s++){s>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Vn.toString(e.getOrdinate(s,o)))}return i.append(")"),i.toString()}},re.ensureValidRing=function(e,t){var n=t.size();if(n===0)return t;if(n<=3)return re.createClosedRing(e,t,4);var i=t.getOrdinate(0,xt.X)===t.getOrdinate(n-1,xt.X)&&t.getOrdinate(0,xt.Y)===t.getOrdinate(n-1,xt.Y);return i?t:re.createClosedRing(e,t,n+1)},re.createClosedRing=function(e,t,n){var i=e.create(n,t.getDimension()),s=t.size();re.copy(t,0,i,0,s);for(var o=s;o<n;o++)re.copy(t,0,i,o,1);return i};var $t=function(r){function e(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new $:this._points.expandEnvelope(new $)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<Math.trunc(this._points.size()/2);s++){var o=i._points.size()-1-s;if(!i._points.getCoordinate(s).equals(i._points.getCoordinate(o)))return i._points.getCoordinate(s).compareTo(i._points.getCoordinate(o))>0&&re.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Mt.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return H.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var i=this._points.copy();re.reverse(i);var s=this.getFactory().createLineString(i);return s},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var s=arguments[0],o=s,a=0,u=0;a<this._points.size()&&u<o._points.size();){var l=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<o._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],h=arguments[1],f=c;return h.compare(this._points,f._points)}},e.prototype.apply=function(){var i=this;if(at(arguments[0],jr))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(at(arguments[0],Qn)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var l=arguments[0];l.filter(this)}else if(at(arguments[0],mi)){var c=arguments[0];c.filter(this)}},e.prototype.getBoundary=function(){return new kn(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},e.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return this._points.size()===0},e.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new Xt("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},e.prototype.isCoordinate=function(i){for(var s=this,o=0;o<this._points.size();o++)if(s._points.getCoordinate(o).equals(i))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},e.prototype.interfaces_=function(){return[Gu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(ot),Wu=function(){};Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var cn=function(r){function e(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new $;var i=new $;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],s=i;return this.getCoordinate().compareTo(s.getCoordinate())}else if(arguments.length===2){var o=arguments[0],a=arguments[1],u=o;return a.compare(this._coordinates,u._coordinates)}},e.prototype.apply=function(){if(at(arguments[0],jr)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(at(arguments[0],Qn)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(at(arguments[0],hr)){var o=arguments[0];o.filter(this)}else if(at(arguments[0],mi)){var a=arguments[0];a.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return this._coordinates.size()===0},e.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),vt.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Wu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(ot),qi=function(){};qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi};var fe=function(r){function e(n,i,s){if(r.call(this,s),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new Xt("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new Xt("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var s=new Array(this.getNumPoints()).fill(null),o=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)o++,s[o]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),h=0;h<c.length;h++)o++,s[o]=c[h];return s},e.prototype.getArea=function(){var i=this,s=0;s+=Math.abs(H.signedArea(this._shell.getCoordinateSequence()));for(var o=0;o<this._holes.length;o++)s-=Math.abs(H.signedArea(i._holes[o].getCoordinateSequence()));return s},e.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),s=this.getEnvelopeInternal(),o=0;o<5;o++){var a=i.getX(o);if(!(a===s.getMinX()||a===s.getMaxX()))return!1;var u=i.getY(o);if(!(u===s.getMinY()||u===s.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),h=1;h<=4;h++){var f=i.getX(h),p=i.getY(h),v=f!==l,C=p!==c;if(v===C)return!1;l=f,c=p}return!0},e.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var s=arguments[0],o=arguments[1];if(!this.isEquivalentClass(s))return!1;var a=s,u=this._shell,l=a._shell;if(!u.equalsExact(l,o)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],o))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var s=0;s<this._holes.length;s++)i.normalize(i._holes[s],!1);ws.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var u=new Array(o.getCoordinates().length-1).fill(null);xe.arraycopy(o.getCoordinates(),0,u,0,u.length);var l=Et.minCoordinate(o.getCoordinates());Et.scroll(u,l),xe.arraycopy(u,0,o.getCoordinates(),0,u.length),o.getCoordinates()[u.length]=u[0],H.isCCW(o.getCoordinates())===a&&Et.reverse(o.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var i=this,s=0;s+=this._shell.getLength();for(var o=0;o<this._holes.length;o++)s+=i._holes[o].getLength();return s},e.prototype.getNumPoints=function(){for(var i=this,s=this._shell.getNumPoints(),o=0;o<this._holes.length;o++)s+=i._holes[o].getNumPoints();return s},e.prototype.reverse=function(){var i=this,s=this.copy();s._shell=this._shell.copy().reverse(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].copy().reverse();return s},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var s=arguments[0],o=this._shell,a=s._shell;return o.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,h=this._shell,f=c._shell,p=h.compareToSameClass(f,l);if(p!==0)return p;for(var v=this.getNumInteriorRing(),C=c.getNumInteriorRing(),S=0;S<v&&S<C;){var P=i.getInteriorRingN(S),y=c.getInteriorRingN(S),_=P.compareToSameClass(y,l);if(_!==0)return _;S++}return S<v?1:S<C?-1:0}},e.prototype.apply=function(i){var s=this;if(at(i,jr)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(at(i,Qn)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(s._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(at(i,hr))i.filter(this);else if(at(i,mi)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)s._holes[u].apply(i)}},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var s=new Array(this._holes.length+1).fill(null);s[0]=this._shell;for(var o=0;o<this._holes.length;o++)s[o+1]=i._holes[o];return s.length<=1?this.getFactory().createLinearRing(s[0].getCoordinateSequence()):this.getFactory().createMultiLineString(s)},e.prototype.clone=function(){var i=this,s=r.prototype.clone.call(this);s._shell=this._shell.clone(),s._holes=new Array(this._holes.length).fill(null);for(var o=0;o<this._holes.length;o++)s._holes[o]=i._holes[o].clone();return s},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var i=this,s=this._shell.copy(),o=new Array(this._holes.length).fill(null),a=0;a<o.length;a++)o[a]=i._holes[a].copy();return new e(s,o,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(i){return this._holes[i]},e.prototype.interfaces_=function(){return[qi]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(ot),ma=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[Wu]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Ue),zr=function(r){function e(n,i){n instanceof M&&i instanceof Ct&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Mt.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();re.reverse(i);var s=this.getFactory().createLinearRing(i);return s},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new Xt("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Xt("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}($t),Ur=function(r){function e(){r.apply(this,arguments)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ot.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,s):!1}else return r.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var i=this,s=this._geometries.length,o=new Array(s).fill(null),a=0;a<this._geometries.length;a++)o[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(o)},e.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var s=new W,o=0;o<this._geometries.length;o++)for(var a=i._geometries[o],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)s.add(u.getGeometryN(l));var c=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(c))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var i=this,s=new Array(this._geometries.length).fill(null),o=0;o<s.length;o++)s[o]=i._geometries[o].copy();return new e(s,this._factory)},e.prototype.interfaces_=function(){return[qi]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Ue),Bn=function(e){this._factory=e||null,this._isUserDataCopied=!1},sc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Bn.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},Bn.prototype.edit=function(e,t){if(e===null)return null;var n=this.editInternal(e,t);return this._isUserDataCopied&&n.setUserData(e.getUserData()),n},Bn.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Ue?this.editGeometryCollection(e,t):e instanceof fe?this.editPolygon(e,t):e instanceof cn?t.edit(e,this._factory):e instanceof $t?t.edit(e,this._factory):(vt.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},Bn.prototype.editGeometryCollection=function(e,t){for(var n=this,i=t.edit(e,this._factory),s=new W,o=0;o<i.getNumGeometries();o++){var a=n.edit(i.getGeometryN(o),t);a===null||a.isEmpty()||s.add(a)}return i.getClass()===ma?this._factory.createMultiPoint(s.toArray([])):i.getClass()===Es?this._factory.createMultiLineString(s.toArray([])):i.getClass()===Ur?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Bn.prototype.editPolygon=function(e,t){var n=this,i=t.edit(e,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var s=this.edit(i.getExteriorRing(),t);if(s===null||s.isEmpty())return this._factory.createPolygon();for(var o=new W,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),t);u===null||u.isEmpty()||o.add(u)}return this._factory.createPolygon(s,o.toArray([]))},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.GeometryEditorOperation=function(){},sc.NoOpGeometryOperation.get=function(){return qu},sc.CoordinateOperation.get=function(){return Hu},sc.CoordinateSequenceOperation.get=function(){return Xu},Object.defineProperties(Bn,sc);var qu=function(){};qu.prototype.edit=function(e,t){return e},qu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},qu.prototype.getClass=function(){return qu};var Hu=function(){};Hu.prototype.edit=function(e,t){var n=this.editCoordinates(e.getCoordinates(),e);return n===null?e:e instanceof zr?t.createLinearRing(n):e instanceof $t?t.createLineString(n):e instanceof cn?n.length>0?t.createPoint(n[0]):t.createPoint():e},Hu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},Hu.prototype.getClass=function(){return Hu};var Xu=function(){};Xu.prototype.edit=function(e,t){return e instanceof zr?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof $t?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof cn?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},Xu.prototype.interfaces_=function(){return[Bn.GeometryEditorOperation]},Xu.prototype.getClass=function(){return Xu};var ie=function(){var e=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var n=0;n<t;n++)e._coordinates[n]=new M}else if(at(arguments[0],xt)){var i=arguments[0];if(i===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var s=0;s<this._coordinates.length;s++)e._coordinates[s]=i.getCoordinateCopy(s)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this._coordinates=o,this._dimension=a,o===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)e._coordinates[c]=new M}}},Pm={serialVersionUID:{configurable:!0}};ie.prototype.setOrdinate=function(e,t,n){switch(t){case xt.X:this._coordinates[e].x=n;break;case xt.Y:this._coordinates[e].y=n;break;case xt.Z:this._coordinates[e].z=n;break;default:throw new Xt("invalid ordinateIndex")}},ie.prototype.size=function(){return this._coordinates.length},ie.prototype.getOrdinate=function(e,t){switch(t){case xt.X:return this._coordinates[e].x;case xt.Y:return this._coordinates[e].y;case xt.Z:return this._coordinates[e].z}return ht.NaN},ie.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],n=arguments[1];n.x=this._coordinates[t].x,n.y=this._coordinates[t].y,n.z=this._coordinates[t].z}},ie.prototype.getCoordinateCopy=function(e){return new M(this._coordinates[e])},ie.prototype.getDimension=function(){return this._dimension},ie.prototype.getX=function(e){return this._coordinates[e].x},ie.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].clone();return new ie(t,this._dimension)},ie.prototype.expandEnvelope=function(e){for(var t=this,n=0;n<this._coordinates.length;n++)e.expandToInclude(t._coordinates[n]);return e},ie.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=e._coordinates[n].copy();return new ie(t,this._dimension)},ie.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new or(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)t.append(", "),t.append(e._coordinates[n]);return t.append(")"),t.toString()}else return"()"},ie.prototype.getY=function(e){return this._coordinates[e].y},ie.prototype.toCoordinateArray=function(){return this._coordinates},ie.prototype.interfaces_=function(){return[xt,An]},ie.prototype.getClass=function(){return ie},Pm.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ie,Pm);var Gr=function(){},od={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Gr.prototype.readResolve=function(){return Gr.instance()},Gr.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new ie(e)}else if(at(arguments[0],xt)){var t=arguments[0];return new ie(t)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new ie(n):new ie(n,i)}},Gr.prototype.interfaces_=function(){return[oa,An]},Gr.prototype.getClass=function(){return Gr},Gr.instance=function(){return Gr.instanceObject},od.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},od.instanceObject.get=function(){return new Gr},Object.defineProperties(Gr,od);var Im=function(r){function e(){r.call(this),this.map_=new Map}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,i){return this.map_.set(n,i),i},e.prototype.values=function(){for(var n=new W,i=this.map_.values(),s=i.next();!s.done;)n.add(s.value),s=i.next();return n},e.prototype.entrySet=function(){var n=new rd;return this.map_.entries().forEach(function(i){return n.add(i)}),n},e.prototype.size=function(){return this.map_.size()},e}(uo),Rt=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof dr){var e=arguments[0];this._modelType=e,e===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=r.FIXED,this.setScale(t)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},ad={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Rt.prototype.equals=function(e){if(!(e instanceof Rt))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Rt.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new ar(n).compareTo(new ar(i))},Rt.prototype.getScale=function(){return this._scale},Rt.prototype.isFloating=function(){return this._modelType===Rt.FLOATING||this._modelType===Rt.FLOATING_SINGLE},Rt.prototype.getType=function(){return this._modelType},Rt.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Rt.FLOATING?e="Floating":this._modelType===Rt.FLOATING_SINGLE?e="Floating-Single":this._modelType===Rt.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Rt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ht.isNaN(e))return e;if(this._modelType===Rt.FLOATING_SINGLE){var t=e;return t}return this._modelType===Rt.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof M){var n=arguments[0];if(this._modelType===Rt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},Rt.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Rt.FLOATING?e=16:this._modelType===Rt.FLOATING_SINGLE?e=6:this._modelType===Rt.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Rt.prototype.setScale=function(e){this._scale=Math.abs(e)},Rt.prototype.interfaces_=function(){return[An,Ln]},Rt.prototype.getClass=function(){return Rt},Rt.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},ad.serialVersionUID.get=function(){return 7777263578777804e3},ad.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Rt,ad);var dr=function r(e){this._name=e||null,r.nameToTypeMap.put(e,this)},ud={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dr.prototype.readResolve=function(){return dr.nameToTypeMap.get(this._name)},dr.prototype.toString=function(){return this._name},dr.prototype.interfaces_=function(){return[An]},dr.prototype.getClass=function(){return dr},ud.serialVersionUID.get=function(){return-552860263173159e4},ud.nameToTypeMap.get=function(){return new Im},Object.defineProperties(dr,ud),Rt.Type=dr,Rt.FIXED=new dr("FIXED"),Rt.FLOATING=new dr("FLOATING"),Rt.FLOATING_SINGLE=new dr("FLOATING SINGLE");var Ct=function r(){this._precisionModel=new Rt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?at(arguments[0],oa)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Rt&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},xm={serialVersionUID:{configurable:!0}};Ct.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new M(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new M(e.getMinX(),e.getMinY()),new M(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new M(e.getMinX(),e.getMinY()),new M(e.getMinX(),e.getMaxY()),new M(e.getMaxX(),e.getMaxY()),new M(e.getMaxX(),e.getMinY()),new M(e.getMinX(),e.getMinY())]),null)},Ct.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new $t(this.getCoordinateSequenceFactory().create(e),this);if(at(e,xt))return new $t(e,this)}else return new $t(this.getCoordinateSequenceFactory().create([]),this)},Ct.prototype.createMultiLineString=function(){if(arguments.length===0)return new Es(null,this);if(arguments.length===1){var e=arguments[0];return new Es(e,this)}},Ct.prototype.buildGeometry=function(e){for(var t=null,n=!1,i=!1,s=e.iterator();s.hasNext();){var o=s.next(),a=o.getClass();t===null&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(Ct.toGeometryArray(e));var u=e.iterator().next(),l=e.size()>1;if(l){if(u instanceof fe)return this.createMultiPolygon(Ct.toPolygonArray(e));if(u instanceof $t)return this.createMultiLineString(Ct.toLineStringArray(e));if(u instanceof cn)return this.createMultiPoint(Ct.toPointArray(e));vt.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},Ct.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)},Ct.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof M){var e=arguments[0];return this.createPoint(e!==null?this.getCoordinateSequenceFactory().create([e]):null)}else if(at(arguments[0],xt)){var t=arguments[0];return new cn(t,this)}}},Ct.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ct.prototype.createPolygon=function(){if(arguments.length===0)return new fe(null,null,this);if(arguments.length===1){if(at(arguments[0],xt)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof zr){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new fe(i,s,this)}},Ct.prototype.getSRID=function(){return this._SRID},Ct.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Ue(null,this);if(arguments.length===1){var e=arguments[0];return new Ue(e,this)}},Ct.prototype.createGeometry=function(e){var t=new Bn(this);return t.edit(e,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},Ct.prototype.getPrecisionModel=function(){return this._precisionModel},Ct.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(e!==null?this.getCoordinateSequenceFactory().create(e):null)}else if(at(arguments[0],xt)){var t=arguments[0];return new zr(t,this)}}},Ct.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ur(null,this);if(arguments.length===1){var e=arguments[0];return new Ur(e,this)}},Ct.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new ma(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new ma(t,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(at(arguments[0],xt)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var s=new Array(i.size()).fill(null),o=0;o<i.size();o++){var a=e.getCoordinateSequenceFactory().create(1,i.getDimension());re.copy(i,o,a,0,1),s[o]=e.createPoint(a)}return this.createMultiPoint(s)}}},Ct.prototype.interfaces_=function(){return[An]},Ct.prototype.getClass=function(){return Ct},Ct.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.getDefaultCoordinateSequenceFactory=function(){return Gr.instance()},Ct.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Ct.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},xm.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ct,xm);var kE=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],oc=function(e){this.geometryFactory=e||new Ct};oc.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var n=t.type;if(!fr[n])throw new Error("Unknown GeoJSON type: "+t.type);return kE.indexOf(n)!==-1?fr[n].apply(this,[t.coordinates]):n==="GeometryCollection"?fr[n].apply(this,[t.geometries]):fr[n].apply(this,[t])},oc.prototype.write=function(e){var t=e.getGeometryType();if(!wi[t])throw new Error("Geometry is not supported");return wi[t].apply(this,[e])};var fr={Feature:function(r){var e={};for(var t in r)e[t]=r[t];if(r.geometry){var n=r.geometry.type;if(!fr[n])throw new Error("Unknown GeoJSON type: "+r.type);e.geometry=this.read(r.geometry)}return r.bbox&&(e.bbox=fr.bbox.apply(this,[r.bbox])),e},FeatureCollection:function(r){var e=this,t={};if(r.features){t.features=[];for(var n=0;n<r.features.length;++n)t.features.push(e.read(r.features[n]))}return r.bbox&&(t.bbox=this.parse.bbox.apply(this,[r.bbox])),t},coordinates:function(r){for(var e=[],t=0;t<r.length;++t){var n=r[t];e.push(new M(n[0],n[1]))}return e},bbox:function(r){return this.geometryFactory.createLinearRing([new M(r[0],r[1]),new M(r[2],r[1]),new M(r[2],r[3]),new M(r[0],r[3]),new M(r[0],r[1])])},Point:function(r){var e=new M(r[0],r[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(fr.Point.apply(e,[r[n]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(r){var e=fr.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(e)},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r.length;++n)t.push(fr.LineString.apply(e,[r[n]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(r){for(var e=this,t=fr.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(t),i=[],s=1;s<r.length;++s){var o=r[s],a=fr.coordinates.apply(e,[o]),u=e.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(fr.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r.length;++n){var i=r[n];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},wi={coordinate:function(r){return[r.x,r.y]},Point:function(r){var e=wi.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.Point.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(r){for(var e=this,t=[],n=r.getCoordinates(),i=0;i<n.length;++i){var s=n[i];t.push(wi.coordinate.apply(e,[s]))}return{type:"LineString",coordinates:t}},MultiLineString:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.LineString.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(r){var e=this,t=[],n=wi.LineString.apply(this,[r._shell]);t.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var s=r._holes[i],o=wi.LineString.apply(e,[s]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=wi.Polygon.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(r){for(var e=this,t=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],s=i.getGeometryType();t.push(wi[s].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},ld=function(e){this.geometryFactory=e||new Ct,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new oc(this.geometryFactory)};ld.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Rt.FIXED&&this.reducePrecision(t),t},ld.prototype.reducePrecision=function(e){var t=this,n,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(n=0,i=e.points.length;n<i;n++)t.precisionModel.makePrecise(e.points[n]);else if(e.geometries)for(n=0,i=e.geometries.length;n<i;n++)t.reducePrecision(e.geometries[n])};var Tm=function(){this.parser=new oc(this.geometryFactory)};Tm.prototype.write=function(e){return this.parser.write(e)};var U=function(){},ac={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.opposite=function(e){return e===U.LEFT?U.RIGHT:e===U.RIGHT?U.LEFT:e},ac.ON.get=function(){return 0},ac.LEFT.get=function(){return 1},ac.RIGHT.get=function(){return 2},Object.defineProperties(U,ac);function uc(r){this.message=r||""}uc.prototype=new Error,uc.prototype.name="EmptyStackException";function pr(){this.array_=[]}pr.prototype=new Zn,pr.prototype.add=function(r){return this.array_.push(r),!0},pr.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},pr.prototype.push=function(r){return this.array_.push(r),r},pr.prototype.pop=function(r){if(this.array_.length===0)throw new uc;return this.array_.pop()},pr.prototype.peek=function(){if(this.array_.length===0)throw new uc;return this.array_[this.array_.length-1]},pr.prototype.empty=function(){return this.array_.length===0},pr.prototype.isEmpty=function(){return this.empty()},pr.prototype.search=function(r){return this.array_.indexOf(r)},pr.prototype.size=function(){return this.array_.length},pr.prototype.toArray=function(){for(var r=this,e=[],t=0,n=this.array_.length;t<n;t++)e.push(r.array_[t]);return e};var gr=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};gr.prototype.getCoordinate=function(){return this._minCoord},gr.prototype.getRightmostSide=function(e,t){var n=this.getRightmostSideOfSegment(e,t);return n<0&&(n=this.getRightmostSideOfSegment(e,t-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),n},gr.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();vt.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],n=e[this._minIndex+1],i=H.computeOrientation(this._minCoord,n,t),s=!1;(t.y<this._minCoord.y&&n.y<this._minCoord.y&&i===H.COUNTERCLOCKWISE||t.y>this._minCoord.y&&n.y>this._minCoord.y&&i===H.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},gr.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge(),i=n.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var s=U.LEFT;return i[t].y<i[t+1].y&&(s=U.RIGHT),s},gr.prototype.getEdge=function(){return this._orientedDe},gr.prototype.checkForRightmostCoordinate=function(e){for(var t=this,n=e.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(t._minCoord===null||n[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=n[i])},gr.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode(),t=e.getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},gr.prototype.findEdge=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();i.isForward()&&t.checkForRightmostCoordinate(i)}vt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var s=this.getRightmostSide(this._minDe,this._minIndex);s===U.LEFT&&(this._orientedDe=this._minDe.getSym())},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var Ei=function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new M(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},e}(gi),lc=function(){this.array_=[]};lc.prototype.addLast=function(e){this.array_.push(e)},lc.prototype.removeFirst=function(){return this.array_.shift()},lc.prototype.isEmpty=function(){return this.array_.length===0};var Ge=function(){this._finder=null,this._dirEdgeList=new W,this._nodes=new W,this._rightMostCoord=null,this._env=null,this._finder=new gr};Ge.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}},Ge.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ge.prototype.computeNodeDepth=function(e){for(var t=this,n=null,i=e.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){n=s;break}}if(n===null)throw new Ei("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(n);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),t.copySymDepths(a)}},Ge.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(U.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},Ge.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ge.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(U.RIGHT)>=1&&t.getDepth(U.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},Ge.prototype.computeDepths=function(e){var t=this,n=new rd,i=new lc,s=e.getNode();for(i.addLast(s),n.add(s),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();n.add(o),t.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},Ge.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},Ge.prototype.getEnvelope=function(){if(this._env===null){for(var e=new $,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next(),i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)e.expandToInclude(i[s]);this._env=e}return this._env},Ge.prototype.addReachable=function(e){var t=this,n=new pr;for(n.add(e);!n.empty();){var i=n.pop();t.add(i,n)}},Ge.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(U.LEFT,e.getDepth(U.RIGHT)),t.setDepth(U.RIGHT,e.getDepth(U.LEFT))},Ge.prototype.add=function(e,t){var n=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var s=i.next();n._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||t.push(a)}},Ge.prototype.getNodes=function(){return this._nodes},Ge.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ge.prototype.interfaces_=function(){return[Ln]},Ge.prototype.getClass=function(){return Ge};var Gt=function r(){var e=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[U.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var s=0;s<this.location.length;s++)e.location[s]=i.location[s]}}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[U.ON]=o,this.location[U.LEFT]=a,this.location[U.RIGHT]=u}};Gt.prototype.setAllLocations=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]=e},Gt.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==A.NONE)return!1;return!0},Gt.prototype.setAllLocationsIfNull=function(e){for(var t=this,n=0;n<this.location.length;n++)t.location[n]===A.NONE&&(t.location[n]=e)},Gt.prototype.isLine=function(){return this.location.length===1},Gt.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var n=new Array(3).fill(null);n[U.ON]=this.location[U.ON],n[U.LEFT]=A.NONE,n[U.RIGHT]=A.NONE,this.location=n}for(var i=0;i<this.location.length;i++)t.location[i]===A.NONE&&i<e.location.length&&(t.location[i]=e.location[i])},Gt.prototype.getLocations=function(){return this.location},Gt.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[U.LEFT];this.location[U.LEFT]=this.location[U.RIGHT],this.location[U.RIGHT]=e},Gt.prototype.toString=function(){var e=new or;return this.location.length>1&&e.append(A.toLocationSymbol(this.location[U.LEFT])),e.append(A.toLocationSymbol(this.location[U.ON])),this.location.length>1&&e.append(A.toLocationSymbol(this.location[U.RIGHT])),e.toString()},Gt.prototype.setLocations=function(e,t,n){this.location[U.ON]=e,this.location[U.LEFT]=t,this.location[U.RIGHT]=n},Gt.prototype.get=function(e){return e<this.location.length?this.location[e]:A.NONE},Gt.prototype.isArea=function(){return this.location.length>1},Gt.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===A.NONE)return!0;return!1},Gt.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(U.ON,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.location[t]=n}},Gt.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(A.NONE)},Gt.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},Gt.prototype.allPositionsEqual=function(e){for(var t=this,n=0;n<this.location.length;n++)if(t.location[n]!==e)return!1;return!0},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var Vt=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Gt(e),this.elt[1]=new Gt(e)}else if(arguments[0]instanceof r){var t=arguments[0];this.elt[0]=new Gt(t.elt[0]),this.elt[1]=new Gt(t.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new Gt(A.NONE),this.elt[1]=new Gt(A.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Gt(s,o,a),this.elt[1]=new Gt(s,o,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Gt(A.NONE,A.NONE,A.NONE),this.elt[1]=new Gt(A.NONE,A.NONE,A.NONE),this.elt[u].setLocations(l,c,h)}};Vt.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},Vt.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},Vt.prototype.isNull=function(e){return this.elt[e].isNull()},Vt.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.elt[t].setAllLocationsIfNull(n)}},Vt.prototype.isLine=function(e){return this.elt[e].isLine()},Vt.prototype.merge=function(e){for(var t=this,n=0;n<2;n++)t.elt[n]===null&&e.elt[n]!==null?t.elt[n]=new Gt(e.elt[n]):t.elt[n].merge(e.elt[n])},Vt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Vt.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(U.ON)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.elt[t].get(n)}},Vt.prototype.toString=function(){var e=new or;return this.elt[0]!==null&&(e.append("A:"),e.append(this.elt[0].toString())),this.elt[1]!==null&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},Vt.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var e=arguments[0];return this.elt[e].isArea()}},Vt.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},Vt.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(U.ON,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this.elt[n].setLocation(i,s)}},Vt.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},Vt.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},Vt.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Gt(this.elt[e].location[0]))},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.toLineLabel=function(e){for(var t=new Vt(A.NONE),n=0;n<2;n++)t.setLocation(n,e.getLocation(n));return t};var ue=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new W,this._pts=new W,this._label=new Vt(A.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new W,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};ue.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)t[n]=e._pts.get(n);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=H.isCCW(this._ring.getCoordinates())},ue.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},ue.prototype.computePoints=function(e){var t=this;this._startDe=e;var n=e,i=!0;do{if(n===null)throw new Ei("Found null DirectedEdge");if(n.getEdgeRing()===t)throw new Ei("Directed Edge visited twice during ring-building at "+n.getCoordinate());t._edges.add(n);var s=n.getLabel();vt.isTrue(s.isArea()),t.mergeLabel(s),t.addPoints(n.getEdge(),n.isForward(),i),i=!1,t.setEdgeRing(n,t),n=t.getNext(n)}while(n!==this._startDe)},ue.prototype.getLinearRing=function(){return this._ring},ue.prototype.getCoordinate=function(e){return this._pts.get(e)},ue.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var n=t.getNode(),i=n.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},ue.prototype.addPoints=function(e,t,n){var i=this,s=e.getCoordinates();if(t){var o=1;n&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var u=s.length-2;n&&(u=s.length-1);for(var l=u;l>=0;l--)i._pts.add(s[l])}},ue.prototype.isHole=function(){return this._isHole},ue.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},ue.prototype.containsPoint=function(e){var t=this.getLinearRing(),n=t.getEnvelopeInternal();if(!n.contains(e)||!H.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var s=i.next();if(s.containsPoint(e))return!1}return!0},ue.prototype.addHole=function(e){this._holes.add(e)},ue.prototype.isShell=function(){return this._shell===null},ue.prototype.getLabel=function(){return this._label},ue.prototype.getEdges=function(){return this._edges},ue.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ue.prototype.getShell=function(){return this._shell},ue.prototype.mergeLabel=function(){if(arguments.length===1){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=t.getLocation(n,U.RIGHT);if(i===A.NONE)return null;if(this._label.getLocation(n)===A.NONE)return this._label.setLocation(n,i),null}},ue.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)},ue.prototype.toPolygon=function(e){for(var t=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=t._holes.get(i).getLinearRing();var s=e.createPolygon(this.getLinearRing(),n);return s},ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue};var VE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},e.prototype.getNext=function(n){return n.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ue),BE=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var n=this,i=new W,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new VE(s,n._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},e.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(n){return n.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ue),In=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._label=e}}};In.prototype.setVisited=function(e){this._isVisited=e},In.prototype.setInResult=function(e){this._isInResult=e},In.prototype.isCovered=function(){return this._isCovered},In.prototype.isCoveredSet=function(){return this._isCoveredSet},In.prototype.setLabel=function(e){this._label=e},In.prototype.getLabel=function(){return this._label},In.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},In.prototype.updateIM=function(e){vt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},In.prototype.isInResult=function(){return this._isInResult},In.prototype.isVisited=function(){return this._isVisited},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var cc=function(r){function e(){r.call(this),this._coord=null,this._edges=null;var t=arguments[0],n=arguments[1];this._coord=t,this._edges=n,this._label=new Vt(0,A.NONE)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,i){var s=A.NONE;if(s=this._label.getLocation(i),!n.isNull(i)){var o=n.getLocation(i);s!==A.BOUNDARY&&(s=o)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new Vt(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof Vt)for(var s=arguments[0],o=0;o<2;o++){var a=n.computeMergedLocation(s,o),u=n._label.getLocation(o);u===A.NONE&&n._label.setLocation(o,a)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=A.NONE;this._label!==null&&(i=this._label.getLocation(n));var s=null;switch(i){case A.BOUNDARY:s=A.INTERIOR;break;case A.INTERIOR:s=A.BOUNDARY;break;default:s=A.BOUNDARY;break}this._label.setLocation(n,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(In),mr=function(){this.nodeMap=new Fe,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};mr.prototype.find=function(e){return this.nodeMap.get(e)},mr.prototype.addNode=function(){if(arguments[0]instanceof M){var e=arguments[0],t=this.nodeMap.get(e);return t===null&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}else if(arguments[0]instanceof cc){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},mr.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},mr.prototype.iterator=function(){return this.nodeMap.values().iterator()},mr.prototype.values=function(){return this.nodeMap.values()},mr.prototype.getBoundaryNodes=function(e){for(var t=new W,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(e)===A.BOUNDARY&&t.add(i)}return t},mr.prototype.add=function(e){var t=e.getCoordinate(),n=this.addNode(t);n.add(e)},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var Bt=function(){},Yu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.isNorthern=function(e){return e===Bt.NE||e===Bt.NW},Bt.isOpposite=function(e,t){if(e===t)return!1;var n=(e-t+4)%4;return n===2},Bt.commonHalfPlane=function(e,t){if(e===t)return e;var n=(e-t+4)%4;if(n===2)return-1;var i=e<t?e:t,s=e>t?e:t;return i===0&&s===3?3:i},Bt.isInHalfPlane=function(e,t){return t===Bt.SE?e===Bt.SE||e===Bt.SW:e===t||e===t+1},Bt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Xt("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?Bt.NE:Bt.SE:t>=0?Bt.NW:Bt.SW}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new Xt("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Bt.NE:Bt.SE:i.y>=n.y?Bt.NW:Bt.SW}},Yu.NE.get=function(){return 0},Yu.NW.get=function(){return 1},Yu.SW.get=function(){return 2},Yu.SE.get=function(){return 3},Object.defineProperties(Bt,Yu);var ke=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var e=arguments[0];this._edge=e}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=null;this._edge=t,this.init(n,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=o,this.init(a,u),this._label=l}};ke.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:H.computeOrientation(e._p0,e._p1,this._p1)},ke.prototype.getDy=function(){return this._dy},ke.prototype.getCoordinate=function(){return this._p0},ke.prototype.setNode=function(e){this._node=e},ke.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),s=n.substring(i+1);e.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},ke.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},ke.prototype.getDirectedCoordinate=function(){return this._p1},ke.prototype.getDx=function(){return this._dx},ke.prototype.getLabel=function(){return this._label},ke.prototype.getEdge=function(){return this._edge},ke.prototype.getQuadrant=function(){return this._quadrant},ke.prototype.getNode=function(){return this._node},ke.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),n=t.lastIndexOf("."),i=t.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},ke.prototype.computeLabel=function(e){},ke.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Bt.quadrant(this._dx,this._dy),vt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},ke.prototype.interfaces_=function(){return[Ln]},ke.prototype.getClass=function(){return ke};var cd=function(r){function e(){var t=arguments[0],n=arguments[1];if(r.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var i=t.getNumPoints()-1;this.init(t.getCoordinate(i),t.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(n){return this._depth[n]},e.prototype.setVisited=function(n){this._isVisited=n},e.prototype.computeDirectedLabel=function(){this._label=new Vt(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Ei("assigned depths do not match",this.getCoordinate());this._depth[n]=i},e.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,s=0;s<2;s++)n._label.isArea(s)&&n._label.getLocation(s,U.LEFT)===A.INTERIOR&&n._label.getLocation(s,U.RIGHT)===A.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(n){this._nextMin=n},e.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[U.LEFT]+"/"+this._depth[U.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},e.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},e.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,A.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,A.EXTERIOR);return n&&i&&s},e.prototype.setEdgeRing=function(n){this._edgeRing=n},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},e.prototype.setInResult=function(n){this._isInResult=n},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},e.prototype.setSym=function(n){this._sym=n},e.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},e.prototype.setEdgeDepths=function(n,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;n===U.LEFT&&(o=-1);var a=U.opposite(n),u=s*o,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(n){this._next=n},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(n,i){return n===A.EXTERIOR&&i===A.INTERIOR?1:n===A.INTERIOR&&i===A.EXTERIOR?-1:0},e}(ke),va=function(){};va.prototype.createNode=function(e){return new cc(e,null)},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var Kt=function(){if(this._edges=new W,this._nodes=null,this._edgeEndList=new W,arguments.length===0)this._nodes=new mr(new va);else if(arguments.length===1){var e=arguments[0];this._nodes=new mr(e)}};Kt.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var n=0;n<this._edges.size();n++){e.println("edge "+n+":");var i=t._edges.get(n);i.print(e),i.eiList.print(e)}},Kt.prototype.find=function(e){return this._nodes.find(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof cc){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof M){var t=arguments[0];return this._nodes.addNode(t)}},Kt.prototype.getNodeIterator=function(){return this._nodes.iterator()},Kt.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}},Kt.prototype.debugPrintln=function(e){xe.out.println(e)},Kt.prototype.isBoundaryNode=function(e,t){var n=this._nodes.find(t);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(e)===A.BOUNDARY},Kt.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}},Kt.prototype.matchInSameDirection=function(e,t,n,i){return e.equals(n)?H.computeOrientation(e,t,i)===H.COLLINEAR&&Bt.quadrant(e,t)===Bt.quadrant(n,i):!1},Kt.prototype.getEdgeEnds=function(){return this._edgeEndList},Kt.prototype.debugPrint=function(e){xe.out.print(e)},Kt.prototype.getEdgeIterator=function(){return this._edges.iterator()},Kt.prototype.findEdgeInSameDirection=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(n.matchInSameDirection(e,t,o[0],o[1])||n.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return s}return null},Kt.prototype.insertEdge=function(e){this._edges.add(e)},Kt.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var n=t.next();if(n.getEdge()===e)return n}return null},Kt.prototype.addEdges=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next();t._edges.add(i);var s=new cd(i,!0),o=new cd(i,!1);s.setSym(o),o.setSym(s),t.add(s),t.add(o)}},Kt.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},Kt.prototype.getNodes=function(){return this._nodes.values()},Kt.prototype.findEdge=function(e,t){for(var n=this,i=0;i<this._edges.size();i++){var s=n._edges.get(i),o=s.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return s}return null},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},Kt.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.getEdges().linkResultDirectedEdges()}};var hn=function(){this._geometryFactory=null,this._shellList=new W;var e=arguments[0];this._geometryFactory=e};hn.prototype.sortShellsAndHoles=function(e,t,n){for(var i=e.iterator();i.hasNext();){var s=i.next();s.isHole()?n.add(s):t.add(s)}},hn.prototype.computePolygons=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(t._geometryFactory);n.add(o)}return n},hn.prototype.placeFreeHoles=function(e,t){for(var n=this,i=t.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=n.findEdgeRingContaining(s,e);if(o===null)throw new Ei("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},hn.prototype.buildMinimalEdgeRings=function(e,t,n){for(var i=this,s=new W,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),t.add(l)):n.addAll(u)}else s.add(a)}return s},hn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var n=t.next();if(n.containsPoint(e))return!0}return!1},hn.prototype.buildMaximalEdgeRings=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new BE(s,t._geometryFactory);n.add(o),o.setInResult()}}return n},hn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(e)}},hn.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e},hn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),i=n.getEnvelopeInternal(),s=n.getCoordinateN(0),o=null,a=null,u=t.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),h=c.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var f=!1;h.contains(i)&&H.isPointInRing(s,c.getCoordinates())&&(f=!0),f&&(o===null||a.contains(h))&&(o=l)}return o},hn.prototype.findShell=function(e){for(var t=0,n=null,i=e.iterator();i.hasNext();){var s=i.next();s.isHole()||(n=s,t++)}return vt.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},hn.prototype.add=function(){if(arguments.length===1){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(arguments.length===2){var t=arguments[0],n=arguments[1];Kt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(t),s=new W,o=this.buildMinimalEdgeRings(i,this._shellList,s);this.sortShellsAndHoles(o,this._shellList,s),this.placeFreeHoles(this._shellList,s)}},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var ya=function(){};ya.prototype.getBounds=function(){},ya.prototype.interfaces_=function(){return[]},ya.prototype.getClass=function(){return ya};var $n=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};$n.prototype.getItem=function(){return this._item},$n.prototype.getBounds=function(){return this._bounds},$n.prototype.interfaces_=function(){return[ya,An]},$n.prototype.getClass=function(){return $n};var Ci=function(){this._size=null,this._items=null,this._size=0,this._items=new W,this._items.add(null)};Ci.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},Ci.prototype.size=function(){return this._size},Ci.prototype.reorder=function(e){for(var t=this,n=null,i=this._items.get(e);e*2<=this._size&&(n=e*2,n!==t._size&&t._items.get(n+1).compareTo(t._items.get(n))<0&&n++,t._items.get(n).compareTo(i)<0);e=n)t._items.set(e,t._items.get(n));this._items.set(e,i)},Ci.prototype.clear=function(){this._size=0,this._items.clear()},Ci.prototype.isEmpty=function(){return this._size===0},Ci.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)t._items.set(n,t._items.get(Math.trunc(n/2)));this._items.set(n,e)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Hi=function(){};Hi.prototype.visitItem=function(e){},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var lo=function(){};lo.prototype.insert=function(e,t){},lo.prototype.remove=function(e,t){},lo.prototype.query=function(){},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var pe=function(){if(this._childBoundables=new W,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this._level=e}}},Nm={serialVersionUID:{configurable:!0}};pe.prototype.getLevel=function(){return this._level},pe.prototype.size=function(){return this._childBoundables.size()},pe.prototype.getChildBoundables=function(){return this._childBoundables},pe.prototype.addChildBoundable=function(e){vt.isTrue(this._bounds===null),this._childBoundables.add(e)},pe.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},pe.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},pe.prototype.interfaces_=function(){return[ya,An]},pe.prototype.getClass=function(){return pe},Nm.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(pe,Nm);var tr=function(){};tr.reverseOrder=function(){return{compare:function(t,n){return n.compareTo(t)}}},tr.min=function(e){return tr.sort(e),e.get(0)},tr.sort=function(e,t){var n=e.toArray();t?ws.sort(n,t):ws.sort(n);for(var i=e.iterator(),s=0,o=n.length;s<o;s++)i.next(),i.set(n[s])},tr.singletonList=function(e){var t=new W;return t.add(e),t};var le=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=n,this._distance=this.distance()};le.prototype.expandToQueue=function(e,t){var n=le.isComposite(this._boundable1),i=le.isComposite(this._boundable2);if(n&&i)return le.area(this._boundable1)>le.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Xt("neither boundable is composite")},le.prototype.isLeaves=function(){return!(le.isComposite(this._boundable1)||le.isComposite(this._boundable2))},le.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},le.prototype.expand=function(e,t,n,i){for(var s=this,o=e.getChildBoundables(),a=o.iterator();a.hasNext();){var u=a.next(),l=new le(u,t,s._itemDistance);l.getDistance()<i&&n.add(l)}},le.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2},le.prototype.getDistance=function(){return this._distance},le.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},le.prototype.interfaces_=function(){return[Ln]},le.prototype.getClass=function(){return le},le.area=function(e){return e.getBounds().getArea()},le.isComposite=function(e){return e instanceof pe};var Ce=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new W,this._nodeCapacity=null,arguments.length===0){var e=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];vt.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},hc={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Ce.prototype.getNodeCapacity=function(){return this._nodeCapacity},Ce.prototype.lastNode=function(e){return e.get(e.size()-1)},Ce.prototype.size=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof pe?n+=e.size(s):s instanceof $n&&(n+=1)}return n}},Ce.prototype.removeItem=function(e,t){for(var n=null,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof $n&&s.getItem()===t&&(n=s)}return n!==null?(e.getChildBoundables().remove(n),!0):!1},Ce.prototype.itemsTree=function(){var e=this;if(arguments.length===0){this.build();var t=this.itemsTree(this._root);return t===null?new W:t}else if(arguments.length===1){for(var n=arguments[0],i=new W,s=n.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof pe){var a=e.itemsTree(o);a!==null&&i.add(a)}else o instanceof $n?i.add(o.getItem()):vt.shouldNeverReachHere()}return i.size()<=0?null:i}},Ce.prototype.insert=function(e,t){vt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new $n(e,t))},Ce.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],n=new W;return this.boundablesAtLevel(t,this._root,n),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(vt.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof pe?e.boundablesAtLevel(i,u,o):(vt.isTrue(u instanceof $n),i===-1&&o.add(u))}return null}},Ce.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var n=new W;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,n),n}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,s)}else if(arguments.length===3){if(at(arguments[2],Hi)&&arguments[0]instanceof Object&&arguments[1]instanceof pe)for(var o=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var h=l.get(c);e.getIntersectsOp().intersects(h.getBounds(),o)&&(h instanceof pe?e.query(o,h,u):h instanceof $n?u.visitItem(h.getItem()):vt.shouldNeverReachHere())}else if(at(arguments[2],Zn)&&arguments[0]instanceof Object&&arguments[1]instanceof pe)for(var f=arguments[0],p=arguments[1],v=arguments[2],C=p.getChildBoundables(),S=0;S<C.size();S++){var P=C.get(S);e.getIntersectsOp().intersects(P.getBounds(),f)&&(P instanceof pe?e.query(f,P,v):P instanceof $n?v.add(P.getItem()):vt.shouldNeverReachHere())}}},Ce.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Ce.prototype.getRoot=function(){return this.build(),this._root},Ce.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=this.removeItem(s,o);if(a)return!0;for(var u=null,l=s.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(e.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof pe&&(a=e.remove(i,c,o),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(u),a}},Ce.prototype.createHigherLevels=function(e,t){vt.isTrue(!e.isEmpty());var n=this.createParentBoundables(e,t+1);return n.size()===1?n.get(0):this.createHigherLevels(n,t+1)},Ce.prototype.depth=function(){var e=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var t=arguments[0],n=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof pe){var o=e.depth(s);o>n&&(n=o)}}return n+1}},Ce.prototype.createParentBoundables=function(e,t){var n=this;vt.isTrue(!e.isEmpty());var i=new W;i.add(this.createNode(t));var s=new W(e);tr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(t)),n.lastNode(i).addChildBoundable(a)}return i},Ce.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Ce.prototype.interfaces_=function(){return[An]},Ce.prototype.getClass=function(){return Ce},Ce.compareDoubles=function(e,t){return e>t?1:e<t?-1:0},hc.IntersectsOp.get=function(){return jE},hc.serialVersionUID.get=function(){return-3886435814360241e3},hc.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Ce,hc);var jE=function(){},_a=function(){};_a.prototype.distance=function(e,t){},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a};var Om=function(r){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(i,s){var o=this;vt.isTrue(i.length>0);for(var a=new W,u=0;u<i.length;u++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[u],s));return a},e.prototype.createNode=function(i){return new Dm(i)},e.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,s)}else return r.prototype.insert.apply(this,arguments)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(i,s){for(var o=Math.trunc(Math.ceil(i.size()/s)),a=new Array(s).fill(null),u=i.iterator(),l=0;l<s;l++){a[l]=new W;for(var c=0;u.hasNext()&&c<o;){var h=u.next();a[l].add(h),c++}}return a},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];r.prototype.query.call(this,s,o)}else if(arguments.length===3){if(at(arguments[2],Hi)&&arguments[0]instanceof Object&&arguments[1]instanceof pe){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(at(arguments[2],Zn)&&arguments[0]instanceof Object&&arguments[1]instanceof pe){var c=arguments[0],h=arguments[1],f=arguments[2];r.prototype.query.call(this,c,h,f)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return r.prototype.createParentBoundables.call(this,i,s)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return r.prototype.remove.call(this,i,s)}else return r.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,s){vt.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new W(i);tr.sort(a,e.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(u,s)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(at(arguments[0],_a)){var i=arguments[0],s=new le(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof le){var o=arguments[0];return this.nearestNeighbour(o,ht.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&at(arguments[1],_a)){var a=arguments[0],u=arguments[1],l=new le(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof le&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=h,p=null,v=new Ci;for(v.add(c);!v.isEmpty()&&f>0;){var C=v.poll(),S=C.getDistance();if(S>=f)break;C.isLeaves()?(f=S,p=C):C.expandToQueue(v,f)}return[p.getBoundable(0).getItem(),p.getBoundable(1).getItem()]}}else if(arguments.length===3){var P=arguments[0],y=arguments[1],_=arguments[2],m=new $n(P,y),w=new le(this.getRoot(),m,_);return this.nearestNeighbour(w)[0]}},e.prototype.interfaces_=function(){return[lo,An]},e.prototype.getClass=function(){return e},e.centreX=function(i){return e.avg(i.getMinX(),i.getMaxX())},e.avg=function(i,s){return(i+s)/2},e.centreY=function(i){return e.avg(i.getMinY(),i.getMaxY())},t.STRtreeNode.get=function(){return Dm},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[sa]},compare:function(n,i){return r.compareDoubles(e.centreX(n.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[sa]},compare:function(n,i){return r.compareDoubles(e.centreY(n.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(Ce),Dm=function(r){function e(){var t=arguments[0];r.call(this,t)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();n===null?n=new $(s.getBounds()):n.expandToInclude(s.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pe),tn=function(){};tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},tn.relativeSign=function(e,t){return e<t?-1:e>t?1:0},tn.compare=function(e,t,n){if(t.equals2D(n))return 0;var i=tn.relativeSign(t.x,n.x),s=tn.relativeSign(t.y,n.y);switch(e){case 0:return tn.compareValue(i,s);case 1:return tn.compareValue(s,i);case 2:return tn.compareValue(s,-i);case 3:return tn.compareValue(-i,s);case 4:return tn.compareValue(-i,-s);case 5:return tn.compareValue(-s,-i);case 6:return tn.compareValue(-s,i);case 7:return tn.compareValue(i,-s)}return vt.shouldNeverReachHere("invalid octant value"),0},tn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var Xi=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._segString=e,this.coord=new M(t),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(n))};Xi.prototype.getCoordinate=function(){return this.coord},Xi.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},Xi.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:tn.compare(this._segmentOctant,this.coord,t.coord)},Xi.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e},Xi.prototype.isInterior=function(){return this._isInterior},Xi.prototype.interfaces_=function(){return[Ln]},Xi.prototype.getClass=function(){return Xi};var We=function(){this._nodeMap=new Fe,this._edge=null;var e=arguments[0];this._edge=e};We.prototype.getSplitCoordinates=function(){var e=this,t=new ju;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next();e.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()},We.prototype.addCollapsedNodes=function(){var e=this,t=new W;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var n=t.iterator();n.hasNext();){var i=n.next().intValue();e.add(e._edge.getCoordinate(i),i)}},We.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},We.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,n=0;n<this._edge.size()-2;n++){var i=t._edge.getCoordinate(n),s=t._edge.getCoordinate(n+2);i.equals2D(s)&&e.add(new ar(n+1))}},We.prototype.addEdgeCoordinates=function(e,t,n){var i=this,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);n.add(new M(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)n.add(i._edge.getCoordinate(a));o&&n.add(new M(t.coord))},We.prototype.iterator=function(){return this._nodeMap.values().iterator()},We.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},We.prototype.findCollapseIndex=function(e,t,n){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(n[0]=e.segmentIndex+1,!0):!1},We.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,n=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=t.findCollapseIndex(s,o,n);a&&e.add(new ar(n[0])),s=o}},We.prototype.getEdge=function(){return this._edge},We.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},We.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new M(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return o&&(a[u]=new M(t.coord)),new se(a,this._edge.getData())},We.prototype.add=function(e,t){var n=new Xi(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(n);return i!==null?(vt.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},We.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),n=e.get(0),i=n.getCoordinate(0);if(!i.equals2D(t[0]))throw new gi("bad split edge start point at "+i);var s=e.get(e.size()-1),o=s.getCoordinates(),a=o[o.length-1];if(!a.equals2D(t[t.length-1]))throw new gi("bad split edge end point at "+a)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var co=function(){};co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co},co.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];if(e===0&&t===0)throw new Xt("Cannot compute the octant for point ( "+e+", "+t+" )");var n=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?n>=i?0:1:n>=i?7:6:t>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(a===0&&u===0)throw new Xt("Cannot compute the octant for two identical points "+s);return co.octant(a,u)}};var Wr=function(){};Wr.prototype.getCoordinates=function(){},Wr.prototype.size=function(){},Wr.prototype.getCoordinate=function(e){},Wr.prototype.isClosed=function(){},Wr.prototype.setData=function(e){},Wr.prototype.getData=function(){},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Ju=function(){};Ju.prototype.addIntersection=function(e,t){},Ju.prototype.interfaces_=function(){return[Wr]},Ju.prototype.getClass=function(){return Ju};var se=function(){this._nodeList=new We(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};se.prototype.getCoordinates=function(){return this._pts},se.prototype.size=function(){return this._pts.length},se.prototype.getCoordinate=function(e){return this._pts[e]},se.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},se.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},se.prototype.setData=function(e){this._data=e},se.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:co.octant(e,t)},se.prototype.getData=function(){return this._data},se.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[3],o=new M(n.getIntersection(s));this.addIntersection(o,i)}},se.prototype.toString=function(){return Jn.toLineString(new ie(this._pts))},se.prototype.getNodeList=function(){return this._nodeList},se.prototype.addIntersectionNode=function(e,t){var n=t,i=n+1;if(i<this._pts.length){var s=this._pts[i];e.equals2D(s)&&(n=i)}var o=this._nodeList.add(e,n);return o},se.prototype.addIntersections=function(e,t,n){for(var i=this,s=0;s<e.getIntersectionNum();s++)i.addIntersection(e,t,n,s)},se.prototype.interfaces_=function(){return[Ju]},se.prototype.getClass=function(){return se},se.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new W;return se.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],s=n.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var tt=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new M,this.p1=new M;else if(arguments.length===1){var e=arguments[0];this.p0=new M(e.p0),this.p1=new M(e.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var t=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];this.p0=new M(t,n),this.p1=new M(i,s)}},Mm={serialVersionUID:{configurable:!0}};tt.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},tt.prototype.orientationIndex=function(){if(arguments[0]instanceof tt){var e=arguments[0],t=H.orientationIndex(this.p0,this.p1,e.p0),n=H.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&n>=0||t<=0&&n<=0?Math.max(t,n):0}else if(arguments[0]instanceof M){var i=arguments[0];return H.orientationIndex(this.p0,this.p1,i)}},tt.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},tt.prototype.isVertical=function(){return this.p0.x===this.p1.x},tt.prototype.equals=function(e){if(!(e instanceof tt))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},tt.prototype.intersection=function(e){var t=new ys;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},tt.prototype.project=function(){if(arguments[0]instanceof M){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new M(e);var t=this.projectionFactor(e),n=new M;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof tt){var i=arguments[0],s=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(s>=1&&o>=1||s<=0&&o<=0)return null;var a=this.project(i.p0);s<0&&(a=this.p0),s>1&&(a=this.p1);var u=this.project(i.p1);return o<0&&(u=this.p0),o>1&&(u=this.p1),new tt(a,u)}},tt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},tt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},tt.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1},tt.prototype.distancePerpendicular=function(e){return H.distancePointLinePerpendicular(e,this.p0,this.p1)},tt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},tt.prototype.midPoint=function(){return tt.midPoint(this.p0,this.p1)},tt.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=t*t+n*n;if(i<=0)return ht.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/i;return s},tt.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var n=new Array(2).fill(null),i=ht.MAX_VALUE,s=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);s=a.distance(e.p1),s<i&&(i=s,n[0]=a,n[1]=e.p1);var u=e.closestPoint(this.p0);s=u.distance(this.p0),s<i&&(i=s,n[0]=this.p0,n[1]=u);var l=e.closestPoint(this.p1);return s=l.distance(this.p1),s<i&&(i=s,n[0]=this.p1,n[1]=l),n},tt.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var n=this.p0.distance(e),i=this.p1.distance(e);return n<i?this.p0:this.p1},tt.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},tt.prototype.getLength=function(){return this.p0.distance(this.p1)},tt.prototype.compareTo=function(e){var t=e,n=this.p0.compareTo(t.p0);return n!==0?n:this.p1.compareTo(t.p1)},tt.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},tt.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},tt.prototype.lineIntersection=function(e){try{var t=Yn.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(n){if(!(n instanceof aa))throw n}finally{}return null},tt.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},tt.prototype.pointAlongOffset=function(e,t){var n=this.p0.x+e*(this.p1.x-this.p0.x),i=this.p0.y+e*(this.p1.y-this.p0.y),s=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(s*s+o*o),u=0,l=0;if(t!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=t*s/a,l=t*o/a}var c=n-l,h=i+u,f=new M(c,h);return f},tt.prototype.setCoordinates=function(){if(arguments.length===1){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=n.x,this.p1.y=n.y}},tt.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ht.isNaN(t))&&(t=1),t},tt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},tt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},tt.prototype.distance=function(){if(arguments[0]instanceof tt){var e=arguments[0];return H.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}else if(arguments[0]instanceof M){var t=arguments[0];return H.distancePointLine(t,this.p0,this.p1)}},tt.prototype.pointAlong=function(e){var t=new M;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},tt.prototype.hashCode=function(){var e=ht.doubleToLongBits(this.p0.x);e^=ht.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),n=ht.doubleToLongBits(this.p1.x);n^=ht.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return t^i},tt.prototype.interfaces_=function(){return[Ln,An]},tt.prototype.getClass=function(){return tt},tt.midPoint=function(e,t){return new M((e.x+t.x)/2,(e.y+t.y)/2)},Mm.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(tt,Mm);var Zu=function(){this.tempEnv1=new $,this.tempEnv2=new $,this._overlapSeg1=new tt,this._overlapSeg2=new tt};Zu.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu};var dn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=i};dn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},dn.prototype.computeSelect=function(e,t,n,i){var s=this._pts[t],o=this._pts[n];if(i.tempEnv1.init(s,o),n-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var a=Math.trunc((t+n)/2);t<a&&this.computeSelect(e,t,a,i),a<n&&this.computeSelect(e,a,n,i)},dn.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)t[n++]=e._pts[i];return t},dn.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},dn.prototype.setId=function(e){this._id=e},dn.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},dn.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new $(e,t)}return this._env},dn.prototype.getEndIndex=function(){return this._end},dn.prototype.getStartIndex=function(){return this._start},dn.prototype.getContext=function(){return this._context},dn.prototype.getId=function(){return this._id},dn.prototype.computeOverlapsInternal=function(e,t,n,i,s,o){var a=this._pts[e],u=this._pts[t],l=n._pts[i],c=n._pts[s];if(t-e===1&&s-i===1)return o.overlap(this,e,n,i),null;if(o.tempEnv1.init(a,u),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((e+t)/2),f=Math.trunc((i+s)/2);e<h&&(i<f&&this.computeOverlapsInternal(e,h,n,i,f,o),f<s&&this.computeOverlapsInternal(e,h,n,f,s,o)),h<t&&(i<f&&this.computeOverlapsInternal(h,t,n,i,f,o),f<s&&this.computeOverlapsInternal(h,t,n,f,s,o))},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var vr=function(){};vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.getChainStartIndices=function(e){var t=0,n=new W;n.add(new ar(t));do{var i=vr.findChainEnd(e,t);n.add(new ar(i)),t=i}while(t<e.length-1);var s=vr.toIntArray(n);return s},vr.findChainEnd=function(e,t){for(var n=t;n<e.length-1&&e[n].equals2D(e[n+1]);)n++;if(n>=e.length-1)return e.length-1;for(var i=Bt.quadrant(e[n],e[n+1]),s=t+1;s<e.length;){if(!e[s-1].equals2D(e[s])){var o=Bt.quadrant(e[s-1],e[s]);if(o!==i)break}s++}return s-1},vr.getChains=function(){if(arguments.length===1){var e=arguments[0];return vr.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],n=arguments[1],i=new W,s=vr.getChainStartIndices(t),o=0;o<s.length-1;o++){var a=new dn(t,s[o],s[o+1],n);i.add(a)}return i}},vr.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var Cs=function(){};Cs.prototype.computeNodes=function(e){},Cs.prototype.getNodedSubstrings=function(){},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var Ku=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};Ku.prototype.setSegmentIntersector=function(e){this._segInt=e},Ku.prototype.interfaces_=function(){return[Cs]},Ku.prototype.getClass=function(){return Ku};var hd=function(r){function e(n){n?r.call(this,n):r.call(this),this._monoChains=new W,this._index=new Om,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return se.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var s=this,o=vr.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var u=a.next();u.setId(s._idCounter++),s._index.insert(u.getEnvelope(),u),s._monoChains.add(u)}},e.prototype.computeNodes=function(i){var s=this;this._nodedSegStrings=i;for(var o=i.iterator();o.hasNext();)s.add(o.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var i=this,s=new Rm(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return Rm},Object.defineProperties(e,t),e}(Ku),Rm=function(r){function e(){r.call(this),this._si=null;var t=arguments[0];this._si=t}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=n.getContext(),u=s.getContext();this._si.processIntersections(a,i,u,o)}else return r.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zu),Lt=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(s),this.setJoinStyle(o),this.setMitreLimit(a)}}},Si={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Lt.prototype.getEndCapStyle=function(){return this._endCapStyle},Lt.prototype.isSingleSided=function(){return this._isSingleSided},Lt.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Lt.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Lt.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Lt.JOIN_ROUND&&(this._quadrantSegments=Lt.DEFAULT_QUADRANT_SEGMENTS)},Lt.prototype.getJoinStyle=function(){return this._joinStyle},Lt.prototype.setJoinStyle=function(e){this._joinStyle=e},Lt.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Lt.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Lt.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Lt.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Lt.prototype.getMitreLimit=function(){return this._mitreLimit},Lt.prototype.setMitreLimit=function(e){this._mitreLimit=e},Lt.prototype.setSingleSided=function(e){this._isSingleSided=e},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Si.CAP_ROUND.get=function(){return 1},Si.CAP_FLAT.get=function(){return 2},Si.CAP_SQUARE.get=function(){return 3},Si.JOIN_ROUND.get=function(){return 1},Si.JOIN_MITRE.get=function(){return 2},Si.JOIN_BEVEL.get=function(){return 3},Si.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Si.DEFAULT_MITRE_LIMIT.get=function(){return 5},Si.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Lt,Si);var te=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=H.COUNTERCLOCKWISE,this._inputLine=e||null},Qu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};te.prototype.isDeletable=function(e,t,n,i){var s=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,e,n,i)},te.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n),s=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,n,i,e._distanceTol)&&(e._isDeleted[n]=te.DELETE,o=!0,s=!0),o?t=i:t=n,n=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(n)}return s},te.prototype.isShallowConcavity=function(e,t,n,i){var s=H.computeOrientation(e,t,n),o=s===this._angleOrientation;if(!o)return!1;var a=H.distancePointLine(t,e,n);return a<i},te.prototype.isShallowSampled=function(e,t,n,i,s){var o=this,a=Math.trunc((i-n)/te.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!o.isShallow(e,t,o._inputLine[u],s))return!1;return!0},te.prototype.isConcave=function(e,t,n){var i=H.computeOrientation(e,t,n),s=i===this._angleOrientation;return s},te.prototype.simplify=function(e){var t=this;this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=H.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=t.deleteShallowConcavities();while(n);return this.collapseLine()},te.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===te.DELETE;)t++;return t},te.prototype.isShallow=function(e,t,n,i){var s=H.distancePointLine(t,e,n);return s<i},te.prototype.collapseLine=function(){for(var e=this,t=new ju,n=0;n<this._inputLine.length;n++)e._isDeleted[n]!==te.DELETE&&t.add(e._inputLine[n]);return t.toCoordinateArray()},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te},te.simplify=function(e,t){var n=new te(e);return n.simplify(t)},Qu.INIT.get=function(){return 0},Qu.DELETE.get=function(){return 1},Qu.KEEP.get=function(){return 1},Qu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(te,Qu);var xn=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new W},Lm={COORDINATE_ARRAY_TYPE:{configurable:!0}};xn.prototype.getCoordinates=function(){var e=this._ptList.toArray(xn.COORDINATE_ARRAY_TYPE);return e},xn.prototype.setPrecisionModel=function(e){this._precisionModel=e},xn.prototype.addPt=function(e){var t=new M(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},xn.prototype.revere=function(){},xn.prototype.addPts=function(e,t){var n=this;if(t)for(var i=0;i<e.length;i++)n.addPt(e[i]);else for(var s=e.length-1;s>=0;s--)n.addPt(e[s])},xn.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),n=e.distance(t);return n<this._minimimVertexDistance},xn.prototype.toString=function(){var e=new Ct,t=e.createLineString(this.getCoordinates());return t.toString()},xn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new M(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)},xn.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},Lm.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(xn,Lm);var Pt=function(){},ho={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Pt.prototype.interfaces_=function(){return[]},Pt.prototype.getClass=function(){return Pt},Pt.toDegrees=function(e){return e*180/Math.PI},Pt.normalize=function(e){for(;e>Math.PI;)e-=Pt.PI_TIMES_2;for(;e<=-Math.PI;)e+=Pt.PI_TIMES_2;return e},Pt.angle=function(){if(arguments.length===1){var e=arguments[0];return Math.atan2(e.y,e.x)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=n.x-t.x,s=n.y-t.y;return Math.atan2(s,i)}},Pt.isAcute=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u>0},Pt.isObtuse=function(e,t,n){var i=e.x-t.x,s=e.y-t.y,o=n.x-t.x,a=n.y-t.y,u=i*o+s*a;return u<0},Pt.interiorAngle=function(e,t,n){var i=Pt.angle(t,e),s=Pt.angle(t,n);return Math.abs(s-i)},Pt.normalizePositive=function(e){if(e<0){for(;e<0;)e+=Pt.PI_TIMES_2;e>=Pt.PI_TIMES_2&&(e=0)}else{for(;e>=Pt.PI_TIMES_2;)e-=Pt.PI_TIMES_2;e<0&&(e=0)}return e},Pt.angleBetween=function(e,t,n){var i=Pt.angle(t,e),s=Pt.angle(t,n);return Pt.diff(i,s)},Pt.diff=function(e,t){var n=null;return e<t?n=t-e:n=e-t,n>Math.PI&&(n=2*Math.PI-n),n},Pt.toRadians=function(e){return e*Math.PI/180},Pt.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?Pt.COUNTERCLOCKWISE:n<0?Pt.CLOCKWISE:Pt.NONE},Pt.angleBetweenOriented=function(e,t,n){var i=Pt.angle(t,e),s=Pt.angle(t,n),o=s-i;return o<=-Math.PI?o+Pt.PI_TIMES_2:o>Math.PI?o-Pt.PI_TIMES_2:o},ho.PI_TIMES_2.get=function(){return 2*Math.PI},ho.PI_OVER_2.get=function(){return Math.PI/2},ho.PI_OVER_4.get=function(){return Math.PI/4},ho.COUNTERCLOCKWISE.get=function(){return H.COUNTERCLOCKWISE},ho.CLOCKWISE.get=function(){return H.CLOCKWISE},ho.NONE.get=function(){return H.COLLINEAR},Object.defineProperties(Pt,ho);var qt=function r(){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 tt,this._seg1=new tt,this._offset0=new tt,this._offset1=new tt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new ys,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===Lt.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},$u={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qt.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,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=H.computeOrientation(this._s0,this._s1,this._s2),i=n===H.CLOCKWISE&&this._side===U.LEFT||n===H.COUNTERCLOCKWISE&&this._side===U.RIGHT;n===0?this.addCollinear(t):i?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},qt.prototype.addLineEndCap=function(e,t){var n=new tt(e,t),i=new tt;this.computeOffsetSegment(n,U.LEFT,this._distance,i);var s=new tt;this.computeOffsetSegment(n,U.RIGHT,this._distance,s);var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Lt.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,u+Math.PI/2,u-Math.PI/2,H.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Lt.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Lt.CAP_SQUARE:var l=new M;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new M(i.p1.x+l.x,i.p1.y+l.y),h=new M(s.p1.x+l.x,s.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(h);break}},qt.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e},qt.prototype.addMitreJoin=function(e,t,n,i){var s=!0,o=null;try{o=Yn.intersection(t.p0,t.p1,n.p0,n.p1);var a=i<=0?1:o.distance(e)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(u){if(u instanceof aa)o=new M(0,0),s=!1;else throw u}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,i,this._bufParams.getMitreLimit())},qt.prototype.addFilletCorner=function(e,t,n,i,s){var o=t.x-e.x,a=t.y-e.y,u=Math.atan2(a,o),l=n.x-e.x,c=n.y-e.y,h=Math.atan2(c,l);i===H.CLOCKWISE?u<=h&&(u+=2*Math.PI):u>=h&&(u-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,u,h,i,s),this._segList.addPt(n)},qt.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Lt.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Lt.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},qt.prototype.createSquare=function(e){this._segList.addPt(new M(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new M(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new M(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new M(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},qt.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},qt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qt.prototype.initSideSegments=function(e,t,n){this._s1=e,this._s2=t,this._side=n,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},qt.prototype.addLimitedMitreJoin=function(e,t,n,i){var s=this._seg0.p1,o=Pt.angle(s,this._seg0.p0),a=Pt.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),u=a/2,l=Pt.normalize(o+u),c=Pt.normalize(l+Math.PI),h=i*n,f=h*Math.abs(Math.sin(u)),p=n-f,v=s.x+h*Math.cos(c),C=s.y+h*Math.sin(c),S=new M(v,C),P=new tt(s,S),y=P.pointAlongOffset(1,p),_=P.pointAlongOffset(1,-p);this._side===U.LEFT?(this._segList.addPt(y),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(y))},qt.prototype.computeOffsetSegment=function(e,t,n,i){var s=t===U.LEFT?1:-1,o=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,u=Math.sqrt(o*o+a*a),l=s*n*o/u,c=s*n*a/u;i.p0.x=e.p0.x-c,i.p0.y=e.p0.y+l,i.p1.x=e.p1.x-c,i.p1.y=e.p1.y+l},qt.prototype.addFilletArc=function(e,t,n,i,s){var o=this,a=i===H.CLOCKWISE?-1:1,u=Math.abs(t-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,h=u/l,f=c,p=new M;f<u;){var v=t+a*f;p.x=e.x+s*Math.cos(v),p.y=e.y+s*Math.sin(v),o._segList.addPt(p),f+=h}},qt.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*qt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new M((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new M((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qt.prototype.createCircle=function(e){var t=new M(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qt.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},qt.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new xn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*qt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qt.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var t=this._li.getIntersectionNum();t>=2&&(this._bufParams.getJoinStyle()===Lt.JOIN_BEVEL||this._bufParams.getJoinStyle()===Lt.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,H.CLOCKWISE,this._distance))},qt.prototype.closeRing=function(){this._segList.closeRing()},qt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},$u.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},$u.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},$u.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},$u.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qt,$u);var en=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};en.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var n=t<0,i=Math.abs(t),s=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,n,s);var o=s.getCoordinates();return n&&Et.reverse(o),o},en.prototype.computeSingleSidedBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var s=te.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{n.addSegments(e,!1);var u=te.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},en.prototype.computeRingBufferCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);t===U.RIGHT&&(i=-i);var s=te.simplify(e,i),o=s.length-1;n.initSideSegments(s[o-1],s[0],t);for(var a=1;a<=o;a++){var u=a!==1;n.addNextSegment(s[a],u)}n.closeRing()},en.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),i=te.simplify(e,n),s=i.length-1;t.initSideSegments(i[0],i[1],U.LEFT);for(var o=2;o<=s;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[s-1],i[s]);var a=te.simplify(e,-n),u=a.length-1;t.initSideSegments(a[u],a[u-1],U.LEFT);for(var l=u-2;l>=0;l--)t.addNextSegment(a[l],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},en.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Lt.CAP_ROUND:t.createCircle(e);break;case Lt.CAP_SQUARE:t.createSquare(e);break}},en.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var n=Math.abs(t),i=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],i);else if(this._bufParams.isSingleSided()){var s=t<0;this.computeSingleSidedBufferCurve(e,s,i)}else this.computeLineBufferCurve(e,i);var o=i.getCoordinates();return o},en.prototype.getBufferParameters=function(){return this._bufParams},en.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},en.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(n===0)return en.copyCoordinates(e);var i=this.getSegGen(n);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()},en.prototype.computeOffsetCurve=function(e,t,n){var i=this.simplifyTolerance(this._distance);if(t){var s=te.simplify(e,-i),o=s.length-1;n.initSideSegments(s[o],s[o-1],U.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(s[a],!0)}else{var u=te.simplify(e,i),l=u.length-1;n.initSideSegments(u[0],u[1],U.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},en.prototype.getSegGen=function(e){return new qt(this._precisionModel,this._bufParams,e)},en.prototype.interfaces_=function(){return[]},en.prototype.getClass=function(){return en},en.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;n<t.length;n++)t[n]=new M(e[n]);return t};var fo=function(){this._subgraphs=null,this._seg=new tt,this._cga=new H;var e=arguments[0];this._subgraphs=e},Am={DepthSegment:{configurable:!0}};fo.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=new W,i=this._subgraphs.iterator();i.hasNext();){var s=i.next(),o=s.getEnvelope();t.y<o.getMinY()||t.y>o.getMaxY()||e.findStabbedSegments(t,s.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(at(arguments[2],Zn)&&arguments[0]instanceof M&&arguments[1]instanceof cd)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),h=0;h<c.length-1;h++){e._seg.p0=c[h],e._seg.p1=c[h+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var f=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(f<a.x)&&!e._seg.isHorizontal()&&!(a.y<e._seg.p0.y||a.y>e._seg.p1.y)&&H.computeOrientation(e._seg.p0,e._seg.p1,a)!==H.RIGHT){var p=u.getDepth(U.LEFT);e._seg.p0.equals(c[h])||(p=u.getDepth(U.RIGHT));var v=new Ss(e._seg,p);l.add(v)}}else if(at(arguments[2],Zn)&&arguments[0]instanceof M&&at(arguments[1],Zn))for(var C=arguments[0],S=arguments[1],P=arguments[2],y=S.iterator();y.hasNext();){var _=y.next();_.isForward()&&e.findStabbedSegments(C,_,P)}}},fo.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var n=tr.min(t);return n._leftDepth},fo.prototype.interfaces_=function(){return[]},fo.prototype.getClass=function(){return fo},Am.DepthSegment.get=function(){return Ss},Object.defineProperties(fo,Am);var Ss=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new tt(e),this._leftDepth=t};Ss.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return n!==0||(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(t._upwardSeg)},Ss.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return n!==0?n:e.p1.compareTo(t.p1)},Ss.prototype.toString=function(){return this._upwardSeg.toString()},Ss.prototype.interfaces_=function(){return[Ln]},Ss.prototype.getClass=function(){return Ss};var At=function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null};At.prototype.area=function(){return At.area(this.p0,this.p1,this.p2)},At.prototype.signedArea=function(){return At.signedArea(this.p0,this.p1,this.p2)},At.prototype.interpolateZ=function(e){if(e===null)throw new Xt("Supplied point is null.");return At.interpolateZ(e,this.p0,this.p1,this.p2)},At.prototype.longestSideLength=function(){return At.longestSideLength(this.p0,this.p1,this.p2)},At.prototype.isAcute=function(){return At.isAcute(this.p0,this.p1,this.p2)},At.prototype.circumcentre=function(){return At.circumcentre(this.p0,this.p1,this.p2)},At.prototype.area3D=function(){return At.area3D(this.p0,this.p1,this.p2)},At.prototype.centroid=function(){return At.centroid(this.p0,this.p1,this.p2)},At.prototype.inCentre=function(){return At.inCentre(this.p0,this.p1,this.p2)},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},At.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},At.det=function(e,t,n,i){return e*i-t*n},At.interpolateZ=function(e,t,n,i){var s=t.x,o=t.y,a=n.x-s,u=i.x-s,l=n.y-o,c=i.y-o,h=a*c-u*l,f=e.x-s,p=e.y-o,v=(c*f-u*p)/h,C=(-l*f+a*p)/h,S=t.z+v*(n.z-t.z)+C*(i.z-t.z);return S},At.longestSideLength=function(e,t,n){var i=e.distance(t),s=t.distance(n),o=n.distance(e),a=i;return s>a&&(a=s),o>a&&(a=o),a},At.isAcute=function(e,t,n){return!(!Pt.isAcute(e,t,n)||!Pt.isAcute(t,n,e)||!Pt.isAcute(n,e,t))},At.circumcentre=function(e,t,n){var i=n.x,s=n.y,o=e.x-i,a=e.y-s,u=t.x-i,l=t.y-s,c=2*At.det(o,a,u,l),h=At.det(a,o*o+a*a,l,u*u+l*l),f=At.det(o,o*o+a*a,u,u*u+l*l),p=i-h/c,v=s+f/c;return new M(p,v)},At.perpendicularBisector=function(e,t){var n=t.x-e.x,i=t.y-e.y,s=new Yn(e.x+n/2,e.y+i/2,1),o=new Yn(e.x-i+n/2,e.y+n+i/2,1);return new Yn(s,o)},At.angleBisector=function(e,t,n){var i=t.distance(e),s=t.distance(n),o=i/(i+s),a=n.x-e.x,u=n.y-e.y,l=new M(e.x+o*a,e.y+o*u);return l},At.area3D=function(e,t,n){var i=t.x-e.x,s=t.y-e.y,o=t.z-e.z,a=n.x-e.x,u=n.y-e.y,l=n.z-e.z,c=s*l-o*u,h=o*a-i*l,f=i*u-s*a,p=c*c+h*h+f*f,v=Math.sqrt(p)/2;return v},At.centroid=function(e,t,n){var i=(e.x+t.x+n.x)/3,s=(e.y+t.y+n.y)/3;return new M(i,s)},At.inCentre=function(e,t,n){var i=t.distance(n),s=e.distance(n),o=e.distance(t),a=i+s+o,u=(i*e.x+s*t.x+o*n.x)/a,l=(i*e.y+s*t.y+o*n.y)/a;return new M(u,l)};var jn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n};jn.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,A.EXTERIOR,A.INTERIOR)},jn.prototype.addPolygon=function(e){var t=this,n=this._distance,i=U.LEFT;this._distance<0&&(n=-this._distance,i=U.RIGHT);var s=e.getExteriorRing(),o=Et.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,i,A.EXTERIOR,A.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var u=e.getInteriorRingN(a),l=Et.removeRepeatedPoints(u.getCoordinates());t._distance>0&&t.isErodedCompletely(u,-t._distance)||t.addPolygonRing(l,n,U.opposite(i),A.INTERIOR,A.EXTERIOR)}},jn.prototype.isTriangleErodedCompletely=function(e,t){var n=new At(e[0],e[1],e[2]),i=n.inCentre(),s=H.distancePointLine(i,n.p0,n.p1);return s<Math.abs(t)},jn.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=Et.removeRepeatedPoints(e.getCoordinates()),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,A.EXTERIOR,A.INTERIOR)},jn.prototype.addCurve=function(e,t,n){if(e===null||e.length<2)return null;var i=new se(e,new Vt(0,A.BOUNDARY,t,n));this._curveList.add(i)},jn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},jn.prototype.addPolygonRing=function(e,t,n,i,s){if(t===0&&e.length<zr.MINIMUM_VALID_SIZE)return null;var o=i,a=s;e.length>=zr.MINIMUM_VALID_SIZE&&H.isCCW(e)&&(o=s,a=i,n=U.opposite(n));var u=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(u,o,a)},jn.prototype.add=function(e){if(e.isEmpty())return null;e instanceof fe?this.addPolygon(e):e instanceof $t?this.addLineString(e):e instanceof cn?this.addPoint(e):e instanceof ma?this.addCollection(e):e instanceof Es?this.addCollection(e):e instanceof Ur?this.addCollection(e):e instanceof Ue&&this.addCollection(e)},jn.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(n.length===4)return this.isTriangleErodedCompletely(n,t);var i=e.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>s},jn.prototype.addCollection=function(e){for(var t=this,n=0;n<e.getNumGeometries();n++){var i=e.getGeometryN(n);t.add(i)}},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var wa=function(){};wa.prototype.locate=function(e){},wa.prototype.interfaces_=function(){return[]},wa.prototype.getClass=function(){return wa};var qr=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};qr.prototype.next=function(){if(this._atStart)return this._atStart=!1,qr.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new pa;var e=this._parent.getGeometryN(this._index++);return e instanceof Ue?(this._subcollectionIterator=new qr(e),this._subcollectionIterator.next()):e},qr.prototype.remove=function(){throw new Error(this.getClass().getName())},qr.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},qr.prototype.interfaces_=function(){return[fa]},qr.prototype.getClass=function(){return qr},qr.isAtomic=function(e){return!(e instanceof Ue)};var Tn=function(){this._geom=null;var e=arguments[0];this._geom=e};Tn.prototype.locate=function(e){return Tn.locate(e,this._geom)},Tn.prototype.interfaces_=function(){return[wa]},Tn.prototype.getClass=function(){return Tn},Tn.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.isPointInRing(e,t.getCoordinates()):!1},Tn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Tn.isPointInRing(e,n))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i);if(Tn.isPointInRing(e,s))return!1}return!0},Tn.containsPoint=function(e,t){if(t instanceof fe)return Tn.containsPointInPolygon(e,t);if(t instanceof Ue)for(var n=new qr(t);n.hasNext();){var i=n.next();if(i!==t&&Tn.containsPoint(e,i))return!0}return!1},Tn.locate=function(e,t){return t.isEmpty()?A.EXTERIOR:Tn.containsPoint(e,t)?A.INTERIOR:A.EXTERIOR};var Ve=function(){this._edgeMap=new Fe,this._edgeList=null,this._ptInAreaLocation=[A.NONE,A.NONE]};Ve.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),n=t-1;return t===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Ve.prototype.propagateSideLabels=function(e){for(var t=A.NONE,n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.isArea(e)&&s.getLocation(e,U.LEFT)!==A.NONE&&(t=s.getLocation(e,U.LEFT))}if(t===A.NONE)return null;for(var o=t,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(e,U.ON)===A.NONE&&l.setLocation(e,U.ON,o),l.isArea(e)){var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(h!==A.NONE){if(h!==o)throw new Ei("side location conflict",u.getCoordinate());c===A.NONE&&vt.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),o=c}else vt.isTrue(l.getLocation(e,U.LEFT)===A.NONE,"found single null side"),l.setLocation(e,U.RIGHT,o),l.setLocation(e,U.LEFT,o)}}},Ve.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()},Ve.prototype.print=function(e){xe.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},Ve.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ve.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var n=t.size()-1,i=t.get(n).getLabel(),s=i.getLocation(e,U.LEFT);vt.isTrue(s!==A.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();vt.isTrue(l.isArea(e),"Found non-area edge");var c=l.getLocation(e,U.LEFT),h=l.getLocation(e,U.RIGHT);if(c===h||h!==o)return!1;o=c}return!0},Ve.prototype.findIndex=function(e){var t=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=t._edgeList.get(n);if(i===e)return n}return-1},Ve.prototype.iterator=function(){return this.getEdges().iterator()},Ve.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new W(this._edgeMap.values())),this._edgeList},Ve.prototype.getLocation=function(e,t,n){return this._ptInAreaLocation[e]===A.NONE&&(this._ptInAreaLocation[e]=Tn.locate(t,n[e].getGeometry())),this._ptInAreaLocation[e]},Ve.prototype.toString=function(){var e=new or;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
|
|
43
43
|
`);for(var t=this.iterator();t.hasNext();){var n=t.next();e.append(n),e.append(`
|
|
44
44
|
`)}return e.toString()},Ve.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();n.computeLabel(e)}},Ve.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var s=i.next(),o=s.getLabel(),a=0;a<2;a++)o.isLine(a)&&o.getLocation(a)===A.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),h=0;h<2;h++)if(c.isAnyNull(h)){var f=A.NONE;if(n[h])f=A.EXTERIOR;else{var p=l.getCoordinate();f=t.getLocation(h,p,e)}c.setAllLocationsIfNull(h,f)}},Ve.prototype.getDegree=function(){return this._edgeMap.size()},Ve.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var zE=function(r){function e(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;s=l,o=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;s.setNext(u),o=n._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Ei("no outgoing dirEdge found",this.getCoordinate());vt.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},e.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var s=n.get(0);if(i===1)return s;var o=n.get(i-1),a=s.getQuadrant(),u=o.getQuadrant();return Bt.isNorthern(a)&&Bt.isNorthern(u)?s:!Bt.isNorthern(a)&&!Bt.isNorthern(u)?o:s.getDy()!==0?s:o.getDy()!==0?o:(vt.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(n){xe.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();n.print("out "),s.print(n),n.println(),n.print("in "),s.getSym().print(n),n.println()}},e.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new W;for(var i=this.iterator();i.hasNext();){var s=i.next();(s.isInResult()||s.getSym().isInResult())&&n._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,n.getLocation(0)),o.setAllLocationsIfNull(1,n.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=n._edgeList.get(o),u=a.getSym();s===null&&(s=u),i!==null&&u.setNext(i),i=a}s.setNext(i)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(U.LEFT),a=i.getDepth(U.RIGHT),u=this.computeDepths(s+1,this._edgeList.size(),o),l=this.computeDepths(0,s,u);if(l!==a)throw new Ei("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],h=arguments[1],f=arguments[2],p=f,v=c;v<h;v++){var C=n._edgeList.get(v);C.setEdgeDepths(U.RIGHT,p),p=C.getDepth(U.LEFT)}return p}},e.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(s===null&&l.getEdgeRing()===n&&(s=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;o=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;o.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(vt.isTrue(s!==null,"found null for first outgoing dirEdge"),vt.isTrue(s.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&a++}return a}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=A.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){n=A.INTERIOR;break}if(o.isInResult()){n=A.EXTERIOR;break}}}if(n===A.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===A.INTERIOR):(l.isInResult()&&(a=A.EXTERIOR),c.isInResult()&&(a=A.INTERIOR))}},e.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new Vt(A.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===A.INTERIOR||c===A.BOUNDARY)&&i._label.setLocation(l,A.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Fm=function(r){function e(){r.apply(this,arguments)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new cc(n,new zE)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(va),Yi=function r(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=r.orientation(e)};Yi.prototype.compareTo=function(e){var t=e,n=Yi.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return n},Yi.prototype.interfaces_=function(){return[Ln]},Yi.prototype.getClass=function(){return Yi},Yi.orientation=function(e){return Et.increasingDirection(e)===1},Yi.compareOriented=function(e,t,n,i){for(var s=t?1:-1,o=i?1:-1,a=t?e.length:-1,u=i?n.length:-1,l=t?0:e.length-1,c=i?0:n.length-1;;){var h=e[l].compareTo(n[c]);if(h!==0)return h;l+=s,c+=o;var f=l===a,p=c===u;if(f&&!p)return-1;if(!f&&p)return 1;if(f&&p)return 0}};var er=function(){this._edges=new W,this._ocaMap=new Fe};er.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=t._edges.get(n);n>0&&e.print(","),e.print("(");for(var s=i.getCoordinates(),o=0;o<s.length;o++)o>0&&e.print(","),e.print(s[o].x+" "+s[o].y);e.println(")")}e.print(") ")},er.prototype.addAll=function(e){for(var t=this,n=e.iterator();n.hasNext();)t.add(n.next())},er.prototype.findEdgeIndex=function(e){for(var t=this,n=0;n<this._edges.size();n++)if(t._edges.get(n).equals(e))return n;return-1},er.prototype.iterator=function(){return this._edges.iterator()},er.prototype.getEdges=function(){return this._edges},er.prototype.get=function(e){return this._edges.get(e)},er.prototype.findEqualEdge=function(e){var t=new Yi(e.getCoordinates()),n=this._ocaMap.get(t);return n},er.prototype.add=function(e){this._edges.add(e);var t=new Yi(e.getCoordinates());this._ocaMap.put(t,e)},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var bs=function(){};bs.prototype.processIntersections=function(e,t,n,i){},bs.prototype.isDone=function(){},bs.prototype.interfaces_=function(){return[]},bs.prototype.getClass=function(){return bs};var Nn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e};Nn.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Nn.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.size()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Nn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Nn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Nn.prototype.getLineIntersector=function(){return this._li},Nn.prototype.hasProperIntersection=function(){return this._hasProper},Nn.prototype.processIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Nn.prototype.hasIntersection=function(){return this._hasIntersection},Nn.prototype.isDone=function(){return!1},Nn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Nn.prototype.interfaces_=function(){return[bs]},Nn.prototype.getClass=function(){return Nn},Nn.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var yr=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],n=arguments[2];this.coord=new M(e),this.segmentIndex=t,this.dist=n};yr.prototype.getSegmentIndex=function(){return this.segmentIndex},yr.prototype.getCoordinate=function(){return this.coord},yr.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},yr.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},yr.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e},yr.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},yr.prototype.getDistance=function(){return this.dist},yr.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},yr.prototype.interfaces_=function(){return[Ln]},yr.prototype.getClass=function(){return yr};var Hr=function(){this._nodeMap=new Fe,this.edge=null;var e=arguments[0];this.edge=e};Hr.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var n=t.next();n.print(e)}},Hr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Hr.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var s=n.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},Hr.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},Hr.prototype.createSplitEdge=function(e,t){var n=this,i=t.segmentIndex-e.segmentIndex+2,s=this.edge.pts[t.segmentIndex],o=t.dist>0||!t.coord.equals2D(s);o||i--;var a=new Array(i).fill(null),u=0;a[u++]=new M(e.coord);for(var l=e.segmentIndex+1;l<=t.segmentIndex;l++)a[u++]=n.edge.pts[l];return o&&(a[u]=t.coord),new dc(a,new Vt(this.edge._label))},Hr.prototype.add=function(e,t,n){var i=new yr(e,t,n),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},Hr.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var n=t.next();if(n.coord.equals(e))return!0}return!1},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Ps=function(){};Ps.prototype.getChainStartIndices=function(e){var t=this,n=0,i=new W;i.add(new ar(n));do{var s=t.findChainEnd(e,n);i.add(new ar(s)),n=s}while(n<e.length-1);var o=Ps.toIntArray(i);return o},Ps.prototype.findChainEnd=function(e,t){for(var n=Bt.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var s=Bt.quadrant(e[i-1],e[i]);if(s!==n)break;i++}return i-1},Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps},Ps.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),n=0;n<t.length;n++)t[n]=e.get(n).intValue();return t};var bi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new $,this.env2=new $;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new Ps;this.startIndex=t.getChainStartIndices(this.pts)};bi.prototype.getCoordinates=function(){return this.pts},bi.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t>n?t:n},bi.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return t<n?t:n},bi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[n],t.startIndex[n+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],h=this.pts[s],f=this.pts[o],p=a.pts[u],v=a.pts[l];if(o-s===1&&l-u===1)return c.addIntersections(this.e,s,a.e,u),null;if(this.env1.init(h,f),this.env2.init(p,v),!this.env1.intersects(this.env2))return null;var C=Math.trunc((s+o)/2),S=Math.trunc((u+l)/2);s<C&&(u<S&&this.computeIntersectsForChain(s,C,a,u,S,c),S<l&&this.computeIntersectsForChain(s,C,a,S,l,c)),C<o&&(u<S&&this.computeIntersectsForChain(C,o,a,u,S,c),S<l&&this.computeIntersectsForChain(C,o,a,S,l,c))}},bi.prototype.getStartIndexes=function(){return this.startIndex},bi.prototype.computeIntersects=function(e,t){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<e.startIndex.length-1;s++)n.computeIntersectsForChain(i,e,s,t)},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var Te=function r(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var n=0;n<3;n++)e._depth[t][n]=r.NULL_VALUE},km={NULL_VALUE:{configurable:!0}};Te.prototype.getDepth=function(e,t){return this._depth[e][t]},Te.prototype.setDepth=function(e,t,n){this._depth[e][t]=n},Te.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var n=0;n<3;n++)if(e._depth[t][n]!==Te.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===Te.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===Te.NULL_VALUE}},Te.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var n=e._depth[t][1];e._depth[t][2]<n&&(n=e._depth[t][2]),n<0&&(n=0);for(var i=1;i<3;i++){var s=0;e._depth[t][i]>n&&(s=1),e._depth[t][i]=s}}},Te.prototype.getDelta=function(e){return this._depth[e][U.RIGHT]-this._depth[e][U.LEFT]},Te.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?A.EXTERIOR:A.INTERIOR},Te.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Te.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var s=t.getLocation(n,i);(s===A.EXTERIOR||s===A.INTERIOR)&&(e.isNull(n,i)?e._depth[n][i]=Te.depthAtLocation(s):e._depth[n][i]+=Te.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2];u===A.INTERIOR&&this._depth[o][a]++}},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.depthAtLocation=function(e){return e===A.EXTERIOR?0:e===A.INTERIOR?1:Te.NULL_VALUE},km.NULL_VALUE.get=function(){return-1},Object.defineProperties(Te,km);var dc=function(r){function e(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Hr(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Te,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new e(n,Vt.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var i=this;if(!(n instanceof e))return!1;var s=n;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(s.pts[l])||(o=!1),i.pts[l].equals2D(s.pts[--u])||(a=!1),!o&&!a)return!1;return!0},e.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&n.print(","),n.print(i.pts[s].x+" "+i.pts[s].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)n.print(i.pts[s]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new bi(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new $;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},e.prototype.addIntersection=function(n,i,s,o){var a=new M(n.getIntersection(o)),u=i,l=n.getEdgeDistance(s,o),c=u+1;if(c<this.pts.length){var h=this.pts[c];a.equals2D(h)&&(u=c,l=0)}this.eiList.add(a,u,l)},e.prototype.toString=function(){var n=this,i=new or;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(n.pts[s].x+" "+n.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(n.pts[s]))return!1;return!0},e.prototype.setDepthDelta=function(n){this._depthDelta=n},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(n,i,s){for(var o=this,a=0;a<n.getIntersectionNum();a++)o.addIntersection(n,i,s,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,U.ON),n.getLocation(1,U.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,U.LEFT),n.getLocation(1,U.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,U.RIGHT),n.getLocation(1,U.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},e}(In),qe=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new er,this._bufParams=e||null};qe.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},qe.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var n=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new Vt(e.getLabel()),i.flip()),n.merge(i);var s=qe.depthDelta(i),o=t.getDepthDelta(),a=o+s;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(qe.depthDelta(e.getLabel()))},qe.prototype.buildSubgraphs=function(e,t){for(var n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new fo(n),u=a.getDepth(o);s.computeDepth(u),s.findResultEdges(),n.add(s),t.add(s.getDirectedEdges(),s.getNodes())}},qe.prototype.createSubgraphs=function(e){for(var t=new W,n=e.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var s=new Ge;s.create(i),t.add(s)}}return tr.sort(t,tr.reverseOrder()),t},qe.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e},qe.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new hd,n=new ys;return n.setPrecisionModel(e),t.setSegmentIntersector(new Nn(n)),t},qe.prototype.buffer=function(e,t){var n=this._workingPrecisionModel;n===null&&(n=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new en(n,this._bufParams),s=new jn(e,t,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this._graph=new Kt(new Fm),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new hn(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},qe.prototype.computeNodedEdges=function(e,t){var n=this,i=this.getNoder(t);i.computeNodes(e);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new dc(a.getCoordinates(),new Vt(l));n.insertUniqueEdge(c)}}},qe.prototype.setNoder=function(e){this._workingNoder=e},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.depthDelta=function(e){var t=e.getLocation(0,U.LEFT),n=e.getLocation(0,U.RIGHT);return t===A.INTERIOR&&n===A.EXTERIOR?1:t===A.EXTERIOR&&n===A.INTERIOR?-1:0},qe.convertSegStrings=function(e){for(var t=new Ct,n=new W;e.hasNext();){var i=e.next(),s=t.createLineString(i.getCoordinates());n.add(s)}return t.buildGeometry(n)};var Ji=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var e=arguments[0],t=arguments[1];this._noder=e,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};Ji.prototype.rescale=function(){var e=this;if(at(arguments[0],de))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var s=arguments[0],o=0;o<s.length;o++)s[o].x=s[o].x/e._scaleFactor+e._offsetX,s[o].y=s[o].y/e._scaleFactor+e._offsetY;s.length===2&&s[0].equals2D(s[1])&&xe.out.println(s)}},Ji.prototype.scale=function(){var e=this;if(at(arguments[0],de)){for(var t=arguments[0],n=new W,i=t.iterator();i.hasNext();){var s=i.next();n.add(new se(e.scale(s.getCoordinates()),s.getData()))}return n}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),u=0;u<o.length;u++)a[u]=new M(Math.round((o[u].x-e._offsetX)*e._scaleFactor),Math.round((o[u].y-e._offsetY)*e._scaleFactor),o[u].z);var l=Et.removeRepeatedPoints(a);return l}},Ji.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},Ji.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},Ji.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},Ji.prototype.interfaces_=function(){return[Cs]},Ji.prototype.getClass=function(){return Ji};var _r=function(){this._li=new ys,this._segStrings=null;var e=arguments[0];this._segStrings=e},Vm={fact:{configurable:!0}};_r.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next(),i=n.getCoordinates();e.checkEndPtVertexIntersections(i[0],e._segStrings),e.checkEndPtVertexIntersections(i[i.length-1],e._segStrings)}else if(arguments.length===2){for(var s=arguments[0],o=arguments[1],a=o.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(s))throw new gi("found endpt/interior pt intersection at index "+c+" :pt "+s)}},_r.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var n=t.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();e.checkInteriorIntersections(n,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],u=o.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var h=0;h<l.length-1;h++)e.checkInteriorIntersections(o,c,a,h);else if(arguments.length===4){var f=arguments[0],p=arguments[1],v=arguments[2],C=arguments[3];if(f===v&&p===C)return null;var S=f.getCoordinates()[p],P=f.getCoordinates()[p+1],y=v.getCoordinates()[C],_=v.getCoordinates()[C+1];if(this._li.computeIntersection(S,P,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,S,P)||this.hasInteriorIntersection(this._li,y,_)))throw new gi("found non-noded intersection at "+S+"-"+P+" and "+y+"-"+_)}},_r.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},_r.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var n=t.next();e.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],s=i.getCoordinates(),o=0;o<s.length-2;o++)e.checkCollapse(s[o],s[o+1],s[o+2])},_r.prototype.hasInteriorIntersection=function(e,t,n){for(var i=0;i<e.getIntersectionNum();i++){var s=e.getIntersection(i);if(!(s.equals(t)||s.equals(n)))return!0}return!1},_r.prototype.checkCollapse=function(e,t,n){if(e.equals(n))throw new gi("found non-noded collapse at "+_r.fact.createLineString([e,t,n]))},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},Vm.fact.get=function(){return new Ct},Object.defineProperties(_r,Vm);var nn=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],n=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=n,t<=0)throw new Xt("Scale factor must be non-zero");t!==1&&(this._pt=new M(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new M,this._p1Scaled=new M),this.initCorners(this._pt)},Bm={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};nn.prototype.intersectsScaled=function(e,t){var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),s=Math.min(e.y,t.y),o=Math.max(e.y,t.y),a=this._maxx<n||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var u=this.intersectsToleranceSquare(e,t);return vt.isTrue(!(a&&u),"Found bad envelope test"),u},nn.prototype.initCorners=function(e){var t=.5;this._minx=e.x-t,this._maxx=e.x+t,this._miny=e.y-t,this._maxy=e.y+t,this._corner[0]=new M(this._maxx,this._maxy),this._corner[1]=new M(this._minx,this._maxy),this._corner[2]=new M(this._minx,this._miny),this._corner[3]=new M(this._maxx,this._miny)},nn.prototype.intersects=function(e,t){return this._scaleFactor===1?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},nn.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},nn.prototype.getCoordinate=function(){return this._originalPt},nn.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},nn.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=nn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new $(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},nn.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))},nn.prototype.intersectsToleranceSquare=function(e,t){var n=!1,i=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||e.equals(this._pt)||t.equals(this._pt))},nn.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(n,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1},nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn},Bm.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(nn,Bm);var tl=function(){this.tempEnv1=new $,this.selectedSegment=new tt};tl.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var Ea=function(){this._index=null;var e=arguments[0];this._index=e},jm={HotPixelSnapAction:{configurable:!0}};Ea.prototype.snap=function(){if(arguments.length===1){var e=arguments[0];return this.snap(e,null,-1)}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),o=new zm(t,n,i);return this._index.query(s,{interfaces_:function(){return[Hi]},visitItem:function(a){var u=a;u.select(s,o)}}),o.isNodeAdded()}},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea},jm.HotPixelSnapAction.get=function(){return zm},Object.defineProperties(Ea,jm);var zm=function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],s=n.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return r.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(tl),po=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new W};po.prototype.processIntersections=function(e,t,n,i){var s=this;if(e===n&&t===i)return null;var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)s._interiorIntersections.add(s._li.getIntersection(c));e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)}},po.prototype.isDone=function(){return!1},po.prototype.getInteriorIntersections=function(){return this._interiorIntersections},po.prototype.interfaces_=function(){return[bs]},po.prototype.getClass=function(){return po};var Xr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new ys,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};Xr.prototype.checkCorrectness=function(e){var t=se.getNodedSubstrings(e),n=new _r(t);try{n.checkValid()}catch(i){if(i instanceof wm)i.printStackTrace();else throw i}finally{}},Xr.prototype.getNodedSubstrings=function(){return se.getNodedSubstrings(this._nodedSegStrings)},Xr.prototype.snapRound=function(e,t){var n=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(n),this.computeVertexSnaps(e)},Xr.prototype.findInteriorIntersections=function(e,t){var n=new po(t);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(e),n.getInteriorIntersections()},Xr.prototype.computeVertexSnaps=function(){var e=this;if(at(arguments[0],de))for(var t=arguments[0],n=t.iterator();n.hasNext();){var i=n.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof se)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var u=new nn(o[a],e._scaleFactor,e._li),l=e._pointSnapper.snap(u,s,a);l&&s.addIntersection(o[a],a)}},Xr.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new hd,this._pointSnapper=new Ea(this._noder.getIndex()),this.snapRound(e,this._li)},Xr.prototype.computeIntersectionSnaps=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=new nn(i,t._scaleFactor,t._li);t._pointSnapper.snap(s)}},Xr.prototype.interfaces_=function(){return[Cs]},Xr.prototype.getClass=function(){return Xr};var Ne=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Lt,this._resultGeometry=null,this._saveException=null,arguments.length===1){var e=arguments[0];this._argGeom=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._argGeom=t,this._bufParams=n}},Ca={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Ne.prototype.bufferFixedPrecision=function(e){var t=new Ji(new Xr(new Rt(1)),e.getScale()),n=new qe(this._bufParams);n.setWorkingPrecisionModel(e),n.setNoder(t),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Ne.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=Ne.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof Ei)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Ne.precisionScaleFactor(this._argGeom,this._distance,n),s=new Rt(i);this.bufferFixedPrecision(s)}},Ne.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Rt.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Ne.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Ne.prototype.bufferOriginalPrecision=function(){try{var e=new qe(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof gi)this._saveException=t;else throw t}finally{}},Ne.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Ne.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Ne(e),i=n.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Ne(s);u.setQuadrantSegments(a);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof Lt&&arguments[0]instanceof ot&&typeof arguments[1]=="number"){var c=arguments[0],h=arguments[1],f=arguments[2],p=new Ne(c,f),v=p.getResultGeometry(h);return v}}else if(arguments.length===4){var C=arguments[0],S=arguments[1],P=arguments[2],y=arguments[3],_=new Ne(C);_.setQuadrantSegments(P),_.setEndCapStyle(y);var m=_.getResultGeometry(S);return m}},Ne.precisionScaleFactor=function(e,t,n){var i=e.getEnvelopeInternal(),s=Pn.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=t>0?t:0,a=s+2*o,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Ca.CAP_ROUND.get=function(){return Lt.CAP_ROUND},Ca.CAP_BUTT.get=function(){return Lt.CAP_FLAT},Ca.CAP_FLAT.get=function(){return Lt.CAP_FLAT},Ca.CAP_SQUARE.get=function(){return Lt.CAP_SQUARE},Ca.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Ne,Ca);var He=function(){this._pt=[new M,new M],this._distance=ht.NaN,this._isNull=!0};He.prototype.getCoordinates=function(){return this._pt},He.prototype.getCoordinate=function(e){return this._pt[e]},He.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},He.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},He.prototype.getDistance=function(){return this._distance},He.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Yr=function(){};Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.computeDistance=function(){if(arguments[2]instanceof He&&arguments[0]instanceof $t&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=e.getCoordinates(),s=new tt,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof He&&arguments[0]instanceof fe&&arguments[1]instanceof M){var u=arguments[0],l=arguments[1],c=arguments[2];Yr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)Yr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof He&&arguments[0]instanceof ot&&arguments[1]instanceof M){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof $t)Yr.computeDistance(f,p,v);else if(f instanceof fe)Yr.computeDistance(f,p,v);else if(f instanceof Ue)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);Yr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof He&&arguments[0]instanceof tt&&arguments[1]instanceof M){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var Is=function(e){this._maxPtDist=new He,this._inputGeom=e||null},dd={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Is.prototype.computeMaxMidpointDistance=function(e){var t=new Zi(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Is.prototype.computeMaxVertexDistance=function(e){var t=new go(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Is.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},Is.prototype.getDistancePoints=function(){return this._maxPtDist},Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is},dd.MaxPointDistanceFilter.get=function(){return go},dd.MaxMidpointDistanceFilter.get=function(){return Zi},Object.defineProperties(Is,dd);var go=function(e){this._maxPtDist=new He,this._minPtDist=new He,this._geom=e||null};go.prototype.filter=function(e){this._minPtDist.initialize(),Yr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},go.prototype.getMaxPointDistance=function(){return this._maxPtDist},go.prototype.interfaces_=function(){return[jr]},go.prototype.getClass=function(){return go};var Zi=function(e){this._maxPtDist=new He,this._minPtDist=new He,this._geom=e||null};Zi.prototype.filter=function(e,t){if(t===0)return null;var n=e.getCoordinate(t-1),i=e.getCoordinate(t),s=new M((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Yr.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Zi.prototype.isDone=function(){return!1},Zi.prototype.isGeometryChanged=function(){return!1},Zi.prototype.getMaxPointDistance=function(){return this._maxPtDist},Zi.prototype.interfaces_=function(){return[Qn]},Zi.prototype.getClass=function(){return Zi};var Pi=function(e){this._comps=e||null};Pi.prototype.filter=function(e){e instanceof fe&&this._comps.add(e)},Pi.prototype.interfaces_=function(){return[hr]},Pi.prototype.getClass=function(){return Pi},Pi.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return Pi.getPolygons(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof fe?n.add(t):t instanceof Ue&&t.apply(new Pi(n)),n}};var Oe=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var e=arguments[0];this._lines=e}else if(arguments.length===2){var t=arguments[0],n=arguments[1];this._lines=t,this._isForcedToLineString=n}};Oe.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof zr){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof $t&&this._lines.add(e)},Oe.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},Oe.prototype.interfaces_=function(){return[mi]},Oe.prototype.getClass=function(){return Oe},Oe.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(Oe.getLines(e))}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t.getFactory().buildGeometry(Oe.getLines(t,n))}},Oe.getLines=function(){if(arguments.length===1){var e=arguments[0];return Oe.getLines(e,!1)}else if(arguments.length===2){if(at(arguments[0],de)&&at(arguments[1],de)){for(var t=arguments[0],n=arguments[1],i=t.iterator();i.hasNext();){var s=i.next();Oe.getLines(s,n)}return n}else if(arguments[0]instanceof ot&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],u=new W;return o.apply(new Oe(u,a)),u}else if(arguments[0]instanceof ot&&at(arguments[1],de)){var l=arguments[0],c=arguments[1];return l instanceof $t?c.add(l):l.apply(new Oe(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&at(arguments[0],de)&&at(arguments[1],de)){for(var h=arguments[0],f=arguments[1],p=arguments[2],v=h.iterator();v.hasNext();){var C=v.next();Oe.getLines(C,f,p)}return f}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof ot&&at(arguments[1],de)){var S=arguments[0],P=arguments[1],y=arguments[2];return S.apply(new Oe(P,y)),P}}};var nr=function(){if(this._boundaryRule=Fn.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e===null)throw new Xt("Rule must be non-null");this._boundaryRule=e}}};nr.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof M&&arguments[1]instanceof fe){var t=arguments[0],n=arguments[1];if(n.isEmpty())return A.EXTERIOR;var i=n.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===A.EXTERIOR)return A.EXTERIOR;if(s===A.BOUNDARY)return A.BOUNDARY;for(var o=0;o<n.getNumInteriorRing();o++){var a=n.getInteriorRingN(o),u=e.locateInPolygonRing(t,a);if(u===A.INTERIOR)return A.EXTERIOR;if(u===A.BOUNDARY)return A.BOUNDARY}return A.INTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof $t){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return A.EXTERIOR;var h=c.getCoordinates();return!c.isClosed()&&(l.equals(h[0])||l.equals(h[h.length-1]))?A.BOUNDARY:H.isOnLine(l,h)?A.INTERIOR:A.EXTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof cn){var f=arguments[0],p=arguments[1],v=p.getCoordinate();return v.equals2D(f)?A.INTERIOR:A.EXTERIOR}},nr.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.locatePointInRing(e,t.getCoordinates()):A.EXTERIOR},nr.prototype.intersects=function(e,t){return this.locate(e,t)!==A.EXTERIOR},nr.prototype.updateLocationInfo=function(e){e===A.INTERIOR&&(this._isIn=!0),e===A.BOUNDARY&&this._numBoundaries++},nr.prototype.computeLocation=function(e,t){var n=this;if(t instanceof cn&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof $t)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof fe)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof Es)for(var i=t,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);n.updateLocationInfo(n.locateInternal(e,o))}else if(t instanceof Ur)for(var a=t,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(e,l))}else if(t instanceof Ue)for(var c=new qr(t);c.hasNext();){var h=c.next();h!==t&&n.computeLocation(e,h)}},nr.prototype.locate=function(e,t){return t.isEmpty()?A.EXTERIOR:t instanceof $t?this.locateInternal(e,t):t instanceof fe?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?A.BOUNDARY:this._numBoundaries>0||this._isIn?A.INTERIOR:A.EXTERIOR)},nr.prototype.interfaces_=function(){return[]},nr.prototype.getClass=function(){return nr};var Xe=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];r.call(this,e,r.INSIDE_AREA,t)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._component=n,this._segIndex=i,this._pt=s}},Um={INSIDE_AREA:{configurable:!0}};Xe.prototype.isInsideArea=function(){return this._segIndex===Xe.INSIDE_AREA},Xe.prototype.getCoordinate=function(){return this._pt},Xe.prototype.getGeometryComponent=function(){return this._component},Xe.prototype.getSegmentIndex=function(){return this._segIndex},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Um.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Xe,Um);var Ki=function(e){this._pts=e||null};Ki.prototype.filter=function(e){e instanceof cn&&this._pts.add(e)},Ki.prototype.interfaces_=function(){return[hr]},Ki.prototype.getClass=function(){return Ki},Ki.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof cn?tr.singletonList(e):Ki.getPoints(e,new W)}else if(arguments.length===2){var t=arguments[0],n=arguments[1];return t instanceof cn?n.add(t):t instanceof Ue&&t.apply(new Ki(n)),n}};var mo=function(){this._locations=null;var e=arguments[0];this._locations=e};mo.prototype.filter=function(e){(e instanceof cn||e instanceof $t||e instanceof fe)&&this._locations.add(new Xe(e,0,e.getCoordinate()))},mo.prototype.interfaces_=function(){return[hr]},mo.prototype.getClass=function(){return mo},mo.getLocations=function(e){var t=new W;return e.apply(new mo(t)),t};var De=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new nr,this._minDistanceLocation=null,this._minDistance=ht.MAX_VALUE,arguments.length===2){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=s}};De.prototype.computeContainmentDistance=function(){var e=this;if(arguments.length===0){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=1-n,o=Pi.getPolygons(this._geom[n]);if(o.size()>0){var a=mo.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&at(arguments[0],Zn)&&at(arguments[1],Zn)){for(var u=arguments[0],l=arguments[1],c=arguments[2],h=0;h<u.size();h++)for(var f=u.get(h),p=0;p<l.size();p++)if(e.computeContainmentDistance(f,l.get(p),c),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Xe&&arguments[1]instanceof fe){var v=arguments[0],C=arguments[1],S=arguments[2],P=v.getCoordinate();if(A.EXTERIOR!==this._ptLocator.locate(P,C))return this._minDistance=0,S[0]=v,S[1]=new Xe(C,P),null}}},De.prototype.computeMinDistanceLinesPoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},De.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=Oe.getLines(this._geom[0]),n=Oe.getLines(this._geom[1]),i=Ki.getPoints(this._geom[0]),s=Ki.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,n,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,s,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance)||(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(n,i,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance))return null;e[0]=null,e[1]=null,this.computeMinDistancePoints(i,s,e),this.updateMinDistance(e,!1)},De.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},De.prototype.updateMinDistance=function(e,t){if(e[0]===null)return null;t?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])},De.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e},De.prototype.computeMinDistance=function(){var e=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof cn){var t=arguments[0],n=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var s=t.getCoordinates(),o=n.getCoordinate(),a=0;a<s.length-1;a++){var u=H.distancePointLine(o,s[a],s[a+1]);if(u<e._minDistance){e._minDistance=u;var l=new tt(s[a],s[a+1]),c=l.closestPoint(o);i[0]=new Xe(t,a,c),i[1]=new Xe(n,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof $t){var h=arguments[0],f=arguments[1],p=arguments[2];if(h.getEnvelopeInternal().distance(f.getEnvelopeInternal())>this._minDistance)return null;for(var v=h.getCoordinates(),C=f.getCoordinates(),S=0;S<v.length-1;S++)for(var P=0;P<C.length-1;P++){var y=H.distanceLineLine(v[S],v[S+1],C[P],C[P+1]);if(y<e._minDistance){e._minDistance=y;var _=new tt(v[S],v[S+1]),m=new tt(C[P],C[P+1]),w=_.closestPoints(m);p[0]=new Xe(h,S,w[0]),p[1]=new Xe(f,P,w[1])}if(e._minDistance<=e._terminateDistance)return null}}}},De.prototype.computeMinDistancePoints=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new Xe(o,0,o.getCoordinate()),n[1]=new Xe(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},De.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Xt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},De.prototype.computeMinDistanceLines=function(e,t,n){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var u=t.get(a);if(i.computeMinDistance(o,u,n),i._minDistance<=i._terminateDistance)return null}},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.distance=function(e,t){var n=new De(e,t);return n.distance()},De.isWithinDistance=function(e,t,n){var i=new De(e,t,n);return i.distance()<=n},De.nearestPoints=function(e,t){var n=new De(e,t);return n.nearestPoints()};var Be=function(){this._pt=[new M,new M],this._distance=ht.NaN,this._isNull=!0};Be.prototype.getCoordinates=function(){return this._pt},Be.prototype.getCoordinate=function(e){return this._pt[e]},Be.prototype.setMinimum=function(){if(arguments.length===1){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i<this._distance&&this.initialize(t,n,i)}},Be.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Be.prototype.toString=function(){return Jn.toLineString(this._pt[0],this._pt[1])},Be.prototype.getDistance=function(){return this._distance},Be.prototype.setMaximum=function(){if(arguments.length===1){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(arguments.length===2){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var i=t.distance(n);i>this._distance&&this.initialize(t,n,i)}},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.computeDistance=function(){if(arguments[2]instanceof Be&&arguments[0]instanceof $t&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],n=arguments[2],i=new tt,s=e.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(t);n.setMinimum(a,t)}else if(arguments[2]instanceof Be&&arguments[0]instanceof fe&&arguments[1]instanceof M){var u=arguments[0],l=arguments[1],c=arguments[2];wr.computeDistance(u.getExteriorRing(),l,c);for(var h=0;h<u.getNumInteriorRing();h++)wr.computeDistance(u.getInteriorRingN(h),l,c)}else if(arguments[2]instanceof Be&&arguments[0]instanceof ot&&arguments[1]instanceof M){var f=arguments[0],p=arguments[1],v=arguments[2];if(f instanceof $t)wr.computeDistance(f,p,v);else if(f instanceof fe)wr.computeDistance(f,p,v);else if(f instanceof Ue)for(var C=f,S=0;S<C.getNumGeometries();S++){var P=C.getGeometryN(S);wr.computeDistance(P,p,v)}else v.setMinimum(f.getCoordinate(),p)}else if(arguments[2]instanceof Be&&arguments[0]instanceof tt&&arguments[1]instanceof M){var y=arguments[0],_=arguments[1],m=arguments[2],w=y.closestPoint(_);m.setMinimum(w,_)}};var zn=function(){this._g0=null,this._g1=null,this._ptDist=new Be,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},fd={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};zn.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},zn.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Xt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},zn.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},zn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},zn.prototype.computeOrientedDistance=function(e,t,n){var i=new vo(t);if(e.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new Qi(t,this._densifyFrac);e.apply(s),n.setMaximum(s.getMaxPointDistance())}},zn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn},zn.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new zn(e,t);return n.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new zn(i,s);return a.setDensifyFraction(o),a.distance()}},fd.MaxPointDistanceFilter.get=function(){return vo},fd.MaxDensifiedByFractionDistanceFilter.get=function(){return Qi},Object.defineProperties(zn,fd);var vo=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._euclideanDist=new wr,this._geom=null;var e=arguments[0];this._geom=e};vo.prototype.filter=function(e){this._minPtDist.initialize(),wr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},vo.prototype.getMaxPointDistance=function(){return this._maxPtDist},vo.prototype.interfaces_=function(){return[jr]},vo.prototype.getClass=function(){return vo};var Qi=function(){this._maxPtDist=new Be,this._minPtDist=new Be,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Qi.prototype.filter=function(e,t){var n=this;if(t===0)return null;for(var i=e.getCoordinate(t-1),s=e.getCoordinate(t),o=(s.x-i.x)/this._numSubSegs,a=(s.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,c=i.y+u*a,h=new M(l,c);n._minPtDist.initialize(),wr.computeDistance(n._geom,h,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},Qi.prototype.isDone=function(){return!1},Qi.prototype.isGeometryChanged=function(){return!1},Qi.prototype.getMaxPointDistance=function(){return this._maxPtDist},Qi.prototype.interfaces_=function(){return[Qn]},Qi.prototype.getClass=function(){return Qi};var fn=function(e,t,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._bufDistance=t||null,this._result=n||null},pd={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};fn.prototype.checkMaximumDistance=function(e,t,n){var i=new zn(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var s=i.getCoordinates();this._errorLocation=s[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Jn.toLineString(s[0],s[1])+")"}},fn.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=fn.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),fn.VERBOSE&&xe.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},fn.prototype.checkNegativeValid=function(){if(!(this._input instanceof fe||this._input instanceof Ur||this._input instanceof Ue))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},fn.prototype.getErrorIndicator=function(){return this._errorIndicator},fn.prototype.checkMinimumDistance=function(e,t,n){var i=new De(e,t,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var s=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(s),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Jn.toLineString(s[0],s[1])+" )"}},fn.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)},fn.prototype.getErrorLocation=function(){return this._errorLocation},fn.prototype.getPolygonLines=function(e){for(var t=new W,n=new Oe(t),i=Pi.getPolygons(e),s=i.iterator();s.hasNext();){var o=s.next();o.apply(n)}return e.getFactory().buildGeometry(t)},fn.prototype.getErrorMessage=function(){return this._errMsg},fn.prototype.interfaces_=function(){return[]},fn.prototype.getClass=function(){return fn},pd.VERBOSE.get=function(){return!1},pd.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(fn,pd);var Me=function(e,t,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=n||null},gd={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Me.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Me.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*Me.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new $(this._input.getEnvelopeInternal());t.expandBy(this._distance);var n=new $(this._result.getEnvelopeInternal());n.expandBy(e),n.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Me.prototype.checkDistance=function(){var e=new fn(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")},Me.prototype.checkArea=function(){var e=this._input.getArea(),t=this._result.getArea();this._distance>0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Me.prototype.checkPolygonal=function(){this._result instanceof fe||this._result instanceof Ur||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Me.prototype.getErrorIndicator=function(){return this._errorIndicator},Me.prototype.getErrorLocation=function(){return this._errorLocation},Me.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Me.prototype.report=function(e){if(!Me.VERBOSE)return null;xe.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Me.prototype.getErrorMessage=function(){return this._errorMsg},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.isValidMsg=function(e,t,n){var i=new Me(e,t,n);return i.isValid()?null:i.getErrorMessage()},Me.isValid=function(e,t,n){var i=new Me(e,t,n);return!!i.isValid()},gd.VERBOSE.get=function(){return!1},gd.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Me,gd);var Er=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};Er.prototype.getCoordinates=function(){return this._pts},Er.prototype.size=function(){return this._pts.length},Er.prototype.getCoordinate=function(e){return this._pts[e]},Er.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Er.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:co.octant(this.getCoordinate(e),this.getCoordinate(e+1))},Er.prototype.setData=function(e){this._data=e},Er.prototype.getData=function(){return this._data},Er.prototype.toString=function(){return Jn.toLineString(new ie(this._pts))},Er.prototype.interfaces_=function(){return[Wr]},Er.prototype.getClass=function(){return Er};var Se=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new W,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};Se.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Se.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},Se.prototype.getIntersectionSegments=function(){return this._intSegments},Se.prototype.count=function(){return this._intersectionCount},Se.prototype.getIntersections=function(){return this._intersections},Se.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},Se.prototype.setKeepIntersections=function(e){this._keepIntersections=e},Se.prototype.processIntersections=function(e,t,n,i){if(!this._findAllIntersections&&this.hasIntersection()||e===n&&t===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(n,i);if(!s)return null}var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(o,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Se.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2},Se.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Se.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Se.prototype.interfaces_=function(){return[bs]},Se.prototype.getClass=function(){return Se},Se.createAllIntersectionsFinder=function(e){var t=new Se(e);return t.setFindAllIntersections(!0),t},Se.createAnyIntersectionFinder=function(e){return new Se(e)},Se.createIntersectionCounter=function(e){var t=new Se(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var rr=function(){this._li=new ys,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};rr.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rr.prototype.getIntersections=function(){return this._segInt.getIntersections()},rr.prototype.isValid=function(){return this.execute(),this._isValid},rr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},rr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Se(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new hd;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ei(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Jn.toLineString(e[0],e[1])+" and "+Jn.toLineString(e[2],e[3])},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.computeIntersections=function(e){var t=new rr(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var xs=function r(){this._nv=null;var e=arguments[0];this._nv=new rr(r.toSegmentStrings(e))};xs.prototype.checkValid=function(){this._nv.checkValid()},xs.prototype.interfaces_=function(){return[]},xs.prototype.getClass=function(){return xs},xs.toSegmentStrings=function(e){for(var t=new W,n=e.iterator();n.hasNext();){var i=n.next();t.add(new Er(i.getCoordinates(),i))}return t},xs.checkValid=function(e){var t=new xs(e);t.checkValid()};var yo=function(e){this._mapOp=e};yo.prototype.map=function(e){for(var t=this,n=new W,i=0;i<e.getNumGeometries();i++){var s=t._mapOp.map(e.getGeometryN(i));s.isEmpty()||n.add(s)}return e.getFactory().createGeometryCollection(Ct.toGeometryArray(n))},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo},yo.map=function(e,t){var n=new yo(t);return n.map(e)};var Cr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new W,this._resultLineList=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=n};Cr.prototype.collectLines=function(e){for(var t=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}},Cr.prototype.labelIsolatedLine=function(e,t){var n=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,n)},Cr.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},Cr.prototype.collectLineEdge=function(e,t,n){var i=e.getLabel(),s=e.getEdge();e.isLineEdge()&&!e.isVisited()&>.isResultOfOp(i,t)&&!s.isCovered()&&(n.add(s),e.setVisitedEdge(!0))},Cr.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var n=t.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getEdge();if(s.isLineEdge()&&!o.isCoveredSet()){var a=e._op.isCoveredByA(s.getCoordinate());o.setCovered(a)}}},Cr.prototype.labelIsolatedLines=function(e){for(var t=this,n=e.iterator();n.hasNext();){var i=n.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}},Cr.prototype.buildLines=function(e){for(var t=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),s=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(s),i.setInResult(!0)}},Cr.prototype.collectBoundaryTouchEdge=function(e,t,n){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;vt.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),gt.isResultOfOp(i,t)&&t===gt.INTERSECTION&&(n.add(e.getEdge()),e.setVisitedEdge(!0))},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr};var _o=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new W;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};_o.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var n=this._geometryFactory.createPoint(t);this._resultPointList.add(n)}},_o.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===gt.INTERSECTION)){var s=i.getLabel();gt.isResultOfOp(s,e)&&t.filterCoveredNodeToPoint(i)}}},_o.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},_o.prototype.interfaces_=function(){return[]},_o.prototype.getClass=function(){return _o};var rn=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};rn.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},rn.prototype.transformPolygon=function(e,t){var n=this,i=!0,s=this.transformLinearRing(e.getExteriorRing(),e);(s===null||!(s instanceof zr)||s.isEmpty())&&(i=!1);for(var o=new W,a=0;a<e.getNumInteriorRing();a++){var u=n.transformLinearRing(e.getInteriorRingN(a),e);u===null||u.isEmpty()||(u instanceof zr||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(s,o.toArray([]));var l=new W;return s!==null&&l.add(s),l.addAll(o),this._factory.buildGeometry(l)},rn.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},rn.prototype.getInputGeometry=function(){return this._inputGeom},rn.prototype.transformMultiLineString=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformLineString(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},rn.prototype.transformCoordinates=function(e,t){return this.copy(e)},rn.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},rn.prototype.transformMultiPoint=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPoint(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},rn.prototype.transformMultiPolygon=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transformPolygon(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},rn.prototype.copy=function(e){return e.copy()},rn.prototype.transformGeometryCollection=function(e,t){for(var n=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=n.transform(e.getGeometryN(s));o!==null&&(n._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Ct.toGeometryArray(i)):this._factory.buildGeometry(i)},rn.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof cn)return this.transformPoint(e,null);if(e instanceof ma)return this.transformMultiPoint(e,null);if(e instanceof zr)return this.transformLinearRing(e,null);if(e instanceof $t)return this.transformLineString(e,null);if(e instanceof Es)return this.transformMultiLineString(e,null);if(e instanceof fe)return this.transformPolygon(e,null);if(e instanceof Ur)return this.transformMultiPolygon(e,null);if(e instanceof Ue)return this.transformGeometryCollection(e,null);throw new Xt("Unknown Geometry subtype: "+e.getClass().getName())},rn.prototype.transformLinearRing=function(e,t){var n=this.transformCoordinates(e.getCoordinateSequence(),e);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},rn.prototype.interfaces_=function(){return[]},rn.prototype.getClass=function(){return rn};var Jr=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new tt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $t&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];r.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Jr.prototype.snapVertices=function(e,t){for(var n=this,i=this._isClosed?e.size()-1:e.size(),s=0;s<i;s++){var o=e.get(s),a=n.findSnapForVertex(o,t);a!==null&&(e.set(s,new M(a)),s===0&&n._isClosed&&e.set(e.size()-1,new M(a)))}},Jr.prototype.findSnapForVertex=function(e,t){for(var n=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<n._snapTolerance)return t[i]}return null},Jr.prototype.snapTo=function(e){var t=new ju(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var n=t.toCoordinateArray();return n},Jr.prototype.snapSegments=function(e,t){var n=this;if(t.length===0)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var s=0;s<i;s++){var o=t[s],a=n.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new M(o),!1)}},Jr.prototype.findSegmentIndexToSnap=function(e,t){for(var n=this,i=ht.MAX_VALUE,s=-1,o=0;o<t.size()-1;o++){if(n._seg.p0=t.get(o),n._seg.p1=t.get(o+1),n._seg.p0.equals2D(e)||n._seg.p1.equals2D(e)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(e);a<n._snapTolerance&&a<i&&(i=a,s=o)}return s},Jr.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var oe=function(e){this._srcGeom=e||null},Gm={SNAP_PRECISION_FACTOR:{configurable:!0}};oe.prototype.snapTo=function(e,t){var n=this.extractTargetCoordinates(e),i=new Wm(t,n);return i.transform(this._srcGeom)},oe.prototype.snapToSelf=function(e,t){var n=this.extractTargetCoordinates(this._srcGeom),i=new Wm(e,n,!0),s=i.transform(this._srcGeom),o=s;return t&&at(o,qi)&&(o=s.buffer(0)),o},oe.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),n=t/10;return n},oe.prototype.extractTargetCoordinates=function(e){for(var t=new cr,n=e.getCoordinates(),i=0;i<n.length;i++)t.add(n[i]);return t.toArray(new Array(0).fill(null))},oe.prototype.computeMinimumSegmentLength=function(e){for(var t=ht.MAX_VALUE,n=0;n<e.length-1;n++){var i=e[n].distance(e[n+1]);i<t&&(t=i)}return t},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.snap=function(e,t,n){var i=new Array(2).fill(null),s=new oe(e);i[0]=s.snapTo(t,n);var o=new oe(t);return i[1]=o.snapTo(i[0],n),i},oe.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=oe.computeSizeBasedSnapTolerance(e),n=e.getPrecisionModel();if(n.getType()===Rt.FIXED){var i=1/n.getScale()*2/1.415;i>t&&(t=i)}return t}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return Math.min(oe.computeOverlaySnapTolerance(s),oe.computeOverlaySnapTolerance(o))}},oe.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),n=Math.min(t.getHeight(),t.getWidth()),i=n*oe.SNAP_PRECISION_FACTOR;return i},oe.snapToSelf=function(e,t,n){var i=new oe(e);return i.snapToSelf(t,n)},Gm.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(oe,Gm);var Wm=function(r){function e(t,n,i){r.call(this),this._snapTolerance=t||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,i){var s=new Jr(n,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(n,i){var s=n.toCoordinateArray(),o=this.snapLine(s,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(rn),Ye=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Ye.prototype.getCommon=function(){return ht.longBitsToDouble(this._commonBits)},Ye.prototype.add=function(e){var t=ht.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=Ye.signExpBits(this._commonBits),this._isFirst=!1,null;var n=Ye.signExpBits(t);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Ye.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=Ye.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Ye.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ht.longBitsToDouble(e),n=ht.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+n,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return o}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.getBit=function(e,t){var n=1<<t;return(e&n)!==0?1:0},Ye.signExpBits=function(e){return e>>52},Ye.zeroLowerBits=function(e,t){var n=(1<<t)-1,i=~n,s=e&i;return s},Ye.numCommonMostSigMantissaBits=function(e,t){for(var n=0,i=52;i>=0;i--){if(Ye.getBit(e,i)!==Ye.getBit(t,i))return n;n++}return 52};var $i=function(){this._commonCoord=null,this._ccFilter=new wo},md={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};$i.prototype.addCommonBits=function(e){var t=new ts(this._commonCoord);e.apply(t),e.geometryChanged()},$i.prototype.removeCommonBits=function(e){if(this._commonCoord.x===0&&this._commonCoord.y===0)return e;var t=new M(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new ts(t);return e.apply(n),e.geometryChanged(),e},$i.prototype.getCommonCoordinate=function(){return this._commonCoord},$i.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},$i.prototype.interfaces_=function(){return[]},$i.prototype.getClass=function(){return $i},md.CommonCoordinateFilter.get=function(){return wo},md.Translater.get=function(){return ts},Object.defineProperties($i,md);var wo=function(){this._commonBitsX=new Ye,this._commonBitsY=new Ye};wo.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},wo.prototype.getCommonCoordinate=function(){return new M(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},wo.prototype.interfaces_=function(){return[jr]},wo.prototype.getClass=function(){return wo};var ts=function(){this.trans=null;var e=arguments[0];this.trans=e};ts.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,i)},ts.prototype.isDone=function(){return!1},ts.prototype.isGeometryChanged=function(){return!0},ts.prototype.interfaces_=function(){return[Qn]},ts.prototype.getClass=function(){return ts};var be=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};be.prototype.selfSnap=function(e){var t=new oe(e),n=t.snapTo(e,this._snapTolerance);return n},be.prototype.removeCommonBits=function(e){this._cbr=new $i,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},be.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},be.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=gt.overlayOp(t[0],t[1],e);return this.prepareResult(n)},be.prototype.checkValid=function(e){e.isValid()||xe.out.println("Snapped geometry is invalid")},be.prototype.computeSnapTolerance=function(){this._snapTolerance=oe.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},be.prototype.snap=function(e){var t=this.removeCommonBits(e),n=oe.snap(t[0],t[1],this._snapTolerance);return n},be.prototype.interfaces_=function(){return[]},be.prototype.getClass=function(){return be},be.overlayOp=function(e,t,n){var i=new be(e,t);return i.getResultGeometry(n)},be.union=function(e,t){return be.overlayOp(e,t,gt.UNION)},be.intersection=function(e,t){return be.overlayOp(e,t,gt.INTERSECTION)},be.symDifference=function(e,t){return be.overlayOp(e,t,gt.SYMDIFFERENCE)},be.difference=function(e,t){return be.overlayOp(e,t,gt.DIFFERENCE)};var Je=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Je.prototype.getResultGeometry=function(e){var t=null,n=!1,i=null;try{t=gt.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(n=!0)}catch(o){if(o instanceof gi)i=o;else throw o}finally{}if(!n)try{t=be.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof gi?i:o}finally{}return t},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},Je.overlayOp=function(e,t,n){var i=new Je(e,t);return i.getResultGeometry(n)},Je.union=function(e,t){return Je.overlayOp(e,t,gt.UNION)},Je.intersection=function(e,t){return Je.overlayOp(e,t,gt.INTERSECTION)},Je.symDifference=function(e,t){return Je.overlayOp(e,t,gt.SYMDIFFERENCE)},Je.difference=function(e,t){return Je.overlayOp(e,t,gt.DIFFERENCE)};var el=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};el.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el};var pn=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],t=arguments[1];this._eventType=r.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=s}},vd={INSERT:{configurable:!0},DELETE:{configurable:!0}};pn.prototype.isDelete=function(){return this._eventType===pn.DELETE},pn.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},pn.prototype.getObject=function(){return this._obj},pn.prototype.compareTo=function(e){var t=e;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0},pn.prototype.getInsertEvent=function(){return this._insertEvent},pn.prototype.isInsert=function(){return this._eventType===pn.INSERT},pn.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label},pn.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},pn.prototype.interfaces_=function(){return[Ln]},pn.prototype.getClass=function(){return pn},vd.INSERT.get=function(){return 1},vd.DELETE.get=function(){return 2},Object.defineProperties(pn,vd);var fc=function(){};fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc};var Re=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n};Re.prototype.isTrivialIntersection=function(e,t,n,i){if(e===n&&this._li.getIntersectionNum()===1){if(Re.isAdjacentSegments(t,i))return!0;if(e.isClosed()){var s=e.getNumPoints()-1;if(t===0&&i===s||i===0&&t===s)return!0}}return!1},Re.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Re.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},Re.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Re.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var i=n.next(),s=i.getCoordinate();if(e.isIntersection(s))return!0}return!1},Re.prototype.hasProperIntersection=function(){return this._hasProper},Re.prototype.hasIntersection=function(){return this._hasIntersection},Re.prototype.isDone=function(){return this._isDone},Re.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))},Re.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},Re.prototype.addIntersections=function(e,t,n,i){if(e===n&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var UE=function(r){function e(){r.call(this),this.events=new W,this.nOverlaps=null}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;tr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=n.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var s=0;s<this.events.size();s++){var o=n.events.get(s);if(o.isInsert()&&n.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Re&&at(arguments[0],Zn)&&at(arguments[1],Zn)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&at(arguments[0],Zn)&&arguments[1]instanceof Re){var c=arguments[0],h=arguments[1],f=arguments[2];f?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(h)}}},e.prototype.addEdge=function(n,i){for(var s=this,o=n.getMonotoneChainEdge(),a=o.getStartIndexes(),u=0;u<a.length-1;u++){var l=new el(o,u),c=new pn(i,o.getMinX(u),l);s.events.add(c),s.events.add(new pn(o.getMaxX(u),c))}},e.prototype.processOverlaps=function(n,i,s,o){for(var a=this,u=s.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var h=c.getObject();s.isSameLabel(c)||(u.computeIntersections(h,o),a.nOverlaps++)}}},e.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();n.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(fc),Zr=function(){this._min=ht.POSITIVE_INFINITY,this._max=ht.NEGATIVE_INFINITY},qm={NodeComparator:{configurable:!0}};Zr.prototype.getMin=function(){return this._min},Zr.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},Zr.prototype.getMax=function(){return this._max},Zr.prototype.toString=function(){return Jn.toLineString(new M(this._min,0),new M(this._max,0))},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},qm.NodeComparator.get=function(){return nl},Object.defineProperties(Zr,qm);var nl=function(){};nl.prototype.compare=function(e,t){var n=e,i=t,s=(n._min+n._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},nl.prototype.interfaces_=function(){return[sa]},nl.prototype.getClass=function(){return nl};var GE=function(r){function e(){r.call(this),this._item=null;var t=arguments[0],n=arguments[1],i=arguments[2];this._min=t,this._max=n,this._item=i}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zr),WE=function(r){function e(){r.call(this),this._node1=null,this._node2=null;var t=arguments[0],n=arguments[1];this._node1=t,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},e.prototype.query=function(n,i,s){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,s),this._node2!==null&&this._node2.query(n,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zr),Kr=function(){this._leaves=new W,this._root=null,this._level=0};Kr.prototype.buildTree=function(){var e=this;tr.sort(this._leaves,new Zr.NodeComparator);for(var t=this._leaves,n=null,i=new W;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);n=t,t=i,i=n}},Kr.prototype.insert=function(e,t,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new GE(e,t,n))},Kr.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)},Kr.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Kr.prototype.printNode=function(e){xe.out.println(Jn.toLineString(new M(e._min,this._level),new M(e._max,this._level)))},Kr.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Kr.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n<e.size();n+=2){var i=e.get(n),s=n+1<e.size()?e.get(n):null;if(s===null)t.add(i);else{var o=new WE(e.get(n),e.get(n+1));t.add(o)}}},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr};var Sa=function(){this._items=new W};Sa.prototype.visitItem=function(e){this._items.add(e)},Sa.prototype.getItems=function(){return this._items},Sa.prototype.interfaces_=function(){return[Hi]},Sa.prototype.getClass=function(){return Sa};var ba=function(){this._index=null;var e=arguments[0];if(!at(e,qi))throw new Xt("Argument must be Polygonal");this._index=new Ts(e)},yd={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};ba.prototype.locate=function(e){var t=new lr(e),n=new Pa(t);return this._index.query(e.y,e.y,n),t.getLocation()},ba.prototype.interfaces_=function(){return[wa]},ba.prototype.getClass=function(){return ba},yd.SegmentVisitor.get=function(){return Pa},yd.IntervalIndexedGeometry.get=function(){return Ts},Object.defineProperties(ba,yd);var Pa=function(){this._counter=null;var e=arguments[0];this._counter=e};Pa.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Pa.prototype.interfaces_=function(){return[Hi]},Pa.prototype.getClass=function(){return Pa};var Ts=function(){this._index=new Kr;var e=arguments[0];this.init(e)};Ts.prototype.init=function(e){for(var t=this,n=Oe.getLines(e),i=n.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();t.addLine(o)}},Ts.prototype.addLine=function(e){for(var t=this,n=1;n<e.length;n++){var i=new tt(e[n-1],e[n]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(s,o,i)}},Ts.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new Sa;return this._index.query(e,t,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts};var rl=function(r){function e(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Im,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new nr,arguments.length===2){var t=arguments[0],n=arguments[1],i=Fn.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=s,this._parentGeom=o,this._boundaryNodeRule=a,o!==null&&this.add(o)}}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(n,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,u=A.NONE;u=o.getLocation(n,U.ON),u===A.BOUNDARY&&a++;var l=e.determineBoundary(this._boundaryNodeRule,a);o.setLocation(n,l)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],u=new Re(s,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof zr||this._parentGeom instanceof fe||this._parentGeom instanceof Ur,h=o||!c;return l.computeIntersections(this._edges,u,h),this.addSelfIntersectionNodes(this._argIndex),u}},e.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(n)}},e.prototype.computeEdgeIntersections=function(n,i,s){var o=new Re(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,o),o},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof cn){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,A.INTERIOR)}else if(arguments[0]instanceof M){var s=arguments[0];this.insertPoint(this._argIndex,s,A.INTERIOR)}},e.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),A.EXTERIOR,A.INTERIOR);for(var s=0;s<n.getNumInteriorRing();s++){var o=n.getInteriorRingN(s);i.addPolygonRing(o,A.INTERIOR,A.EXTERIOR)}},e.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],A.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],A.BOUNDARY)},e.prototype.addLineString=function(n){var i=Et.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new dc(i,new Vt(this._argIndex,A.INTERIOR));this._lineEdgeMap.put(n,s),this.insertEdge(s),vt.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),s=0,o=n.iterator();o.hasNext();){var a=o.next();i[s++]=a.getCoordinate().copy()}return i},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,i,s){if(this.isBoundaryNode(n,i))return null;s===A.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,s)},e.prototype.addPolygonRing=function(n,i,s){if(n.isEmpty())return null;var o=Et.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,u=s;H.isCCW(o)&&(a=s,u=i);var l=new dc(o,new Vt(this._argIndex,A.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],A.BOUNDARY)},e.prototype.insertPoint=function(n,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new Vt(n,s):a.setLocation(n,s)},e.prototype.createEdgeSetIntersector=function(){return new UE},e.prototype.addSelfIntersectionNodes=function(n){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(n),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Ur&&(this._useBoundaryDeterminationRule=!1),n instanceof fe)this.addPolygon(n);else if(n instanceof $t)this.addLineString(n);else if(n instanceof cn)this.addPoint(n);else if(n instanceof ma)this.addCollection(n);else if(n instanceof Es)this.addCollection(n);else if(n instanceof Ur)this.addCollection(n);else if(n instanceof Ue)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var i=this,s=0;s<n.getNumGeometries();s++){var o=n.getGeometryN(s);i.add(o)}},e.prototype.locate=function(n){return at(this._parentGeom,qi)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new ba(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,i){return n.isInBoundary(i)?A.BOUNDARY:A.INTERIOR},e}(Kt),Ia=function(){if(this._li=new ys,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new rl(0,e)}else if(arguments.length===2){var t=arguments[0],n=arguments[1],i=Fn.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new rl(0,t,i),this._arg[1]=new rl(1,n,i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];s.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(s.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new rl(0,s,a),this._arg[1]=new rl(1,o,a)}};Ia.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Ia.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Ia.prototype.interfaces_=function(){return[]},Ia.prototype.getClass=function(){return Ia};var Ns=function(){};Ns.prototype.interfaces_=function(){return[]},Ns.prototype.getClass=function(){return Ns},Ns.map=function(){if(arguments[0]instanceof ot&&at(arguments[1],Ns.MapOp)){for(var e=arguments[0],t=arguments[1],n=new W,i=0;i<e.getNumGeometries();i++){var s=t.map(e.getGeometryN(i));s!==null&&n.add(s)}return e.getFactory().buildGeometry(n)}else if(at(arguments[0],de)&&at(arguments[1],Ns.MapOp)){for(var o=arguments[0],a=arguments[1],u=new W,l=o.iterator();l.hasNext();){var c=l.next(),h=a.map(c);h!==null&&u.add(h)}return u}},Ns.MapOp=function(){};var gt=function(r){function e(){var t=arguments[0],n=arguments[1];r.call(this,t,n),this._ptLocator=new nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new er,this._resultPolyList=new W,this._resultLineList=new W,this._resultPointList=new W,this._graph=new Kt(new Fm),this._geomFact=t.getFactory()}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var s=i.getLabel(),o=n.getLabel();i.isPointwiseEqual(n)||(o=new Vt(n.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(n)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},e.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},e.prototype.computeGeometry=function(n,i,s,o){var a=new W;return a.addAll(n),a.addAll(i),a.addAll(s),a.isEmpty()?e.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},e.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(n,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),u=s._ptLocator.locate(n,a);if(u!==A.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var n=new W,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),n.add(s.getCollapsedEdge()))}this._edgeList.addAll(n)},e.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},e.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},e.prototype.insertUniqueEdges=function(n){for(var i=this,s=n.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new W;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),xs.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var s=new hn(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Cr(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(n);var a=new _o(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},e.prototype.labelIncompleteNode=function(n,i){var s=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,s)},e.prototype.copyPoints=function(n){for(var i=this,s=this._arg[n].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(n,o.getLabel().getLocation(n))}},e.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.isArea()&&!s.isInteriorAreaEdge()&&e.isResultOfOp(o.getLocation(0,U.RIGHT),o.getLocation(1,U.RIGHT),n)&&s.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),s=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var a=0;a<2;a++)!s.isNull(a)&&s.isArea()&&!o.isNull(a)&&(o.getDelta(a)===0?s.toLine(a):(vt.isTrue(!o.isNull(a,U.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,U.LEFT,o.getLocation(a,U.LEFT)),vt.isTrue(!o.isNull(a,U.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,U.RIGHT,o.getLocation(a,U.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?n.labelIncompleteNode(s,0):n.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ia);gt.overlayOp=function(r,e,t){var n=new gt(r,e),i=n.getResultGeometry(t);return i},gt.intersection=function(r,e){if(r.isEmpty()||e.isEmpty())return gt.createEmptyResult(gt.INTERSECTION,r,e,r.getFactory());if(r.isGeometryCollection()){var t=e;return yo.map(r,{interfaces_:function(){return[Ns.MapOp]},map:function(n){return n.intersection(t)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),Je.overlayOp(r,e,gt.INTERSECTION)},gt.symDifference=function(r,e){if(r.isEmpty()||e.isEmpty()){if(r.isEmpty()&&e.isEmpty())return gt.createEmptyResult(gt.SYMDIFFERENCE,r,e,r.getFactory());if(r.isEmpty())return e.copy();if(e.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),Je.overlayOp(r,e,gt.SYMDIFFERENCE)},gt.resultDimension=function(r,e,t){var n=e.getDimension(),i=t.getDimension(),s=-1;switch(r){case gt.INTERSECTION:s=Math.min(n,i);break;case gt.UNION:s=Math.max(n,i);break;case gt.DIFFERENCE:s=n;break;case gt.SYMDIFFERENCE:s=Math.max(n,i);break}return s},gt.createEmptyResult=function(r,e,t,n){var i=null;switch(gt.resultDimension(r,e,t)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},gt.difference=function(r,e){return r.isEmpty()?gt.createEmptyResult(gt.DIFFERENCE,r,e,r.getFactory()):e.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(e),Je.overlayOp(r,e,gt.DIFFERENCE))},gt.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],e=arguments[1],t=r.getLocation(0),n=r.getLocation(1);return gt.isResultOfOp(t,n,e)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===A.BOUNDARY&&(i=A.INTERIOR),s===A.BOUNDARY&&(s=A.INTERIOR),o){case gt.INTERSECTION:return i===A.INTERIOR&&s===A.INTERIOR;case gt.UNION:return i===A.INTERIOR||s===A.INTERIOR;case gt.DIFFERENCE:return i===A.INTERIOR&&s!==A.INTERIOR;case gt.SYMDIFFERENCE:return i===A.INTERIOR&&s!==A.INTERIOR||i!==A.INTERIOR&&s===A.INTERIOR}return!1}},gt.INTERSECTION=1,gt.UNION=2,gt.DIFFERENCE=3,gt.SYMDIFFERENCE=4;var es=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new nr,this._seg=new tt;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};es.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=t._linework.getGeometryN(n),s=i.getCoordinateSequence(),o=0;o<s.size()-1;o++){s.getCoordinate(o,t._seg.p0),s.getCoordinate(o+1,t._seg.p1);var a=t._seg.distance(e);if(a<=t._boundaryDistanceTolerance)return!0}return!1},es.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?A.BOUNDARY:this._ptLocator.locate(e,this._g)},es.prototype.extractLinework=function(e){var t=new xa;e.apply(t);var n=t.getLinework(),i=Ct.toLineStringArray(n);return e.getFactory().createMultiLineString(i)},es.prototype.interfaces_=function(){return[]},es.prototype.getClass=function(){return es};var xa=function(){this._linework=null,this._linework=new W};xa.prototype.getLinework=function(){return this._linework},xa.prototype.filter=function(e){var t=this;if(e instanceof fe){var n=e;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)t._linework.add(n.getInteriorRingN(i))}},xa.prototype.interfaces_=function(){return[hr]},xa.prototype.getClass=function(){return xa};var Os=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};Os.prototype.extractPoints=function(e,t,n){for(var i=this,s=e.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],t,n)},Os.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},Os.prototype.getPoints=function(e){for(var t=this,n=new W,i=Oe.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();t.extractPoints(o,e,n)}return n},Os.prototype.computeOffsetPoints=function(e,t,n,i){var s=t.x-e.x,o=t.y-e.y,a=Math.sqrt(s*s+o*o),u=n*s/a,l=n*o/a,c=(t.x+e.x)/2,h=(t.y+e.y)/2;if(this._doLeft){var f=new M(c-l,h+u);i.add(f)}if(this._doRight){var p=new M(c+l,h-u);i.add(p)}},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var On=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new W;var e=arguments[0],t=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,n],this._locFinder=[new es(this._geom[0],this._boundaryDistanceTolerance),new es(this._geom[1],this._boundaryDistanceTolerance),new es(this._geom[2],this._boundaryDistanceTolerance)]},Hm={TOLERANCE:{configurable:!0}};On.prototype.reportResult=function(e,t,n){xe.out.println("Overlay result invalid - A:"+A.toLocationSymbol(t[0])+" B:"+A.toLocationSymbol(t[1])+" expected:"+(n?"i":"e")+" actual:"+A.toLocationSymbol(t[2]))},On.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},On.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],n=0;n<this._testCoords.size();n++){var i=e._testCoords.get(n);if(!e.checkValid(t,i))return e._invalidLocation=i,!1}return!0}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),On.hasLocation(this._location,A.BOUNDARY)?!0:this.isValidResult(s,this._location)}},On.prototype.addTestPts=function(e){var t=new Os(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},On.prototype.isValidResult=function(e,t){var n=gt.isResultOfOp(t[0],t[1],e),i=t[2]===A.INTERIOR,s=!(n^i);return s||this.reportResult(e,t,n),s},On.prototype.getInvalidLocation=function(){return this._invalidLocation},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},On.hasLocation=function(e,t){for(var n=0;n<3;n++)if(e[n]===t)return!0;return!1},On.computeBoundaryDistanceTolerance=function(e,t){return Math.min(oe.computeSizeBasedSnapTolerance(e),oe.computeSizeBasedSnapTolerance(t))},On.isValid=function(e,t,n,i){var s=new On(e,t,i);return s.isValid(n)},Hm.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(On,Hm);var Dn=function r(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(e),this._inputGeoms=e};Dn.prototype.extractElements=function(e,t){var n=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);n._skipEmpty&&s.isEmpty()||t.add(s)}},Dn.prototype.combine=function(){for(var e=this,t=new W,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.combine=function(){if(arguments.length===1){var e=arguments[0],t=new Dn(e);return t.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],s=new Dn(Dn.createList(n,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],u=arguments[2],l=new Dn(Dn.createList(o,a,u));return l.combine()}},Dn.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},Dn.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],n=new W;return n.add(e),n.add(t),n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new W;return a.add(i),a.add(s),a.add(o),a}};var ce=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new W)},Xm={STRTREE_NODE_CAPACITY:{configurable:!0}};ce.prototype.reduceToGeometries=function(e){for(var t=this,n=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=null;at(s,Zn)?o=t.unionTree(s):s instanceof ot&&(o=s),n.add(o)}return n},ce.prototype.extractByEnvelope=function(e,t,n){for(var i=new W,s=0;s<t.getNumGeometries();s++){var o=t.getGeometryN(s);o.getEnvelopeInternal().intersects(e)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},ce.prototype.unionOptimized=function(e,t){var n=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!n.intersects(i)){var s=Dn.combine(e,t);return s}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)},ce.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new Om(ce.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var n=t.next();e.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=e.itemsTree(),s=this.unionTree(i);return s},ce.prototype.binaryUnion=function(){if(arguments.length===1){var e=arguments[0];return this.binaryUnion(e,0,e.size())}else if(arguments.length===3){var t=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var s=ce.getGeometry(t,n);return this.unionSafe(s,null)}else{if(i-n===2)return this.unionSafe(ce.getGeometry(t,n),ce.getGeometry(t,n+1));var o=Math.trunc((i+n)/2),a=this.binaryUnion(t,n,o),u=this.binaryUnion(t,o,i);return this.unionSafe(a,u)}}},ce.prototype.repeatedUnion=function(e){for(var t=null,n=e.iterator();n.hasNext();){var i=n.next();t===null?t=i.copy():t=t.union(i)}return t},ce.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)},ce.prototype.unionActual=function(e,t){return ce.restrictToPolygons(e.union(t))},ce.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),n=this.binaryUnion(t);return n},ce.prototype.unionUsingEnvelopeIntersection=function(e,t,n){var i=new W,s=this.extractByEnvelope(n,e,i),o=this.extractByEnvelope(n,t,i),a=this.unionActual(s,o);i.add(a);var u=Dn.combine(i);return u},ce.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),n=t.buildGeometry(e),i=n.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),u=a.createGeometryCollection([s,o]),l=u.buffer(0);return l}},ce.prototype.interfaces_=function(){return[]},ce.prototype.getClass=function(){return ce},ce.restrictToPolygons=function(e){if(at(e,qi))return e;var t=Pi.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(Ct.toPolygonArray(t))},ce.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},ce.union=function(e){var t=new ce(e);return t.union()},Xm.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ce,Xm);var pc=function(){};pc.prototype.interfaces_=function(){return[]},pc.prototype.getClass=function(){return pc},pc.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return gt.createEmptyResult(gt.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Je.overlayOp(e,t,gt.UNION)};function Ds(){return new gc}function gc(){this.reset()}gc.prototype={constructor:gc,reset:function(){this.s=this.t=0},add:function(r){Ym(mc,r,this.t),Ym(this,mc.s,this.s),this.s?this.t+=mc.t:this.s=mc.t},valueOf:function(){return this.s}};var mc=new gc;function Ym(r,e,t){var n=r.s=e+t,i=n-e,s=n-i;r.t=e-s+(t-i)}var he=1e-6,zt=Math.PI,Ii=zt/2,Jm=zt/4,xi=zt*2,Ms=180/zt,Sr=zt/180,Ze=Math.abs,qE=Math.atan,Ta=Math.atan2,ge=Math.cos,me=Math.sin,Na=Math.sqrt;function Zm(r){return r>1?0:r<-1?zt:Math.acos(r)}function Eo(r){return r>1?Ii:r<-1?-Ii:Math.asin(r)}function il(){}function vc(r,e){r&&Qm.hasOwnProperty(r.type)&&Qm[r.type](r,e)}var Km={Feature:function(r,e){vc(r.geometry,e)},FeatureCollection:function(r,e){for(var t=r.features,n=-1,i=t.length;++n<i;)vc(t[n].geometry,e)}},Qm={Sphere:function(r,e){e.sphere()},Point:function(r,e){r=r.coordinates,e.point(r[0],r[1],r[2])},MultiPoint:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)r=t[n],e.point(r[0],r[1],r[2])},LineString:function(r,e){_d(r.coordinates,e,0)},MultiLineString:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)_d(t[n],e,0)},Polygon:function(r,e){$m(r.coordinates,e)},MultiPolygon:function(r,e){for(var t=r.coordinates,n=-1,i=t.length;++n<i;)$m(t[n],e)},GeometryCollection:function(r,e){for(var t=r.geometries,n=-1,i=t.length;++n<i;)vc(t[n],e)}};function _d(r,e,t){var n=-1,i=r.length-t,s;for(e.lineStart();++n<i;)s=r[n],e.point(s[0],s[1],s[2]);e.lineEnd()}function $m(r,e){var t=-1,n=r.length;for(e.polygonStart();++t<n;)_d(r[t],e,1);e.polygonEnd()}function HE(r,e){r&&Km.hasOwnProperty(r.type)?Km[r.type](r,e):vc(r,e)}Ds(),Ds();function wd(r){return[Ta(r[1],r[0]),Eo(r[2])]}function Oa(r){var e=r[0],t=r[1],n=ge(t);return[n*ge(e),n*me(e),me(t)]}function yc(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function _c(r,e){return[r[1]*e[2]-r[2]*e[1],r[2]*e[0]-r[0]*e[2],r[0]*e[1]-r[1]*e[0]]}function Ed(r,e){r[0]+=e[0],r[1]+=e[1],r[2]+=e[2]}function wc(r,e){return[r[0]*e,r[1]*e,r[2]*e]}function Cd(r){var e=Na(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=e,r[1]/=e,r[2]/=e}Ds();function tv(r,e){function t(n,i){return n=r(n,i),e(n[0],n[1])}return r.invert&&e.invert&&(t.invert=function(n,i){return n=e.invert(n,i),n&&r.invert(n[0],n[1])}),t}function Sd(r,e){return[r>zt?r-xi:r<-zt?r+xi:r,e]}Sd.invert=Sd;function XE(r,e,t){return(r%=xi)?e||t?tv(nv(r),rv(e,t)):nv(r):e||t?rv(e,t):Sd}function ev(r){return function(e,t){return e+=r,[e>zt?e-xi:e<-zt?e+xi:e,t]}}function nv(r){var e=ev(r);return e.invert=ev(-r),e}function rv(r,e){var t=ge(r),n=me(r),i=ge(e),s=me(e);function o(a,u){var l=ge(u),c=ge(a)*l,h=me(a)*l,f=me(u),p=f*t+c*n;return[Ta(h*i-p*s,c*t-f*n),Eo(p*i+h*s)]}return o.invert=function(a,u){var l=ge(u),c=ge(a)*l,h=me(a)*l,f=me(u),p=f*i-h*s;return[Ta(h*i+f*s,c*t+p*n),Eo(p*t-c*n)]},o}function YE(r,e,t,n,i,s){if(t){var o=ge(e),a=me(e),u=n*t;i==null?(i=e+n*xi,s=e-u/2):(i=iv(o,i),s=iv(o,s),(n>0?i<s:i>s)&&(i+=n*xi));for(var l,c=i;n>0?c>s:c<s;c-=u)l=wd([o,-a*ge(c),-a*me(c)]),r.point(l[0],l[1])}}function iv(r,e){e=Oa(e),e[0]-=r,Cd(e);var t=Zm(-e[1]);return((-e[2]<0?-t:t)+xi-he)%xi}function sv(){var r=[],e;return{point:function(t,n){e.push([t,n])},lineStart:function(){r.push(e=[])},lineEnd:il,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var t=r;return r=[],e=null,t}}}function JE(r,e,t,n,i,s){var o=r[0],a=r[1],u=e[0],l=e[1],c=0,h=1,f=u-o,p=l-a,v;if(v=t-o,!(!f&&v>0)){if(v/=f,f<0){if(v<c)return;v<h&&(h=v)}else if(f>0){if(v>h)return;v>c&&(c=v)}if(v=i-o,!(!f&&v<0)){if(v/=f,f<0){if(v>h)return;v>c&&(c=v)}else if(f>0){if(v<c)return;v<h&&(h=v)}if(v=n-a,!(!p&&v>0)){if(v/=p,p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}if(v=s-a,!(!p&&v<0)){if(v/=p,p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}return c>0&&(r[0]=o+c*f,r[1]=a+c*p),h<1&&(e[0]=o+h*f,e[1]=a+h*p),!0}}}}}function Ec(r,e){return Ze(r[0]-e[0])<he&&Ze(r[1]-e[1])<he}function Cc(r,e,t,n){this.x=r,this.z=e,this.o=t,this.e=n,this.v=!1,this.n=this.p=null}function ov(r,e,t,n,i){var s=[],o=[],a,u;if(r.forEach(function(v){if(!((C=v.length-1)<=0)){var C,S=v[0],P=v[C],y;if(Ec(S,P)){for(i.lineStart(),a=0;a<C;++a)i.point((S=v[a])[0],S[1]);i.lineEnd();return}s.push(y=new Cc(S,v,null,!0)),o.push(y.o=new Cc(S,null,y,!1)),s.push(y=new Cc(P,v,null,!1)),o.push(y.o=new Cc(P,null,y,!0))}}),!!s.length){for(o.sort(e),av(s),av(o),a=0,u=o.length;a<u;++a)o[a].e=t=!t;for(var l=s[0],c,h;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,u=c.length;a<u;++a)i.point((h=c[a])[0],h[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)i.point((h=c[a])[0],h[1]);else n(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function av(r){if(e=r.length){for(var e,t=0,n=r[0],i;++t<e;)n.n=i=r[t],i.p=n,n=i;n.n=i=r[0],i.p=n}}function uv(r,e){return r<e?-1:r>e?1:r>=e?0:NaN}function ZE(r){return r.length===1&&(r=KE(r)),{left:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)<0?n=s+1:i=s}return n},right:function(e,t,n,i){for(n==null&&(n=0),i==null&&(i=e.length);n<i;){var s=n+i>>>1;r(e[s],t)>0?i=s:n=s+1}return n}}}function KE(r){return function(e,t){return uv(r(e),t)}}ZE(uv);function lv(r){for(var e=r.length,t,n=-1,i=0,s,o;++n<e;)i+=r[n].length;for(s=new Array(i);--e>=0;)for(o=r[e],t=o.length;--t>=0;)s[--i]=o[t];return s}var Sc=1e9,bc=-1e9;function QE(r,e,t,n){function i(l,c){return r<=l&&l<=t&&e<=c&&c<=n}function s(l,c,h,f){var p=0,v=0;if(l==null||(p=o(l,h))!==(v=o(c,h))||u(l,c)<0^h>0)do f.point(p===0||p===3?r:t,p>1?n:e);while((p=(p+h+4)%4)!==v);else f.point(c[0],c[1])}function o(l,c){return Ze(l[0]-r)<he?c>0?0:3:Ze(l[0]-t)<he?c>0?2:1:Ze(l[1]-e)<he?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var h=o(l,1),f=o(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=sv(),f,p,v,C,S,P,y,_,m,w,E,b={point:I,lineStart:O,lineEnd:L,polygonStart:D,polygonEnd:x};function I(J,q){i(J,q)&&c.point(J,q)}function T(){for(var J=0,q=0,Q=p.length;q<Q;++q)for(var ct=p[q],mt=1,X=ct.length,Z=ct[0],K,wt,Ft=Z[0],Tt=Z[1];mt<X;++mt)K=Ft,wt=Tt,Z=ct[mt],Ft=Z[0],Tt=Z[1],wt<=n?Tt>n&&(Ft-K)*(n-wt)>(Tt-wt)*(r-K)&&++J:Tt<=n&&(Ft-K)*(n-wt)<(Tt-wt)*(r-K)&&--J;return J}function D(){c=h,f=[],p=[],E=!0}function x(){var J=T(),q=E&&J,Q=(f=lv(f)).length;(q||Q)&&(l.polygonStart(),q&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),Q&&ov(f,a,J,s,l),l.polygonEnd()),c=l,f=p=v=null}function O(){b.point=F,p&&p.push(v=[]),w=!0,m=!1,y=_=NaN}function L(){f&&(F(C,S),P&&m&&h.rejoin(),f.push(h.result())),b.point=I,m&&c.lineEnd()}function F(J,q){var Q=i(J,q);if(p&&v.push([J,q]),w)C=J,S=q,P=Q,w=!1,Q&&(c.lineStart(),c.point(J,q));else if(Q&&m)c.point(J,q);else{var ct=[y=Math.max(bc,Math.min(Sc,y)),_=Math.max(bc,Math.min(Sc,_))],mt=[J=Math.max(bc,Math.min(Sc,J)),q=Math.max(bc,Math.min(Sc,q))];JE(ct,mt,r,e,t,n)?(m||(c.lineStart(),c.point(ct[0],ct[1])),c.point(mt[0],mt[1]),Q||c.lineEnd(),E=!1):Q&&(c.lineStart(),c.point(J,q),E=!1)}y=J,_=q,m=Q}return b}}var bd=Ds();function $E(r,e){var t=e[0],n=e[1],i=[me(t),-ge(t),0],s=0,o=0;bd.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,h=l[c-1],f=h[0],p=h[1]/2+Jm,v=me(p),C=ge(p),S=0;S<c;++S,f=y,v=m,C=w,h=P){var P=l[S],y=P[0],_=P[1]/2+Jm,m=me(_),w=ge(_),E=y-f,b=E>=0?1:-1,I=b*E,T=I>zt,D=v*m;if(bd.add(Ta(D*b*me(I),C*w+D*ge(I))),s+=T?E+b*xi:E,T^f>=t^y>=t){var x=_c(Oa(h),Oa(P));Cd(x);var O=_c(i,x);Cd(O);var L=(T^E>=0?-1:1)*Eo(O[2]);(n>L||n===L&&(x[0]||x[1]))&&(o+=T^E>=0?1:-1)}}return(s<-1e-6||s<he&&bd<-1e-6)^o&1}Ds();function cv(r){return r}Ds(),Ds();var Da=1/0,Pc=Da,sl=-Da,Ic=sl,hv={point:tC,lineStart:il,lineEnd:il,polygonStart:il,polygonEnd:il,result:function(){var r=[[Da,Pc],[sl,Ic]];return sl=Ic=-(Pc=Da=1/0),r}};function tC(r,e){r<Da&&(Da=r),r>sl&&(sl=r),e<Pc&&(Pc=e),e>Ic&&(Ic=e)}Ds();function dv(r,e,t,n){return function(i,s){var o=e(s),a=i.invert(n[0],n[1]),u=sv(),l=e(u),c=!1,h,f,p,v={point:C,lineStart:P,lineEnd:y,polygonStart:function(){v.point=_,v.lineStart=m,v.lineEnd=w,f=[],h=[]},polygonEnd:function(){v.point=C,v.lineStart=P,v.lineEnd=y,f=lv(f);var E=$E(h,a);f.length?(c||(s.polygonStart(),c=!0),ov(f,nC,E,t,s)):E&&(c||(s.polygonStart(),c=!0),s.lineStart(),t(null,null,1,s),s.lineEnd()),c&&(s.polygonEnd(),c=!1),f=h=null},sphere:function(){s.polygonStart(),s.lineStart(),t(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function C(E,b){var I=i(E,b);r(E=I[0],b=I[1])&&s.point(E,b)}function S(E,b){var I=i(E,b);o.point(I[0],I[1])}function P(){v.point=S,o.lineStart()}function y(){v.point=C,o.lineEnd()}function _(E,b){p.push([E,b]);var I=i(E,b);l.point(I[0],I[1])}function m(){l.lineStart(),p=[]}function w(){_(p[0][0],p[0][1]),l.lineEnd();var E=l.clean(),b=u.result(),I,T=b.length,D,x,O;if(p.pop(),h.push(p),p=null,!!T){if(E&1){if(x=b[0],(D=x.length-1)>0){for(c||(s.polygonStart(),c=!0),s.lineStart(),I=0;I<D;++I)s.point((O=x[I])[0],O[1]);s.lineEnd()}return}T>1&&E&2&&b.push(b.pop().concat(b.shift())),f.push(b.filter(eC))}}return v}}function eC(r){return r.length>1}function nC(r,e){return((r=r.x)[0]<0?r[1]-Ii-he:Ii-r[1])-((e=e.x)[0]<0?e[1]-Ii-he:Ii-e[1])}const fv=dv(function(){return!0},rC,sC,[-zt,-Ii]);function rC(r){var e=NaN,t=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(s,o){var a=s>0?zt:-zt,u=Ze(s-e);Ze(u-zt)<he?(r.point(e,t=(t+o)/2>0?Ii:-Ii),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),r.point(s,t),i=0):n!==a&&u>=zt&&(Ze(e-n)<he&&(e-=n*he),Ze(s-a)<he&&(s-=a*he),t=iC(e,t,s,o),r.point(n,t),r.lineEnd(),r.lineStart(),r.point(a,t),i=0),r.point(e=s,t=o),n=a},lineEnd:function(){r.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function iC(r,e,t,n){var i,s,o=me(r-t);return Ze(o)>he?qE((me(e)*(s=ge(n))*me(t)-me(n)*(i=ge(e))*me(r))/(i*s*o)):(e+n)/2}function sC(r,e,t,n){var i;if(r==null)i=t*Ii,n.point(-zt,i),n.point(0,i),n.point(zt,i),n.point(zt,0),n.point(zt,-i),n.point(0,-i),n.point(-zt,-i),n.point(-zt,0),n.point(-zt,i);else if(Ze(r[0]-e[0])>he){var s=r[0]<e[0]?zt:-zt;i=t*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(e[0],e[1])}function oC(r,e){var t=ge(r),n=t>0,i=Ze(t)>he;function s(c,h,f,p){YE(p,r,e,f,c,h)}function o(c,h){return ge(c)*ge(h)>t}function a(c){var h,f,p,v,C;return{lineStart:function(){v=p=!1,C=1},point:function(S,P){var y=[S,P],_,m=o(S,P),w=n?m?0:l(S,P):m?l(S+(S<0?zt:-zt),P):0;if(!h&&(v=p=m)&&c.lineStart(),m!==p&&(_=u(h,y),(!_||Ec(h,_)||Ec(y,_))&&(y[0]+=he,y[1]+=he,m=o(y[0],y[1]))),m!==p)C=0,m?(c.lineStart(),_=u(y,h),c.point(_[0],_[1])):(_=u(h,y),c.point(_[0],_[1]),c.lineEnd()),h=_;else if(i&&h&&n^m){var E;!(w&f)&&(E=u(y,h,!0))&&(C=0,n?(c.lineStart(),c.point(E[0][0],E[0][1]),c.point(E[1][0],E[1][1]),c.lineEnd()):(c.point(E[1][0],E[1][1]),c.lineEnd(),c.lineStart(),c.point(E[0][0],E[0][1])))}m&&(!h||!Ec(h,y))&&c.point(y[0],y[1]),h=y,p=m,f=w},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return C|(v&&p)<<1}}}function u(c,h,f){var p=Oa(c),v=Oa(h),C=[1,0,0],S=_c(p,v),P=yc(S,S),y=S[0],_=P-y*y;if(!_)return!f&&c;var m=t*P/_,w=-t*y/_,E=_c(C,S),b=wc(C,m),I=wc(S,w);Ed(b,I);var T=E,D=yc(b,T),x=yc(T,T),O=D*D-x*(yc(b,b)-1);if(!(O<0)){var L=Na(O),F=wc(T,(-D-L)/x);if(Ed(F,b),F=wd(F),!f)return F;var J=c[0],q=h[0],Q=c[1],ct=h[1],mt;q<J&&(mt=J,J=q,q=mt);var X=q-J,Z=Ze(X-zt)<he,K=Z||X<he;if(!Z&&ct<Q&&(mt=Q,Q=ct,ct=mt),K?Z?Q+ct>0^F[1]<(Ze(F[0]-J)<he?Q:ct):Q<=F[1]&&F[1]<=ct:X>zt^(J<=F[0]&&F[0]<=q)){var wt=wc(T,(-D+L)/x);return Ed(wt,b),[F,wd(wt)]}}}function l(c,h){var f=n?r:zt-r,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return dv(o,a,s,n?[0,-r]:[-zt,r-zt])}function pv(r){return function(e){var t=new Pd;for(var n in r)t[n]=r[n];return t.stream=e,t}}function Pd(){}Pd.prototype={constructor:Pd,point:function(r,e){this.stream.point(r,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()}};function gv(r,e,t){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),s!=null&&r.clipExtent(null),HE(t,r.stream(hv));var o=hv.result(),a=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+e[0][0]+(n-a*(o[1][0]+o[0][0]))/2,l=+e[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&r.clipExtent(s),r.scale(a*150).translate([u,l])}function aC(r,e,t){return gv(r,[[0,0],e],t)}var mv=16,uC=ge(30*Sr);function vv(r,e){return+e?cC(r,e):lC(r)}function lC(r){return pv({point:function(e,t){e=r(e,t),this.stream.point(e[0],e[1])}})}function cC(r,e){function t(n,i,s,o,a,u,l,c,h,f,p,v,C,S){var P=l-n,y=c-i,_=P*P+y*y;if(_>4*e&&C--){var m=o+f,w=a+p,E=u+v,b=Na(m*m+w*w+E*E),I=Eo(E/=b),T=Ze(Ze(E)-1)<he||Ze(s-h)<he?(s+h)/2:Ta(w,m),D=r(T,I),x=D[0],O=D[1],L=x-n,F=O-i,J=y*L-P*F;(J*J/_>e||Ze((P*L+y*F)/_-.5)>.3||o*f+a*p+u*v<uC)&&(t(n,i,s,o,a,u,x,O,T,m/=b,w/=b,E,C,S),S.point(x,O),t(x,O,T,m,w,E,l,c,h,f,p,v,C,S))}}return function(n){var i,s,o,a,u,l,c,h,f,p,v,C,S={point:P,lineStart:y,lineEnd:m,polygonStart:function(){n.polygonStart(),S.lineStart=w},polygonEnd:function(){n.polygonEnd(),S.lineStart=y}};function P(I,T){I=r(I,T),n.point(I[0],I[1])}function y(){h=NaN,S.point=_,n.lineStart()}function _(I,T){var D=Oa([I,T]),x=r(I,T);t(h,f,c,p,v,C,h=x[0],f=x[1],c=I,p=D[0],v=D[1],C=D[2],mv,n),n.point(h,f)}function m(){S.point=P,n.lineEnd()}function w(){y(),S.point=E,S.lineEnd=b}function E(I,T){_(i=I,T),s=h,o=f,a=p,u=v,l=C,S.point=_}function b(){t(h,f,c,p,v,C,s,o,i,a,u,l,mv,n),S.lineEnd=m,m()}return S}}var hC=pv({point:function(r,e){this.stream.point(r*Sr,e*Sr)}});function dC(r){return fC(function(){return r})()}function fC(r){var e,t=150,n=480,i=250,s,o,a=0,u=0,l=0,c=0,h=0,f,p,v=null,C=fv,S=null,P,y,_,m=cv,w=.5,E=vv(x,w),b,I;function T(F){return F=p(F[0]*Sr,F[1]*Sr),[F[0]*t+s,o-F[1]*t]}function D(F){return F=p.invert((F[0]-s)/t,(o-F[1])/t),F&&[F[0]*Ms,F[1]*Ms]}function x(F,J){return F=e(F,J),[F[0]*t+s,o-F[1]*t]}T.stream=function(F){return b&&I===F?b:b=hC(C(f,E(m(I=F))))},T.clipAngle=function(F){return arguments.length?(C=+F?oC(v=F*Sr,6*Sr):(v=null,fv),L()):v*Ms},T.clipExtent=function(F){return arguments.length?(m=F==null?(S=P=y=_=null,cv):QE(S=+F[0][0],P=+F[0][1],y=+F[1][0],_=+F[1][1]),L()):S==null?null:[[S,P],[y,_]]},T.scale=function(F){return arguments.length?(t=+F,O()):t},T.translate=function(F){return arguments.length?(n=+F[0],i=+F[1],O()):[n,i]},T.center=function(F){return arguments.length?(a=F[0]%360*Sr,u=F[1]%360*Sr,O()):[a*Ms,u*Ms]},T.rotate=function(F){return arguments.length?(l=F[0]%360*Sr,c=F[1]%360*Sr,h=F.length>2?F[2]%360*Sr:0,O()):[l*Ms,c*Ms,h*Ms]},T.precision=function(F){return arguments.length?(E=vv(x,w=F*F),L()):Na(w)},T.fitExtent=function(F,J){return gv(T,F,J)},T.fitSize=function(F,J){return aC(T,F,J)};function O(){p=tv(f=XE(l,c,h),e);var F=e(a,u);return s=n-F[0]*t,o=i+F[1]*t,L()}function L(){return b=I=null,T}return function(){return e=r.apply(this,arguments),T.invert=e.invert&&D,O()}}function yv(r){return function(e,t){var n=ge(e),i=ge(t),s=r(n*i);return[s*i*me(e),s*me(t)]}}function _v(r){return function(e,t){var n=Na(e*e+t*t),i=r(n),s=me(i),o=ge(i);return[Ta(e*s,n*o),Eo(n&&t*s/n)]}}var pC=yv(function(r){return Na(2/(1+r))});pC.invert=_v(function(r){return 2*Eo(r/2)});var wv=yv(function(r){return(r=Zm(r))&&r/me(r)});wv.invert=_v(function(r){return r});function gC(){return dC(wv).scale(79.4188).clipAngle(180-.001)}function Ev(r,e){return[r,e]}Ev.invert=Ev;function mC(r,e,t){t=t||{};var n=t.units||"kilometers",i=t.steps||8;if(!r)throw new Error("geojson is required");if(typeof t!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var s=[];switch(r.type){case"GeometryCollection":return Hl(r,function(o){var a=xc(o,e,n,i);a&&s.push(a)}),na(s);case"FeatureCollection":return ql(r,function(o){var a=xc(o,e,n,i);a&&ql(a,function(u){u&&s.push(u)})}),na(s)}return xc(r,e,n,i)}function xc(r,e,t,n){var i=r.properties||{},s=r.type==="Feature"?r.geometry:r;if(s.type==="GeometryCollection"){var o=[];return Hl(r,function(C){var S=xc(C,e,t,n);S&&o.push(S)}),na(o)}var a=vC(s),u={type:s.type,coordinates:Sv(s.coordinates,a)},l=new ld,c=l.read(u),h=Wh(qh(e,t),"meters"),f=Ne.bufferOp(c,h,n),p=new Tm;if(f=p.write(f),!Cv(f.coordinates)){var v={type:f.type,coordinates:bv(f.coordinates,a)};return Ar(v,i)}}function Cv(r){return Array.isArray(r[0])?Cv(r[0]):isNaN(r[0])}function Sv(r,e){return typeof r[0]!="object"?e(r):r.map(function(t){return Sv(t,e)})}function bv(r,e){return typeof r[0]!="object"?e.invert(r):r.map(function(t){return bv(t,e)})}function vC(r){var e=xE(r).geometry.coordinates,t=[-e[0],-e[1]];return gC().rotate(t).scale(Qe)}function yC(r,e,t){t===void 0&&(t={});for(var n=t.steps||64,i=t.properties?t.properties:!Array.isArray(r)&&r.type==="Feature"&&r.properties?r.properties:{},s=[],o=0;o<n;o++)s.push(ra(r,e,o*-360/n,t).geometry.coordinates);return s.push(s[0]),Sn([s],i)}/**
|
|
45
45
|
* splaytree v3.1.2
|
|
@@ -351,7 +351,7 @@ export type ESJTimeIntervalCollectionJsonType = {
|
|
|
351
351
|
\`\`\`
|
|
352
352
|
${dy}
|
|
353
353
|
\`\`\`
|
|
354
|
-
`,_S="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",Pt=class Pt extends Wt{constructor(t){super(t);d(this,"_flyToFeatureEvent",this.dv(new N));d(this,"_flyToFeatureIndexEvent",this.dv(new N));d(this,"_features",this.disposeVar(Yt(void 0)));d(this,"pickedInfoType","FeatureCollection");d(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(t,n,i){this._flyToFeatureEvent.emit(t,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(t,n){this._flyToFeatureIndexEvent.emit(t,n)}get features(){return this._features.value}set features(t){this._features.value=t}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var n;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const t=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:jh(this.url)?this.features=JSON.parse(this.url):await fetch(et.context.getStrFromEnv(this.url),{signal:t}).then(i=>i.json()).then(i=>{this.features=i}).catch(i=>{i.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",i)}),this.pickedInfoType=((n=this.features)==null?void 0:n.type)??"FeatureCollection"}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",dataSource:[...t.dataSource,new nt([this,"url"],"服务地址",Pt.defaults.url),new R([this,"minFeatureVisibleDistance"],"要素最小可视距离",Pt.defaults.minFeatureVisibleDistance),new R([this,"maxFeatureVisibleDistance"],"要素最大可视距离",Pt.defaults.maxFeatureVisibleDistance),new St([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new St([this,"classificationType"],Pt.classificationTypes,"贴地附着目标",Pt.defaults.classificationType)],style:[...t.style,new ut([],"点样式集合"),new Y([this,"textShow"],"是否显示",Pt.defaults.textShow),new Ae([this,"textAnchor"],"锚点",Pt.defaults.anchor),new pt([this,"textProperty"],"标注显示属性",Pt.defaults.textStyle.textProperty),new pt([this,"textDefaultText"],"默认文本",Pt.defaults.textStyle.defaultText),new Dt([this,"textColor"],"文本颜色",Pt.defaults.textStyle.color),new Dt([this,"textBackgroundColor"],"文本背景颜色",Pt.defaults.textStyle.backgroundColor),new pt([this,"textFontStyle"],"字体样式",Pt.defaults.textStyle.fontStyle),new pt([this,"textFontWeight"],"字体粗细",Pt.defaults.textStyle.fontWeight),new R([this,"textFontSize"],"字体大小",Pt.defaults.textStyle.fontSize),new Ae([this,"textOffset"],"像素偏移",Pt.defaults.textStyle.offset),new ut([],"点图片样式集合"),new Y([this,"imageShow"],"是否显示",Pt.defaults.imageShow),new Ae([this,"imageAnchor"],"锚点",Pt.defaults.imageStyle.anchor),new nt([this,"imageUrl"],"图片地址",Pt.defaults.imageStyle.url),new Ae([this,"imageSize"],"图片大小",Pt.defaults.imageStyle.size),new Ae([this,"imageOffset"],"像素偏移",Pt.defaults.imageStyle.offset),new ut([],"线样式集合"),new Y([this,"stroked"],"是否显示",Pt.defaults.stroked),new Y([this,"strokeGround"],"贴地",Pt.defaults.strokeStyle.ground),new R([this,"strokeWidth"],"线宽",Pt.defaults.strokeStyle.width),new St([this,"strokeWidthType"],Pt.strokeStyleWidthTypes,"线宽类型"),new Dt([this,"strokeColor"],"线颜色",Pt.defaults.strokeStyle.color),new pt([this,"strokeMaterial"],"线材质",Pt.defaults.strokeStyle.material),new nt([this,"strokeMaterialParams"],"线材质参数",Pt.defaults.strokeStyle.materialParams),new ut([],"面样式集合"),new Y([this,"filled"],"是否显示",Pt.defaults.filled),new Y([this,"fillGround"],"贴地",Pt.defaults.fillStyle.ground),new Dt([this,"fillColor"],"填充颜色",Pt.defaults.fillStyle.color),new pt([this,"fillMaterial"],"填充材质",Pt.defaults.fillStyle.material),new nt([this,"fillMaterialParams"],"填充材质参数",Pt.defaults.fillStyle.materialParams)],more:[...t.more,new ut([],"标注文本样式"),new pt([this,"textFontFamily"],"字体",Pt.defaults.textStyle.fontFamily),new ut([],"通用"),new vs([this,"loadFuncStr"],"loadFnStr",dy,yS,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(t){this.textStyle={...this.textStyle,textProperty:t}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(t){this.textStyle={...this.textStyle,defaultText:t}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(t){this.textStyle={...this.textStyle,color:t}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(t){this.textStyle={...this.textStyle,backgroundColor:t}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(t){this.textStyle={...this.textStyle,fontFamily:t}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(t){this.textStyle={...this.textStyle,fontStyle:t}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(t){this.textStyle={...this.textStyle,fontWeight:t}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(t){this.textStyle={...this.textStyle,fontSize:t}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(t){this.textStyle={...this.textStyle,anchor:t}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(t){this.textStyle={...this.textStyle,offset:t}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(t){this.imageStyle={...this.imageStyle,url:t}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(t){this.imageStyle={...this.imageStyle,size:t}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(t){this.imageStyle={...this.imageStyle,anchor:t}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(t){this.imageStyle={...this.imageStyle,offset:t}}get imageOffsetChanged(){return this.imageStyleChanged}};d(Pt,"createDefaultProps",()=>({...Wt.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:_S,stroked:!0,strokeStyle:_t({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:_t({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:_t({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:_t({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})),d(Pt,"type",Pt.register("ESGeoJson",Pt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),d(Pt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),d(Pt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let fl=Pt;const Fo=class Fo extends Ot{constructor(t){super(t);d(this,"editingBindMode","doublePoints");d(this,"_height",this.disposeVar(B(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(t){this._height.value=t}get heightChanged(){return this._height.changed}};d(Fo,"createDefaultProps",()=>({...Ot.createDefaultProps(),stroked:!0,strokeStyle:_t({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Fo,"type",Fo.register("ESHeightMeasurement",Fo,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),d(Fo,"supportEditingModes",[...Ot.supportEditingModes,rt.DoublePointsAppend,rt.DoublePointsModify]);let Ef=Fo;const $a=class $a extends rs{constructor(t){super(t);d(this,"_area",this.dv(B(0)));d(this,"_perimeter",this.dv(B(0)));d(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(t=10,n){return Gv([...this.position],this.radius,t,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",basic:[...t.basic,new R([this,"radius"],"圆半径",1,!0)],coordinate:[...t.coordinate,new Y([this,"editing"],"是否编辑"),new ta([this,"position"],"三维坐标",[0,0,0],!0),new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};d($a,"createDefaultProps",()=>({...rs.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:_t({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d($a,"type",$a.register("ESLocalCircle",$a,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let Cf=$a;const tu=class tu extends rs{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new Eg([this,"points"],"坐标",[])]}}};d(tu,"createDefaultProps",()=>({...rs.createDefaultProps(),points:jd([]),filled:!0})),d(tu,"type",tu.register("ESLocalPolygon",tu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let pl=tu;const eu=class eu extends La{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new kh([this,"points"],"本地位置数组")]}}};d(eu,"createDefaultProps",()=>({...La.createDefaultProps(),points:Il(void 0),filled:!0})),d(eu,"type",eu.register("ESLocalPolygonZ",eu,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Sf=eu;const nu=class nu extends rs{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"width"],"宽度"),new R([this,"height"],"高度")]}}};d(nu,"createDefaultProps",()=>({...rs.createDefaultProps(),width:5e5,height:3e5,filled:!0})),d(nu,"type",nu.register("ESLocalRectangle",nu,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let bf=nu;const Mi=class Mi extends Ot{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_distance",this.dv(B(0)));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=ll(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new R([this,"height"],"高度",10),new R([this,"width"],"宽度",10),new St([this,"materialMode"],Mi.materialModes,"模式",Mi.defaults.materialMode)],coordinate:[...t.coordinate,new R([this,"distance"],"距离",0,!1,!0)]}}};d(Mi,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:_t({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Mi,"type",Mi.register("ESPipeFence",Mi,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),d(Mi,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),d(Mi,"supportEditingModes",[...Ot.supportEditingModes,rt.LineStringAppend,rt.LineStringInsert]);let zc=Mi;const as=class as extends Pr{constructor(t){super(t);d(this,"_setLayerVisibleEvent",this.dv(new N));d(this,"_setLayerColorEvent",this.dv(new N))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(t,n){this._setLayerVisibleEvent.emit(t,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(t,n){this._setLayerColorEvent.emit(t,n)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESPipeserTileset"),new lt(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new lt(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new St([this,"colorMode"],as.colorModes,"colorMode",as.defaults.colorMode,!0)]}}};d(as,"createDefaultProps",()=>({...Pr.createDefaultProps(),colorMode:"default"})),d(as,"type",as.register("ESPipeserTileset",as,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),d(as,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let Pf=as;const us=class us extends Ot{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",coordinate:[...t.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)],basic:[...t.basic,new R([this,"height"],"高度",10),new St([this,"materialMode"],us.materialModes,"模式","danger")]}}};d(us,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),d(us,"type",us.register("ESPolygonFence",us,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),d(us,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),d(us,"supportEditingModes",[...Ot.supportEditingModes,rt.CircularAppend,rt.CircularInsert,rt.HeightModify]);let Uc=us;const Us=class Us extends Ot{constructor(t){super(t);d(this,"_deprecated",["ground"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new Y([this,"ground"],"是否贴地"),new Y([this,"outlineTranslucent"],"轮廓线半透明"),new R([this,"height"],"高度"),new R([this,"extrudedHeight"],"拉伸高度"),new Rr([this,"rectangle"],"范围",Us.defaults.rectangle,!0),new R([this,"stRotation"],"纹理旋转角度"),new R([this,"rotation"],"旋转角度"),new Y([this,"pointEditing"],"是否单点编辑")]}}};d(Us,"createDefaultProps",()=>({...Ot.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:ne(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),d(Us,"type",Us.register("ESRectangle",Us,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Us,"supportEditingModes",[...Ot.supportEditingModes,rt.DoublePointsAppend,rt.DoublePointsModify]);let If=Us;const ru=class ru extends Ht{getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new nt([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};d(ru,"createDefaultProps",()=>({...Ht.createDefaultProps(),innerRings:mp([])})),d(ru,"type",ru.register("ESPolygonWithHole",ru,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let xf=ru;const Gs=class Gs extends Ht{constructor(t){super(t);d(this,"_startEvent",this.disposeVar(new N));d(this,"_stopEvent",this.dv(new N));d(this,"_surfaceArea",this.disposeVar(B(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(t){this._surfaceArea.value=t}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"表面积测量","表面积测量"),new lt([],()=>this.start(),[],"开始计算"),new R([this,"interpolation"],"插值距离",Gs.defaults.interpolation),new R([this,"offsetHeight"],"偏移高度",Gs.defaults.offsetHeight)]}}};d(Gs,"createDefaultProps",()=>({...Ht.createDefaultProps(),interpolation:.5,offsetHeight:0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:_t({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),d(Gs,"type",Gs.register("ESSurfaceAreaMeasurement",Gs,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Tf=Gs;const Ws=class Ws extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"downloadProgress"],"下载进度",Ws.defaults.downloadProgress,!0,!0),new nt([this,"importOptions"],"导入参数",Ws.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new nt([this,"url"],"路径")]}}};d(Ws,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",importOptions:Yt({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),d(Ws,"type",Ws.register("ESDatasmithRuntimeModel",Ws,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Nf=Ws;const _n=class _n extends pl{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new St([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",_n.defaults.waterType),new R([this,"frequency"],"频率",_n.defaults.frequency),new ze([this,"amplitude"],.01,[0,1],"振幅",_n.defaults.amplitude),new ze([this,"flowDirection"],1,[0,360],"流向",_n.defaults.flowDirection),new ze([this,"waveVelocity"],.01,[0,1],"波动频率",_n.defaults.waveVelocity),new ze([this,"specularIntensity"],.01,[0,1],"镜面反射强度",_n.defaults.specularIntensity),new ze([this,"murkiness"],.1,[0,10],"水体浑浊度",_n.defaults.murkiness),new R([this,"flowSpeed"],"水流速度",_n.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",_n.defaults.waterColor),new nt([this,"waterImage"],"水的图片",_n.defaults.waterImage)]}}};d(_n,"createDefaultProps",()=>({...pl.createDefaultProps(),allowPicking:!0,waterImage:Yt(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),d(_n,"type",_n.register("ESDynamicWater",_n,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Of=_n;const wn=class wn extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new St([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",wn.defaults.waterType),new R([this,"frequency"],"频率",wn.defaults.frequency),new ze([this,"amplitude"],.01,[0,1],"振幅",wn.defaults.amplitude),new ze([this,"flowDirection"],1,[0,360],"流向",wn.defaults.flowDirection),new ze([this,"waveVelocity"],.01,[0,1],"波动频率",wn.defaults.waveVelocity),new ze([this,"specularIntensity"],.01,[0,1],"镜面反射强度",wn.defaults.specularIntensity),new ze([this,"murkiness"],.1,[0,10],"水体浑浊度",wn.defaults.murkiness),new R([this,"flowSpeed"],"水流速度",wn.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",wn.defaults.waterColor),new nt([this,"waterImage"],"水的图片",wn.defaults.waterImage)]}}};d(wn,"createDefaultProps",()=>({...Ht.createDefaultProps(),allowPicking:!0,waterImage:Yt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),d(wn,"type",wn.register("ESGeoWater",wn,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let Df=wn;const ko=class ko extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"downloadProgress"],"下载进度",ko.defaults.downloadProgress,!0,!0),new pt([this,"levelName"],"levelName",""),new R([this,"levelLoadDistance"],"levelLoadDistance",1e3),new un([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...e.dataSource,new nt([this,"url"],"url","")]}}};d(ko,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:dt([0,0,0]),levelLoadDistance:1e3})),d(ko,"type",ko.register("ESLevelRuntimeModel",ko,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let Mf=ko;const sr=class sr extends is{constructor(t){super(t);d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new R([this,"radius"],"半径",sr.defaults.radius),new R([this,"sides"],"圆边数",sr.defaults.sides),new R([this,"speed"],"材质速度",sr.defaults.speed),new St([this,"materialMode"],sr.materialModes,"材质模式",sr.defaults.materialMode),new nt([this,"materialImage"],"材质图片和重复度",sr.defaults.materialImage)]}}};d(sr,"createDefaultProps",()=>({...is.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:_t({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:_t({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(sr,"type",sr.register("ESPipeline",sr,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),d(sr,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Rf=sr;const Ri=class Ri extends Ot{constructor(t){super(t);d(this,"editingBindMode","visibility")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"visibleColor"],"可视区域颜色",Ri.defaults.visibleColor),new Dt([this,"invisibleColor"],"遮挡区域颜色",Ri.defaults.invisibleColor),new R([this,"heightOffset"],"视点高度偏移",Ri.defaults.heightOffset)]}}};d(Ri,"createDefaultProps",()=>({...Ot.createDefaultProps(),visibleColor:dt([0,1,0,1]),invisibleColor:dt([1,0,0,1]),heightOffset:0})),d(Ri,"type",Ri.register("ESVisibilityAnalysis",Ri,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),d(Ri,"supportEditingModes",[...Ot.supportEditingModes,rt.VisibilityAppend,rt.VisibilityModify]);let Lf=Ri;const iu=class iu extends Ht{constructor(t){super(t);d(this,"_startEvent",this.dv(new N));d(this,"_clearEvent",this.dv(new N));d(this,"_volume",this.disposeVar(B(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(t){this._volume.value=t}get volumeChanged(){return this._volume.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new R([this,"planeHeight"],"基准面高程",void 0,!0),new R([this,"gridWidth"],"采样间距 m"),new R([this,"cutVolume"],"挖方",0,!1,!0),new R([this,"fillVolume"],"填方",0,!1,!0),new R([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new R([this,"progress"],"计算进度",0,!1,!0),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清空分析结果"),new Y([this,"depthTest"],"是否开启深度检测")]}}};d(iu,"createDefaultProps",()=>({...Ht.createDefaultProps(),planeHeight:B(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:_t({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(iu,"type",iu.register("ESVolumeMeasurement",iu,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let Af=iu;const su=class su extends Co{constructor(t){super(t);d(this,"_human",this.dv(new Co));d(this,"_poi",this.dv(new dl));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(z([n,"show"],[this,"show"])),this.d(z([i,"show"],[this,"show"])),this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([i,"allowPicking"],[this,"allowPicking"])),this.d(it([n,"scale"],[this,"scale"])),this.d(it([i,"scale"],[this,"scale"])),this.d(z([n,"collision"],[this,"collision"])),this.d(z([i,"collision"],[this,"collision"])),this.d(it([n,"flyInParam"],[this,"flyInParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"animation"],[this,"animation"])),this.d(z([n,"mode"],[this,"mode"])),this.d(z([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(z([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(z([i,"name"],[this,"name"])),this.d(z([i,"mode"],[this,"poiMode"])),this.d(z([i,"autoAnchor"],[this,"autoAnchor"])),this.d(z([i,"screenRender"],[this,"screenRender"])),this.d(z([i,"size"],[this,"size"])),this.d(z([i,"anchor"],[this,"anchor"])),this.d(z([i,"sizeByContent"],[this,"sizeByContent"])),this.d(z([i,"renderMode"],[this,"renderMode"])),this.d(z([i,"rotationType"],[this,"rotationType"])),this.d(z([i,"zOrder"],[this,"zOrder"])),this.d(z([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(z([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(it([n,"position"],[this,"position"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new St([this,"poiMode"],dl.modes,"poi模式","SquareH01"),new R([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};d(su,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:_t({}),autoAnchor:!0,screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Co.createDefaultProps()})),d(su,"type",su.register("ESHumanPoi",su,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let Ff=su;const ai=class ai extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"depth"],"深度",ai.defaults.depth),new R([this,"interpolation"],"插值",ai.defaults.interpolation),new R([this,"opacity"],"透明度",ai.defaults.opacity),new nt([this,"sideImage"],"侧面图片",ai.defaults.sideImage),new nt([this,"bottomImage"],"底面图片",ai.defaults.bottomImage)]}}};d(ai,"createDefaultProps",()=>({...Ht.createDefaultProps(),depth:100,sideImage:_t({url:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:_t({url:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),d(ai,"type",ai.register("ESPit",ai,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Fa=ai;const ou=class ou extends Fa{constructor(t){super(t);d(this,"_excavate",this.dv(new hl));d(this,"_pit",this.dv(new Fa));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:i}=this;this.d(z([n,"show"],[this,"show"])),this.d(z([i,"show"],[this,"show"])),this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([i,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(z([i,"collision"],[this,"collision"])),this.d(it([i,"points"],[this,"points"])),this.d(z([n,"points"],[this,"points"])),this.d(z([i,"pointed"],[this,"pointed"])),this.d(z([n,"pointed"],[this,"pointed"])),this.d(z([i,"pointStyle"],[this,"pointStyle"])),this.d(z([n,"pointStyle"],[this,"pointStyle"])),this.d(z([i,"stroked"],[this,"stroked"])),this.d(z([n,"stroked"],[this,"stroked"])),this.d(z([i,"strokeStyle"],[this,"strokeStyle"])),this.d(z([n,"strokeStyle"],[this,"strokeStyle"])),this.d(z([i,"filled"],[this,"filled"])),this.d(z([i,"fillStyle"],[this,"fillStyle"])),this.d(z([n,"fillStyle"],[this,"fillStyle"])),this.d(z([n,"mode"],[this,"mode"])),this.d(z([n,"targetID"],[this,"targetID"])),this.d(z([i,"depth"],[this,"depth"])),this.d(z([i,"sideImage"],[this,"sideImage"])),this.d(z([i,"bottomImage"],[this,"bottomImage"])),this.d(z([i,"opacity"],[this,"opacity"])),this.d(z([i,"interpolation"],[this,"interpolation"])),this.d(it([i,"flyInParam"],[this,"flyInParam"])),this.d(it([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new St([this,"mode"],hl.modes,"模式","in"),new pt([this,"targetID"],"瓦片图层","")]}}};d(ou,"createDefaultProps",()=>({...Fa.createDefaultProps(),mode:"in",targetID:""})),d(ou,"type",ou.register("ESHole",ou,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let kf=ou;const Vf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},wS=async(r,e,t,n)=>{try{const i=window.localStorage.getItem("Authorization");let s=r+`${Vf.layerconfigfind}?tileServiceName=${e}`;t&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},ES=async(r,e,t,n,i)=>{try{const s=window.localStorage.getItem("Authorization");let o=r+Vf.layerconfigsave;const a=i??{};t&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!t&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,u)).text();return JSON.parse(c)}catch(s){console.error(s)}},CS=async(r,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},SS=async(r,e,t,n,i)=>{try{const s={tileServiceName:e,featureId:t},o=window.localStorage.getItem("Authorization");let a=r+Vf.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(l);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},au=class au extends Pr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Pr));d(this,"_ids",this.dv(_t([])));d(this,"_useEarthDSToken",this.dv(B(!1)));d(this,"_earthdstoken",this.dv(B("")));d(this,"_visJson",this.disposeVar(B({})));d(this,"_highlightInner3DtilesetEvent",this.dv(new N));d(this,"_removeHighlightInner3DtilesetEvent",this.dv(new N));d(this,"_tilesetServePort",this.dv(B("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"actorTag"],[this,"actorTag"])),this.d(z([n,"materialMode"],[this,"materialMode"])),this.d(z([n,"highlight"],[this,"highlight"])),this.d(z([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(z([n,"highlightID"],[this,"highlightID"])),this.d(z([n,"highlightColor"],[this,"highlightColor"])),this.d(it([n,"offset"],[this,"offset"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(z([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(z([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(z([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(z([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(z([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(z([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(z([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(z([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(z([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(z([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(z([n,"cacheBytes"],[this,"cacheBytes"])),this.d(z([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(z([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(z([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(z([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(z([n,"materialParams"],[this,"materialParams"])),this.d(it([n,"supportEdit"],[this,"supportEdit"])),this.d(it([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(it([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(it([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(it([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(it([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(it([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(t){return await SS(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const t=await wS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await ES(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var a,u,l;const i=await t.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await CS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};d(au,"createDefaultProps",()=>({...Pr.createDefaultProps(),layerConfig:Yt([])})),d(au,"type",au.register("ESRtsTileset",au,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Bf=au;function bS(r){return typeof r=="number"&&!isNaN(r)}const uu=class uu extends Pr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){this.featureId=t;const n=await e.getFeatureProperty(t);this.uiShowprops=n.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:bS(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const i=e.tileServiceIp,s=e.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${i}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:e}),e.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};d(uu,"createDefaultProps",()=>({...Pr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:_t({}),changeMaterial:Yt(void 0),uiShowprops:_t({}),props:_t({})})),d(uu,"type",uu.register("ESRtsFeatureEditing",uu,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let jf=uu;const PS=async(r,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},Cl=class Cl extends Pr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Pr));d(this,"_tilesetServePort",this.dv(B("")));d(this,"_useEarthDSToken",this.dv(B(!1)));d(this,"_earthdstoken",this.dv(B("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"actorTag"],[this,"actorTag"])),this.d(z([n,"materialMode"],[this,"materialMode"])),this.d(z([n,"highlight"],[this,"highlight"])),this.d(z([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(z([n,"highlightID"],[this,"highlightID"])),this.d(z([n,"highlightColor"],[this,"highlightColor"])),this.d(it([n,"offset"],[this,"offset"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(z([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(z([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(z([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(z([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(z([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(z([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(z([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(z([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(z([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(z([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(z([n,"cacheBytes"],[this,"cacheBytes"])),this.d(z([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(z([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(z([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(z([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(z([n,"materialParams"],[this,"materialParams"])),this.d(it([n,"supportEdit"],[this,"supportEdit"])),this.d(it([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(it([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(it([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(it([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(it([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(it([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}async getport(){const t=await PS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};d(Cl,"type",Cl.register("ESMsTileset",Cl,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let zf=Cl;const fy={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
|
|
354
|
+
`,_S="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",bt=class bt extends Wt{constructor(t){super(t);d(this,"_flyToFeatureEvent",this.dv(new N));d(this,"_flyToFeatureIndexEvent",this.dv(new N));d(this,"_features",this.disposeVar(Yt(void 0)));d(this,"pickedInfoType","FeatureCollection");d(this,"abortController");this._updateUrl(),this.ad(this.urlChanged.don(()=>{this._updateUrl()})),this.ad(this.editingChanged.don(()=>{console.warn("ESGeoJson暂不支持编辑!")}))}get flyToFeatureEvent(){return this._flyToFeatureEvent}flyToFeature(t,n,i){this._flyToFeatureEvent.emit(t,n,i)}get flyToFeatureIndexEvent(){return this._flyToFeatureIndexEvent}flyToFeatureIndex(t,n){this._flyToFeatureIndexEvent.emit(t,n)}get features(){return this._features.value}set features(t){this._features.value=t}get featuresChanged(){return this._features.changed}getFeatures(){if(this.features)return this.features;console.log("数据未加载完成,请稍后调用此方法getFeatures()")}async _updateUrl(){var n;this.abortController&&this.abortController.abort(),this.abortController=new AbortController;const t=this.abortController.signal;if(!this.url){this.features=void 0;return}typeof this.url=="object"?this.features=this.url:jh(this.url)?this.features=JSON.parse(this.url):await fetch(et.context.getStrFromEnv(this.url),{signal:t}).then(i=>i.json()).then(i=>{this.features=i}).catch(i=>{i.name!="AbortError"&&console.warn("ESGeoJson数据加载失败",i)}),this.pickedInfoType=((n=this.features)==null?void 0:n.type)??"FeatureCollection"}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",dataSource:[...t.dataSource,new nt([this,"url"],"服务地址",bt.defaults.url),new R([this,"minFeatureVisibleDistance"],"要素最小可视距离",bt.defaults.minFeatureVisibleDistance),new R([this,"maxFeatureVisibleDistance"],"要素最大可视距离",bt.defaults.maxFeatureVisibleDistance),new St([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考"),new St([this,"classificationType"],bt.classificationTypes,"贴地附着目标",bt.defaults.classificationType),new R([this,"zIndex"],"层级排序",bt.defaults.zIndex)],style:[...t.style,new ut([],"点样式集合"),new Y([this,"textShow"],"是否显示",bt.defaults.textShow),new Ae([this,"textAnchor"],"锚点",bt.defaults.anchor),new pt([this,"textProperty"],"标注显示属性",bt.defaults.textStyle.textProperty),new pt([this,"textDefaultText"],"默认文本",bt.defaults.textStyle.defaultText),new Dt([this,"textColor"],"文本颜色",bt.defaults.textStyle.color),new Dt([this,"textBackgroundColor"],"文本背景颜色",bt.defaults.textStyle.backgroundColor),new pt([this,"textFontStyle"],"字体样式",bt.defaults.textStyle.fontStyle),new pt([this,"textFontWeight"],"字体粗细",bt.defaults.textStyle.fontWeight),new R([this,"textFontSize"],"字体大小",bt.defaults.textStyle.fontSize),new Ae([this,"textOffset"],"像素偏移",bt.defaults.textStyle.offset),new ut([],"点图片样式集合"),new Y([this,"imageShow"],"是否显示",bt.defaults.imageShow),new Ae([this,"imageAnchor"],"锚点",bt.defaults.imageStyle.anchor),new nt([this,"imageUrl"],"图片地址",bt.defaults.imageStyle.url),new Ae([this,"imageSize"],"图片大小",bt.defaults.imageStyle.size),new Ae([this,"imageOffset"],"像素偏移",bt.defaults.imageStyle.offset),new ut([],"线样式集合"),new Y([this,"stroked"],"是否显示",bt.defaults.stroked),new Y([this,"strokeGround"],"贴地",bt.defaults.strokeStyle.ground),new R([this,"strokeWidth"],"线宽",bt.defaults.strokeStyle.width),new St([this,"strokeWidthType"],bt.strokeStyleWidthTypes,"线宽类型"),new Dt([this,"strokeColor"],"线颜色",bt.defaults.strokeStyle.color),new pt([this,"strokeMaterial"],"线材质",bt.defaults.strokeStyle.material),new nt([this,"strokeMaterialParams"],"线材质参数",bt.defaults.strokeStyle.materialParams),new ut([],"面样式集合"),new Y([this,"filled"],"是否显示",bt.defaults.filled),new Y([this,"fillGround"],"贴地",bt.defaults.fillStyle.ground),new Dt([this,"fillColor"],"填充颜色",bt.defaults.fillStyle.color),new pt([this,"fillMaterial"],"填充材质",bt.defaults.fillStyle.material),new nt([this,"fillMaterialParams"],"填充材质参数",bt.defaults.fillStyle.materialParams)],more:[...t.more,new ut([],"标注文本样式"),new pt([this,"textFontFamily"],"字体",bt.defaults.textStyle.fontFamily),new ut([],"通用"),new vs([this,"loadFuncStr"],"loadFnStr",dy,yS,!0)]}}get strokeWidth(){return this.strokeStyle.width}set strokeWidth(t){this.strokeStyle={...this.strokeStyle,width:t}}get strokeWidthChanged(){return this.strokeStyleChanged}get strokeWidthType(){return this.strokeStyle.widthType}set strokeWidthType(t){this.strokeStyle={...this.strokeStyle,widthType:t}}get strokeWidthTypeChanged(){return this.strokeStyleChanged}get strokeColor(){return this.strokeStyle.color}set strokeColor(t){this.strokeStyle={...this.strokeStyle,color:[...t]}}get strokeColorChanged(){return this.strokeStyleChanged}get strokeMaterial(){return this.strokeStyle.material}set strokeMaterial(t){this.strokeStyle={...this.strokeStyle,material:t}}get strokeMaterialChanged(){return this.strokeStyleChanged}get strokeMaterialParams(){return this.strokeStyle.materialParams}set strokeMaterialParams(t){this.strokeStyle={...this.strokeStyle,materialParams:t}}get strokeMaterialParamsChanged(){return this.strokeStyleChanged}get strokeGround(){return this.strokeStyle.ground}set strokeGround(t){this.strokeStyle={...this.strokeStyle,ground:t}}get strokeGroundChanged(){return this.strokeStyleChanged}get fillColor(){return this.fillStyle.color}set fillColor(t){this.fillStyle={...this.fillStyle,color:[...t]}}get fillColorChanged(){return this.fillStyleChanged}get fillMaterial(){return this.fillStyle.material}set fillMaterial(t){this.fillStyle={...this.fillStyle,material:t}}get fillMaterialChanged(){return this.fillStyleChanged}get fillMaterialParams(){return this.fillStyle.materialParams}set fillMaterialParams(t){this.fillStyle={...this.fillStyle,materialParams:t}}get fillMaterialParamsChanged(){return this.fillStyleChanged}get fillGround(){return this.fillStyle.ground}set fillGround(t){this.fillStyle={...this.fillStyle,ground:t}}get fillGroundChanged(){return this.fillStyleChanged}get textProperty(){return this.textStyle.textProperty}set textProperty(t){this.textStyle={...this.textStyle,textProperty:t}}get textPropertyChanged(){return this.textStyleChanged}get textDefaultText(){return this.textStyle.defaultText}set textDefaultText(t){this.textStyle={...this.textStyle,defaultText:t}}get textDefaultTextChanged(){return this.textStyleChanged}get textColor(){return this.textStyle.color}set textColor(t){this.textStyle={...this.textStyle,color:t}}get textColorChanged(){return this.textStyleChanged}get textBackgroundColor(){return this.textStyle.backgroundColor}set textBackgroundColor(t){this.textStyle={...this.textStyle,backgroundColor:t}}get textBackgroundColorChanged(){return this.textStyleChanged}get textFontFamily(){return this.textStyle.fontFamily}set textFontFamily(t){this.textStyle={...this.textStyle,fontFamily:t}}get textFontFamilyChanged(){return this.textStyleChanged}get textFontStyle(){return this.textStyle.fontStyle}set textFontStyle(t){this.textStyle={...this.textStyle,fontStyle:t}}get textFontStyleChanged(){return this.textStyleChanged}get textFontWeight(){return this.textStyle.fontWeight}set textFontWeight(t){this.textStyle={...this.textStyle,fontWeight:t}}get textFontWeightChanged(){return this.textStyleChanged}get textFontSize(){return this.textStyle.fontSize}set textFontSize(t){this.textStyle={...this.textStyle,fontSize:t}}get textFontSizeChanged(){return this.textStyleChanged}get textAnchor(){return this.textStyle.anchor}set textAnchor(t){this.textStyle={...this.textStyle,anchor:t}}get textAnchorChanged(){return this.textStyleChanged}get textOffset(){return this.textStyle.offset}set textOffset(t){this.textStyle={...this.textStyle,offset:t}}get textOffsetChanged(){return this.textStyleChanged}get imageUrl(){return this.imageStyle.url}set imageUrl(t){this.imageStyle={...this.imageStyle,url:t}}get imageUrlChanged(){return this.imageStyleChanged}get imageSize(){return this.imageStyle.size}set imageSize(t){this.imageStyle={...this.imageStyle,size:t}}get imageSizeChanged(){return this.imageStyleChanged}get imageAnchor(){return this.imageStyle.anchor}set imageAnchor(t){this.imageStyle={...this.imageStyle,anchor:t}}get imageAnchorChanged(){return this.imageStyleChanged}get imageOffset(){return this.imageStyle.offset}set imageOffset(t){this.imageStyle={...this.imageStyle,offset:t}}get imageOffsetChanged(){return this.imageStyleChanged}};d(bt,"createDefaultProps",()=>({...Wt.createDefaultProps(),show:!0,allowPicking:!0,loadFuncStr:void 0,url:_S,stroked:!0,strokeStyle:_t({width:1,widthType:"world",color:[.79,.91,.06,1],material:"",materialParams:{},ground:!1}),filled:!0,fillStyle:_t({color:[.79,.91,.06,.2],material:"",materialParams:{},ground:!1}),imageShow:!0,imageStyle:_t({url:"${earthsdk3-assets-script-dir}/assets/img/location.png",size:[32,32],anchor:[.5,1],offset:[0,0]}),textShow:!0,textStyle:_t({textProperty:"",defaultText:"默认标注",color:[1,1,1,1],backgroundColor:void 0,fontFamily:"Arial",fontSize:16,fontStyle:"normal",fontWeight:"normal",anchor:[0,1],offset:[16,-8]}),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN",zIndex:0})),d(bt,"type",bt.register("ESGeoJson",bt,{chsName:"ESGeoJson",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"GeoJson数据加载"})),d(bt,"strokeStyleWidthTypes",[["screen","screen"],["world","world"]]),d(bt,"classificationTypes",[["TERRAIN","TERRAIN"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["BOTH","BOTH"]]);let fl=bt;const Fo=class Fo extends Ot{constructor(t){super(t);d(this,"editingBindMode","doublePoints");d(this,"_height",this.disposeVar(B(0)));{const n=()=>{this.height=this.points&&this.points.length>=2?this.points[1][2]-this.points[0][2]:0};n(),this.ad(this.pointsChanged.don(n))}}get height(){return this._height.value}set height(t){this._height.value=t}get heightChanged(){return this._height.changed}};d(Fo,"createDefaultProps",()=>({...Ot.createDefaultProps(),stroked:!0,strokeStyle:_t({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(Fo,"type",Fo.register("ESHeightMeasurement",Fo,{chsName:"高度测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"高度测量"})),d(Fo,"supportEditingModes",[...Ot.supportEditingModes,rt.DoublePointsAppend,rt.DoublePointsModify]);let Ef=Fo;const $a=class $a extends rs{constructor(t){super(t);d(this,"_area",this.dv(B(0)));d(this,"_perimeter",this.dv(B(0)));d(this,"editingBindMode","doublePoints");const n=()=>{this._area.value=Math.PI*this.radius*this.radius,this._perimeter.value=2*Math.PI*this.radius};n(),this.d(this.radiusChanged.don(n))}get area(){return this._area.value}get areaChanged(){return this._area.changed}get perimeter(){return this._perimeter.value}get perimeterChanged(){return this._perimeter.changed}toPolygon(t=10,n){return Gv([...this.position],this.radius,t,n)[0].map(s=>[...s,this.position?this.position[2]:0])}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"style",basic:[...t.basic,new R([this,"radius"],"圆半径",1,!0)],coordinate:[...t.coordinate,new Y([this,"editing"],"是否编辑"),new ta([this,"position"],"三维坐标",[0,0,0],!0),new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)]}}};d($a,"createDefaultProps",()=>({...rs.createDefaultProps(),radius:1,filled:!0,collision:!1,fillStyle:_t({color:[1,1,1,.5],material:"",materialParams:{},ground:!1})})),d($a,"type",$a.register("ESLocalCircle",$a,{chsName:"局部坐标圆形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalCircle"}));let Cf=$a;const tu=class tu extends rs{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new Eg([this,"points"],"坐标",[])]}}};d(tu,"createDefaultProps",()=>({...rs.createDefaultProps(),points:jd([]),filled:!0})),d(tu,"type",tu.register("ESLocalPolygon",tu,{chsName:"局部2D坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygon"}));let pl=tu;const eu=class eu extends La{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,coordinate:[...e.coordinate,new kh([this,"points"],"本地位置数组")]}}};d(eu,"createDefaultProps",()=>({...La.createDefaultProps(),points:Il(void 0),filled:!0})),d(eu,"type",eu.register("ESLocalPolygonZ",eu,{chsName:"局部坐标多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalPolygonZ"}));let Sf=eu;const nu=class nu extends rs{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"width"],"宽度"),new R([this,"height"],"高度")]}}};d(nu,"createDefaultProps",()=>({...rs.createDefaultProps(),width:5e5,height:3e5,filled:!0})),d(nu,"type",nu.register("ESLocalRectangle",nu,{chsName:"局部坐标四边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalRectangle"}));let bf=nu;const Mi=class Mi extends Ot{constructor(t){super(t);d(this,"editingBindMode","lineString");d(this,"_distance",this.dv(B(0)));d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());const n=()=>{if(this.points&&this.points.length>=2){const i=ll(this.points,"GEODESIC"),s=i[i.length-1];this._distance.value=s}else this._distance.value=0};n(),this.d(this.pointsChanged.don(n))}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new R([this,"height"],"高度",10),new R([this,"width"],"宽度",10),new St([this,"materialMode"],Mi.materialModes,"模式",Mi.defaults.materialMode)],coordinate:[...t.coordinate,new R([this,"distance"],"距离",0,!1,!0)]}}};d(Mi,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,width:10,materialMode:"singleArrow",filled:!0,stroked:!0,fillStyle:_t({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(Mi,"type",Mi.register("ESPipeFence",Mi,{chsName:"管道电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"管道电子围栏"})),d(Mi,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"],["纯色","color"]]),d(Mi,"supportEditingModes",[...Ot.supportEditingModes,rt.LineStringAppend,rt.LineStringInsert]);let zc=Mi;const as=class as extends Pr{constructor(t){super(t);d(this,"_setLayerVisibleEvent",this.dv(new N));d(this,"_setLayerColorEvent",this.dv(new N))}get setLayerVisibleEvent(){return this._setLayerVisibleEvent}setLayerVisible(t,n){this._setLayerVisibleEvent.emit(t,n)}get setLayerColorEvent(){return this._setLayerColorEvent}setLayerColor(t,n){this._setLayerColorEvent.emit(t,n)}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"ESPipeserTileset"),new lt(["string","string"],(n,i)=>this.setLayerVisible(n,i),["",""],"setLayerVisible"),new lt(["string","string"],(n,i)=>this.setLayerColor(n,i),["",""],"setLayerColor"),new St([this,"colorMode"],as.colorModes,"colorMode",as.defaults.colorMode,!0)]}}};d(as,"createDefaultProps",()=>({...Pr.createDefaultProps(),colorMode:"default"})),d(as,"type",as.register("ESPipeserTileset",as,{chsName:"PipeSer图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"PipeSer图层"})),d(as,"colorModes",[["default","default"],["color","color"],["blend","blend"]]);let Pf=as;const us=class us extends Ot{constructor(t){super(t);d(this,"editingBindMode","circular")}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",coordinate:[...t.coordinate,new R([this,"area"],"面积",0,!1,!0),new R([this,"perimeter"],"周长",0,!1,!0)],basic:[...t.basic,new R([this,"height"],"高度",10),new St([this,"materialMode"],us.materialModes,"模式","danger")]}}};d(us,"createDefaultProps",()=>({...Ot.createDefaultProps(),height:10,materialMode:"danger",filled:!0,collision:!1})),d(us,"type",us.register("ESPolygonFence",us,{chsName:"多边形电子围栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"多边形电子围栏"})),d(us,"materialModes",[["模式一","danger"],["模式二","checkerboard"],["模式三","warning"],["模式四","cord"],["模式五","scanline"],["模式六","honeycomb"],["模式七","gradientColor"]]),d(us,"supportEditingModes",[...Ot.supportEditingModes,rt.CircularAppend,rt.CircularInsert,rt.HeightModify]);let Uc=us;const Us=class Us extends Ot{constructor(t){super(t);d(this,"_deprecated",["ground"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());d(this,"editingBindMode","doublePoints")}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new Y([this,"ground"],"是否贴地"),new Y([this,"outlineTranslucent"],"轮廓线半透明"),new R([this,"height"],"高度"),new R([this,"extrudedHeight"],"拉伸高度"),new Rr([this,"rectangle"],"范围",Us.defaults.rectangle,!0),new R([this,"stRotation"],"纹理旋转角度"),new R([this,"rotation"],"旋转角度"),new Y([this,"pointEditing"],"是否单点编辑")]}}};d(Us,"createDefaultProps",()=>({...Ot.createDefaultProps(),ground:!1,outlineTranslucent:!0,height:0,extrudedHeight:0,rectangle:ne(void 0),rotation:0,stRotation:0,pointEditing:!1,filled:!0})),d(Us,"type",Us.register("ESRectangle",Us,{chsName:"矩形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"矩形"})),d(Us,"supportEditingModes",[...Ot.supportEditingModes,rt.DoublePointsAppend,rt.DoublePointsModify]);let If=Us;const ru=class ru extends Ht{getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new nt([this,"innerRings"],"裁切多边形数组",[],void 0,!0)]}}};d(ru,"createDefaultProps",()=>({...Ht.createDefaultProps(),innerRings:mp([])})),d(ru,"type",ru.register("ESPolygonWithHole",ru,{chsName:"内部裁切多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"带洞多边形"}));let xf=ru;const Gs=class Gs extends Ht{constructor(t){super(t);d(this,"_startEvent",this.disposeVar(new N));d(this,"_stopEvent",this.dv(new N));d(this,"_surfaceArea",this.disposeVar(B(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get surfaceArea(){return this._surfaceArea.value}set surfaceArea(t){this._surfaceArea.value=t}get surfaceChanged(){return this._surfaceArea.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"表面积测量","表面积测量"),new lt([],()=>this.start(),[],"开始计算"),new R([this,"interpolation"],"插值距离",Gs.defaults.interpolation),new R([this,"offsetHeight"],"偏移高度",Gs.defaults.offsetHeight)]}}};d(Gs,"createDefaultProps",()=>({...Ht.createDefaultProps(),interpolation:.5,offsetHeight:0,units:dt(["SquareMeter_SquareKilometer","MU_Hectare"]),fillStyle:_t({color:[1,1,1,.5],material:"",materialParams:{},ground:!0})})),d(Gs,"type",Gs.register("ESSurfaceAreaMeasurement",Gs,{chsName:"表面积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"表面积测量"}));let Tf=Gs;const Ws=class Ws extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"downloadProgress"],"下载进度",Ws.defaults.downloadProgress,!0,!0),new nt([this,"importOptions"],"导入参数",Ws.defaults.importOptions,void 0,!0)],dataSource:[...e.dataSource,new nt([this,"url"],"路径")]}}};d(Ws,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",importOptions:Yt({buildCollisions:"QueryAndPhysics",buildHierarchy:"Simplified",collisionType:"CTF_UseComplexAsSimple",bImportMetaData:!0}),downloadProgress:0})),d(Ws,"type",Ws.register("ESDatasmithRuntimeModel",Ws,{chsName:"Datasmith Model",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Datasmith Model"}));let Nf=Ws;const _n=class _n extends pl{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new St([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",_n.defaults.waterType),new R([this,"frequency"],"频率",_n.defaults.frequency),new ze([this,"amplitude"],.01,[0,1],"振幅",_n.defaults.amplitude),new ze([this,"flowDirection"],1,[0,360],"流向",_n.defaults.flowDirection),new ze([this,"waveVelocity"],.01,[0,1],"波动频率",_n.defaults.waveVelocity),new ze([this,"specularIntensity"],.01,[0,1],"镜面反射强度",_n.defaults.specularIntensity),new ze([this,"murkiness"],.1,[0,10],"水体浑浊度",_n.defaults.murkiness),new R([this,"flowSpeed"],"水流速度",_n.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",_n.defaults.waterColor),new nt([this,"waterImage"],"水的图片",_n.defaults.waterImage)]}}};d(_n,"createDefaultProps",()=>({...pl.createDefaultProps(),allowPicking:!0,waterImage:Yt(void 0),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5,stroked:!1,filled:!0})),d(_n,"type",_n.register("ESDynamicWater",_n,{chsName:"动态水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"局部多边形水面"}));let Of=_n;const wn=class wn extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new St([this,"waterType"],[["river","river"],["ocean","ocean"],["lake","lake"],["custom","custom"]],"水域类型",wn.defaults.waterType),new R([this,"frequency"],"频率",wn.defaults.frequency),new ze([this,"amplitude"],.01,[0,1],"振幅",wn.defaults.amplitude),new ze([this,"flowDirection"],1,[0,360],"流向",wn.defaults.flowDirection),new ze([this,"waveVelocity"],.01,[0,1],"波动频率",wn.defaults.waveVelocity),new ze([this,"specularIntensity"],.01,[0,1],"镜面反射强度",wn.defaults.specularIntensity),new ze([this,"murkiness"],.1,[0,10],"水体浑浊度",wn.defaults.murkiness),new R([this,"flowSpeed"],"水流速度",wn.defaults.flowSpeed),new Dt([this,"waterColor"],"水的底色",wn.defaults.waterColor),new nt([this,"waterImage"],"水的图片",wn.defaults.waterImage)]}}};d(wn,"createDefaultProps",()=>({...Ht.createDefaultProps(),allowPicking:!0,waterImage:Yt({}),waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,waterType:"river",flowDirection:0,flowSpeed:0,murkiness:5})),d(wn,"type",wn.register("ESGeoWater",wn,{chsName:"地理水面",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"地理动态水面"}));let Df=wn;const ko=class ko extends st{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"downloadProgress"],"下载进度",ko.defaults.downloadProgress,!0,!0),new pt([this,"levelName"],"levelName",""),new R([this,"levelLoadDistance"],"levelLoadDistance",1e3),new un([this,"levelOffset"],"levelOffset",[0,0,0])],dataSource:[...e.dataSource,new nt([this,"url"],"url","")]}}};d(ko,"createDefaultProps",()=>({...st.createDefaultProps(),url:"",downloadProgress:0,levelName:"",levelOffset:dt([0,0,0]),levelLoadDistance:1e3})),d(ko,"type",ko.register("ESLevelRuntimeModel",ko,{chsName:"关卡包模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"关卡包模型"}));let Mf=ko;const sr=class sr extends is{constructor(t){super(t);d(this,"_deprecated",[{materialMode:{blue:"multipleArrows",purple:"singleArrow"}},"show"]);d(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})())}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new R([this,"radius"],"半径",sr.defaults.radius),new R([this,"sides"],"圆边数",sr.defaults.sides),new R([this,"speed"],"材质速度",sr.defaults.speed),new St([this,"materialMode"],sr.materialModes,"材质模式",sr.defaults.materialMode),new nt([this,"materialImage"],"材质图片和重复度",sr.defaults.materialImage)]}}};d(sr,"createDefaultProps",()=>({...is.createDefaultProps(),radius:10,sides:10,materialMode:"singleArrow",materialImage:_t({url:"",uDis:50,vDis:10}),speed:1,filled:!0,stroked:!1,fillStyle:_t({color:[1,0,.73,1],material:"",materialParams:{},ground:!1})})),d(sr,"type",sr.register("ESPipeline",sr,{chsName:"管线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESPipeline"})),d(sr,"materialModes",[["单箭头","singleArrow"],["多箭头","multipleArrows"]]);let Rf=sr;const Ri=class Ri extends Ot{constructor(t){super(t);d(this,"editingBindMode","visibility")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new Dt([this,"visibleColor"],"可视区域颜色",Ri.defaults.visibleColor),new Dt([this,"invisibleColor"],"遮挡区域颜色",Ri.defaults.invisibleColor),new R([this,"heightOffset"],"视点高度偏移",Ri.defaults.heightOffset)]}}};d(Ri,"createDefaultProps",()=>({...Ot.createDefaultProps(),visibleColor:dt([0,1,0,1]),invisibleColor:dt([1,0,0,1]),heightOffset:0})),d(Ri,"type",Ri.register("ESVisibilityAnalysis",Ri,{chsName:"通视分析,视线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"通视分析,视线分析"})),d(Ri,"supportEditingModes",[...Ot.supportEditingModes,rt.VisibilityAppend,rt.VisibilityModify]);let Lf=Ri;const iu=class iu extends Ht{constructor(t){super(t);d(this,"_startEvent",this.dv(new N));d(this,"_clearEvent",this.dv(new N));d(this,"_volume",this.disposeVar(B(0)))}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get volume(){return this._volume.value}set volume(t){this._volume.value=t}get volumeChanged(){return this._volume.changed}getESProperties(){const t={...super.getESProperties()};return{...t,more:[...t.more,new ut([],"通用","通用"),new R([this,"planeHeight"],"基准面高程",void 0,!0),new R([this,"gridWidth"],"采样间距 m"),new R([this,"cutVolume"],"挖方",0,!1,!0),new R([this,"fillVolume"],"填方",0,!1,!0),new R([this,"cutAndFillVolume"],"挖填方",0,!1,!0),new R([this,"progress"],"计算进度",0,!1,!0),new lt([],()=>this.start(),[],"开始分析"),new lt([],()=>this.clear(),[],"清空分析结果"),new Y([this,"depthTest"],"是否开启深度检测")]}}};d(iu,"createDefaultProps",()=>({...Ht.createDefaultProps(),planeHeight:B(void 0),gridWidth:1,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,filled:!1,stroked:!0,strokeStyle:_t({width:2,widthType:"screen",color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),d(iu,"type",iu.register("ESVolumeMeasurement",iu,{chsName:"体积测量",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"体积测量"}));let Af=iu;const su=class su extends Co{constructor(t){super(t);d(this,"_human",this.dv(new Co));d(this,"_poi",this.dv(new dl));this.d(this.components.disposableAdd(this._human,!0)),this.d(this.components.disposableAdd(this._poi));{const{_human:n,_poi:i}=this;this.d(z([n,"show"],[this,"show"])),this.d(z([i,"show"],[this,"show"])),this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([i,"allowPicking"],[this,"allowPicking"])),this.d(it([n,"scale"],[this,"scale"])),this.d(it([i,"scale"],[this,"scale"])),this.d(z([n,"collision"],[this,"collision"])),this.d(z([i,"collision"],[this,"collision"])),this.d(it([n,"flyInParam"],[this,"flyInParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"animation"],[this,"animation"])),this.d(z([n,"mode"],[this,"mode"])),this.d(z([n,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(z([n,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(z([i,"name"],[this,"name"])),this.d(z([i,"mode"],[this,"poiMode"])),this.d(z([i,"autoAnchor"],[this,"autoAnchor"])),this.d(z([i,"screenRender"],[this,"screenRender"])),this.d(z([i,"size"],[this,"size"])),this.d(z([i,"anchor"],[this,"anchor"])),this.d(z([i,"sizeByContent"],[this,"sizeByContent"])),this.d(z([i,"renderMode"],[this,"renderMode"])),this.d(z([i,"rotationType"],[this,"rotationType"])),this.d(z([i,"zOrder"],[this,"zOrder"])),this.d(z([i,"minVisibleDistance"],[this,"minVisibleDistance"])),this.d(z([i,"maxVisibleDistance"],[this,"maxVisibleDistance"])),this.d(it([n,"position"],[this,"position"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(this.flyInEvent.don(s=>{n.flyIn(s)})),this.d(this.flyToEvent.don(s=>{n.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()})),this.d(this.smoothMoveEvent.don((s,o)=>{n.smoothMove(s,o)})),this.d(this.smoothMoveWithRotationEvent.don((s,o,a)=>{n.smoothMoveWithRotation(s,o,a)})),this.d(this.smoothMoveOnGroundEvent.don((s,o,a,u)=>{n.smoothMoveOnGround(s,o,a,u)})),this.d(this.smoothMoveWithRotationOnGroundEvent.don((s,o,a,u,l)=>{n.smoothMoveWithRotationOnGround(s,o,a,u,l)})),this.d(this.automaticLandingEvent.don(()=>{n.automaticLanding()})),this.d(this._human.readyEvent.don(s=>{this.readyEvent.emit(s)}))}}get human(){return this._human}get poi(){return this._poi}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new St([this,"poiMode"],dl.modes,"poi模式","SquareH01"),new R([this,"poiOffsetHeight"],"poi高度偏移",1.8)]}}};d(su,"createDefaultProps",()=>({poiOffsetHeight:1.8,poiMode:"SquareH01",style:_t({}),autoAnchor:!0,screenRender:!0,size:dt([100,100]),anchor:dt([.5,1]),sizeByContent:!0,renderMode:0,rotationType:1,zOrder:0,...Co.createDefaultProps()})),d(su,"type",su.register("ESHumanPoi",su,{chsName:"人员poi",tags:["ESObjects"],description:"ESHuman + ESPoi2D组合对象"}));let Ff=su;const ai=class ai extends Ht{constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new R([this,"depth"],"深度",ai.defaults.depth),new R([this,"interpolation"],"插值",ai.defaults.interpolation),new R([this,"opacity"],"透明度",ai.defaults.opacity),new nt([this,"sideImage"],"侧面图片",ai.defaults.sideImage),new nt([this,"bottomImage"],"底面图片",ai.defaults.bottomImage)]}}};d(ai,"createDefaultProps",()=>({...Ht.createDefaultProps(),depth:100,sideImage:_t({url:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/side.jpg"),uDis:50,vDis:50}),bottomImage:_t({url:et.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPit/bottom.jpg"),uDis:50,vDis:50}),opacity:1,interpolation:50,collision:!1,allowPicking:!1,filled:!0})),d(ai,"type",ai.register("ESPit",ai,{chsName:"坑",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"坑"}));let Fa=ai;const ou=class ou extends Fa{constructor(t){super(t);d(this,"_excavate",this.dv(new hl));d(this,"_pit",this.dv(new Fa));this.d(this.components.disposableAdd(this._excavate)),this.d(this.components.disposableAdd(this._pit,!0));{const{_excavate:n,_pit:i}=this;this.d(z([n,"show"],[this,"show"])),this.d(z([i,"show"],[this,"show"])),this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([i,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(z([i,"collision"],[this,"collision"])),this.d(it([i,"points"],[this,"points"])),this.d(z([n,"points"],[this,"points"])),this.d(z([i,"pointed"],[this,"pointed"])),this.d(z([n,"pointed"],[this,"pointed"])),this.d(z([i,"pointStyle"],[this,"pointStyle"])),this.d(z([n,"pointStyle"],[this,"pointStyle"])),this.d(z([i,"stroked"],[this,"stroked"])),this.d(z([n,"stroked"],[this,"stroked"])),this.d(z([i,"strokeStyle"],[this,"strokeStyle"])),this.d(z([n,"strokeStyle"],[this,"strokeStyle"])),this.d(z([i,"filled"],[this,"filled"])),this.d(z([i,"fillStyle"],[this,"fillStyle"])),this.d(z([n,"fillStyle"],[this,"fillStyle"])),this.d(z([n,"mode"],[this,"mode"])),this.d(z([n,"targetID"],[this,"targetID"])),this.d(z([i,"depth"],[this,"depth"])),this.d(z([i,"sideImage"],[this,"sideImage"])),this.d(z([i,"bottomImage"],[this,"bottomImage"])),this.d(z([i,"opacity"],[this,"opacity"])),this.d(z([i,"interpolation"],[this,"interpolation"])),this.d(it([i,"flyInParam"],[this,"flyInParam"])),this.d(it([i,"flyToParam"],[this,"flyToParam"])),this.d(this.flyInEvent.don(s=>{i.flyIn(s)})),this.d(this.flyToEvent.don(s=>{i.flyTo(s)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}}get excavate(){return this._excavate}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new St([this,"mode"],hl.modes,"模式","in"),new pt([this,"targetID"],"瓦片图层","")]}}};d(ou,"createDefaultProps",()=>({...Fa.createDefaultProps(),mode:"in",targetID:""})),d(ou,"type",ou.register("ESHole",ou,{chsName:"挖坑(带材质+深度)",tags:["ESObjects"],description:"挖坑"}));let kf=ou;const Vf={layerconfigfind:"/ts/layer/config/get",layerconfigsave:"/ts/layer/config/put",featureproperty:"/ts/editor/property",featureeditormuti:"/ts/editor/update",getts:"/ts/info"},wS=async(r,e,t,n)=>{try{const i=window.localStorage.getItem("Authorization");let s=r+`${Vf.layerconfigfind}?tileServiceName=${e}`;t&&(s+=`&earthdstoken=${encodeURIComponent(n)}`);const o={headers:{...!t&&i?{Authorization:i}:{}},mode:"cors"},u=await(await fetch(s,o)).text();return JSON.parse(u)}catch(i){console.error(i)}},ES=async(r,e,t,n,i)=>{try{const s=window.localStorage.getItem("Authorization");let o=r+Vf.layerconfigsave;const a=i??{};t&&(o+=`?earthdstoken=${encodeURIComponent(n)}`);const u={method:"POST",headers:{"Content-Type":"application/json",...!t&&s?{Authorization:s}:{}},mode:"cors",body:JSON.stringify({tileServiceName:e,layerConfig:JSON.stringify(a)})},c=await(await fetch(o,u)).text();return JSON.parse(c)}catch(s){console.error(s)}},CS=async(r,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},SS=async(r,e,t,n,i)=>{try{const s={tileServiceName:e,featureId:t},o=window.localStorage.getItem("Authorization");let a=r+Vf.featureproperty;n&&(a+=`?earthdstoken=${encodeURIComponent(i)}`);const l=await(await fetch(a,{method:"post",headers:{"Content-Type":"application/json",...!n&&o?{Authorization:o}:{}},body:JSON.stringify(s),mode:"cors"})).text(),c=JSON.parse(l);if(c.status=="ok")return c.data;console.error(c.data.status);return}catch(s){console.error(s)}},au=class au extends Pr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Pr));d(this,"_ids",this.dv(_t([])));d(this,"_useEarthDSToken",this.dv(B(!1)));d(this,"_earthdstoken",this.dv(B("")));d(this,"_visJson",this.disposeVar(B({})));d(this,"_highlightInner3DtilesetEvent",this.dv(new N));d(this,"_removeHighlightInner3DtilesetEvent",this.dv(new N));d(this,"_tilesetServePort",this.dv(B("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ts01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"actorTag"],[this,"actorTag"])),this.d(z([n,"materialMode"],[this,"materialMode"])),this.d(z([n,"highlight"],[this,"highlight"])),this.d(z([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(z([n,"highlightID"],[this,"highlightID"])),this.d(z([n,"highlightColor"],[this,"highlightColor"])),this.d(it([n,"offset"],[this,"offset"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(z([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(z([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(z([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(z([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(z([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(z([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(z([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(z([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(z([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(z([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(z([n,"cacheBytes"],[this,"cacheBytes"])),this.d(z([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(z([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(z([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(z([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(z([n,"materialParams"],[this,"materialParams"])),this.d(it([n,"supportEdit"],[this,"supportEdit"])),this.d(it([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(it([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(it([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(it([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(it([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(it([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.setFeatureStyleEvent.don((...i)=>{n.setFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get ids(){return this._ids.value}get idsChanged(){return this._ids.changed}set ids(t){this._ids.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}get visJson(){return this._visJson.value}set visJson(t){this._visJson.value=t}get visJsonChanged(){return this._visJson.changed}setFeatureVisable(t,n){var i;if((i=this.layerConfig)!=null&&i.length){const s={};s[n[0].value]=n[0].visable,this.visJson={...this.visJson,...s}}else this.setFeatureVisableEvent.emit(t,typeof n=="string"?JSON.parse(n):n)}async getFeatureProperty(t){return await SS(this.baseUrl,this.tileServiceName,t,this.useEarthDSToken,this.earthdstoken)}async getLayerConfig(){const t=await wS(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken);return!t||!Array.isArray(t)?this.layerConfig=[]:this.layerConfig=t,this.layerConfig}async saveLayerConfig(){const t=this.layerConfig;return await ES(this.baseUrl,this.tileServiceName,this.useEarthDSToken,this.earthdstoken,t)}get highlightInner3DtilesetEvent(){return this._highlightInner3DtilesetEvent}_highlightInner3Dtileset(t){this._highlightInner3DtilesetEvent.emit(t)}async highlightDSFeature(t){this._highlightInner3Dtileset(t)}get removeHighlightInner3DtilesetEvent(){return this._removeHighlightInner3DtilesetEvent}_removeHighlightInner3Dtileset(t){this._removeHighlightInner3DtilesetEvent.emit(t)}async removeHighlightDSFeature(t){this._removeHighlightInner3Dtileset(t)}async pickFeature(t,n){var a,u,l;const i=await t.pick(n),s=i.sceneObject;return!s||s.id!==this.id&&s.typeName!="ESRtsFeatureEditing"?void 0:s.typeName!="ESRtsFeatureEditing"?(this.ids=[...this.ids,(a=i==null?void 0:i.tilesetPickInfo)==null?void 0:a.id],{featureId:(u=i==null?void 0:i.tilesetPickInfo)==null?void 0:u.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}):{featureId:(l=i==null?void 0:i.sceneObject)==null?void 0:l.id,pickInnerFields:i==null?void 0:i.tilesetPickInfo}}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}async getport(){const t=await CS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();await this.getLayerConfig(),this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ts01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ts01")}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt([this,"layerConfig"],"图层配置",[],void 0,!0)]}}};d(au,"createDefaultProps",()=>({...Pr.createDefaultProps(),layerConfig:Yt([])})),d(au,"type",au.register("ESRtsTileset",au,{chsName:"CIMRTS实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let Bf=au;function bS(r){return typeof r=="number"&&!isNaN(r)}const uu=class uu extends Pr{get json(){return{...this._innerGetJson(),show:this.show,materials:this.materials,changeMaterial:this.changeMaterial,props:this.props,rotation:this.rotation,offset:this.offset}}set json(e){this._innerSetJson(e)}async init(e,t){this.featureId=t;const n=await e.getFeatureProperty(t);this.uiShowprops=n.allFields.map(o=>({featureClassName:o.featureClassName,fields:o.fields.map(a=>({key:a.name,type:a.type,value:a.type!="Double"?a.value:bS(a.value)?Number(a.value.toFixed(3)):""}))})),this.datasetName=n.datasetName,e.setFeatureVisable("id",[{value:this.featureId,visable:!1}]),this.d(()=>{e.setFeatureVisable("id",[{value:this.featureId,visable:!0}])});const i=e.tileServiceIp,s=e.tilesetServePort;if(!s)throw new Error("ESRtsFeatureEditing: port is not defined");this.url=`${i}:${s}/featuretiles/${this.featureId}/tileset.json`,this.allowPicking=!0,this.d(this.pickedEvent.don(o=>{o.assign({sceneObject:e}),e.pickedEvent.emit(o)})),this.d(()=>{this.editing=!1,e.removeHighlightDSFeature(this)})}constructor(e){super(e)}};d(uu,"createDefaultProps",()=>({...Pr.createDefaultProps(),datasetName:void 0,featureId:void 0,materials:_t({}),changeMaterial:Yt(void 0),uiShowprops:_t({}),props:_t({})})),d(uu,"type",uu.register("ESRtsFeatureEditing",uu,{chsName:"ESRtsFeatureEditing",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let jf=uu;const PS=async(r,e,t)=>{try{const n=window.localStorage.getItem("Authorization");let i=r;e&&(i+=`?earthdstoken=${encodeURIComponent(t)}`);const s={headers:{...!e&&n?{Authorization:n}:{}},mode:"cors"},a=await(await fetch(i,s)).text(),u=JSON.parse(a);if(u.status=="ok")return u.data.port;console.error(u.status);return}catch(n){console.error(n)}},Cl=class Cl extends Pr{constructor(t){super(t);d(this,"_es3DTileset",this.dv(new Pr));d(this,"_tilesetServePort",this.dv(B("")));d(this,"_useEarthDSToken",this.dv(B(!1)));d(this,"_earthdstoken",this.dv(B("")));{const n=async()=>{if(typeof this.url!="string"){console.error("服务地址不合法, Init Error! 示例: http://localhost:9009/ts/info/ms01");return}this.url?this.refresh():this._es3DTileset.url=""};this.d(this.urlChanged.don(()=>{n()}))}{this.d(this.components.disposableAdd(this._es3DTileset,!0));const n=this._es3DTileset;this.d(z([n,"allowPicking"],[this,"allowPicking"])),this.d(z([n,"collision"],[this,"collision"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(it([n,"flyToParam"],[this,"flyToParam"])),this.d(z([n,"actorTag"],[this,"actorTag"])),this.d(z([n,"materialMode"],[this,"materialMode"])),this.d(z([n,"highlight"],[this,"highlight"])),this.d(z([n,"maximumScreenSpaceError"],[this,"maximumScreenSpaceError"])),this.d(z([n,"highlightID"],[this,"highlightID"])),this.d(z([n,"highlightColor"],[this,"highlightColor"])),this.d(it([n,"offset"],[this,"offset"])),this.d(it([n,"rotation"],[this,"rotation"])),this.d(z([n,"czmImageBasedLightingFactor"],[this,"czmImageBasedLightingFactor"])),this.d(z([n,"czmLuminanceAtZenith"],[this,"czmLuminanceAtZenith"])),this.d(z([n,"czmMaximumMemoryUsage"],[this,"czmMaximumMemoryUsage"])),this.d(z([n,"czmClassificationType"],[this,"czmClassificationType"])),this.d(z([n,"czmStyleJson"],[this,"czmStyleJson"])),this.d(z([n,"czmBackFaceCulling"],[this,"czmBackFaceCulling"])),this.d(z([n,"czmDebugShowBoundingVolume"],[this,"czmDebugShowBoundingVolume"])),this.d(z([n,"czmDebugShowContentBoundingVolume"],[this,"czmDebugShowContentBoundingVolume"])),this.d(z([n,"czmSkipLevelOfDetail"],[this,"czmSkipLevelOfDetail"])),this.d(z([n,"colorBlendMode"],[this,"colorBlendMode"])),this.d(z([n,"cacheBytes"],[this,"cacheBytes"])),this.d(z([n,"clippingPlaneEnabled"],[this,"clippingPlaneEnabled"])),this.d(z([n,"unionClippingRegions"],[this,"unionClippingRegions"])),this.d(z([n,"clippingPlaneEdgeColor"],[this,"clippingPlaneEdgeColor"])),this.d(z([n,"clippingPlaneEdgeWidth"],[this,"clippingPlaneEdgeWidth"])),this.d(z([n,"materialParams"],[this,"materialParams"])),this.d(it([n,"supportEdit"],[this,"supportEdit"])),this.d(it([n,"clippingPlanesId"],[this,"clippingPlanesId"])),this.d(it([n,"clippingPlaneIds"],[this,"clippingPlaneIds"])),this.d(it([n,"flattenedPlaneId"],[this,"flattenedPlaneId"])),this.d(it([n,"flattenedPlaneEnabled"],[this,"flattenedPlaneEnabled"])),this.d(it([n,"clippingPlaneId"],[this,"clippingPlaneId"])),this.d(it([n,"excavateId"],[this,"excavateId"]))}{const n=this._es3DTileset;this.d(this.refreshTilesetEvent.don(()=>{n.refreshTileset()})),this.d(this.highlightFeatureEvent.don((...i)=>{n.highlightFeature(...i)})),this.d(this.highlightFeatureAndFlyToEvent.don((...i)=>{n.highlightFeatureAndFlyTo(...i)})),this.d(this.setFeatureColorEvent.don((...i)=>{n.setFeatureColor(...i)})),this.d(this.setFeatureVisableEvent.don((...i)=>{n.setFeatureVisable(...i)})),this.d(this.resetFeatureStyleEvent.don((...i)=>{n.resetFeatureStyle(...i)})),this.d(this.flyInEvent.don((...i)=>{n.flyIn(i[0])})),this.d(this.flyToEvent.don((...i)=>{n.flyTo(i[0])})),this.d(this.calcFlyToParamEvent.don((...i)=>{n.calcFlyToParam(...i)})),this.d(this.calcFlyInParamEvent.don((...i)=>{n.calcFlyInParam(...i)}))}{const n=this._es3DTileset;this.d(n.tilesetReady.don(i=>{this.tilesetReady.emit(i)})),this.d(n.pickedEvent.don(i=>{i.assign({sceneObject:this}),this.pickedEvent.emit(i)}))}{const n=()=>{this.es3DTileset.show=this.show};n(),this.d(this.showChanged.don(()=>{n()}))}}get es3DTileset(){return this._es3DTileset}get tilesetServePort(){return this._tilesetServePort.value}get tilesetServePortChanged(){return this._tilesetServePort.changed}set tilesetServePort(t){this._tilesetServePort.value=t}get useEarthDSToken(){return this._useEarthDSToken.value}get useEarthDSTokenChanged(){return this._useEarthDSToken.changed}set useEarthDSToken(t){this._useEarthDSToken.value=t}get earthdstoken(){return this._earthdstoken.value}get earthdstokenChanged(){return this._earthdstoken.changed}set earthdstoken(t){this._earthdstoken.value=t}async getport(){const t=await PS(this.url,this.useEarthDSToken,this.earthdstoken);if(t)return this.tilesetServePort=t,t;throw new Error("服务地址port获取失败!")}async refresh(){var i;if(!this.url||typeof this.url!="string")return;const t=(i=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:i[1],n=+new Date;if(t){const s=this.tileServiceIp,o=await this.getport();this._es3DTileset.url=`${s}:${o}/tiles/tileset.json?t=${n}`}console.log("3dtileset url:",this._es3DTileset.url)}get baseUrl(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^\/]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,baseUrl is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceIp(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/^(https?:\/\/[^:]+)/))==null?void 0:t[1];if(!n)throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01");return n}else throw new Error("服务地址不合法,ip is not found! 示例: http://localhost:9009/ts/info/ms01")}get tileServiceName(){var t;if(this.url&&typeof this.url=="string"){const n=(t=this.url.match(/\/ts\/info\/(.*)/))==null?void 0:t[1];if(!n)throw console.log(this.url),new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01,");return n}else throw new Error("服务地址不合法,tileServiceName is not found! 示例: http://localhost:9009/ts/info/ms01")}};d(Cl,"type",Cl.register("ESMsTileset",Cl,{chsName:"Modelser实时3DTileset图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"实时3DTileset图层"}));let zf=Cl;const fy={defaultValue:[{type:"2",widget:"WidgetBlueprint'/ESFoliage/PoiSheng.PoiSheng'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"3",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"4",widget:"WidgetBlueprint'/ESFoliage/PoiShi.PoiShi'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"5",widget:"WidgetBlueprint'/ESFoliage/PoiXiang.PoiXiang'",povit:[.5,1],worldScale:.1,hiddenDistance:40},{type:"6",widget:"WidgetBlueprint'/ESFoliage/PoiCun.PoiCun'",povit:[.5,1],worldScale:.1,hiddenDistance:40}],sampleValue:`
|
|
355
355
|
## 参数类型为 ESPoiType[]
|
|
356
356
|
\`\`\`js
|
|
357
357
|
type Vector2D = [number, number]
|