earthsdk3 3.4.0-beta.4 → 3.4.0-beta.6

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.
@@ -1,9 +1,9 @@
1
1
  (function(P,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("xbsj-base"),require("@turf/turf"),require("proj4")):typeof define=="function"&&define.amd?define(["exports","xbsj-base","@turf/turf","proj4"],c):(P=typeof globalThis<"u"?globalThis:P||self,c(P.EarthSDK3={},P.xbsj_base,P.turf,P.proj4))})(this,function(P,c,ja,Ah){"use strict";var R0=Object.defineProperty;var F0=(P,c,ja)=>c in P?R0(P,c,{enumerable:!0,configurable:!0,writable:!0,value:ja}):P[c]=ja;var d=(P,c,ja)=>F0(P,typeof c!="symbol"?c+"":c,ja);function Qp(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const _c=Qp(ja);class Bp extends c.Destroyable{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,r,i){const s=this.registerEngines[t]||new Map;s.has(r)&&console.warn(`register warn:${t}中${r}的实现类已经被注册,再次注册会覆盖。`),s.set(r,i),this.registerEngines[t]=s}getEngineObjConstructor(t,r){const s=(this.registerEngines[r]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${r}中对应的实现类!`)}createEngineObject(t,r){const i=this.getEngineObjConstructor(t.typeName,r.typeName);if(i){const s=new i(t,r);return s.createdEvent.emit(),s}else{const s=new Ys(t,r);return s.createdEvent.emit(),s}}}class $p extends c.Destroyable{constructor(){super(...arguments);d(this,"registerEngines",{})}register(t,r,i){const s=this.registerEngines[t]||new Map;s.has(r)&&console.warn(`register warn:${t}中${r}的实现类已经被注册,再次注册会覆盖。`),s.set(r,i),this.registerEngines[t]=s}getEngineObjConstructor(t,r){const s=(this.registerEngines[r]||new Map).get(t);if(s)return s;console.warn(`未找到${t}在${r}中对应的实现类!`)}createEngineObject(t,r){const i=this.getEngineObjConstructor(t.typeName,r.typeName);if(i){const s=new i(t,r);return s.createdEvent.emit(),s}else{const s=new Ys(t,r);return s.createdEvent.emit(),s}}}const In=class In extends c.Destroyable{constructor(t,r,i=!1){super();d(this,"_createdEvent",this.dv(new c.Event));d(this,"_id",++In._accumId);this._sceneObject=t,this._viewer=r;{if(i)return;t.viewer=r,t.viewerChanged.emit(r);const s=(o,a)=>{for(let l of o)this._viewer.delete(l);for(let l of a)this._viewer.add(l)};s([],this._sceneObject.components.values()),this.d(this._sceneObject.components.toChange.don(s)),this.d(()=>s(this._sceneObject.components.values(),[]))}}get createdEvent(){return this._createdEvent}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get id(){return this._id}};d(In,"context",new Bp),d(In,"contextEditing",new $p),d(In,"register",In.context.register.bind(In.context)),d(In,"registerEditing",In.contextEditing.register.bind(In.contextEditing)),d(In,"_accumId",-1);let Ys=In;const yc=class yc extends c.Destroyable{constructor(t,r){super();d(this,"_id",++yc._accumId);this._name=t,this._description=r}get id(){return this._id}get name(){return this._name}get description(){return this._description}};d(yc,"_accumId",-1);let cs=yc;class wc extends cs{constructor(e,t,r,i,s){super(e,t),this._withUndefined=r,this._readonly=i,this._defaultValue=s}get withUndefined(){return this._withUndefined}get readonly(){return this._readonly}get defaultValue(){return this._defaultValue instanceof Function?this._defaultValue():this._defaultValue}}class Ee extends wc{constructor(e,t,r,i,s,o){super(e,t,r,i,o),this._reactVar=s}get reactVar(){return this._reactVar}}class F extends Ee{get type(){return"BooleanProperty"}}class Z extends Ee{get type(){return"StringProperty"}}class S extends Ee{get type(){return"NumberProperty"}}class jp extends Ee{get type(){return"MaximumScreenSpaceErrorProperty"}}class Rh extends Ee{get type(){return"StringsProperty"}}class eg extends Ee{get type(){return"NumbersProperty"}}class tg extends Ee{get type(){return"BooleansProperty"}}class rg extends Ee{get type(){return"String2Property"}}class ng extends Ee{get type(){return"String3Property"}}class ig extends Ee{get type(){return"String4Property"}}class Fh extends Ee{get type(){return"String2sProperty"}}class sg extends Ee{get type(){return"String3sProperty"}}class og extends Ee{get type(){return"String4sProperty"}}class ze extends Ee{get type(){return"Number2Property"}}class It extends Ee{get type(){return"Number3Property"}}class or extends Ee{get type(){return"Number4Property"}}class ag extends Ee{get type(){return"Number4WithUndefinedProperty"}}class kh extends Ee{get type(){return"Number2sProperty"}}class Ec extends Ee{get type(){return"Number3sProperty"}}class lg extends Ee{get type(){return"Number4sProperty"}}class ug extends Ee{get type(){return"Boolean2Property"}}class cg extends Ee{get type(){return"Boolean3Property"}}class hg extends Ee{get type(){return"Boolean4Property"}}class fg extends Ee{get type(){return"Boolean2sProperty"}}class dg extends Ee{get type(){return"Boolean3sProperty"}}class pg extends Ee{get type(){return"Boolean4sProperty"}}class gg extends Ee{get type(){return"StringNumberProperty"}}class mg extends Ee{get type(){return"StringNumbersProperty"}}class J extends or{get type(){return"ColorProperty"}}class vg extends It{get type(){return"ColorRgbProperty"}}class yg extends S{get type(){return"DashPatternProperty"}}class Y extends Ee{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,a),this._enums=o}get type(){return"EnumProperty"}get enums(){return this._enums}}class _g extends Ee{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,a),this._enums=o}get type(){return"EnumStringsProperty"}get enums(){return this._enums}}class ni extends Ee{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,o),this._sampleValue=a}get sampleValue(){return this._sampleValue}get type(){return"EvalStringProperty"}}class Vh extends Ee{constructor(e,t,r,i,s){super(e,t,!1,!1,r,s),this._paramTypes=i}get type(){return"ParamsProperty"}get paramTypes(){return this._paramTypes}}class ie extends cs{constructor(t,r,i,s,o){super(t,r);d(this,"_paramsProperty");d(this,"_getValueFunc");this._func=s;const a=this.disposeVar(c.reactJson(o));this._paramsProperty=this.disposeVar(new Vh(t+"_params",t+"_params",a,i,o));const[l]=c.getReactFuncs(this._paramsProperty.reactVar);this._getValueFunc=l}get paramsProperty(){return this._paramsProperty}exec(){this._func(...this._getValueFunc())}get type(){return"FunctionProperty"}}class z extends cs{constructor(e,t,r){super(e,t),this._children=r}get type(){return"GroupProperty"}get children(){return this._children}}class U extends Ee{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,o),this._sampleValue=a}get sampleValue(){return this._sampleValue}get type(){return"JsonProperty"}}class Eu extends Ee{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,o),this._sampleValue=a}get sampleValue(){return this._sampleValue}get type(){return"LongStringProperty"}}class wg extends ze{get type(){return"MinmaxProperty"}}class Eg extends or{get type(){return"NearFarScalerProperty"}}class zh extends wc{constructor(e,t,r,i,s,o,a){super(e,t,r,i,a),this._getJsonStringFunc=s,this._setJsonStringFunc=o}get type(){return"NonreactiveJsonStringProperty"}get getJsonStringFunc(){return this._getJsonStringFunc}get setJsonStringFunc(){return this._setJsonStringFunc}}class Sg extends ze{get type(){return"NumberRangeProperty"}}class Me extends Ee{constructor(e,t,r,i,s,o,a,l){super(e,t,r,i,s,l),this._step=o,this._minMax=a}get type(){return"NumberSliderProperty"}get minMax(){return this._minMax}get step(){return this._step}}function Cg(n,e){const[t,r,i]=c.getReactFuncs(n),[s,o,a]=c.getReactFuncs(e),l=c.react((t()??0)/(s()??3e3)),u=()=>{const h=l.value,f=s()??3e3,p=t()??0;if(!Number.isFinite(f)||!Number.isFinite(p)){console.warn(`duration || currentTime error: duration: ${f} currentTime: ${p}`);return}Math.abs(h*f-p)<.001||(f<=0?l.value=0:l.value=p/f)};return l.dispose(i.disposableOn(u)),l.dispose(a.disposableOn(u)),l.dispose(l.changed.disposableOn(()=>{const h=l.value,f=s()??3e3,p=t()??0;if(!Number.isFinite(f)||!Number.isFinite(p)){console.warn(`duration || currentTime error: duration: ${f} currentTime: ${p}`);return}Math.abs(h*f-p)<.001||r(h*f)})),l}class Su extends cs{constructor(t,r,i,s,o,a){super(t,r);d(this,"_defaults",{playing:!1,ratio:0,loop:!1});this._playingReact=i,this._ratioReact=s,this._loopReact=o,a&&(this._defaults.playing=a.playing??this._defaults.playing,this._defaults.ratio=a.ratio??this._defaults.ratio,this._defaults.loop=a.loop??this._defaults.loop)}get type(){return"PlayerProperty"}get playingReact(){return this._playingReact}get ratioReact(){return this._ratioReact}get loopReact(){return this._loopReact}get defaults(){return this._defaults}}d(Su,"createPlayingRatio",Cg);class Dn extends It{get type(){return"PositionProperty"}}class Uh extends Ee{get type(){return"PositionsProperty"}}class Pg extends Ee{get type(){return"PositionsSetPropety"}}class Cu extends It{get type(){return"RotationProperty"}}class zl extends Z{get type(){return"UriProperty"}}class Gh extends cs{constructor(t,r,i,s,o,a){super(t,r);d(this,"_defaults",{playing:!1,loop:!1});this._playingReact=i,this._stopFn=s,this._loopReact=o,a&&(this._defaults.playing=a.playing??this._defaults.playing,this._defaults.loop=a.loop??this._defaults.loop)}get type(){return"ViewPlayerProperty"}get playingReact(){return this._playingReact}get loopReact(){return this._loopReact}get stopFn(){return this._stopFn}get defaults(){return this._defaults}}class Sc extends Ee{get type(){return"DatesProperty"}}class ii extends Ee{get type(){return"DateProperty"}}var se=(n=>(n.Place="place",n.Translation="translation",n.Rotation="rotation",n.Scale="scale",n.DoublePointsAppend="doublePointsAppend",n.DoublePointsModify="doublePointsModify",n.CircularAppend="circularAppend",n.CircularInsert="circularInsert",n.LineStringAppend="lineStringAppend",n.LineStringInsert="lineStringInsert",n.ScatterAppend="scatterAppend",n.ScatterModify="scatterModify",n.VisibilityAppend="visibilityAppend",n.VisibilityModify="visibilityModify",n.HeightModify="heightModify",n))(se||{}),Wh=(n=>(n.DECIMAL_DEGREE="DECIMAL_DEGREE",n.DEGREES_DECIMAL_MINUTES="DEGREES_DECIMAL_MINUTES",n.SEXAGESIMAL_DEGREE="SEXAGESIMAL_DEGREE",n))(Wh||{});class Ig{constructor(e){this.childPickedInfo=e}}class Tg{constructor(e,t,r,i,s,o){this.pickResult=e,this.sceneObject=t,this.tilesetPickInfo=r,this.geojsonPickInfo=i,this.attachedInfo=s,this.screenPosition=o}assign(e){e!=null&&e.pickedResult&&(this.pickResult=e.pickedResult),e!=null&&e.sceneObject&&(this.sceneObject=e.sceneObject),e!=null&&e.tilesetPickInfo&&(this.tilesetPickInfo=e.tilesetPickInfo),e!=null&&e.geojsonPickInfo&&(this.geojsonPickInfo=e.geojsonPickInfo),e!=null&&e.attachedInfo&&(this.attachedInfo=e.attachedInfo),e!=null&&e.screenPosition&&(this.screenPosition=e.screenPosition)}}class Ng extends c.Destroyable{constructor(t){super();d(this,"_sceneObjRefs",new Map);d(this,"_refs",{});d(this,"_refsChanged",this.dv(new c.Event));const r=(i,s,o)=>{if(o){const a=this.getLastSceneObject(o),l=this._sceneObjRefs.get(o);if(!l)console.warn(`this._sceneObjRefs中不存在ref(${o}), 可能系统存在逻辑问题`);else{const h=l.indexOf(i);h===-1?console.warn(`this._sceneObjRefs中不存在当前对象(id: ${i.id} type: ${i.typeName})!可能系统存在逻辑问题`):(l.splice(h,1),l.length===0&&this._sceneObjRefs.delete(o))}const u=this.getLastSceneObject(o);this._refs[o]=u,this._refsChanged.emit(u,a)}if(s){const a=this.getLastSceneObject(s),l=this._sceneObjRefs.get(s);l?(l.push(i),l.length>0&&console.warn(`同时存在多个ref${s}相同的场景对象!
2
2
  ${l.map(h=>`${h.id} ${h.typeName}
3
- `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,a)}};this.d(t.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>r(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(t.sceneObjToDestroyEvent.don(i=>{i.ref&&r(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const r=this.getSceneObjects(t);if(r)return r[r.length-1]}getSceneObjects(t){const r=this._sceneObjRefs.get(t);if(!(!r||r.length===0))return r}}function qh(n,e){const[t,r,i]=c.getReactFuncs(n),s=c.react(void 0),o=()=>{const a=t()??e;s.value=a&&j.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(j.context.environmentVariablesChanged.don(o)),s}function Dg(n){do{const e=n.replace(/\${(.*?)\}/,(t,r)=>{const i=j.context.getEnv(r);return i===void 0?(console.warn(`环境变量(${r})不存在,无法进行转换`),"{env-error}"):i});if(e===n)break;n=e}while(!0);return n}class bg extends c.Destroyable{constructor(){super();d(this,"_esObjConstructors",new Map);d(this,"_sceneObjs",new Map);d(this,"_sceneObjCreatedEvent",new c.Event);d(this,"_sceneObjToDestroyEvent",new c.Event);d(this,"_refsManager",this.dv(new Ng(this)));d(this,"_environmentVariables",window.ESSDK_ENV||{});d(this,"_environmentVariablesChanged",this.dv(new c.Event))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,r,i){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,r),i&&c.setExtProp(r,"__sceneObjExtraInfo",i),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,r){if(!r||this._sceneObjs.has(r)){const s=c.createGuid();r&&console.warn(`已存在相同id的对象!id自动变更!${r} -> ${s} 请注意:id变更可能导致引用失效!`),r=s}if(!r)throw new Error("id不能为空!");const i=new t(r);return i.id!==r&&(console.warn(`sceneObj.id(${i.id}) !== id(${r}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(t,r){if(typeof t=="string"){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(i,r)}else return this.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){const r=this.createSceneObject(t.type,t.id);return r&&(r.json=t),r}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(t.startsWith("ES")){const r=[];for(const i of this._sceneObjs.values())i.typeName===t&&r.push(i);return r}else return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const r=this._esObjConstructors.get(t);if(r)return r}getProps(t){const r=this._getSceneObjConstructor(t);if(!r){console.warn(`cannot get constructor from type: ${t}`);return}return c.getExtProp(r,"__sceneObjExtraInfo")}setProps(t,r){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`cannot get constructor from type: ${t}`);return}let s=c.getExtProp(i,"__sceneObjExtraInfo");s||(s={},c.setExtProp(i,"__sceneObjExtraInfo",s)),Object.assign(s,r)}getProp(t,r){const i=this.getProps(t);return i&&i[r]}setProp(t,r,i){this.setProps(t,{[r]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[r,i]of Object.entries(t))this.setEnv(r,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,r){if(this._environmentVariables[t]!==r){const i=this._environmentVariables[t];this._environmentVariables[t]=r,this._environmentVariablesChanged.emit(t,r,i)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return Dg(t)}createEnvStrReact(t,r){return qh(t,r)}createEvnStrReact(t,r){return qh(t,r)}}const pe=class pe extends c.Destroyable{constructor(t){super();d(this,"_components",this.dv(new c.ObservableSet));d(this,"_viewerAttached",this.dv(new c.Event));d(this,"_viewerDetached",this.dv(new c.Event));d(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(r=>{t.add(r)})),this.d(this._viewerDetached.don(r=>{t.delete(r)})),t})());d(this,"_createdEvent",this.dv(new c.Event));d(this,"_flushEvent",this.dv(new c.Event));d(this,"_id");d(this,"viewer");d(this,"viewerChanged",this.ad(new c.Event));d(this,"combinationClass",!1);d(this,"mainClass");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_parentID",this.disposeVar(c.react(void 0)));t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??c.createGuid(),this._initName();{const r=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};r(),this.d(this.execOnceFuncStrChanged.don(r))}{const r=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};r(),this.d(this.updateFuncStrChanged.don(r));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||c.createAnimateFrame(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const r=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};r(),this.d(this.toDestroyFuncStrChanged.don(r)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static get envs(){return pe.context.environmentVariables}static get $refs(){return pe.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const r=new Map;this.d(()=>{r.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=t(i);s&&r.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!r.has(i))return;const s=r.get(i);s&&(s.destroy(),r.delete(i))}))}createAttachedObject(t){const r=new Map,i=()=>{for(let[l,u]of r.entries())u.destroy();r.clear()},s=l=>{const u=t(l);u&&r.set(l,u)};for(let l of this.attachedViewers)s(l);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(l=>{if(!r.has(l))return;const u=r.get(l);u&&(u.destroy(),r.delete(l))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(r=>new Og(r,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.name}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return pe.createDefaultProps()}getMainClass(){return this.mainClass??this}_innerGetJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_innerGetJson1(t=!0){const r={id:this.id,type:this.typeName},i=this.constructor.properties;for(let s of Object.keys(i))if(t){let o,a=i[s];a instanceof c.ReactiveVariable?o=a.equals(this[s]):o=a===this[s],o||(r[s]=this[s])}else r[s]=this[s];return r}_innerSetJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID.value}set parentID(t){this._parentID.value=t}get parentIDChanged(){return this._parentID.changed}getProperties(t){return[new z("ESSceneObject","ESSceneObject",[new Z("对象类型","类型(type)",!1,!0,[this,"typeName"]),new Z("对象id","唯一标识符(id)",!1,!0,[this,"id"]),new Z("对象名称","名称(name)",!1,!1,[this,"name"]),new Z("ref","标识(ref),可通过 ESSceneObject.$refs.xxx快速获取到对象",!0,!1,[this,"ref"]),new U("extras","扩展属性,必须整体赋值(extras)",!0,!1,[this,"extras"]),new zh("JSON","对象JSON数据动态更改导入导出。",!1,!1,()=>this._jsonStr,r=>r&&(this._jsonStr=r))])]}getESProperties(){return{defaultMenu:"basic",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[]}}static register1(t,r,i){let s={},o=r;for(;o&&o!==Object;)o.hasOwnProperty("properties")&&(s={...s,...o.properties}),o=Object.getPrototypeOf(o);return r.properties=Object.freeze(s),c.extendClassProps(r.prototype,()=>s),this.register(t,r,i),t}};d(pe,"context",new bg),d(pe,"register",pe.context.register.bind(pe.context)),d(pe,"create",pe.context.createSceneObject.bind(pe.context)),d(pe,"createFromClass",pe.context.createSceneObjectFromClass.bind(pe.context)),d(pe,"createFromJson",pe.context.createSceneObjectFromJson.bind(pe.context)),d(pe,"destroySceneObject",pe.context.destroySceneObject.bind(pe.context)),d(pe,"getSceneObjById",pe.context.getSceneObjectById.bind(pe.context)),d(pe,"getSceneObj",pe.context.getSceneObject.bind(pe.context)),d(pe,"getEnv",pe.context.getEnv.bind(pe.context)),d(pe,"setEnv",pe.context.setEnv.bind(pe.context)),d(pe,"getStrFromEnv",pe.context.getStrFromEnv.bind(pe.context)),d(pe,"getSceneObjectById",pe.context.getSceneObjectById.bind(pe.context)),d(pe,"getSceneObject",pe.context.getSceneObject.bind(pe.context)),d(pe,"defaults",{}),d(pe,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),d(pe,"properties",{reff:void 0});let j=pe;c.extendClassProps(j.prototype,j.createDefaultProps);class Og extends c.Destroyable{constructor(e,t){super(),this.dv(new c.ObjResettingWithEvent(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}function Cc(n){return c.reactDeepArrayWithUndefined(n,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function Xh(n,e){const t=new Array;for(let r of n)t.push(e(r));return t}function Pc(n,e){return n===void 0&&e===void 0?!0:!n||!e?!1:n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]}function Mg(n,e){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&n.push(n[0]);const t=_c.point(e),r=_c.polygon([n]);return _c.booleanPointInPolygon(t,r)}var Ut=63710088e-1,Yh={centimeters:Ut*100,centimetres:Ut*100,degrees:Ut/111325,feet:Ut*3.28084,inches:Ut*39.37,kilometers:Ut/1e3,kilometres:Ut/1e3,meters:Ut,metres:Ut,miles:Ut/1609.344,millimeters:Ut*1e3,millimetres:Ut*1e3,nauticalmiles:Ut/1852,radians:1,yards:Ut*1.0936};function bn(n,e,t){t===void 0&&(t={});var r={type:"Feature"};return(t.id===0||t.id)&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.properties=e||{},r.geometry=n,r}function Xe(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Hh(n[0])||!Hh(n[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:n};return bn(r,e,t)}function ar(n,e,t){t===void 0&&(t={});for(var r=0,i=n;r<i.length;r++){var s=i[r];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:n};return bn(a,e,t)}function On(n,e,t){if(t===void 0&&(t={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:n};return bn(r,e,t)}function el(n,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function Ic(n,e,t){t===void 0&&(t={});var r={type:"MultiPolygon",coordinates:n};return bn(r,e,t)}function Tc(n,e){e===void 0&&(e="kilometers");var t=Yh[e];if(!t)throw new Error(e+" units is invalid");return n*t}function Nc(n,e){e===void 0&&(e="kilometers");var t=Yh[e];if(!t)throw new Error(e+" units is invalid");return n/t}function Pu(n){var e=n%(2*Math.PI);return e*180/Math.PI}function $t(n){var e=n%360;return e*Math.PI/180}function Dc(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return Tc(Nc(n,e),t)}function Hh(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function lr(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Hs(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Jh(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}function Wr(n){return n.type==="Feature"?n.geometry:n}function xg(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}function Ul(n,e,t){if(t===void 0&&(t={}),t.final===!0)return Lg(n,e);var r=lr(n),i=lr(e),s=$t(r[0]),o=$t(i[0]),a=$t(r[1]),l=$t(i[1]),u=Math.sin(o-s)*Math.cos(l),h=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(o-s);return Pu(Math.atan2(u,h))}function Lg(n,e){var t=Ul(e,n);return t=(t+180)%360,t}function tl(n,e,t,r){r===void 0&&(r={});var i=lr(n),s=$t(i[0]),o=$t(i[1]),a=$t(t),l=Nc(e,r.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(a)),h=s+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u)),f=Pu(h),p=Pu(u);return Xe([f,p],r.properties)}function xi(n,e,t){t===void 0&&(t={});var r=lr(n),i=lr(e),s=$t(i[1]-r[1]),o=$t(i[0]-r[0]),a=$t(r[1]),l=$t(i[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(l);return Tc(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function Ag(n,e,t){t===void 0&&(t={});for(var r=Wr(n),i=r.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 l=Ul(i[o],i[o-1])-180,u=tl(i[o],a,l,t);return u}else return Xe(i[o])}else s+=xi(i[o],i[o+1],t);return Xe(i[i.length-1])}function Rg(n,e){const t=On(n);return Ag(t,e,{units:"meters"}).geometry.coordinates}function rl(n,e,t){if(n!==null)for(var r,i,s,o,a,l,u,h=0,f=0,p,v=n.type,w=v==="FeatureCollection",I=v==="Feature",T=w?n.features.length:1,L=0;L<T;L++){u=w?n.features[L].geometry:I?n.geometry:n,p=u?u.type==="GeometryCollection":!1,a=p?u.geometries.length:1;for(var m=0;m<a;m++){var _=0,g=0;if(o=p?u.geometries[m]:u,o!==null){l=o.coordinates;var y=o.type;switch(h=t&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(l,f,L,_,g)===!1)return!1;f++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(e(l[r],f,L,_,g)===!1)return!1;f++,y==="MultiPoint"&&_++}y==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(e(l[r][i],f,L,_,g)===!1)return!1;f++}y==="MultiLineString"&&_++,y==="Polygon"&&g++}y==="Polygon"&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(g=0,i=0;i<l[r].length;i++){for(s=0;s<l[r][i].length-h;s++){if(e(l[r][i][s],f,L,_,g)===!1)return!1;f++}g++}_++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(rl(o.geometries[r],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iu(n,e){if(n.type==="Feature")e(n,0);else if(n.type==="FeatureCollection")for(var t=0;t<n.features.length&&e(n.features[t],t)!==!1;t++);}function Tu(n,e){var t,r,i,s,o,a,l,u,h,f,p=0,v=n.type==="FeatureCollection",w=n.type==="Feature",I=v?n.features.length:1;for(t=0;t<I;t++){for(a=v?n.features[t].geometry:w?n.geometry:n,u=v?n.features[t].properties:w?n.properties:{},h=v?n.features[t].bbox:w?n.bbox:void 0,f=v?n.features[t].id:w?n.id:void 0,l=a?a.type==="GeometryCollection":!1,o=l?a.geometries.length:1,i=0;i<o;i++){if(s=l?a.geometries[i]:a,s===null){if(e(null,p,u,h,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,p,u,h,f)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(e(s.geometries[r],p,u,h,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}p++}}function Fg(n,e,t){var r=t;return Tu(n,function(i,s,o,a,l){r=e(r,i,s,o,a,l)}),r}function bc(n,e){Tu(n,function(t,r,i,s,o){var a=t===null?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(bn(t,i,{bbox:s,id:o}),r,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],f={type:l,coordinates:h};if(e(bn(f,i),r,u)===!1)return!1}})}function kg(n,e){bc(n,function(t,r,i){var s=0;if(t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,l=0,u=0,h=0;if(rl(t,function(f,p,v,w,I){if(a===void 0||r>l||w>u||I>h){a=f,l=r,u=w,h=I,s=0;return}var T=On([a,f],t.properties);if(e(T,r,i,I,s)===!1)return!1;s++,a=f})===!1)return!1}}})}var Zh=6378137;function Vg(n){return Fg(n,function(e,t){return e+zg(t)},0)}function zg(n){var e=0,t;switch(n.type){case"Polygon":return Kh(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)e+=Kh(n.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Kh(n){var e=0;if(n&&n.length>0){e+=Math.abs(Qh(n[0]));for(var t=1;t<n.length;t++)e-=Math.abs(Qh(n[t]))}return e}function Qh(n){var e,t,r,i,s,o,a,l=0,u=n.length;if(u>2){for(a=0;a<u;a++)a===u-2?(i=u-2,s=u-1,o=0):a===u-1?(i=u-1,s=0,o=1):(i=a,s=a+1,o=a+2),e=n[i],t=n[s],r=n[o],l+=(Oc(r[0])-Oc(e[0]))*Math.sin(Oc(t[1]));l=l*Zh*Zh/2}return l}function Oc(n){return n*Math.PI/180}function Mc(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const e=ar([n]);return Vg(e)}function Bh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ug(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Nu={exports:{}},Du={exports:{}},Gg=Du.exports,$h;function jh(){return $h||($h=1,function(n,e){(function(t,r){n.exports=r()})(Gg,function(){function t(m,_,g,y,E){(function C(N,b,x,D,O){for(;D>x;){if(D-x>600){var A=D-x+1,k=b-x+1,B=Math.log(A),X=.5*Math.exp(2*B/3),ne=.5*Math.sqrt(B*X*(A-X)/A)*(k-A/2<0?-1:1),ce=Math.max(x,Math.floor(b-k*X/A+ne)),de=Math.min(D,Math.floor(b+(A-k)*X/A+ne));C(N,b,ce,de,O)}var K=N[b],$=x,ee=D;for(r(N,x,b),O(N[D],K)>0&&r(N,x,D);$<ee;){for(r(N,$,ee),$++,ee--;O(N[$],K)<0;)$++;for(;O(N[ee],K)>0;)ee--}O(N[x],K)===0?r(N,x,ee):r(N,++ee,D),ee<=b&&(x=ee+1),b<=ee&&(D=ee-1)}})(m,_,g||0,y||m.length-1,E||i)}function r(m,_,g){var y=m[_];m[_]=m[g],m[g]=y}function i(m,_){return m<_?-1:m>_?1:0}var s=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(m,_,g){if(!g)return _.indexOf(m);for(var y=0;y<_.length;y++)if(g(m,_[y]))return y;return-1}function a(m,_){l(m,0,m.children.length,_,m)}function l(m,_,g,y,E){E||(E=T(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var C=_;C<g;C++){var N=m.children[C];u(E,m.leaf?y(N):N)}return E}function u(m,_){return m.minX=Math.min(m.minX,_.minX),m.minY=Math.min(m.minY,_.minY),m.maxX=Math.max(m.maxX,_.maxX),m.maxY=Math.max(m.maxY,_.maxY),m}function h(m,_){return m.minX-_.minX}function f(m,_){return m.minY-_.minY}function p(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function v(m){return m.maxX-m.minX+(m.maxY-m.minY)}function w(m,_){return m.minX<=_.minX&&m.minY<=_.minY&&_.maxX<=m.maxX&&_.maxY<=m.maxY}function I(m,_){return _.minX<=m.maxX&&_.minY<=m.maxY&&_.maxX>=m.minX&&_.maxY>=m.minY}function T(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function L(m,_,g,y,E){for(var C=[_,g];C.length;)if(!((g=C.pop())-(_=C.pop())<=y)){var N=_+Math.ceil((g-_)/y/2)*y;t(m,N,_,g,E),C.push(_,N,N,g)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(m){var _=this.data,g=[];if(!I(m,_))return g;for(var y=this.toBBox,E=[];_;){for(var C=0;C<_.children.length;C++){var N=_.children[C],b=_.leaf?y(N):N;I(m,b)&&(_.leaf?g.push(N):w(m,b)?this._all(N,g):E.push(N))}_=E.pop()}return g},s.prototype.collides=function(m){var _=this.data;if(!I(m,_))return!1;for(var g=[];_;){for(var y=0;y<_.children.length;y++){var E=_.children[y],C=_.leaf?this.toBBox(E):E;if(I(m,C)){if(_.leaf||w(m,C))return!0;g.push(E)}}_=g.pop()}return!1},s.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var _=0;_<m.length;_++)this.insert(m[_]);return this}var g=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===g.height)this._splitRoot(this.data,g);else{if(this.data.height<g.height){var y=this.data;this.data=g,g=y}this._insert(g,this.data.height-g.height-1,!0)}else this.data=g;return this},s.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},s.prototype.clear=function(){return this.data=T([]),this},s.prototype.remove=function(m,_){if(!m)return this;for(var g,y,E,C=this.data,N=this.toBBox(m),b=[],x=[];C||b.length;){if(C||(C=b.pop(),y=b[b.length-1],g=x.pop(),E=!0),C.leaf){var D=o(m,C.children,_);if(D!==-1)return C.children.splice(D,1),b.push(C),this._condense(b),this}E||C.leaf||!w(C,N)?y?(g++,C=y.children[g],E=!1):C=null:(b.push(C),x.push(g),g=0,y=C,C=C.children[0])}return this},s.prototype.toBBox=function(m){return m},s.prototype.compareMinX=function(m,_){return m.minX-_.minX},s.prototype.compareMinY=function(m,_){return m.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(m){return this.data=m,this},s.prototype._all=function(m,_){for(var g=[];m;)m.leaf?_.push.apply(_,m.children):g.push.apply(g,m.children),m=g.pop();return _},s.prototype._build=function(m,_,g,y){var E,C=g-_+1,N=this._maxEntries;if(C<=N)return a(E=T(m.slice(_,g+1)),this.toBBox),E;y||(y=Math.ceil(Math.log(C)/Math.log(N)),N=Math.ceil(C/Math.pow(N,y-1))),(E=T([])).leaf=!1,E.height=y;var b=Math.ceil(C/N),x=b*Math.ceil(Math.sqrt(N));L(m,_,g,x,this.compareMinX);for(var D=_;D<=g;D+=x){var O=Math.min(D+x-1,g);L(m,D,O,b,this.compareMinY);for(var A=D;A<=O;A+=b){var k=Math.min(A+b-1,O);E.children.push(this._build(m,A,k,y-1))}}return a(E,this.toBBox),E},s.prototype._chooseSubtree=function(m,_,g,y){for(;y.push(_),!_.leaf&&y.length-1!==g;){for(var E=1/0,C=1/0,N=void 0,b=0;b<_.children.length;b++){var x=_.children[b],D=p(x),O=(A=m,k=x,(Math.max(k.maxX,A.maxX)-Math.min(k.minX,A.minX))*(Math.max(k.maxY,A.maxY)-Math.min(k.minY,A.minY))-D);O<C?(C=O,E=D<E?D:E,N=x):O===C&&D<E&&(E=D,N=x)}_=N||_.children[0]}var A,k;return _},s.prototype._insert=function(m,_,g){var y=g?m:this.toBBox(m),E=[],C=this._chooseSubtree(y,this.data,_,E);for(C.children.push(m),u(C,y);_>=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(y,E,_)},s.prototype._split=function(m,_){var g=m[_],y=g.children.length,E=this._minEntries;this._chooseSplitAxis(g,E,y);var C=this._chooseSplitIndex(g,E,y),N=T(g.children.splice(C,g.children.length-C));N.height=g.height,N.leaf=g.leaf,a(g,this.toBBox),a(N,this.toBBox),_?m[_-1].children.push(N):this._splitRoot(g,N)},s.prototype._splitRoot=function(m,_){this.data=T([m,_]),this.data.height=m.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(m,_,g){for(var y,E,C,N,b,x,D,O=1/0,A=1/0,k=_;k<=g-_;k++){var B=l(m,0,k,this.toBBox),X=l(m,k,g,this.toBBox),ne=(E=B,C=X,N=void 0,b=void 0,x=void 0,D=void 0,N=Math.max(E.minX,C.minX),b=Math.max(E.minY,C.minY),x=Math.min(E.maxX,C.maxX),D=Math.min(E.maxY,C.maxY),Math.max(0,x-N)*Math.max(0,D-b)),ce=p(B)+p(X);ne<O?(O=ne,y=k,A=ce<A?ce:A):ne===O&&ce<A&&(A=ce,y=k)}return y||g-_},s.prototype._chooseSplitAxis=function(m,_,g){var y=m.leaf?this.compareMinX:h,E=m.leaf?this.compareMinY:f;this._allDistMargin(m,_,g,y)<this._allDistMargin(m,_,g,E)&&m.children.sort(y)},s.prototype._allDistMargin=function(m,_,g,y){m.children.sort(y);for(var E=this.toBBox,C=l(m,0,_,E),N=l(m,g-_,g,E),b=v(C)+v(N),x=_;x<g-_;x++){var D=m.children[x];u(C,m.leaf?E(D):D),b+=v(C)}for(var O=g-_-1;O>=_;O--){var A=m.children[O];u(N,m.leaf?E(A):A),b+=v(N)}return b},s.prototype._adjustParentBBoxes=function(m,_,g){for(var y=g;y>=0;y--)u(_[y],m)},s.prototype._condense=function(m){for(var _=m.length-1,g=void 0;_>=0;_--)m[_].children.length===0?_>0?(g=m[_-1].children).splice(g.indexOf(m[_]),1):this.clear():a(m[_],this.toBBox)},s})}(Du)),Du.exports}class Wg{constructor(e=[],t=qg){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}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:r}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(r(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1,a=t[o];const l=o+1;if(l<this.length&&r(t[l],a)<0&&(o=l,a=t[l]),r(a,s)>=0)break;t[e]=a,e=o}t[e]=s}}function qg(n,e){return n<e?-1:n>e?1:0}const Xg=Ug(Object.freeze(Object.defineProperty({__proto__:null,default:Wg},Symbol.toStringTag,{value:"Module"})));var Gl={exports:{}},xc,ef;function Yg(){return ef||(ef=1,xc=function(e,t,r,i){var s=e[0],o=e[1],a=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,h=l-1;u<l;h=u++){var f=t[r+u*2+0],p=t[r+u*2+1],v=t[r+h*2+0],w=t[r+h*2+1],I=p>o!=w>o&&s<(v-f)*(o-p)/(w-p)+f;I&&(a=!a)}return a}),xc}var Lc,tf;function Hg(){return tf||(tf=1,Lc=function(e,t,r,i){var s=e[0],o=e[1],a=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,h=l-1;u<l;h=u++){var f=t[u+r][0],p=t[u+r][1],v=t[h+r][0],w=t[h+r][1],I=p>o!=w>o&&s<(v-f)*(o-p)/(w-p)+f;I&&(a=!a)}return a}),Lc}var rf;function Jg(){if(rf)return Gl.exports;rf=1;var n=Yg(),e=Hg();return Gl.exports=function(r,i,s,o){return i.length>0&&Array.isArray(i[0])?e(r,i,s,o):n(r,i,s,o)},Gl.exports.nested=e,Gl.exports.flat=n,Gl.exports}var Wl={exports:{}},Zg=Wl.exports,nf;function Kg(){return nf||(nf=1,function(n,e){(function(t,r){r(e)})(Zg,function(t){const i=33306690738754706e-32;function s(I,T,L,m,_){let g,y,E,C,N=T[0],b=m[0],x=0,D=0;b>N==b>-N?(g=N,N=T[++x]):(g=b,b=m[++D]);let O=0;if(x<I&&D<L)for(b>N==b>-N?(E=g-((y=N+g)-N),N=T[++x]):(E=g-((y=b+g)-b),b=m[++D]),g=y,E!==0&&(_[O++]=E);x<I&&D<L;)b>N==b>-N?(E=g-((y=g+N)-(C=y-g))+(N-C),N=T[++x]):(E=g-((y=g+b)-(C=y-g))+(b-C),b=m[++D]),g=y,E!==0&&(_[O++]=E);for(;x<I;)E=g-((y=g+N)-(C=y-g))+(N-C),N=T[++x],g=y,E!==0&&(_[O++]=E);for(;D<L;)E=g-((y=g+b)-(C=y-g))+(b-C),b=m[++D],g=y,E!==0&&(_[O++]=E);return g===0&&O!==0||(_[O++]=g),O}function o(I){return new Float64Array(I)}const a=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,h=o(4),f=o(8),p=o(12),v=o(16),w=o(4);t.orient2d=function(I,T,L,m,_,g){const y=(T-g)*(L-_),E=(I-_)*(m-g),C=y-E;if(y===0||E===0||y>0!=E>0)return C;const N=Math.abs(y+E);return Math.abs(C)>=a*N?C:-function(b,x,D,O,A,k,B){let X,ne,ce,de,K,$,ee,ye,Oe,Ce,Pe,Fe,gt,lt,kr,Vr,Mi,zr;const Ur=b-A,Gr=D-A,ti=x-k,ri=O-k;K=(kr=(ye=Ur-(ee=($=134217729*Ur)-($-Ur)))*(Ce=ri-(Oe=($=134217729*ri)-($-ri)))-((lt=Ur*ri)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ti-(ee=($=134217729*ti)-($-ti)))*(Ce=Gr-(Oe=($=134217729*Gr)-($-Gr)))-((Vr=ti*Gr)-ee*Oe-ye*Oe-ee*Ce))),h[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),h[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,h[2]=Fe-(zr-K)+(Pe-K),h[3]=zr;let Xs=function(A0,Zp){let Kp=Zp[0];for(let Lh=1;Lh<A0;Lh++)Kp+=Zp[Lh];return Kp}(4,h),wu=l*B;if(Xs>=wu||-Xs>=wu||(X=b-(Ur+(K=b-Ur))+(K-A),ce=D-(Gr+(K=D-Gr))+(K-A),ne=x-(ti+(K=x-ti))+(K-k),de=O-(ri+(K=O-ri))+(K-k),X===0&&ne===0&&ce===0&&de===0)||(wu=u*B+i*Math.abs(Xs),(Xs+=Ur*de+ri*X-(ti*ce+Gr*ne))>=wu||-Xs>=wu))return Xs;K=(kr=(ye=X-(ee=($=134217729*X)-($-X)))*(Ce=ri-(Oe=($=134217729*ri)-($-ri)))-((lt=X*ri)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ne-(ee=($=134217729*ne)-($-ne)))*(Ce=Gr-(Oe=($=134217729*Gr)-($-Gr)))-((Vr=ne*Gr)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const M0=s(4,h,4,w,f);K=(kr=(ye=Ur-(ee=($=134217729*Ur)-($-Ur)))*(Ce=de-(Oe=($=134217729*de)-($-de)))-((lt=Ur*de)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ti-(ee=($=134217729*ti)-($-ti)))*(Ce=ce-(Oe=($=134217729*ce)-($-ce)))-((Vr=ti*ce)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const x0=s(M0,f,4,w,p);K=(kr=(ye=X-(ee=($=134217729*X)-($-X)))*(Ce=de-(Oe=($=134217729*de)-($-de)))-((lt=X*de)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ne-(ee=($=134217729*ne)-($-ne)))*(Ce=ce-(Oe=($=134217729*ce)-($-ce)))-((Vr=ne*ce)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const L0=s(x0,p,4,w,v);return v[L0-1]}(I,T,L,m,_,g,N)},t.orient2dfast=function(I,T,L,m,_,g){return(T-g)*(L-_)-(I-_)*(m-g)},Object.defineProperty(t,"__esModule",{value:!0})})}(Wl,Wl.exports)),Wl.exports}var sf;function Qg(){if(sf)return Nu.exports;sf=1;var n=jh(),e=Xg,t=Jg(),r=Kg().orient2d;e.default&&(e=e.default),Nu.exports=i,Nu.exports.default=i;function i(g,y,E){y=Math.max(0,y===void 0?2:y),E=E||0;var C=v(g),N=new n(16);N.toBBox=function(ee){return{minX:ee[0],minY:ee[1],maxX:ee[0],maxY:ee[1]}},N.compareMinX=function(ee,ye){return ee[0]-ye[0]},N.compareMinY=function(ee,ye){return ee[1]-ye[1]},N.load(g);for(var b=[],x=0,D;x<C.length;x++){var O=C[x];N.remove(O),D=w(O,D),b.push(D)}var A=new n(16);for(x=0;x<b.length;x++)A.insert(p(b[x]));for(var k=y*y,B=E*E;b.length;){var X=b.shift(),ne=X.p,ce=X.next.p,de=I(ne,ce);if(!(de<B)){var K=de/k;O=s(N,X.prev.p,ne,ce,X.next.next.p,K,A),O&&Math.min(I(O,ne),I(O,ce))<=K&&(b.push(X),b.push(w(O,X)),N.remove(O),A.remove(X),A.insert(p(X)),A.insert(p(X.next)))}}X=D;var $=[];do $.push(X.p),X=X.next;while(X!==D);return $.push(X.p),$}function s(g,y,E,C,N,b,x){for(var D=new e([],o),O=g.data;O;){for(var A=0;A<O.children.length;A++){var k=O.children[A],B=O.leaf?T(k,E,C):a(E,C,k);B>b||D.push({node:k,dist:B})}for(;D.length&&!D.peek().node.children;){var X=D.pop(),ne=X.node,ce=T(ne,y,E),de=T(ne,C,N);if(X.dist<ce&&X.dist<de&&u(E,ne,x)&&u(C,ne,x))return ne}O=D.pop(),O&&(O=O.node)}return null}function o(g,y){return g.dist-y.dist}function a(g,y,E){if(l(g,E)||l(y,E))return 0;var C=L(g[0],g[1],y[0],y[1],E.minX,E.minY,E.maxX,E.minY);if(C===0)return 0;var N=L(g[0],g[1],y[0],y[1],E.minX,E.minY,E.minX,E.maxY);if(N===0)return 0;var b=L(g[0],g[1],y[0],y[1],E.maxX,E.minY,E.maxX,E.maxY);if(b===0)return 0;var x=L(g[0],g[1],y[0],y[1],E.minX,E.maxY,E.maxX,E.maxY);return x===0?0:Math.min(C,N,b,x)}function l(g,y){return g[0]>=y.minX&&g[0]<=y.maxX&&g[1]>=y.minY&&g[1]<=y.maxY}function u(g,y,E){for(var C=Math.min(g[0],y[0]),N=Math.min(g[1],y[1]),b=Math.max(g[0],y[0]),x=Math.max(g[1],y[1]),D=E.search({minX:C,minY:N,maxX:b,maxY:x}),O=0;O<D.length;O++)if(f(D[O].p,D[O].next.p,g,y))return!1;return!0}function h(g,y,E){return r(g[0],g[1],y[0],y[1],E[0],E[1])}function f(g,y,E,C){return g!==C&&y!==E&&h(g,y,E)>0!=h(g,y,C)>0&&h(E,C,g)>0!=h(E,C,y)>0}function p(g){var y=g.p,E=g.next.p;return g.minX=Math.min(y[0],E[0]),g.minY=Math.min(y[1],E[1]),g.maxX=Math.max(y[0],E[0]),g.maxY=Math.max(y[1],E[1]),g}function v(g){for(var y=g[0],E=g[0],C=g[0],N=g[0],b=0;b<g.length;b++){var x=g[b];x[0]<y[0]&&(y=x),x[0]>C[0]&&(C=x),x[1]<E[1]&&(E=x),x[1]>N[1]&&(N=x)}var D=[y,E,C,N],O=D.slice();for(b=0;b<g.length;b++)t(g[b],D)||O.push(g[b]);return _(O)}function w(g,y){var E={p:g,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return y?(E.next=y.next,E.prev=y,y.next.prev=E,y.next=E):(E.prev=E,E.next=E),E}function I(g,y){var E=g[0]-y[0],C=g[1]-y[1];return E*E+C*C}function T(g,y,E){var C=y[0],N=y[1],b=E[0]-C,x=E[1]-N;if(b!==0||x!==0){var D=((g[0]-C)*b+(g[1]-N)*x)/(b*b+x*x);D>1?(C=E[0],N=E[1]):D>0&&(C+=b*D,N+=x*D)}return b=g[0]-C,x=g[1]-N,b*b+x*x}function L(g,y,E,C,N,b,x,D){var O=E-g,A=C-y,k=x-N,B=D-b,X=g-N,ne=y-b,ce=O*O+A*A,de=O*k+A*B,K=k*k+B*B,$=O*X+A*ne,ee=k*X+B*ne,ye=ce*K-de*de,Oe,Ce,Pe,Fe,gt=ye,lt=ye;ye===0?(Ce=0,gt=1,Fe=ee,lt=K):(Ce=de*ee-K*$,Fe=ce*ee-de*$,Ce<0?(Ce=0,Fe=ee,lt=K):Ce>gt&&(Ce=gt,Fe=ee+de,lt=K)),Fe<0?(Fe=0,-$<0?Ce=0:-$>ce?Ce=gt:(Ce=-$,gt=ce)):Fe>lt&&(Fe=lt,-$+de<0?Ce=0:-$+de>ce?Ce=gt:(Ce=-$+de,gt=ce)),Oe=Ce===0?0:Ce/gt,Pe=Fe===0?0:Fe/lt;var kr=(1-Oe)*g+Oe*E,Vr=(1-Oe)*y+Oe*C,Mi=(1-Pe)*N+Pe*x,zr=(1-Pe)*b+Pe*D,Ur=Mi-kr,Gr=zr-Vr;return Ur*Ur+Gr*Gr}function m(g,y){return g[0]===y[0]?g[1]-y[1]:g[0]-y[0]}function _(g){g.sort(m);for(var y=[],E=0;E<g.length;E++){for(;y.length>=2&&h(y[y.length-2],y[y.length-1],g[E])<=0;)y.pop();y.push(g[E])}for(var C=[],N=g.length-1;N>=0;N--){for(;C.length>=2&&h(C[C.length-2],C[C.length-1],g[N])<=0;)C.pop();C.push(g[N])}return C.pop(),y.pop(),y.concat(C)}return Nu.exports}var Bg=Qg();const $g=Bh(Bg);function jg(n,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(rl(n,function(i){t.push([i[0],i[1]])}),!t.length)return null;var r=$g(t,e.concavity);return r.length>3?ar([r]):null}function of(n,e){e===void 0&&(e={});var t=0,r=0,i=0;return rl(n,function(s){t+=s[0],r+=s[1],i++},!0),Xe([t/i,r/i],e.properties)}function af(n,e){switch(e===void 0&&(e={}),xg(n)){case"Point":return Xe(lr(n),e.properties);case"Polygon":var t=[];rl(n,function(g){t.push(g)});var r=of(n,{properties:e.properties}),i=r.geometry.coordinates,s=0,o=0,a=0,l,u,h,f,p,v,w,I,T=t.map(function(g){return[g[0]-i[0],g[1]-i[1]]});for(l=0;l<t.length-1;l++)u=T[l],f=u[0],v=u[1],h=T[l+1],p=h[0],w=h[1],I=f*w-p*v,a+=I,s+=(f+p)*I,o+=(v+w)*I;if(a===0)return r;var L=a*.5,m=1/(6*L);return Xe([i[0]+m*s,i[1]+m*o],e.properties);default:var _=jg(n);return _?af(_,{properties:e.properties}):of(n,{properties:e.properties})}}function em(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const e=ar([n]),r=af(e).geometry.coordinates;return[r[0],r[1],r[2]??n[0][2]??0]}function tm(n,e,t,r){const[i,s,o]=n,a=tl(Xe([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function Ac(n,e){return xi(Xe(n),Xe(e),{units:"meters"})}function bu(n,e){return Ul(Xe(n),Xe(e))}function lf(n){if(!n)throw new Error("geojson is required");var e=[];return bc(n,function(t){rm(t,e)}),el(e)}function rm(n,e){var t=[],r=n.geometry;if(r!==null){switch(r.type){case"Polygon":t=Hs(r);break;case"LineString":t=[Hs(r)]}t.forEach(function(i){var s=nm(i,n.properties);s.forEach(function(o){o.id=e.length,e.push(o)})})}}function nm(n,e){var t=[];return n.reduce(function(r,i){var s=On([r,i],e);return s.bbox=im(r,i),t.push(s),i}),t}function im(n,e){var t=n[0],r=n[1],i=e[0],s=e[1],o=t<i?t:i,a=r<s?r:s,l=t>i?t:i,u=r>s?r:s;return[o,a,l,u]}var Ou={exports:{}},Rc={},uf;function cf(){return uf||(uf=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.earthRadius=63710088e-1,n.factors={centimeters:n.earthRadius*100,centimetres:n.earthRadius*100,degrees:n.earthRadius/111325,feet:n.earthRadius*3.28084,inches:n.earthRadius*39.37,kilometers:n.earthRadius/1e3,kilometres:n.earthRadius/1e3,meters:n.earthRadius,metres:n.earthRadius,miles:n.earthRadius/1609.344,millimeters:n.earthRadius*1e3,millimetres:n.earthRadius*1e3,nauticalmiles:n.earthRadius/1852,radians:1,yards:n.earthRadius*1.0936},n.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/n.earthRadius,yards:1.0936133},n.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(D,O,A){A===void 0&&(A={});var k={type:"Feature"};return(A.id===0||A.id)&&(k.id=A.id),A.bbox&&(k.bbox=A.bbox),k.properties=O||{},k.geometry=D,k}n.feature=e;function t(D,O,A){switch(D){case"Point":return r(O).geometry;case"LineString":return a(O).geometry;case"Polygon":return s(O).geometry;case"MultiPoint":return f(O).geometry;case"MultiLineString":return h(O).geometry;case"MultiPolygon":return p(O).geometry;default:throw new Error(D+" is invalid")}}n.geometry=t;function r(D,O,A){if(A===void 0&&(A={}),!D)throw new Error("coordinates is required");if(!Array.isArray(D))throw new Error("coordinates must be an Array");if(D.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!C(D[0])||!C(D[1]))throw new Error("coordinates must contain numbers");var k={type:"Point",coordinates:D};return e(k,O,A)}n.point=r;function i(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return r(k,O)}),A)}n.points=i;function s(D,O,A){A===void 0&&(A={});for(var k=0,B=D;k<B.length;k++){var X=B[k];if(X.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ne=0;ne<X[X.length-1].length;ne++)if(X[X.length-1][ne]!==X[0][ne])throw new Error("First and last Position are not equivalent.")}var ce={type:"Polygon",coordinates:D};return e(ce,O,A)}n.polygon=s;function o(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return s(k,O)}),A)}n.polygons=o;function a(D,O,A){if(A===void 0&&(A={}),D.length<2)throw new Error("coordinates must be an array of two or more positions");var k={type:"LineString",coordinates:D};return e(k,O,A)}n.lineString=a;function l(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return a(k,O)}),A)}n.lineStrings=l;function u(D,O){O===void 0&&(O={});var A={type:"FeatureCollection"};return O.id&&(A.id=O.id),O.bbox&&(A.bbox=O.bbox),A.features=D,A}n.featureCollection=u;function h(D,O,A){A===void 0&&(A={});var k={type:"MultiLineString",coordinates:D};return e(k,O,A)}n.multiLineString=h;function f(D,O,A){A===void 0&&(A={});var k={type:"MultiPoint",coordinates:D};return e(k,O,A)}n.multiPoint=f;function p(D,O,A){A===void 0&&(A={});var k={type:"MultiPolygon",coordinates:D};return e(k,O,A)}n.multiPolygon=p;function v(D,O,A){A===void 0&&(A={});var k={type:"GeometryCollection",geometries:D};return e(k,O,A)}n.geometryCollection=v;function w(D,O){if(O===void 0&&(O=0),O&&!(O>=0))throw new Error("precision must be a positive number");var A=Math.pow(10,O||0);return Math.round(D*A)/A}n.round=w;function I(D,O){O===void 0&&(O="kilometers");var A=n.factors[O];if(!A)throw new Error(O+" units is invalid");return D*A}n.radiansToLength=I;function T(D,O){O===void 0&&(O="kilometers");var A=n.factors[O];if(!A)throw new Error(O+" units is invalid");return D/A}n.lengthToRadians=T;function L(D,O){return _(T(D,O))}n.lengthToDegrees=L;function m(D){var O=D%360;return O<0&&(O+=360),O}n.bearingToAzimuth=m;function _(D){var O=D%(2*Math.PI);return O*180/Math.PI}n.radiansToDegrees=_;function g(D){var O=D%360;return O*Math.PI/180}n.degreesToRadians=g;function y(D,O,A){if(O===void 0&&(O="kilometers"),A===void 0&&(A="kilometers"),!(D>=0))throw new Error("length must be a positive number");return I(T(D,O),A)}n.convertLength=y;function E(D,O,A){if(O===void 0&&(O="meters"),A===void 0&&(A="kilometers"),!(D>=0))throw new Error("area must be a positive number");var k=n.areaFactors[O];if(!k)throw new Error("invalid original units");var B=n.areaFactors[A];if(!B)throw new Error("invalid final units");return D/k*B}n.convertArea=E;function C(D){return!isNaN(D)&&D!==null&&!Array.isArray(D)}n.isNumber=C;function N(D){return!!D&&D.constructor===Object}n.isObject=N;function b(D){if(!D)throw new Error("bbox is required");if(!Array.isArray(D))throw new Error("bbox must be an Array");if(D.length!==4&&D.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");D.forEach(function(O){if(!C(O))throw new Error("bbox must only contain numbers")})}n.validateBBox=b;function x(D){if(!D)throw new Error("id is required");if(["string","number"].indexOf(typeof D)===-1)throw new Error("id must be a number or a string")}n.validateId=x}(Rc)),Rc}var mt={},hf;function ff(){if(hf)return mt;hf=1,Object.defineProperty(mt,"__esModule",{value:!0});var n=cf();function e(m,_,g){if(m!==null)for(var y,E,C,N,b,x,D,O=0,A=0,k,B=m.type,X=B==="FeatureCollection",ne=B==="Feature",ce=X?m.features.length:1,de=0;de<ce;de++){D=X?m.features[de].geometry:ne?m.geometry:m,k=D?D.type==="GeometryCollection":!1,b=k?D.geometries.length:1;for(var K=0;K<b;K++){var $=0,ee=0;if(N=k?D.geometries[K]:D,N!==null){x=N.coordinates;var ye=N.type;switch(O=g&&(ye==="Polygon"||ye==="MultiPolygon")?1:0,ye){case null:break;case"Point":if(_(x,A,de,$,ee)===!1)return!1;A++,$++;break;case"LineString":case"MultiPoint":for(y=0;y<x.length;y++){if(_(x[y],A,de,$,ee)===!1)return!1;A++,ye==="MultiPoint"&&$++}ye==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(y=0;y<x.length;y++){for(E=0;E<x[y].length-O;E++){if(_(x[y][E],A,de,$,ee)===!1)return!1;A++}ye==="MultiLineString"&&$++,ye==="Polygon"&&ee++}ye==="Polygon"&&$++;break;case"MultiPolygon":for(y=0;y<x.length;y++){for(ee=0,E=0;E<x[y].length;E++){for(C=0;C<x[y][E].length-O;C++){if(_(x[y][E][C],A,de,$,ee)===!1)return!1;A++}ee++}$++}break;case"GeometryCollection":for(y=0;y<N.geometries.length;y++)if(e(N.geometries[y],_,g)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function t(m,_,g,y){var E=g;return e(m,function(C,N,b,x,D){N===0&&g===void 0?E=C:E=_(E,C,N,b,x,D)},y),E}function r(m,_){var g;switch(m.type){case"FeatureCollection":for(g=0;g<m.features.length&&_(m.features[g].properties,g)!==!1;g++);break;case"Feature":_(m.properties,0);break}}function i(m,_,g){var y=g;return r(m,function(E,C){C===0&&g===void 0?y=E:y=_(y,E,C)}),y}function s(m,_){if(m.type==="Feature")_(m,0);else if(m.type==="FeatureCollection")for(var g=0;g<m.features.length&&_(m.features[g],g)!==!1;g++);}function o(m,_,g){var y=g;return s(m,function(E,C){C===0&&g===void 0?y=E:y=_(y,E,C)}),y}function a(m){var _=[];return e(m,function(g){_.push(g)}),_}function l(m,_){var g,y,E,C,N,b,x,D,O,A,k=0,B=m.type==="FeatureCollection",X=m.type==="Feature",ne=B?m.features.length:1;for(g=0;g<ne;g++){for(b=B?m.features[g].geometry:X?m.geometry:m,D=B?m.features[g].properties:X?m.properties:{},O=B?m.features[g].bbox:X?m.bbox:void 0,A=B?m.features[g].id:X?m.id:void 0,x=b?b.type==="GeometryCollection":!1,N=x?b.geometries.length:1,E=0;E<N;E++){if(C=x?b.geometries[E]:b,C===null){if(_(null,k,D,O,A)===!1)return!1;continue}switch(C.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(C,k,D,O,A)===!1)return!1;break}case"GeometryCollection":{for(y=0;y<C.geometries.length;y++)if(_(C.geometries[y],k,D,O,A)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}k++}}function u(m,_,g){var y=g;return l(m,function(E,C,N,b,x){C===0&&g===void 0?y=E:y=_(y,E,C,N,b,x)}),y}function h(m,_){l(m,function(g,y,E,C,N){var b=g===null?null:g.type;switch(b){case null:case"Point":case"LineString":case"Polygon":return _(n.feature(g,E,{bbox:C,id:N}),y,0)===!1?!1:void 0}var x;switch(b){case"MultiPoint":x="Point";break;case"MultiLineString":x="LineString";break;case"MultiPolygon":x="Polygon";break}for(var D=0;D<g.coordinates.length;D++){var O=g.coordinates[D],A={type:x,coordinates:O};if(_(n.feature(A,E),y,D)===!1)return!1}})}function f(m,_,g){var y=g;return h(m,function(E,C,N){C===0&&N===0&&g===void 0?y=E:y=_(y,E,C,N)}),y}function p(m,_){h(m,function(g,y,E){var C=0;if(g.geometry){var N=g.geometry.type;if(!(N==="Point"||N==="MultiPoint")){var b,x=0,D=0,O=0;if(e(g,function(A,k,B,X,ne){if(b===void 0||y>x||X>D||ne>O){b=A,x=y,D=X,O=ne,C=0;return}var ce=n.lineString([b,A],g.properties);if(_(ce,y,E,ne,C)===!1)return!1;C++,b=A})===!1)return!1}}})}function v(m,_,g){var y=g,E=!1;return p(m,function(C,N,b,x,D){E===!1&&g===void 0?y=C:y=_(y,C,N,b,x,D),E=!0}),y}function w(m,_){if(!m)throw new Error("geojson is required");h(m,function(g,y,E){if(g.geometry!==null){var C=g.geometry.type,N=g.geometry.coordinates;switch(C){case"LineString":if(_(g,y,E,0,0)===!1)return!1;break;case"Polygon":for(var b=0;b<N.length;b++)if(_(n.lineString(N[b],g.properties),y,E,b)===!1)return!1;break}}})}function I(m,_,g){var y=g;return w(m,function(E,C,N,b){C===0&&g===void 0?y=E:y=_(y,E,C,N,b)}),y}function T(m,_){if(_=_||{},!n.isObject(_))throw new Error("options is invalid");var g=_.featureIndex||0,y=_.multiFeatureIndex||0,E=_.geometryIndex||0,C=_.segmentIndex||0,N=_.properties,b;switch(m.type){case"FeatureCollection":g<0&&(g=m.features.length+g),N=N||m.features[g].properties,b=m.features[g].geometry;break;case"Feature":N=N||m.properties,b=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":b=m;break;default:throw new Error("geojson is invalid")}if(b===null)return null;var x=b.coordinates;switch(b.type){case"Point":case"MultiPoint":return null;case"LineString":return C<0&&(C=x.length+C-1),n.lineString([x[C],x[C+1]],N,_);case"Polygon":return E<0&&(E=x.length+E),C<0&&(C=x[E].length+C-1),n.lineString([x[E][C],x[E][C+1]],N,_);case"MultiLineString":return y<0&&(y=x.length+y),C<0&&(C=x[y].length+C-1),n.lineString([x[y][C],x[y][C+1]],N,_);case"MultiPolygon":return y<0&&(y=x.length+y),E<0&&(E=x[y].length+E),C<0&&(C=x[y][E].length-C-1),n.lineString([x[y][E][C],x[y][E][C+1]],N,_)}throw new Error("geojson is invalid")}function L(m,_){if(_=_||{},!n.isObject(_))throw new Error("options is invalid");var g=_.featureIndex||0,y=_.multiFeatureIndex||0,E=_.geometryIndex||0,C=_.coordIndex||0,N=_.properties,b;switch(m.type){case"FeatureCollection":g<0&&(g=m.features.length+g),N=N||m.features[g].properties,b=m.features[g].geometry;break;case"Feature":N=N||m.properties,b=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":b=m;break;default:throw new Error("geojson is invalid")}if(b===null)return null;var x=b.coordinates;switch(b.type){case"Point":return n.point(x,N,_);case"MultiPoint":return y<0&&(y=x.length+y),n.point(x[y],N,_);case"LineString":return C<0&&(C=x.length+C),n.point(x[C],N,_);case"Polygon":return E<0&&(E=x.length+E),C<0&&(C=x[E].length+C),n.point(x[E][C],N,_);case"MultiLineString":return y<0&&(y=x.length+y),C<0&&(C=x[y].length+C),n.point(x[y][C],N,_);case"MultiPolygon":return y<0&&(y=x.length+y),E<0&&(E=x[y].length+E),C<0&&(C=x[y][E].length-C),n.point(x[y][E][C],N,_)}throw new Error("geojson is invalid")}return mt.coordAll=a,mt.coordEach=e,mt.coordReduce=t,mt.featureEach=s,mt.featureReduce=o,mt.findPoint=L,mt.findSegment=T,mt.flattenEach=h,mt.flattenReduce=f,mt.geomEach=l,mt.geomReduce=u,mt.lineEach=w,mt.lineReduce=I,mt.propEach=r,mt.propReduce=i,mt.segmentEach=p,mt.segmentReduce=v,mt}var Mu={},df;function sm(){if(df)return Mu;df=1,Object.defineProperty(Mu,"__esModule",{value:!0});var n=ff();function e(t){var r=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,function(i){r[0]>i[0]&&(r[0]=i[0]),r[1]>i[1]&&(r[1]=i[1]),r[2]<i[0]&&(r[2]=i[0]),r[3]<i[1]&&(r[3]=i[1])}),r}return e.default=e,Mu.default=e,Mu}var pf;function om(){if(pf)return Ou.exports;pf=1;var n=jh(),e=cf(),t=ff(),r=sm().default,i=t.featureEach;t.coordEach,e.polygon;var s=e.featureCollection;function o(a){var l=new n(a);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:r(u),n.prototype.insert.call(this,u)},l.load=function(u){var h=[];return Array.isArray(u)?u.forEach(function(f){if(f.type!=="Feature")throw new Error("invalid features");f.bbox=f.bbox?f.bbox:r(f),h.push(f)}):i(u,function(f){if(f.type!=="Feature")throw new Error("invalid features");f.bbox=f.bbox?f.bbox:r(f),h.push(f)}),n.prototype.load.call(this,h)},l.remove=function(u,h){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:r(u),n.prototype.remove.call(this,u,h)},l.clear=function(){return n.prototype.clear.call(this)},l.search=function(u){var h=n.prototype.search.call(this,this.toBBox(u));return s(h)},l.collides=function(u){return n.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=n.prototype.all.call(this);return s(u)},l.toJSON=function(){return n.prototype.toJSON.call(this)},l.fromJSON=function(u){return n.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var h;if(u.bbox)h=u.bbox;else if(Array.isArray(u)&&u.length===4)h=u;else if(Array.isArray(u)&&u.length===6)h=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")h=r(u);else if(u.type==="FeatureCollection")h=r(u);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},l}return Ou.exports=o,Ou.exports.default=o,Ou.exports}var am=om();const lm=Bh(am);function gf(n,e){var t={},r=[];if(n.type==="LineString"&&(n=bn(n)),e.type==="LineString"&&(e=bn(e)),n.type==="Feature"&&e.type==="Feature"&&n.geometry!==null&&e.geometry!==null&&n.geometry.type==="LineString"&&e.geometry.type==="LineString"&&n.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=mf(n,e);return i&&r.push(i),el(r)}var s=lm();return s.load(lf(e)),Iu(lf(n),function(o){Iu(s.search(o),function(a){var l=mf(o,a);if(l){var u=Hs(l).join(",");t[u]||(t[u]=!0,r.push(l))}})}),el(r)}function mf(n,e){var t=Hs(n),r=Hs(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(r.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],l=r[0][0],u=r[0][1],h=r[1][0],f=r[1][1],p=(f-u)*(o-i)-(h-l)*(a-s),v=(h-l)*(s-u)-(f-u)*(i-l),w=(o-i)*(s-u)-(a-s)*(i-l);if(p===0)return null;var I=v/p,T=w/p;if(I>=0&&I<=1&&T>=0&&T<=1){var L=i+I*(o-i),m=s+I*(a-s);return Xe([L,m])}return null}function um(n,e){return gf(On(n),On(e))}function cm(n,e){var t=xi(n,e),r=Ul(n,e),i=tl(n,t/2,r);return i}function hm(n,e){const t=Xe(n),r=Xe(e),i=cm(t,r),s=(n[2]+e[2])/2;return[...i.geometry.coordinates,s]}function fm(n,e,t){t===void 0&&(t={});var r=Xe([1/0,1/0],{dist:1/0}),i=0;return bc(n,function(s){for(var o=Hs(s),a=0;a<o.length-1;a++){var l=Xe(o[a]);l.properties.dist=xi(e,l,t);var u=Xe(o[a+1]);u.properties.dist=xi(e,u,t);var h=xi(l,u,t),f=Math.max(l.properties.dist,u.properties.dist),p=Ul(l,u),v=tl(e,f,p+90,t),w=tl(e,f,p-90,t),I=gf(On([v.geometry.coordinates,w.geometry.coordinates]),On([l.geometry.coordinates,u.geometry.coordinates])),T=null;I.features.length>0&&(T=I.features[0],T.properties.dist=xi(e,T,t),T.properties.location=i+xi(l,T,t)),l.properties.dist<r.properties.dist&&(r=l,r.properties.index=a,r.properties.location=i),u.properties.dist<r.properties.dist&&(r=u,r.properties.index=a+1,r.properties.location=i+h),T&&T.properties.dist<r.properties.dist&&(r=T,r.properties.index=a),i+=h}}),r}function dm(n,e){const t=Xe(e),r=On(n);return fm(r,t,{units:"meters"})}function vf(n,e,t){t===void 0&&(t={});var r=lr(n),i=lr(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var s=pm(r,i),o=Dc(s,"meters",t.units);return o}function pm(n,e,t){t=t===void 0?Ut:Number(t);var r=t,i=n[1]*Math.PI/180,s=e[1]*Math.PI/180,o=s-i,a=Math.abs(e[0]-n[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(l)>1e-11?o/l:Math.cos(i),h=Math.sqrt(o*o+u*u*a*a),f=h*r;return f}function gm(n,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!n)throw new Error("pt is required");if(Array.isArray(n)?n=Xe(n):n.type==="Point"?n=bn(n):Jh(n,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=On(e):e.type==="LineString"?e=bn(e):Jh(e,"LineString","line");var r=1/0,i=n.geometry.coordinates;return kg(e,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],l=mm(i,o,a,t);l<r&&(r=l)}),Dc(r,"degrees",t.units)}function mm(n,e,t,r){var i=[t[0]-e[0],t[1]-e[1]],s=[n[0]-e[0],n[1]-e[1]],o=yf(s,i);if(o<=0)return Fc(n,e,{method:r.method,units:"degrees"});var a=yf(i,i);if(a<=o)return Fc(n,t,{method:r.method,units:"degrees"});var l=o/a,u=[e[0]+l*i[0],e[1]+l*i[1]];return Fc(n,u,{method:r.method,units:"degrees"})}function yf(n,e){return n[0]*e[0]+n[1]*e[1]}function Fc(n,e,t){return t.method==="planar"?vf(n,e,t):xi(n,e,t)}function vm(n,e){const t=Xe(n),r=On(e);return gm(t,r,{units:"meters"})}function ym(n,e,t,r){r===void 0&&(r={});var i=e<0,s=Dc(Math.abs(e),r.units,"meters");i&&(s=-Math.abs(s));var o=lr(n),a=_m(o,s,t);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Xe(a,r.properties)}function _m(n,e,t,r){r=r===void 0?Ut:Number(r);var i=e/r,s=n[0]*Math.PI/180,o=$t(n[1]),a=$t(t),l=i*Math.cos(a),u=o+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),f=Math.abs(h)>1e-11?l/h:Math.cos(o),p=i*Math.sin(a)/f,v=s+p;return[(v*180/Math.PI+540)%360-180,u*180/Math.PI]}function wm(n,e,t,r){const[i,s,o]=n,a=ym(Xe([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function _f(n,e){return vf(Xe(n),Xe(e),{units:"meters"})}function Em(n,e,t){t===void 0&&(t={});var r;t.final?r=wf(lr(e),lr(n)):r=wf(lr(n),lr(e));var i=r>180?-(360-r):r;return i}function wf(n,e){var t=$t(n[1]),r=$t(e[1]),i=$t(e[0]-n[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,s);return(Pu(o)+360)%360}function Sm(n,e){return Em(Xe(n),Xe(e))}function Mn(n){var e=[1/0,1/0,-1/0,-1/0];return rl(n,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}Mn.default=Mn;function xn(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=lr(n),i=Wr(e),s=i.type,o=e.bbox,a=i.coordinates;if(o&&Cm(r,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(Ef(r,a[u][0],t.ignoreBoundary)){for(var h=!1,f=1;f<a[u].length&&!h;)Ef(r,a[u][f],!t.ignoreBoundary)&&(h=!0),f++;h||(l=!0)}return l}function Ef(n,e,t){var r=!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],l=e[s][0],u=e[s][1],h=n[1]*(o-l)+a*(l-n[0])+u*(n[0]-o)===0&&(o-n[0])*(l-n[0])<=0&&(a-n[1])*(u-n[1])<=0;if(h)return!t;var f=a>n[1]!=u>n[1]&&n[0]<(l-o)*(n[1]-a)/(u-a)+o;f&&(r=!r)}return r}function Cm(n,e){return e[0]<=n[0]&&e[1]<=n[1]&&e[2]>=n[0]&&e[3]>=n[1]}function Li(n,e,t){t===void 0&&(t={});for(var r=lr(n),i=Hs(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")),Pm(i[s],i[s+1],r,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function Pm(n,e,t,r,i){var s=t[0],o=t[1],a=n[0],l=n[1],u=e[0],h=e[1],f=t[0]-a,p=t[1]-l,v=u-a,w=h-l,I=f*w-p*v;if(i!==null){if(Math.abs(I)>i)return!1}else if(I!==0)return!1;if(r){if(r==="start")return Math.abs(v)>=Math.abs(w)?v>0?a<s&&s<=u:u<=s&&s<a:w>0?l<o&&o<=h:h<=o&&o<l;if(r==="end")return Math.abs(v)>=Math.abs(w)?v>0?a<=s&&s<u:u<s&&s<=a:w>0?l<=o&&o<h:h<o&&o<=l;if(r==="both")return Math.abs(v)>=Math.abs(w)?v>0?a<s&&s<u:u<s&&s<a:w>0?l<o&&o<h:h<o&&o<l}else return Math.abs(v)>=Math.abs(w)?v>0?a<=s&&s<=u:u<=s&&s<=a:w>0?l<=o&&o<=h:h<=o&&o<=l;return!1}function Im(n,e){var t=Wr(n),r=Wr(e),i=t.type,s=r.type,o=t.coordinates,a=r.coordinates;switch(i){case"Point":switch(s){case"Point":return kc(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return Tm(t,r);case"MultiPoint":return Nm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Li(r,t,{ignoreEndVertices:!0});case"LineString":return Om(t,r);case"MultiPoint":return Dm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return xn(r,t,{ignoreBoundary:!0});case"LineString":return Mm(t,r);case"Polygon":return xm(t,r);case"MultiPoint":return bm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Tm(n,e){var t,r=!1;for(t=0;t<n.coordinates.length;t++)if(kc(n.coordinates[t],e.coordinates)){r=!0;break}return r}function Nm(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){for(var i=r[t],s=!1,o=0,a=n.coordinates;o<a.length;o++){var l=a[o];if(kc(i,l)){s=!0;break}}if(!s)return!1}return!0}function Dm(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var s=i[r];if(Li(s,n,{ignoreEndVertices:!0})&&(t=!0),!Li(s,n))return!1}return!!t}function bm(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){var i=r[t];if(!xn(i,n,{ignoreBoundary:!0}))return!1}return!0}function Om(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var s=i[r];if(Li({type:"Point",coordinates:s},n,{ignoreEndVertices:!0})&&(t=!0),!Li({type:"Point",coordinates:s},n,{ignoreEndVertices:!1}))return!1}return t}function Mm(n,e){var t=!1,r=0,i=Mn(n),s=Mn(e);if(!Sf(i,s))return!1;for(r;r<e.coordinates.length-1;r++){var o=Lm(e.coordinates[r],e.coordinates[r+1]);if(xn({type:"Point",coordinates:o},n,{ignoreBoundary:!0})){t=!0;break}}return t}function xm(n,e){if(n.type==="Feature"&&n.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=Mn(n),r=Mn(e);if(!Sf(t,r))return!1;for(var i=Wr(e).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],l=0,u=a;l<u.length;l++){var h=u[l];if(!xn(h,n))return!1}return!0}function Sf(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function kc(n,e){return n[0]===e[0]&&n[1]===e[1]}function Lm(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function Am(n,e){var t=Wr(n),r=Wr(e),i=t.type,s=r.type;switch(i){case"Point":switch(s){case"MultiPoint":return Rm(t,r);case"LineString":return Li(t,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return xn(t,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Fm(t,r);case"LineString":return km(t,r);case"Polygon":case"MultiPolygon":return Vm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return zm(t,r);case"Polygon":case"MultiPolygon":return Um(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Gm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Rm(n,e){var t,r=!1;for(t=0;t<e.coordinates.length;t++)if(Pf(e.coordinates[t],n.coordinates)){r=!0;break}return r}function Fm(n,e){for(var t=0;t<n.coordinates.length;t++){for(var r=!1,i=0;i<e.coordinates.length;i++)Pf(n.coordinates[t],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}function km(n,e){for(var t=!1,r=0;r<n.coordinates.length;r++){if(!Li(n.coordinates[r],e))return!1;t||(t=Li(n.coordinates[r],e,{ignoreEndVertices:!0}))}return t}function Vm(n,e){for(var t=!0,r=!1,i=0;i<n.coordinates.length;i++){if(r=xn(n.coordinates[1],e),!r){t=!1;break}r=xn(n.coordinates[1],e,{ignoreBoundary:!0})}return t&&r}function zm(n,e){for(var t=0;t<n.coordinates.length;t++)if(!Li(n.coordinates[t],e))return!1;return!0}function Um(n,e){var t=Mn(e),r=Mn(n);if(!Cf(t,r))return!1;for(var i=!1,s=0;s<n.coordinates.length-1;s++){if(!xn(n.coordinates[s],e))return!1;if(i||(i=xn(n.coordinates[s],e,{ignoreBoundary:!0})),!i){var o=Wm(n.coordinates[s],n.coordinates[s+1]);i=xn(o,e,{ignoreBoundary:!0})}}return i}function Gm(n,e){var t=Mn(n),r=Mn(e);if(!Cf(r,t))return!1;for(var i=0;i<n.coordinates[0].length;i++)if(!xn(n.coordinates[0][i],e))return!1;return!0}function Cf(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function Pf(n,e){return n[0]===e[0]&&n[1]===e[1]}function Wm(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function qm(n,e){e===void 0&&(e={});var t=Mn(n),r=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Xe([r,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),r=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(s=s<0?Math.max(r+arguments[2],0):Math.min(s,r);i<s;)t[i]=e,++i;return t},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!==n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var Js=function(){};Js.prototype.interfaces_=function(){return[]},Js.prototype.getClass=function(){return Js},Js.prototype.equalsWithTolerance=function(e,t,r){return Math.abs(e-t)<=r};var Ue=function(n){function e(t){n.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new n().stack}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(Error),ue=function(){},If={MAX_VALUE:{configurable:!0}};ue.isNaN=function(e){return Number.isNaN(e)},ue.doubleToLongBits=function(e){return e},ue.longBitsToDouble=function(e){return e},ue.isInfinite=function(e){return!Number.isFinite(e)},If.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ue,If);var Sr=function(){},xu=function(){},nl=function(){};function Cr(){}var M=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.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=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Zs={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 Ue("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],r=arguments[1];return!(!Js.equalsWithTolerance(this.x,t.x,r)||!Js.equalsWithTolerance(this.y,t.y,r))}},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 Ue("Invalid ordinate index: "+e)},M.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ue.isNaN(this.z))&&ue.isNaN(e.z)},M.prototype.equals=function(e){return e instanceof M?this.equals2D(e):!1},M.prototype.equalInZ=function(e,t){return Js.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,r=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+r*r+i*i)},M.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},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[Sr,xu,Cr]},M.prototype.getClass=function(){return M},M.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ue.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},Zs.DimensionalComparator.get=function(){return Ai},Zs.serialVersionUID.get=function(){return 6683108902428367e3},Zs.NULL_ORDINATE.get=function(){return ue.NaN},Zs.X.get=function(){return 0},Zs.Y.get=function(){return 1},Zs.Z.get=function(){return 2},Object.defineProperties(M,Zs);var Ai=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Ue("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};Ai.prototype.compare=function(e,t){var r=e,i=t,s=Ai.compare(r.x,i.x);if(s!==0)return s;var o=Ai.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ai.compare(r.z,i.z);return a},Ai.prototype.interfaces_=function(){return[nl]},Ai.prototype.getClass=function(){return Ai},Ai.compare=function(e,t){return e<t?-1:e>t?1:ue.isNaN(e)?ue.isNaN(t)?0:-1:ue.isNaN(t)?1:0};var il=function(){};il.prototype.create=function(){},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var R=function(){},ql={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.toLocationSymbol=function(e){switch(e){case R.EXTERIOR:return"e";case R.BOUNDARY:return"b";case R.INTERIOR:return"i";case R.NONE:return"-"}throw new Ue("Unknown location value: "+e)},ql.INTERIOR.get=function(){return 0},ql.BOUNDARY.get=function(){return 1},ql.EXTERIOR.get=function(){return 2},ql.NONE.get=function(){return-1},Object.defineProperties(R,ql);var ae=function(n,e){return n.interfaces_&&n.interfaces_().indexOf(e)>-1},ur=function(){},Tf={LOG_10:{configurable:!0}};ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},ur.log10=function(e){var t=Math.log(e);return ue.isInfinite(t)||ue.isNaN(t)?t:t/ur.LOG_10},ur.min=function(e,t,r,i){var s=e;return t<s&&(s=t),r<s&&(s=r),i<s&&(s=i),s},ur.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],r=arguments[2];return e<t?t:e>r?r: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}},ur.wrap=function(e,t){return e<0?t- -e%t:e%t},ur.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2],i=e;return t>i&&(i=t),r>i&&(i=r),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=s;return o>u&&(u=o),a>u&&(u=a),l>u&&(u=l),u}},ur.average=function(e,t){return(e+t)/2},Tf.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(ur,Tf);var on=function(e){this.str=e};on.prototype.append=function(e){this.str+=e},on.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},on.prototype.toString=function(e){return this.str};var an=function(e){this.value=e};an.prototype.intValue=function(){return this.value},an.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},an.isNaN=function(e){return Number.isNaN(e)};var Xl=function(){};Xl.isWhitespace=function(e){return e<=32&&e>=0||e===127},Xl.toUpperCase=function(e){return e.toUpperCase()};var V=function n(){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 n){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},qr={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}};V.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},V.prototype.extractSignificantDigits=function(e,t){var r=this.abs(),i=V.magnitude(r._hi),s=V.TEN.pow(i);r=r.divide(s),r.gt(V.TEN)?(r=r.divide(V.TEN),i+=1):r.lt(V.ONE)&&(r=r.multiply(V.TEN),i-=1);for(var o=i+1,a=new on,l=V.MAX_PRINT_DIGITS-1,u=0;u<=l;u++){e&&u===o&&a.append(".");var h=Math.trunc(r._hi);if(h<0)break;var f=!1,p=0;h>9?(f=!0,p="9"):p="0"+h,a.append(p),r=r.subtract(V.valueOf(h)).multiply(V.TEN),f&&r.selfAdd(V.TEN);var v=!0,w=V.magnitude(r._hi);if(w<0&&Math.abs(w)>=l-u&&(v=!1),!v)break}return t[0]=i,a.toString()},V.prototype.sqr=function(){return this.multiply(this)},V.prototype.doubleValue=function(){return this._hi+this._lo},V.prototype.subtract=function(){if(arguments[0]instanceof V){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}},V.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},V.prototype.isZero=function(){return this._hi===0&&this._lo===0},V.prototype.selfSubtract=function(){if(arguments[0]instanceof V){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)}},V.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},V.prototype.min=function(e){return this.le(e)?this:e},V.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof V){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null,f=null,p=null;return u=this._hi/r,h=V.SPLIT*u,s=h-u,p=V.SPLIT*r,s=h-s,o=u-s,a=p-r,f=u*r,a=p-a,l=r-a,p=s*a-f+s*l+o*a+o*l,h=(this._hi-f-p+this._lo-u*i)/r,p=u+h,this._hi=p,this._lo=u-p+h,this}},V.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},V.prototype.divide=function(){if(arguments[0]instanceof V){var e=arguments[0],t=null,r=null,i=null,s=null,o=null,a=null,l=null,u=null;o=this._hi/e._hi,a=V.SPLIT*o,t=a-o,u=V.SPLIT*e._hi,t=a-t,r=o-t,i=u-e._hi,l=o*e._hi,i=u-i,s=e._hi-i,u=t*i-l+t*s+r*i+r*s,a=(this._hi-l-u+this._lo-o*e._lo)/e._hi,u=o+a;var h=u,f=o-u+a;return new V(h,f)}else if(typeof arguments[0]=="number"){var p=arguments[0];return ue.isNaN(p)?V.createNaN():V.copy(this).selfDivide(p,0)}},V.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},V.prototype.pow=function(e){if(e===0)return V.valueOf(1);var t=new V(this),r=V.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else r=t;return e<0?r.reciprocal():r},V.prototype.ceil=function(){if(this.isNaN())return V.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new V(e,t)},V.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},V.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()},V.prototype.setValue=function(){if(arguments[0]instanceof V){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}},V.prototype.max=function(e){return this.ge(e)?this:e},V.prototype.sqrt=function(){if(this.isZero())return V.valueOf(0);if(this.isNegative())return V.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,r=V.valueOf(t),i=this.subtract(r.sqr()),s=i._hi*(e*.5);return r.add(s)},V.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof V){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],r=null,i=null,s=null,o=null,a=null,l=null;return s=this._hi+t,a=s-this._hi,o=s-a,o=t-a+(this._hi-o),l=o+this._lo,r=s+l,i=l+(s-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var u=arguments[0],h=arguments[1],f=null,p=null,v=null,w=null,I=null,T=null,L=null,m=null;I=this._hi+u,v=this._lo+h,L=I-this._hi,m=v-this._lo,T=I-L,w=v-m,T=u-L+(this._hi-T),w=h-m+(this._lo-w),L=T+v,f=I+L,p=L+(I-f),L=w+p;var _=f+L,g=L+(f-_);return this._hi=_,this._lo=g,this}},V.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof V){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null;u=V.SPLIT*this._hi,s=u-this._hi,h=V.SPLIT*r,s=u-s,o=this._hi-s,a=h-r,u=this._hi*r,a=h-a,l=r-a,h=s*a-u+s*l+o*a+o*l+(this._hi*i+this._lo*r);var f=u+h;s=u-f;var p=h+s;return this._hi=f,this._lo=p,this}},V.prototype.selfSqr=function(){return this.selfMultiply(this)},V.prototype.floor=function(){if(this.isNaN())return V.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new V(e,t)},V.prototype.negate=function(){return this.isNaN()?this:new V(-this._hi,-this._lo)},V.prototype.clone=function(){},V.prototype.multiply=function(){if(arguments[0]instanceof V){var e=arguments[0];return e.isNaN()?V.createNaN():V.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ue.isNaN(t)?V.createNaN():V.copy(this).selfMultiply(t,0)}},V.prototype.isNaN=function(){return ue.isNaN(this._hi)},V.prototype.intValue=function(){return Math.trunc(this._hi)},V.prototype.toString=function(){var e=V.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},V.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!0,t),i=t[0]+1,s=r;if(r.charAt(0)===".")s="0"+r;else if(i<0)s="0."+V.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,a=V.stringOfChar("0",o);s=r+a+".0"}return this.isNegative()?"-"+s:s},V.prototype.reciprocal=function(){var e=null,t=null,r=null,i=null,s=null,o=null,a=null,l=null;s=1/this._hi,o=V.SPLIT*s,e=o-s,l=V.SPLIT*this._hi,e=o-e,t=s-e,r=l-this._hi,a=s*this._hi,r=l-r,i=this._hi-r,l=e*r-a+e*i+t*r+t*i,o=(1-a-l-s*this._lo)/this._hi;var u=s+o,h=s-u+o;return new V(u,h)},V.prototype.toSciNotation=function(){if(this.isZero())return V.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!1,t),i=V.SCI_NOT_EXPONENT_CHAR+t[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var s="";r.length>1&&(s=r.substring(1));var o=r.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},V.prototype.abs=function(){return this.isNaN()?V.NaN:this.isNegative()?this.negate():new V(this)},V.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},V.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},V.prototype.add=function(){if(arguments[0]instanceof V){var e=arguments[0];return V.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return V.copy(this).selfAdd(t)}},V.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 V){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},V.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},V.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},V.prototype.trunc=function(){return this.isNaN()?V.NaN:this.isPositive()?this.floor():this.ceil()},V.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},V.prototype.interfaces_=function(){return[Cr,Sr,xu]},V.prototype.getClass=function(){return V},V.sqr=function(e){return V.valueOf(e).selfMultiply(e)},V.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return V.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new V(t)}},V.sqrt=function(e){return V.valueOf(e).sqrt()},V.parse=function(e){for(var t=0,r=e.length;Xl.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<r){var s=e.charAt(t);(s==="-"||s==="+")&&(t++,s==="-"&&(i=!0))}for(var o=new V,a=0,l=0,u=0;!(t>=r);){var h=e.charAt(t);if(t++,Xl.isDigit(h)){var f=h-"0";o.selfMultiply(V.TEN),o.selfAdd(f),a++;continue}if(h==="."){l=a;continue}if(h==="e"||h==="E"){var p=e.substring(t);try{u=an.parseInt(p)}catch(L){throw L instanceof Error?new Error("Invalid exponent "+p+" in string "+e):L}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+t+" in string "+e)}var v=o,w=a-l-u;if(w===0)v=o;else if(w>0){var I=V.TEN.pow(w);v=o.divide(I)}else if(w<0){var T=V.TEN.pow(-w);v=o.multiply(T)}return i?v.negate():v},V.createNaN=function(){return new V(ue.NaN,ue.NaN)},V.copy=function(e){return new V(e)},V.magnitude=function(e){var t=Math.abs(e),r=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(r)),s=Math.pow(10,i);return s*10<=t&&(i+=1),i},V.stringOfChar=function(e,t){for(var r=new on,i=0;i<t;i++)r.append(e);return r.toString()},qr.PI.get=function(){return new V(3.141592653589793,12246467991473532e-32)},qr.TWO_PI.get=function(){return new V(6.283185307179586,24492935982947064e-32)},qr.PI_2.get=function(){return new V(1.5707963267948966,6123233995736766e-32)},qr.E.get=function(){return new V(2.718281828459045,14456468917292502e-32)},qr.NaN.get=function(){return new V(ue.NaN,ue.NaN)},qr.EPS.get=function(){return 123259516440783e-46},qr.SPLIT.get=function(){return 134217729},qr.MAX_PRINT_DIGITS.get=function(){return 32},qr.TEN.get=function(){return V.valueOf(10)},qr.ONE.get=function(){return V.valueOf(1)},qr.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},qr.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(V,qr);var Gt=function(){},Nf={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(e,t,r){var i=Gt.orientationIndexFilter(e,t,r);if(i<=1)return i;var s=V.valueOf(t.x).selfAdd(-e.x),o=V.valueOf(t.y).selfAdd(-e.y),a=V.valueOf(r.x).selfAdd(-t.x),l=V.valueOf(r.y).selfAdd(-t.y);return s.selfMultiply(l).selfSubtract(o.selfMultiply(a)).signum()},Gt.signOfDet2x2=function(e,t,r,i){var s=e.multiply(i).selfSubtract(t.multiply(r));return s.signum()},Gt.intersection=function(e,t,r,i){var s=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(t.x).selfSubtract(e.x)),o=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(t.y).selfSubtract(e.y)),a=s.subtract(o),l=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(e.y).selfSubtract(r.y)),u=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(e.x).selfSubtract(r.x)),h=l.subtract(u),f=h.selfDivide(a).doubleValue(),p=V.valueOf(e.x).selfAdd(V.valueOf(t.x).selfSubtract(e.x).selfMultiply(f)).doubleValue(),v=V.valueOf(t.x).selfSubtract(e.x).selfMultiply(V.valueOf(e.y).selfSubtract(r.y)),w=V.valueOf(t.y).selfSubtract(e.y).selfMultiply(V.valueOf(e.x).selfSubtract(r.x)),I=v.subtract(w),T=I.selfDivide(a).doubleValue(),L=V.valueOf(r.y).selfAdd(V.valueOf(i.y).selfSubtract(r.y).selfMultiply(T)).doubleValue();return new M(p,L)},Gt.orientationIndexFilter=function(e,t,r){var i=null,s=(e.x-r.x)*(t.y-r.y),o=(e.y-r.y)*(t.x-r.x),a=s-o;if(s>0){if(o<=0)return Gt.signum(a);i=s+o}else if(s<0){if(o>=0)return Gt.signum(a);i=-s-o}else return Gt.signum(a);var l=Gt.DP_SAFE_EPSILON*i;return a>=l||-a>=l?Gt.signum(a):2},Gt.signum=function(e){return e>0?1:e<0?-1:0},Nf.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,Nf);var Se=function(){},Yl={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Yl.X.get=function(){return 0},Yl.Y.get=function(){return 1},Yl.Z.get=function(){return 2},Yl.M.get=function(){return 3},Se.prototype.setOrdinate=function(e,t,r){},Se.prototype.size=function(){},Se.prototype.getOrdinate=function(e,t){},Se.prototype.getCoordinate=function(){},Se.prototype.getCoordinateCopy=function(e){},Se.prototype.getDimension=function(){},Se.prototype.getX=function(e){},Se.prototype.clone=function(){},Se.prototype.expandEnvelope=function(e){},Se.prototype.copy=function(){},Se.prototype.getY=function(e){},Se.prototype.toCoordinateArray=function(){},Se.prototype.interfaces_=function(){return[xu]},Se.prototype.getClass=function(){return Se},Object.defineProperties(Se,Yl);var Df=function(){},sl=function(n){function e(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Df),vt=function(){};vt.arraycopy=function(e,t,r,i,s){for(var o=0,a=t;a<t+s;a++)r[i+o]=e[a],o++},vt.getProperty=function(e){return{"line.separator":`
3
+ `).join(" ")}`)):this._sceneObjRefs.set(s,[i]);const u=this.getLastSceneObject(s);this._refs[s]=u,this._refsChanged.emit(u,a)}};this.d(t.sceneObjCreatedEvent.don(i=>{const s=(o,a)=>r(i,o,a);i.ref&&s(i.ref,void 0),i.refChanged.don(s)})),this.d(t.sceneObjToDestroyEvent.don(i=>{i.ref&&r(i,void 0,i.ref)}))}get sceneObjRefs(){return this._sceneObjRefs}get refs(){return this._refs}get refsChanged(){return this._refsChanged}getLastSceneObject(t){const r=this.getSceneObjects(t);if(r)return r[r.length-1]}getSceneObjects(t){const r=this._sceneObjRefs.get(t);if(!(!r||r.length===0))return r}}function qh(n,e){const[t,r,i]=c.getReactFuncs(n),s=c.react(void 0),o=()=>{const a=t()??e;s.value=a&&j.context.getStrFromEnv(a)};return o(),i&&s.d(i.don(o)),s.d(j.context.environmentVariablesChanged.don(o)),s}function Dg(n){do{const e=n.replace(/\${(.*?)\}/,(t,r)=>{const i=j.context.getEnv(r);return i===void 0?(console.warn(`环境变量(${r})不存在,无法进行转换`),"{env-error}"):i});if(e===n)break;n=e}while(!0);return n}class bg extends c.Destroyable{constructor(){super();d(this,"_esObjConstructors",new Map);d(this,"_sceneObjs",new Map);d(this,"_sceneObjCreatedEvent",new c.Event);d(this,"_sceneObjToDestroyEvent",new c.Event);d(this,"_refsManager",this.dv(new Ng(this)));d(this,"_environmentVariables",window.ESSDK_ENV||{});d(this,"_environmentVariablesChanged",this.dv(new c.Event))}get typeNames(){return this._esObjConstructors.keys()}get sceneObjs(){return this._sceneObjs.values()}get sceneObjCreatedEvent(){return this._sceneObjCreatedEvent}get sceneObjToDestroyEvent(){return this._sceneObjToDestroyEvent}get refsManager(){return this._refsManager}get $refs(){return this._refsManager.refs}register(t,r,i){return this._esObjConstructors.has(t)&&console.warn(`register warn: ${t} has registered ! will be override!`),this._esObjConstructors.set(t,r),i&&c.setExtProp(r,"__sceneObjExtraInfo",i),t}_addSceneObject(t){this._sceneObjs.set(t.id,t),this._sceneObjCreatedEvent.emit(t),t.d(()=>this._deleteSceneObject(t))}addSceneObject(t){this._addSceneObject(t)}_deleteSceneObject(t){this._sceneObjToDestroyEvent.emit(t),this._sceneObjs.delete(t.id)}deleteSceneObject(t){this._deleteSceneObject(t)}createSceneObjectFromClass(t,r){if(!r||this._sceneObjs.has(r)){const s=c.createGuid();r&&console.warn(`已存在相同id的对象!id自动变更!${r} -> ${s} 请注意:id变更可能导致引用失效!`),r=s}if(!r)throw new Error("id不能为空!");const i=new t(r);return i.id!==r&&(console.warn(`sceneObj.id(${i.id}) !== id(${r}) sceneObjectType: ${i.typeName}`),console.warn("出现这种问题有可能是自定义的场景对象,没有在构造函数中传递id参数!示例如下:"),console.warn("class XXX extends XXX { constructor(id) { super(id); } }")),this._addSceneObject(i),i}createSceneObject(t,r){if(typeof t=="string"){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`Cannot find SceneObjectType: ${t}`);return}return this.createSceneObjectFromClass(i,r)}else return this.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){const r=this.createSceneObject(t.type,t.id);return r&&(r.json=t),r}destroySceneObject(t){return this._deleteSceneObject(t),t.destroy(),t.isDestroyed()}getSceneObjectById(t){return this._sceneObjs.get(t)}getSceneObject(t){if(!t&&t!="")return Array.from(this._sceneObjs.values());if(t.startsWith("ES")){const r=[];for(const i of this._sceneObjs.values())i.typeName===t&&r.push(i);return r}else return this._sceneObjs.get(t)}_getSceneObjConstructor(t){const r=this._esObjConstructors.get(t);if(r)return r}getProps(t){const r=this._getSceneObjConstructor(t);if(!r){console.warn(`cannot get constructor from type: ${t}`);return}return c.getExtProp(r,"__sceneObjExtraInfo")}setProps(t,r){const i=this._getSceneObjConstructor(t);if(!i){console.warn(`cannot get constructor from type: ${t}`);return}let s=c.getExtProp(i,"__sceneObjExtraInfo");s||(s={},c.setExtProp(i,"__sceneObjExtraInfo",s)),Object.assign(s,r)}getProp(t,r){const i=this.getProps(t);return i&&i[r]}setProp(t,r,i){this.setProps(t,{[r]:i})}get environmentVariables(){return this._environmentVariables}set environmentVariables(t){for(let[r,i]of Object.entries(t))this.setEnv(r,i)}get environmentVariablesChanged(){return this._environmentVariablesChanged}setEnv(t,r){if(this._environmentVariables[t]!==r){const i=this._environmentVariables[t];this._environmentVariables[t]=r,this._environmentVariablesChanged.emit(t,r,i)}window.ESSDK_ENV={...this._environmentVariables}}getEnv(t){return this._environmentVariables[t]}getStrFromEnv(t){return Dg(t)}createEnvStrReact(t,r){return qh(t,r)}createEvnStrReact(t,r){return qh(t,r)}}const de=class de extends c.Destroyable{constructor(t){super();d(this,"_components",this.dv(new c.ObservableSet));d(this,"_viewerAttached",this.dv(new c.Event));d(this,"_viewerDetached",this.dv(new c.Event));d(this,"_attachedViewers",(()=>{const t=new Set;return this.d(this._viewerAttached.don(r=>{t.add(r)})),this.d(this._viewerDetached.don(r=>{t.delete(r)})),t})());d(this,"_createdEvent",this.dv(new c.Event));d(this,"_flushEvent",this.dv(new c.Event));d(this,"_id");d(this,"viewer");d(this,"viewerChanged",this.ad(new c.Event));d(this,"combinationClass",!1);d(this,"mainClass");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_parentID",this.disposeVar(c.react(void 0)));t!==void 0&&(typeof t!="string"?console.warn(`对象id必须是字符串类型,当前id的类型是${typeof t},值为${t}`):t.trim()===""?console.warn("场景对象创建时的id不能是空字符串!"):t.trim()!==t&&console.warn(`id前后有空字符串!id: ${t}`)),this._id=t??c.createGuid(),this._initName();{const r=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(i){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`)}};r(),this.d(this.execOnceFuncStrChanged.don(r))}{const r=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(s){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};r(),this.d(this.updateFuncStrChanged.don(r));let i;this.d(()=>i&&i.destroy()),this.d(this.updateFuncChanged.don(()=>{i&&i.cancel(),this.updateFunc&&(i=i||c.createAnimateFrame(),i.restart(void 0,s=>{this.updateFunc&&this.updateFunc(this,s)}))}))}{const r=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(i){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${i}`),this.toDestroyFunc=void 0}};r(),this.d(this.toDestroyFuncStrChanged.don(r)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}}static get envs(){return de.context.environmentVariables}static get $refs(){return de.context.refsManager.refs}get components(){return this._components}get viewerAttached(){return this._viewerAttached}get viewerDetached(){return this._viewerDetached}get attachedViewers(){return this._attachedViewers}removefromViewer(t){this.attachedViewers.has(t)&&t.delete(this)}addToViewer(t){this.attachedViewers.has(t)||t.add(this)}registerAttachedObject(t){const r=new Map;this.d(()=>{r.size>0&&console.warn("viewerPropSceneObjects.size > 0")}),this.d(this._viewerAttached.don(i=>{const s=t(i);s&&r.set(i,s)})),this.d(this._viewerDetached.don(i=>{if(!r.has(i))return;const s=r.get(i);s&&(s.destroy(),r.delete(i))}))}createAttachedObject(t){const r=new Map,i=()=>{for(let[l,u]of r.entries())u.destroy();r.clear()},s=l=>{const u=t(l);u&&r.set(l,u)};for(let l of this.attachedViewers)s(l);const o=this._viewerAttached.don(s),a=this._viewerDetached.don(l=>{if(!r.has(l))return;const u=r.get(l);u&&(u.destroy(),r.delete(l))});return()=>{a(),o(),i()}}registerAttachedObjectForContainer(t){this.registerAttachedObject(r=>new Og(r,t))}get createdEvent(){return this._createdEvent}get flushEvent(){return this._flushEvent}flush(){this.flushEvent.emit()}get id(){return this._id}get typeName(){return this.constructor.type}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return de.createDefaultProps()}getMainClass(){return this.mainClass??this}_innerGetJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_innerGetJson1(t=!0){const r={id:this.id,type:this.typeName},i=this.constructor.properties;for(let s of Object.keys(i))if(t){let o,a=i[s];a instanceof c.ReactiveVariable?o=a.equals(this[s]):o=a===this[s],o||(r[s]=this[s])}else r[s]=this[s];return r}_innerSetJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._innerGetJson()}set json(t){this._innerSetJson(t)}get _jsonStr(){return JSON.stringify(this.json,null,4)}set _jsonStr(t){this._innerSetJson(JSON.parse(t))}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get parentID(){return this._parentID.value}set parentID(t){this._parentID.value=t}get parentIDChanged(){return this._parentID.changed}getProperties(t){return[new z("ESSceneObject","ESSceneObject",[new Z("对象类型","类型(type)",!1,!0,[this,"typeName"]),new Z("对象id","唯一标识符(id)",!1,!0,[this,"id"]),new Z("对象名称","名称(name)",!1,!1,[this,"name"]),new Z("ref","标识(ref),可通过 ESSceneObject.$refs.xxx快速获取到对象",!0,!1,[this,"ref"]),new U("extras","扩展属性,必须整体赋值(extras)",!0,!1,[this,"extras"]),new zh("JSON","对象JSON数据动态更改导入导出。",!1,!1,()=>this._jsonStr,r=>r&&(this._jsonStr=r))])]}getESProperties(){return{defaultMenu:"basic",basic:[],general:[],dataSource:[],location:[],coordinate:[],style:[]}}static register1(t,r,i){let s={},o=r;for(;o&&o!==Object;)o.hasOwnProperty("properties")&&(s={...s,...o.properties}),o=Object.getPrototypeOf(o);return r.properties=Object.freeze(s),c.extendClassProps(r.prototype,()=>s),this.register(t,r,i),t}};d(de,"context",new bg),d(de,"register",de.context.register.bind(de.context)),d(de,"create",de.context.createSceneObject.bind(de.context)),d(de,"createFromClass",de.context.createSceneObjectFromClass.bind(de.context)),d(de,"createFromJson",de.context.createSceneObjectFromJson.bind(de.context)),d(de,"destroySceneObject",de.context.destroySceneObject.bind(de.context)),d(de,"getSceneObjById",de.context.getSceneObjectById.bind(de.context)),d(de,"getSceneObj",de.context.getSceneObject.bind(de.context)),d(de,"getEnv",de.context.getEnv.bind(de.context)),d(de,"setEnv",de.context.setEnv.bind(de.context)),d(de,"getStrFromEnv",de.context.getStrFromEnv.bind(de.context)),d(de,"getSceneObjectById",de.context.getSceneObjectById.bind(de.context)),d(de,"getSceneObject",de.context.getSceneObject.bind(de.context)),d(de,"defaults",{}),d(de,"createDefaultProps",()=>({name:"未命名场景对象",ref:void 0,extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0})),d(de,"type",de.register1("ESSceneObject",de,{chsName:"场景类",tags:["ESObjects"],description:""})),d(de,"properties",{reff:void 0});let j=de;c.extendClassProps(j.prototype,j.createDefaultProps);class Og extends c.Destroyable{constructor(e,t){super(),this.dv(new c.ObjResettingWithEvent(e.subContainerChanged,()=>{if(e.subContainer)return t(e,e.subContainer)}))}}function Cc(n){return c.reactDeepArrayWithUndefined(n,(e,t)=>e[0]===t[0]&&e[1]===t[1],e=>[...e])}function Xh(n,e){const t=new Array;for(let r of n)t.push(e(r));return t}function Pc(n,e){return n===void 0&&e===void 0?!0:!n||!e?!1:n[0]===e[0]&&n[1]===e[1]&&n[2]===e[2]}function Mg(n,e){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&n.push(n[0]);const t=_c.point(e),r=_c.polygon([n]);return _c.booleanPointInPolygon(t,r)}var Ut=63710088e-1,Yh={centimeters:Ut*100,centimetres:Ut*100,degrees:Ut/111325,feet:Ut*3.28084,inches:Ut*39.37,kilometers:Ut/1e3,kilometres:Ut/1e3,meters:Ut,metres:Ut,miles:Ut/1609.344,millimeters:Ut*1e3,millimetres:Ut*1e3,nauticalmiles:Ut/1852,radians:1,yards:Ut*1.0936};function bn(n,e,t){t===void 0&&(t={});var r={type:"Feature"};return(t.id===0||t.id)&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.properties=e||{},r.geometry=n,r}function Xe(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Hh(n[0])||!Hh(n[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:n};return bn(r,e,t)}function ar(n,e,t){t===void 0&&(t={});for(var r=0,i=n;r<i.length;r++){var s=i[r];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:n};return bn(a,e,t)}function On(n,e,t){if(t===void 0&&(t={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:n};return bn(r,e,t)}function el(n,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function Ic(n,e,t){t===void 0&&(t={});var r={type:"MultiPolygon",coordinates:n};return bn(r,e,t)}function Tc(n,e){e===void 0&&(e="kilometers");var t=Yh[e];if(!t)throw new Error(e+" units is invalid");return n*t}function Nc(n,e){e===void 0&&(e="kilometers");var t=Yh[e];if(!t)throw new Error(e+" units is invalid");return n/t}function Pu(n){var e=n%(2*Math.PI);return e*180/Math.PI}function $t(n){var e=n%360;return e*Math.PI/180}function Dc(n,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(n>=0))throw new Error("length must be a positive number");return Tc(Nc(n,e),t)}function Hh(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function lr(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Hs(n){if(Array.isArray(n))return n;if(n.type==="Feature"){if(n.geometry!==null)return n.geometry.coordinates}else if(n.coordinates)return n.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Jh(n,e,t){if(!n)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}function Wr(n){return n.type==="Feature"?n.geometry:n}function xg(n,e){return n.type==="FeatureCollection"?"FeatureCollection":n.type==="GeometryCollection"?"GeometryCollection":n.type==="Feature"&&n.geometry!==null?n.geometry.type:n.type}function Ul(n,e,t){if(t===void 0&&(t={}),t.final===!0)return Lg(n,e);var r=lr(n),i=lr(e),s=$t(r[0]),o=$t(i[0]),a=$t(r[1]),l=$t(i[1]),u=Math.sin(o-s)*Math.cos(l),h=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(o-s);return Pu(Math.atan2(u,h))}function Lg(n,e){var t=Ul(e,n);return t=(t+180)%360,t}function tl(n,e,t,r){r===void 0&&(r={});var i=lr(n),s=$t(i[0]),o=$t(i[1]),a=$t(t),l=Nc(e,r.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(a)),h=s+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u)),f=Pu(h),p=Pu(u);return Xe([f,p],r.properties)}function xi(n,e,t){t===void 0&&(t={});var r=lr(n),i=lr(e),s=$t(i[1]-r[1]),o=$t(i[0]-r[0]),a=$t(r[1]),l=$t(i[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(l);return Tc(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),t.units)}function Ag(n,e,t){t===void 0&&(t={});for(var r=Wr(n),i=r.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 l=Ul(i[o],i[o-1])-180,u=tl(i[o],a,l,t);return u}else return Xe(i[o])}else s+=xi(i[o],i[o+1],t);return Xe(i[i.length-1])}function Rg(n,e){const t=On(n);return Ag(t,e,{units:"meters"}).geometry.coordinates}function rl(n,e,t){if(n!==null)for(var r,i,s,o,a,l,u,h=0,f=0,p,v=n.type,w=v==="FeatureCollection",I=v==="Feature",T=w?n.features.length:1,L=0;L<T;L++){u=w?n.features[L].geometry:I?n.geometry:n,p=u?u.type==="GeometryCollection":!1,a=p?u.geometries.length:1;for(var m=0;m<a;m++){var _=0,g=0;if(o=p?u.geometries[m]:u,o!==null){l=o.coordinates;var y=o.type;switch(h=t&&(y==="Polygon"||y==="MultiPolygon")?1:0,y){case null:break;case"Point":if(e(l,f,L,_,g)===!1)return!1;f++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(e(l[r],f,L,_,g)===!1)return!1;f++,y==="MultiPoint"&&_++}y==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(e(l[r][i],f,L,_,g)===!1)return!1;f++}y==="MultiLineString"&&_++,y==="Polygon"&&g++}y==="Polygon"&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(g=0,i=0;i<l[r].length;i++){for(s=0;s<l[r][i].length-h;s++){if(e(l[r][i][s],f,L,_,g)===!1)return!1;f++}g++}_++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(rl(o.geometries[r],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iu(n,e){if(n.type==="Feature")e(n,0);else if(n.type==="FeatureCollection")for(var t=0;t<n.features.length&&e(n.features[t],t)!==!1;t++);}function Tu(n,e){var t,r,i,s,o,a,l,u,h,f,p=0,v=n.type==="FeatureCollection",w=n.type==="Feature",I=v?n.features.length:1;for(t=0;t<I;t++){for(a=v?n.features[t].geometry:w?n.geometry:n,u=v?n.features[t].properties:w?n.properties:{},h=v?n.features[t].bbox:w?n.bbox:void 0,f=v?n.features[t].id:w?n.id:void 0,l=a?a.type==="GeometryCollection":!1,o=l?a.geometries.length:1,i=0;i<o;i++){if(s=l?a.geometries[i]:a,s===null){if(e(null,p,u,h,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,p,u,h,f)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(e(s.geometries[r],p,u,h,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}p++}}function Fg(n,e,t){var r=t;return Tu(n,function(i,s,o,a,l){r=e(r,i,s,o,a,l)}),r}function bc(n,e){Tu(n,function(t,r,i,s,o){var a=t===null?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return e(bn(t,i,{bbox:s,id:o}),r,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],f={type:l,coordinates:h};if(e(bn(f,i),r,u)===!1)return!1}})}function kg(n,e){bc(n,function(t,r,i){var s=0;if(t.geometry){var o=t.geometry.type;if(!(o==="Point"||o==="MultiPoint")){var a,l=0,u=0,h=0;if(rl(t,function(f,p,v,w,I){if(a===void 0||r>l||w>u||I>h){a=f,l=r,u=w,h=I,s=0;return}var T=On([a,f],t.properties);if(e(T,r,i,I,s)===!1)return!1;s++,a=f})===!1)return!1}}})}var Zh=6378137;function Vg(n){return Fg(n,function(e,t){return e+zg(t)},0)}function zg(n){var e=0,t;switch(n.type){case"Polygon":return Kh(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)e+=Kh(n.coordinates[t]);return e;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function Kh(n){var e=0;if(n&&n.length>0){e+=Math.abs(Qh(n[0]));for(var t=1;t<n.length;t++)e-=Math.abs(Qh(n[t]))}return e}function Qh(n){var e,t,r,i,s,o,a,l=0,u=n.length;if(u>2){for(a=0;a<u;a++)a===u-2?(i=u-2,s=u-1,o=0):a===u-1?(i=u-1,s=0,o=1):(i=a,s=a+1,o=a+2),e=n[i],t=n[s],r=n[o],l+=(Oc(r[0])-Oc(e[0]))*Math.sin(Oc(t[1]));l=l*Zh*Zh/2}return l}function Oc(n){return n*Math.PI/180}function Mc(n){if((n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]),n.length<=3)return 0;const e=ar([n]);return Vg(e)}function Bh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Ug(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Nu={exports:{}},Du={exports:{}},Gg=Du.exports,$h;function jh(){return $h||($h=1,function(n,e){(function(t,r){n.exports=r()})(Gg,function(){function t(m,_,g,y,E){(function C(N,b,x,D,O){for(;D>x;){if(D-x>600){var A=D-x+1,k=b-x+1,B=Math.log(A),X=.5*Math.exp(2*B/3),ne=.5*Math.sqrt(B*X*(A-X)/A)*(k-A/2<0?-1:1),ce=Math.max(x,Math.floor(b-k*X/A+ne)),pe=Math.min(D,Math.floor(b+(A-k)*X/A+ne));C(N,b,ce,pe,O)}var K=N[b],$=x,ee=D;for(r(N,x,b),O(N[D],K)>0&&r(N,x,D);$<ee;){for(r(N,$,ee),$++,ee--;O(N[$],K)<0;)$++;for(;O(N[ee],K)>0;)ee--}O(N[x],K)===0?r(N,x,ee):r(N,++ee,D),ee<=b&&(x=ee+1),b<=ee&&(D=ee-1)}})(m,_,g||0,y||m.length-1,E||i)}function r(m,_,g){var y=m[_];m[_]=m[g],m[g]=y}function i(m,_){return m<_?-1:m>_?1:0}var s=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(m,_,g){if(!g)return _.indexOf(m);for(var y=0;y<_.length;y++)if(g(m,_[y]))return y;return-1}function a(m,_){l(m,0,m.children.length,_,m)}function l(m,_,g,y,E){E||(E=T(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var C=_;C<g;C++){var N=m.children[C];u(E,m.leaf?y(N):N)}return E}function u(m,_){return m.minX=Math.min(m.minX,_.minX),m.minY=Math.min(m.minY,_.minY),m.maxX=Math.max(m.maxX,_.maxX),m.maxY=Math.max(m.maxY,_.maxY),m}function h(m,_){return m.minX-_.minX}function f(m,_){return m.minY-_.minY}function p(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function v(m){return m.maxX-m.minX+(m.maxY-m.minY)}function w(m,_){return m.minX<=_.minX&&m.minY<=_.minY&&_.maxX<=m.maxX&&_.maxY<=m.maxY}function I(m,_){return _.minX<=m.maxX&&_.minY<=m.maxY&&_.maxX>=m.minX&&_.maxY>=m.minY}function T(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function L(m,_,g,y,E){for(var C=[_,g];C.length;)if(!((g=C.pop())-(_=C.pop())<=y)){var N=_+Math.ceil((g-_)/y/2)*y;t(m,N,_,g,E),C.push(_,N,N,g)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(m){var _=this.data,g=[];if(!I(m,_))return g;for(var y=this.toBBox,E=[];_;){for(var C=0;C<_.children.length;C++){var N=_.children[C],b=_.leaf?y(N):N;I(m,b)&&(_.leaf?g.push(N):w(m,b)?this._all(N,g):E.push(N))}_=E.pop()}return g},s.prototype.collides=function(m){var _=this.data;if(!I(m,_))return!1;for(var g=[];_;){for(var y=0;y<_.children.length;y++){var E=_.children[y],C=_.leaf?this.toBBox(E):E;if(I(m,C)){if(_.leaf||w(m,C))return!0;g.push(E)}}_=g.pop()}return!1},s.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var _=0;_<m.length;_++)this.insert(m[_]);return this}var g=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===g.height)this._splitRoot(this.data,g);else{if(this.data.height<g.height){var y=this.data;this.data=g,g=y}this._insert(g,this.data.height-g.height-1,!0)}else this.data=g;return this},s.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},s.prototype.clear=function(){return this.data=T([]),this},s.prototype.remove=function(m,_){if(!m)return this;for(var g,y,E,C=this.data,N=this.toBBox(m),b=[],x=[];C||b.length;){if(C||(C=b.pop(),y=b[b.length-1],g=x.pop(),E=!0),C.leaf){var D=o(m,C.children,_);if(D!==-1)return C.children.splice(D,1),b.push(C),this._condense(b),this}E||C.leaf||!w(C,N)?y?(g++,C=y.children[g],E=!1):C=null:(b.push(C),x.push(g),g=0,y=C,C=C.children[0])}return this},s.prototype.toBBox=function(m){return m},s.prototype.compareMinX=function(m,_){return m.minX-_.minX},s.prototype.compareMinY=function(m,_){return m.minY-_.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(m){return this.data=m,this},s.prototype._all=function(m,_){for(var g=[];m;)m.leaf?_.push.apply(_,m.children):g.push.apply(g,m.children),m=g.pop();return _},s.prototype._build=function(m,_,g,y){var E,C=g-_+1,N=this._maxEntries;if(C<=N)return a(E=T(m.slice(_,g+1)),this.toBBox),E;y||(y=Math.ceil(Math.log(C)/Math.log(N)),N=Math.ceil(C/Math.pow(N,y-1))),(E=T([])).leaf=!1,E.height=y;var b=Math.ceil(C/N),x=b*Math.ceil(Math.sqrt(N));L(m,_,g,x,this.compareMinX);for(var D=_;D<=g;D+=x){var O=Math.min(D+x-1,g);L(m,D,O,b,this.compareMinY);for(var A=D;A<=O;A+=b){var k=Math.min(A+b-1,O);E.children.push(this._build(m,A,k,y-1))}}return a(E,this.toBBox),E},s.prototype._chooseSubtree=function(m,_,g,y){for(;y.push(_),!_.leaf&&y.length-1!==g;){for(var E=1/0,C=1/0,N=void 0,b=0;b<_.children.length;b++){var x=_.children[b],D=p(x),O=(A=m,k=x,(Math.max(k.maxX,A.maxX)-Math.min(k.minX,A.minX))*(Math.max(k.maxY,A.maxY)-Math.min(k.minY,A.minY))-D);O<C?(C=O,E=D<E?D:E,N=x):O===C&&D<E&&(E=D,N=x)}_=N||_.children[0]}var A,k;return _},s.prototype._insert=function(m,_,g){var y=g?m:this.toBBox(m),E=[],C=this._chooseSubtree(y,this.data,_,E);for(C.children.push(m),u(C,y);_>=0&&E[_].children.length>this._maxEntries;)this._split(E,_),_--;this._adjustParentBBoxes(y,E,_)},s.prototype._split=function(m,_){var g=m[_],y=g.children.length,E=this._minEntries;this._chooseSplitAxis(g,E,y);var C=this._chooseSplitIndex(g,E,y),N=T(g.children.splice(C,g.children.length-C));N.height=g.height,N.leaf=g.leaf,a(g,this.toBBox),a(N,this.toBBox),_?m[_-1].children.push(N):this._splitRoot(g,N)},s.prototype._splitRoot=function(m,_){this.data=T([m,_]),this.data.height=m.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(m,_,g){for(var y,E,C,N,b,x,D,O=1/0,A=1/0,k=_;k<=g-_;k++){var B=l(m,0,k,this.toBBox),X=l(m,k,g,this.toBBox),ne=(E=B,C=X,N=void 0,b=void 0,x=void 0,D=void 0,N=Math.max(E.minX,C.minX),b=Math.max(E.minY,C.minY),x=Math.min(E.maxX,C.maxX),D=Math.min(E.maxY,C.maxY),Math.max(0,x-N)*Math.max(0,D-b)),ce=p(B)+p(X);ne<O?(O=ne,y=k,A=ce<A?ce:A):ne===O&&ce<A&&(A=ce,y=k)}return y||g-_},s.prototype._chooseSplitAxis=function(m,_,g){var y=m.leaf?this.compareMinX:h,E=m.leaf?this.compareMinY:f;this._allDistMargin(m,_,g,y)<this._allDistMargin(m,_,g,E)&&m.children.sort(y)},s.prototype._allDistMargin=function(m,_,g,y){m.children.sort(y);for(var E=this.toBBox,C=l(m,0,_,E),N=l(m,g-_,g,E),b=v(C)+v(N),x=_;x<g-_;x++){var D=m.children[x];u(C,m.leaf?E(D):D),b+=v(C)}for(var O=g-_-1;O>=_;O--){var A=m.children[O];u(N,m.leaf?E(A):A),b+=v(N)}return b},s.prototype._adjustParentBBoxes=function(m,_,g){for(var y=g;y>=0;y--)u(_[y],m)},s.prototype._condense=function(m){for(var _=m.length-1,g=void 0;_>=0;_--)m[_].children.length===0?_>0?(g=m[_-1].children).splice(g.indexOf(m[_]),1):this.clear():a(m[_],this.toBBox)},s})}(Du)),Du.exports}class Wg{constructor(e=[],t=qg){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}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:r}=this,i=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(r(i,o)>=0)break;t[e]=o,e=s}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,s=t[e];for(;e<i;){let o=(e<<1)+1,a=t[o];const l=o+1;if(l<this.length&&r(t[l],a)<0&&(o=l,a=t[l]),r(a,s)>=0)break;t[e]=a,e=o}t[e]=s}}function qg(n,e){return n<e?-1:n>e?1:0}const Xg=Ug(Object.freeze(Object.defineProperty({__proto__:null,default:Wg},Symbol.toStringTag,{value:"Module"})));var Gl={exports:{}},xc,ef;function Yg(){return ef||(ef=1,xc=function(e,t,r,i){var s=e[0],o=e[1],a=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=(i-r)/2,u=0,h=l-1;u<l;h=u++){var f=t[r+u*2+0],p=t[r+u*2+1],v=t[r+h*2+0],w=t[r+h*2+1],I=p>o!=w>o&&s<(v-f)*(o-p)/(w-p)+f;I&&(a=!a)}return a}),xc}var Lc,tf;function Hg(){return tf||(tf=1,Lc=function(e,t,r,i){var s=e[0],o=e[1],a=!1;r===void 0&&(r=0),i===void 0&&(i=t.length);for(var l=i-r,u=0,h=l-1;u<l;h=u++){var f=t[u+r][0],p=t[u+r][1],v=t[h+r][0],w=t[h+r][1],I=p>o!=w>o&&s<(v-f)*(o-p)/(w-p)+f;I&&(a=!a)}return a}),Lc}var rf;function Jg(){if(rf)return Gl.exports;rf=1;var n=Yg(),e=Hg();return Gl.exports=function(r,i,s,o){return i.length>0&&Array.isArray(i[0])?e(r,i,s,o):n(r,i,s,o)},Gl.exports.nested=e,Gl.exports.flat=n,Gl.exports}var Wl={exports:{}},Zg=Wl.exports,nf;function Kg(){return nf||(nf=1,function(n,e){(function(t,r){r(e)})(Zg,function(t){const i=33306690738754706e-32;function s(I,T,L,m,_){let g,y,E,C,N=T[0],b=m[0],x=0,D=0;b>N==b>-N?(g=N,N=T[++x]):(g=b,b=m[++D]);let O=0;if(x<I&&D<L)for(b>N==b>-N?(E=g-((y=N+g)-N),N=T[++x]):(E=g-((y=b+g)-b),b=m[++D]),g=y,E!==0&&(_[O++]=E);x<I&&D<L;)b>N==b>-N?(E=g-((y=g+N)-(C=y-g))+(N-C),N=T[++x]):(E=g-((y=g+b)-(C=y-g))+(b-C),b=m[++D]),g=y,E!==0&&(_[O++]=E);for(;x<I;)E=g-((y=g+N)-(C=y-g))+(N-C),N=T[++x],g=y,E!==0&&(_[O++]=E);for(;D<L;)E=g-((y=g+b)-(C=y-g))+(b-C),b=m[++D],g=y,E!==0&&(_[O++]=E);return g===0&&O!==0||(_[O++]=g),O}function o(I){return new Float64Array(I)}const a=33306690738754716e-32,l=22204460492503146e-32,u=11093356479670487e-47,h=o(4),f=o(8),p=o(12),v=o(16),w=o(4);t.orient2d=function(I,T,L,m,_,g){const y=(T-g)*(L-_),E=(I-_)*(m-g),C=y-E;if(y===0||E===0||y>0!=E>0)return C;const N=Math.abs(y+E);return Math.abs(C)>=a*N?C:-function(b,x,D,O,A,k,B){let X,ne,ce,pe,K,$,ee,ye,Oe,Ce,Pe,Fe,gt,lt,kr,Vr,Mi,zr;const Ur=b-A,Gr=D-A,ti=x-k,ri=O-k;K=(kr=(ye=Ur-(ee=($=134217729*Ur)-($-Ur)))*(Ce=ri-(Oe=($=134217729*ri)-($-ri)))-((lt=Ur*ri)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ti-(ee=($=134217729*ti)-($-ti)))*(Ce=Gr-(Oe=($=134217729*Gr)-($-Gr)))-((Vr=ti*Gr)-ee*Oe-ye*Oe-ee*Ce))),h[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),h[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,h[2]=Fe-(zr-K)+(Pe-K),h[3]=zr;let Xs=function(A0,Zp){let Kp=Zp[0];for(let Lh=1;Lh<A0;Lh++)Kp+=Zp[Lh];return Kp}(4,h),wu=l*B;if(Xs>=wu||-Xs>=wu||(X=b-(Ur+(K=b-Ur))+(K-A),ce=D-(Gr+(K=D-Gr))+(K-A),ne=x-(ti+(K=x-ti))+(K-k),pe=O-(ri+(K=O-ri))+(K-k),X===0&&ne===0&&ce===0&&pe===0)||(wu=u*B+i*Math.abs(Xs),(Xs+=Ur*pe+ri*X-(ti*ce+Gr*ne))>=wu||-Xs>=wu))return Xs;K=(kr=(ye=X-(ee=($=134217729*X)-($-X)))*(Ce=ri-(Oe=($=134217729*ri)-($-ri)))-((lt=X*ri)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ne-(ee=($=134217729*ne)-($-ne)))*(Ce=Gr-(Oe=($=134217729*Gr)-($-Gr)))-((Vr=ne*Gr)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const M0=s(4,h,4,w,f);K=(kr=(ye=Ur-(ee=($=134217729*Ur)-($-Ur)))*(Ce=pe-(Oe=($=134217729*pe)-($-pe)))-((lt=Ur*pe)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ti-(ee=($=134217729*ti)-($-ti)))*(Ce=ce-(Oe=($=134217729*ce)-($-ce)))-((Vr=ti*ce)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const x0=s(M0,f,4,w,p);K=(kr=(ye=X-(ee=($=134217729*X)-($-X)))*(Ce=pe-(Oe=($=134217729*pe)-($-pe)))-((lt=X*pe)-ee*Oe-ye*Oe-ee*Ce))-(Pe=kr-(Mi=(ye=ne-(ee=($=134217729*ne)-($-ne)))*(Ce=ce-(Oe=($=134217729*ce)-($-ce)))-((Vr=ne*ce)-ee*Oe-ye*Oe-ee*Ce))),w[0]=kr-(Pe+K)+(K-Mi),K=(gt=lt-((Fe=lt+Pe)-(K=Fe-lt))+(Pe-K))-(Pe=gt-Vr),w[1]=gt-(Pe+K)+(K-Vr),K=(zr=Fe+Pe)-Fe,w[2]=Fe-(zr-K)+(Pe-K),w[3]=zr;const L0=s(x0,p,4,w,v);return v[L0-1]}(I,T,L,m,_,g,N)},t.orient2dfast=function(I,T,L,m,_,g){return(T-g)*(L-_)-(I-_)*(m-g)},Object.defineProperty(t,"__esModule",{value:!0})})}(Wl,Wl.exports)),Wl.exports}var sf;function Qg(){if(sf)return Nu.exports;sf=1;var n=jh(),e=Xg,t=Jg(),r=Kg().orient2d;e.default&&(e=e.default),Nu.exports=i,Nu.exports.default=i;function i(g,y,E){y=Math.max(0,y===void 0?2:y),E=E||0;var C=v(g),N=new n(16);N.toBBox=function(ee){return{minX:ee[0],minY:ee[1],maxX:ee[0],maxY:ee[1]}},N.compareMinX=function(ee,ye){return ee[0]-ye[0]},N.compareMinY=function(ee,ye){return ee[1]-ye[1]},N.load(g);for(var b=[],x=0,D;x<C.length;x++){var O=C[x];N.remove(O),D=w(O,D),b.push(D)}var A=new n(16);for(x=0;x<b.length;x++)A.insert(p(b[x]));for(var k=y*y,B=E*E;b.length;){var X=b.shift(),ne=X.p,ce=X.next.p,pe=I(ne,ce);if(!(pe<B)){var K=pe/k;O=s(N,X.prev.p,ne,ce,X.next.next.p,K,A),O&&Math.min(I(O,ne),I(O,ce))<=K&&(b.push(X),b.push(w(O,X)),N.remove(O),A.remove(X),A.insert(p(X)),A.insert(p(X.next)))}}X=D;var $=[];do $.push(X.p),X=X.next;while(X!==D);return $.push(X.p),$}function s(g,y,E,C,N,b,x){for(var D=new e([],o),O=g.data;O;){for(var A=0;A<O.children.length;A++){var k=O.children[A],B=O.leaf?T(k,E,C):a(E,C,k);B>b||D.push({node:k,dist:B})}for(;D.length&&!D.peek().node.children;){var X=D.pop(),ne=X.node,ce=T(ne,y,E),pe=T(ne,C,N);if(X.dist<ce&&X.dist<pe&&u(E,ne,x)&&u(C,ne,x))return ne}O=D.pop(),O&&(O=O.node)}return null}function o(g,y){return g.dist-y.dist}function a(g,y,E){if(l(g,E)||l(y,E))return 0;var C=L(g[0],g[1],y[0],y[1],E.minX,E.minY,E.maxX,E.minY);if(C===0)return 0;var N=L(g[0],g[1],y[0],y[1],E.minX,E.minY,E.minX,E.maxY);if(N===0)return 0;var b=L(g[0],g[1],y[0],y[1],E.maxX,E.minY,E.maxX,E.maxY);if(b===0)return 0;var x=L(g[0],g[1],y[0],y[1],E.minX,E.maxY,E.maxX,E.maxY);return x===0?0:Math.min(C,N,b,x)}function l(g,y){return g[0]>=y.minX&&g[0]<=y.maxX&&g[1]>=y.minY&&g[1]<=y.maxY}function u(g,y,E){for(var C=Math.min(g[0],y[0]),N=Math.min(g[1],y[1]),b=Math.max(g[0],y[0]),x=Math.max(g[1],y[1]),D=E.search({minX:C,minY:N,maxX:b,maxY:x}),O=0;O<D.length;O++)if(f(D[O].p,D[O].next.p,g,y))return!1;return!0}function h(g,y,E){return r(g[0],g[1],y[0],y[1],E[0],E[1])}function f(g,y,E,C){return g!==C&&y!==E&&h(g,y,E)>0!=h(g,y,C)>0&&h(E,C,g)>0!=h(E,C,y)>0}function p(g){var y=g.p,E=g.next.p;return g.minX=Math.min(y[0],E[0]),g.minY=Math.min(y[1],E[1]),g.maxX=Math.max(y[0],E[0]),g.maxY=Math.max(y[1],E[1]),g}function v(g){for(var y=g[0],E=g[0],C=g[0],N=g[0],b=0;b<g.length;b++){var x=g[b];x[0]<y[0]&&(y=x),x[0]>C[0]&&(C=x),x[1]<E[1]&&(E=x),x[1]>N[1]&&(N=x)}var D=[y,E,C,N],O=D.slice();for(b=0;b<g.length;b++)t(g[b],D)||O.push(g[b]);return _(O)}function w(g,y){var E={p:g,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return y?(E.next=y.next,E.prev=y,y.next.prev=E,y.next=E):(E.prev=E,E.next=E),E}function I(g,y){var E=g[0]-y[0],C=g[1]-y[1];return E*E+C*C}function T(g,y,E){var C=y[0],N=y[1],b=E[0]-C,x=E[1]-N;if(b!==0||x!==0){var D=((g[0]-C)*b+(g[1]-N)*x)/(b*b+x*x);D>1?(C=E[0],N=E[1]):D>0&&(C+=b*D,N+=x*D)}return b=g[0]-C,x=g[1]-N,b*b+x*x}function L(g,y,E,C,N,b,x,D){var O=E-g,A=C-y,k=x-N,B=D-b,X=g-N,ne=y-b,ce=O*O+A*A,pe=O*k+A*B,K=k*k+B*B,$=O*X+A*ne,ee=k*X+B*ne,ye=ce*K-pe*pe,Oe,Ce,Pe,Fe,gt=ye,lt=ye;ye===0?(Ce=0,gt=1,Fe=ee,lt=K):(Ce=pe*ee-K*$,Fe=ce*ee-pe*$,Ce<0?(Ce=0,Fe=ee,lt=K):Ce>gt&&(Ce=gt,Fe=ee+pe,lt=K)),Fe<0?(Fe=0,-$<0?Ce=0:-$>ce?Ce=gt:(Ce=-$,gt=ce)):Fe>lt&&(Fe=lt,-$+pe<0?Ce=0:-$+pe>ce?Ce=gt:(Ce=-$+pe,gt=ce)),Oe=Ce===0?0:Ce/gt,Pe=Fe===0?0:Fe/lt;var kr=(1-Oe)*g+Oe*E,Vr=(1-Oe)*y+Oe*C,Mi=(1-Pe)*N+Pe*x,zr=(1-Pe)*b+Pe*D,Ur=Mi-kr,Gr=zr-Vr;return Ur*Ur+Gr*Gr}function m(g,y){return g[0]===y[0]?g[1]-y[1]:g[0]-y[0]}function _(g){g.sort(m);for(var y=[],E=0;E<g.length;E++){for(;y.length>=2&&h(y[y.length-2],y[y.length-1],g[E])<=0;)y.pop();y.push(g[E])}for(var C=[],N=g.length-1;N>=0;N--){for(;C.length>=2&&h(C[C.length-2],C[C.length-1],g[N])<=0;)C.pop();C.push(g[N])}return C.pop(),y.pop(),y.concat(C)}return Nu.exports}var Bg=Qg();const $g=Bh(Bg);function jg(n,e){e===void 0&&(e={}),e.concavity=e.concavity||1/0;var t=[];if(rl(n,function(i){t.push([i[0],i[1]])}),!t.length)return null;var r=$g(t,e.concavity);return r.length>3?ar([r]):null}function of(n,e){e===void 0&&(e={});var t=0,r=0,i=0;return rl(n,function(s){t+=s[0],r+=s[1],i++},!0),Xe([t/i,r/i],e.properties)}function af(n,e){switch(e===void 0&&(e={}),xg(n)){case"Point":return Xe(lr(n),e.properties);case"Polygon":var t=[];rl(n,function(g){t.push(g)});var r=of(n,{properties:e.properties}),i=r.geometry.coordinates,s=0,o=0,a=0,l,u,h,f,p,v,w,I,T=t.map(function(g){return[g[0]-i[0],g[1]-i[1]]});for(l=0;l<t.length-1;l++)u=T[l],f=u[0],v=u[1],h=T[l+1],p=h[0],w=h[1],I=f*w-p*v,a+=I,s+=(f+p)*I,o+=(v+w)*I;if(a===0)return r;var L=a*.5,m=1/(6*L);return Xe([i[0]+m*s,i[1]+m*o],e.properties);default:var _=jg(n);return _?af(_,{properties:e.properties}):of(n,{properties:e.properties})}}function em(n){(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1]||n[0][2]!==n[n.length-1][2])&&n.push(n[0]);const e=ar([n]),r=af(e).geometry.coordinates;return[r[0],r[1],r[2]??n[0][2]??0]}function tm(n,e,t,r){const[i,s,o]=n,a=tl(Xe([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function Ac(n,e){return xi(Xe(n),Xe(e),{units:"meters"})}function bu(n,e){return Ul(Xe(n),Xe(e))}function lf(n){if(!n)throw new Error("geojson is required");var e=[];return bc(n,function(t){rm(t,e)}),el(e)}function rm(n,e){var t=[],r=n.geometry;if(r!==null){switch(r.type){case"Polygon":t=Hs(r);break;case"LineString":t=[Hs(r)]}t.forEach(function(i){var s=nm(i,n.properties);s.forEach(function(o){o.id=e.length,e.push(o)})})}}function nm(n,e){var t=[];return n.reduce(function(r,i){var s=On([r,i],e);return s.bbox=im(r,i),t.push(s),i}),t}function im(n,e){var t=n[0],r=n[1],i=e[0],s=e[1],o=t<i?t:i,a=r<s?r:s,l=t>i?t:i,u=r>s?r:s;return[o,a,l,u]}var Ou={exports:{}},Rc={},uf;function cf(){return uf||(uf=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.earthRadius=63710088e-1,n.factors={centimeters:n.earthRadius*100,centimetres:n.earthRadius*100,degrees:n.earthRadius/111325,feet:n.earthRadius*3.28084,inches:n.earthRadius*39.37,kilometers:n.earthRadius/1e3,kilometres:n.earthRadius/1e3,meters:n.earthRadius,metres:n.earthRadius,miles:n.earthRadius/1609.344,millimeters:n.earthRadius*1e3,millimetres:n.earthRadius*1e3,nauticalmiles:n.earthRadius/1852,radians:1,yards:n.earthRadius*1.0936},n.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/n.earthRadius,yards:1.0936133},n.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(D,O,A){A===void 0&&(A={});var k={type:"Feature"};return(A.id===0||A.id)&&(k.id=A.id),A.bbox&&(k.bbox=A.bbox),k.properties=O||{},k.geometry=D,k}n.feature=e;function t(D,O,A){switch(D){case"Point":return r(O).geometry;case"LineString":return a(O).geometry;case"Polygon":return s(O).geometry;case"MultiPoint":return f(O).geometry;case"MultiLineString":return h(O).geometry;case"MultiPolygon":return p(O).geometry;default:throw new Error(D+" is invalid")}}n.geometry=t;function r(D,O,A){if(A===void 0&&(A={}),!D)throw new Error("coordinates is required");if(!Array.isArray(D))throw new Error("coordinates must be an Array");if(D.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!C(D[0])||!C(D[1]))throw new Error("coordinates must contain numbers");var k={type:"Point",coordinates:D};return e(k,O,A)}n.point=r;function i(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return r(k,O)}),A)}n.points=i;function s(D,O,A){A===void 0&&(A={});for(var k=0,B=D;k<B.length;k++){var X=B[k];if(X.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ne=0;ne<X[X.length-1].length;ne++)if(X[X.length-1][ne]!==X[0][ne])throw new Error("First and last Position are not equivalent.")}var ce={type:"Polygon",coordinates:D};return e(ce,O,A)}n.polygon=s;function o(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return s(k,O)}),A)}n.polygons=o;function a(D,O,A){if(A===void 0&&(A={}),D.length<2)throw new Error("coordinates must be an array of two or more positions");var k={type:"LineString",coordinates:D};return e(k,O,A)}n.lineString=a;function l(D,O,A){return A===void 0&&(A={}),u(D.map(function(k){return a(k,O)}),A)}n.lineStrings=l;function u(D,O){O===void 0&&(O={});var A={type:"FeatureCollection"};return O.id&&(A.id=O.id),O.bbox&&(A.bbox=O.bbox),A.features=D,A}n.featureCollection=u;function h(D,O,A){A===void 0&&(A={});var k={type:"MultiLineString",coordinates:D};return e(k,O,A)}n.multiLineString=h;function f(D,O,A){A===void 0&&(A={});var k={type:"MultiPoint",coordinates:D};return e(k,O,A)}n.multiPoint=f;function p(D,O,A){A===void 0&&(A={});var k={type:"MultiPolygon",coordinates:D};return e(k,O,A)}n.multiPolygon=p;function v(D,O,A){A===void 0&&(A={});var k={type:"GeometryCollection",geometries:D};return e(k,O,A)}n.geometryCollection=v;function w(D,O){if(O===void 0&&(O=0),O&&!(O>=0))throw new Error("precision must be a positive number");var A=Math.pow(10,O||0);return Math.round(D*A)/A}n.round=w;function I(D,O){O===void 0&&(O="kilometers");var A=n.factors[O];if(!A)throw new Error(O+" units is invalid");return D*A}n.radiansToLength=I;function T(D,O){O===void 0&&(O="kilometers");var A=n.factors[O];if(!A)throw new Error(O+" units is invalid");return D/A}n.lengthToRadians=T;function L(D,O){return _(T(D,O))}n.lengthToDegrees=L;function m(D){var O=D%360;return O<0&&(O+=360),O}n.bearingToAzimuth=m;function _(D){var O=D%(2*Math.PI);return O*180/Math.PI}n.radiansToDegrees=_;function g(D){var O=D%360;return O*Math.PI/180}n.degreesToRadians=g;function y(D,O,A){if(O===void 0&&(O="kilometers"),A===void 0&&(A="kilometers"),!(D>=0))throw new Error("length must be a positive number");return I(T(D,O),A)}n.convertLength=y;function E(D,O,A){if(O===void 0&&(O="meters"),A===void 0&&(A="kilometers"),!(D>=0))throw new Error("area must be a positive number");var k=n.areaFactors[O];if(!k)throw new Error("invalid original units");var B=n.areaFactors[A];if(!B)throw new Error("invalid final units");return D/k*B}n.convertArea=E;function C(D){return!isNaN(D)&&D!==null&&!Array.isArray(D)}n.isNumber=C;function N(D){return!!D&&D.constructor===Object}n.isObject=N;function b(D){if(!D)throw new Error("bbox is required");if(!Array.isArray(D))throw new Error("bbox must be an Array");if(D.length!==4&&D.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");D.forEach(function(O){if(!C(O))throw new Error("bbox must only contain numbers")})}n.validateBBox=b;function x(D){if(!D)throw new Error("id is required");if(["string","number"].indexOf(typeof D)===-1)throw new Error("id must be a number or a string")}n.validateId=x}(Rc)),Rc}var mt={},hf;function ff(){if(hf)return mt;hf=1,Object.defineProperty(mt,"__esModule",{value:!0});var n=cf();function e(m,_,g){if(m!==null)for(var y,E,C,N,b,x,D,O=0,A=0,k,B=m.type,X=B==="FeatureCollection",ne=B==="Feature",ce=X?m.features.length:1,pe=0;pe<ce;pe++){D=X?m.features[pe].geometry:ne?m.geometry:m,k=D?D.type==="GeometryCollection":!1,b=k?D.geometries.length:1;for(var K=0;K<b;K++){var $=0,ee=0;if(N=k?D.geometries[K]:D,N!==null){x=N.coordinates;var ye=N.type;switch(O=g&&(ye==="Polygon"||ye==="MultiPolygon")?1:0,ye){case null:break;case"Point":if(_(x,A,pe,$,ee)===!1)return!1;A++,$++;break;case"LineString":case"MultiPoint":for(y=0;y<x.length;y++){if(_(x[y],A,pe,$,ee)===!1)return!1;A++,ye==="MultiPoint"&&$++}ye==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(y=0;y<x.length;y++){for(E=0;E<x[y].length-O;E++){if(_(x[y][E],A,pe,$,ee)===!1)return!1;A++}ye==="MultiLineString"&&$++,ye==="Polygon"&&ee++}ye==="Polygon"&&$++;break;case"MultiPolygon":for(y=0;y<x.length;y++){for(ee=0,E=0;E<x[y].length;E++){for(C=0;C<x[y][E].length-O;C++){if(_(x[y][E][C],A,pe,$,ee)===!1)return!1;A++}ee++}$++}break;case"GeometryCollection":for(y=0;y<N.geometries.length;y++)if(e(N.geometries[y],_,g)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function t(m,_,g,y){var E=g;return e(m,function(C,N,b,x,D){N===0&&g===void 0?E=C:E=_(E,C,N,b,x,D)},y),E}function r(m,_){var g;switch(m.type){case"FeatureCollection":for(g=0;g<m.features.length&&_(m.features[g].properties,g)!==!1;g++);break;case"Feature":_(m.properties,0);break}}function i(m,_,g){var y=g;return r(m,function(E,C){C===0&&g===void 0?y=E:y=_(y,E,C)}),y}function s(m,_){if(m.type==="Feature")_(m,0);else if(m.type==="FeatureCollection")for(var g=0;g<m.features.length&&_(m.features[g],g)!==!1;g++);}function o(m,_,g){var y=g;return s(m,function(E,C){C===0&&g===void 0?y=E:y=_(y,E,C)}),y}function a(m){var _=[];return e(m,function(g){_.push(g)}),_}function l(m,_){var g,y,E,C,N,b,x,D,O,A,k=0,B=m.type==="FeatureCollection",X=m.type==="Feature",ne=B?m.features.length:1;for(g=0;g<ne;g++){for(b=B?m.features[g].geometry:X?m.geometry:m,D=B?m.features[g].properties:X?m.properties:{},O=B?m.features[g].bbox:X?m.bbox:void 0,A=B?m.features[g].id:X?m.id:void 0,x=b?b.type==="GeometryCollection":!1,N=x?b.geometries.length:1,E=0;E<N;E++){if(C=x?b.geometries[E]:b,C===null){if(_(null,k,D,O,A)===!1)return!1;continue}switch(C.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(C,k,D,O,A)===!1)return!1;break}case"GeometryCollection":{for(y=0;y<C.geometries.length;y++)if(_(C.geometries[y],k,D,O,A)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}k++}}function u(m,_,g){var y=g;return l(m,function(E,C,N,b,x){C===0&&g===void 0?y=E:y=_(y,E,C,N,b,x)}),y}function h(m,_){l(m,function(g,y,E,C,N){var b=g===null?null:g.type;switch(b){case null:case"Point":case"LineString":case"Polygon":return _(n.feature(g,E,{bbox:C,id:N}),y,0)===!1?!1:void 0}var x;switch(b){case"MultiPoint":x="Point";break;case"MultiLineString":x="LineString";break;case"MultiPolygon":x="Polygon";break}for(var D=0;D<g.coordinates.length;D++){var O=g.coordinates[D],A={type:x,coordinates:O};if(_(n.feature(A,E),y,D)===!1)return!1}})}function f(m,_,g){var y=g;return h(m,function(E,C,N){C===0&&N===0&&g===void 0?y=E:y=_(y,E,C,N)}),y}function p(m,_){h(m,function(g,y,E){var C=0;if(g.geometry){var N=g.geometry.type;if(!(N==="Point"||N==="MultiPoint")){var b,x=0,D=0,O=0;if(e(g,function(A,k,B,X,ne){if(b===void 0||y>x||X>D||ne>O){b=A,x=y,D=X,O=ne,C=0;return}var ce=n.lineString([b,A],g.properties);if(_(ce,y,E,ne,C)===!1)return!1;C++,b=A})===!1)return!1}}})}function v(m,_,g){var y=g,E=!1;return p(m,function(C,N,b,x,D){E===!1&&g===void 0?y=C:y=_(y,C,N,b,x,D),E=!0}),y}function w(m,_){if(!m)throw new Error("geojson is required");h(m,function(g,y,E){if(g.geometry!==null){var C=g.geometry.type,N=g.geometry.coordinates;switch(C){case"LineString":if(_(g,y,E,0,0)===!1)return!1;break;case"Polygon":for(var b=0;b<N.length;b++)if(_(n.lineString(N[b],g.properties),y,E,b)===!1)return!1;break}}})}function I(m,_,g){var y=g;return w(m,function(E,C,N,b){C===0&&g===void 0?y=E:y=_(y,E,C,N,b)}),y}function T(m,_){if(_=_||{},!n.isObject(_))throw new Error("options is invalid");var g=_.featureIndex||0,y=_.multiFeatureIndex||0,E=_.geometryIndex||0,C=_.segmentIndex||0,N=_.properties,b;switch(m.type){case"FeatureCollection":g<0&&(g=m.features.length+g),N=N||m.features[g].properties,b=m.features[g].geometry;break;case"Feature":N=N||m.properties,b=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":b=m;break;default:throw new Error("geojson is invalid")}if(b===null)return null;var x=b.coordinates;switch(b.type){case"Point":case"MultiPoint":return null;case"LineString":return C<0&&(C=x.length+C-1),n.lineString([x[C],x[C+1]],N,_);case"Polygon":return E<0&&(E=x.length+E),C<0&&(C=x[E].length+C-1),n.lineString([x[E][C],x[E][C+1]],N,_);case"MultiLineString":return y<0&&(y=x.length+y),C<0&&(C=x[y].length+C-1),n.lineString([x[y][C],x[y][C+1]],N,_);case"MultiPolygon":return y<0&&(y=x.length+y),E<0&&(E=x[y].length+E),C<0&&(C=x[y][E].length-C-1),n.lineString([x[y][E][C],x[y][E][C+1]],N,_)}throw new Error("geojson is invalid")}function L(m,_){if(_=_||{},!n.isObject(_))throw new Error("options is invalid");var g=_.featureIndex||0,y=_.multiFeatureIndex||0,E=_.geometryIndex||0,C=_.coordIndex||0,N=_.properties,b;switch(m.type){case"FeatureCollection":g<0&&(g=m.features.length+g),N=N||m.features[g].properties,b=m.features[g].geometry;break;case"Feature":N=N||m.properties,b=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":b=m;break;default:throw new Error("geojson is invalid")}if(b===null)return null;var x=b.coordinates;switch(b.type){case"Point":return n.point(x,N,_);case"MultiPoint":return y<0&&(y=x.length+y),n.point(x[y],N,_);case"LineString":return C<0&&(C=x.length+C),n.point(x[C],N,_);case"Polygon":return E<0&&(E=x.length+E),C<0&&(C=x[E].length+C),n.point(x[E][C],N,_);case"MultiLineString":return y<0&&(y=x.length+y),C<0&&(C=x[y].length+C),n.point(x[y][C],N,_);case"MultiPolygon":return y<0&&(y=x.length+y),E<0&&(E=x[y].length+E),C<0&&(C=x[y][E].length-C),n.point(x[y][E][C],N,_)}throw new Error("geojson is invalid")}return mt.coordAll=a,mt.coordEach=e,mt.coordReduce=t,mt.featureEach=s,mt.featureReduce=o,mt.findPoint=L,mt.findSegment=T,mt.flattenEach=h,mt.flattenReduce=f,mt.geomEach=l,mt.geomReduce=u,mt.lineEach=w,mt.lineReduce=I,mt.propEach=r,mt.propReduce=i,mt.segmentEach=p,mt.segmentReduce=v,mt}var Mu={},df;function sm(){if(df)return Mu;df=1,Object.defineProperty(Mu,"__esModule",{value:!0});var n=ff();function e(t){var r=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,function(i){r[0]>i[0]&&(r[0]=i[0]),r[1]>i[1]&&(r[1]=i[1]),r[2]<i[0]&&(r[2]=i[0]),r[3]<i[1]&&(r[3]=i[1])}),r}return e.default=e,Mu.default=e,Mu}var pf;function om(){if(pf)return Ou.exports;pf=1;var n=jh(),e=cf(),t=ff(),r=sm().default,i=t.featureEach;t.coordEach,e.polygon;var s=e.featureCollection;function o(a){var l=new n(a);return l.insert=function(u){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:r(u),n.prototype.insert.call(this,u)},l.load=function(u){var h=[];return Array.isArray(u)?u.forEach(function(f){if(f.type!=="Feature")throw new Error("invalid features");f.bbox=f.bbox?f.bbox:r(f),h.push(f)}):i(u,function(f){if(f.type!=="Feature")throw new Error("invalid features");f.bbox=f.bbox?f.bbox:r(f),h.push(f)}),n.prototype.load.call(this,h)},l.remove=function(u,h){if(u.type!=="Feature")throw new Error("invalid feature");return u.bbox=u.bbox?u.bbox:r(u),n.prototype.remove.call(this,u,h)},l.clear=function(){return n.prototype.clear.call(this)},l.search=function(u){var h=n.prototype.search.call(this,this.toBBox(u));return s(h)},l.collides=function(u){return n.prototype.collides.call(this,this.toBBox(u))},l.all=function(){var u=n.prototype.all.call(this);return s(u)},l.toJSON=function(){return n.prototype.toJSON.call(this)},l.fromJSON=function(u){return n.prototype.fromJSON.call(this,u)},l.toBBox=function(u){var h;if(u.bbox)h=u.bbox;else if(Array.isArray(u)&&u.length===4)h=u;else if(Array.isArray(u)&&u.length===6)h=[u[0],u[1],u[3],u[4]];else if(u.type==="Feature")h=r(u);else if(u.type==="FeatureCollection")h=r(u);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},l}return Ou.exports=o,Ou.exports.default=o,Ou.exports}var am=om();const lm=Bh(am);function gf(n,e){var t={},r=[];if(n.type==="LineString"&&(n=bn(n)),e.type==="LineString"&&(e=bn(e)),n.type==="Feature"&&e.type==="Feature"&&n.geometry!==null&&e.geometry!==null&&n.geometry.type==="LineString"&&e.geometry.type==="LineString"&&n.geometry.coordinates.length===2&&e.geometry.coordinates.length===2){var i=mf(n,e);return i&&r.push(i),el(r)}var s=lm();return s.load(lf(e)),Iu(lf(n),function(o){Iu(s.search(o),function(a){var l=mf(o,a);if(l){var u=Hs(l).join(",");t[u]||(t[u]=!0,r.push(l))}})}),el(r)}function mf(n,e){var t=Hs(n),r=Hs(e);if(t.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(r.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],l=r[0][0],u=r[0][1],h=r[1][0],f=r[1][1],p=(f-u)*(o-i)-(h-l)*(a-s),v=(h-l)*(s-u)-(f-u)*(i-l),w=(o-i)*(s-u)-(a-s)*(i-l);if(p===0)return null;var I=v/p,T=w/p;if(I>=0&&I<=1&&T>=0&&T<=1){var L=i+I*(o-i),m=s+I*(a-s);return Xe([L,m])}return null}function um(n,e){return gf(On(n),On(e))}function cm(n,e){var t=xi(n,e),r=Ul(n,e),i=tl(n,t/2,r);return i}function hm(n,e){const t=Xe(n),r=Xe(e),i=cm(t,r),s=(n[2]+e[2])/2;return[...i.geometry.coordinates,s]}function fm(n,e,t){t===void 0&&(t={});var r=Xe([1/0,1/0],{dist:1/0}),i=0;return bc(n,function(s){for(var o=Hs(s),a=0;a<o.length-1;a++){var l=Xe(o[a]);l.properties.dist=xi(e,l,t);var u=Xe(o[a+1]);u.properties.dist=xi(e,u,t);var h=xi(l,u,t),f=Math.max(l.properties.dist,u.properties.dist),p=Ul(l,u),v=tl(e,f,p+90,t),w=tl(e,f,p-90,t),I=gf(On([v.geometry.coordinates,w.geometry.coordinates]),On([l.geometry.coordinates,u.geometry.coordinates])),T=null;I.features.length>0&&(T=I.features[0],T.properties.dist=xi(e,T,t),T.properties.location=i+xi(l,T,t)),l.properties.dist<r.properties.dist&&(r=l,r.properties.index=a,r.properties.location=i),u.properties.dist<r.properties.dist&&(r=u,r.properties.index=a+1,r.properties.location=i+h),T&&T.properties.dist<r.properties.dist&&(r=T,r.properties.index=a),i+=h}}),r}function dm(n,e){const t=Xe(e),r=On(n);return fm(r,t,{units:"meters"})}function vf(n,e,t){t===void 0&&(t={});var r=lr(n),i=lr(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var s=pm(r,i),o=Dc(s,"meters",t.units);return o}function pm(n,e,t){t=t===void 0?Ut:Number(t);var r=t,i=n[1]*Math.PI/180,s=e[1]*Math.PI/180,o=s-i,a=Math.abs(e[0]-n[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var l=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),u=Math.abs(l)>1e-11?o/l:Math.cos(i),h=Math.sqrt(o*o+u*u*a*a),f=h*r;return f}function gm(n,e,t){if(t===void 0&&(t={}),t.method||(t.method="geodesic"),t.units||(t.units="kilometers"),!n)throw new Error("pt is required");if(Array.isArray(n)?n=Xe(n):n.type==="Point"?n=bn(n):Jh(n,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=On(e):e.type==="LineString"?e=bn(e):Jh(e,"LineString","line");var r=1/0,i=n.geometry.coordinates;return kg(e,function(s){var o=s.geometry.coordinates[0],a=s.geometry.coordinates[1],l=mm(i,o,a,t);l<r&&(r=l)}),Dc(r,"degrees",t.units)}function mm(n,e,t,r){var i=[t[0]-e[0],t[1]-e[1]],s=[n[0]-e[0],n[1]-e[1]],o=yf(s,i);if(o<=0)return Fc(n,e,{method:r.method,units:"degrees"});var a=yf(i,i);if(a<=o)return Fc(n,t,{method:r.method,units:"degrees"});var l=o/a,u=[e[0]+l*i[0],e[1]+l*i[1]];return Fc(n,u,{method:r.method,units:"degrees"})}function yf(n,e){return n[0]*e[0]+n[1]*e[1]}function Fc(n,e,t){return t.method==="planar"?vf(n,e,t):xi(n,e,t)}function vm(n,e){const t=Xe(n),r=On(e);return gm(t,r,{units:"meters"})}function ym(n,e,t,r){r===void 0&&(r={});var i=e<0,s=Dc(Math.abs(e),r.units,"meters");i&&(s=-Math.abs(s));var o=lr(n),a=_m(o,s,t);return a[0]+=a[0]-o[0]>180?-360:o[0]-a[0]>180?360:0,Xe(a,r.properties)}function _m(n,e,t,r){r=r===void 0?Ut:Number(r);var i=e/r,s=n[0]*Math.PI/180,o=$t(n[1]),a=$t(t),l=i*Math.cos(a),u=o+l;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),f=Math.abs(h)>1e-11?l/h:Math.cos(o),p=i*Math.sin(a)/f,v=s+p;return[(v*180/Math.PI+540)%360-180,u*180/Math.PI]}function wm(n,e,t,r){const[i,s,o]=n,a=ym(Xe([i,s]),e,t,{units:"meters"});if(!(!a||!a.geometry||!a.geometry.coordinates))return r=r||[0,0,0],r[0]=a.geometry.coordinates[0],r[1]=a.geometry.coordinates[1],r[2]=o,r}function _f(n,e){return vf(Xe(n),Xe(e),{units:"meters"})}function Em(n,e,t){t===void 0&&(t={});var r;t.final?r=wf(lr(e),lr(n)):r=wf(lr(n),lr(e));var i=r>180?-(360-r):r;return i}function wf(n,e){var t=$t(n[1]),r=$t(e[1]),i=$t(e[0]-n[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var s=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=Math.atan2(i,s);return(Pu(o)+360)%360}function Sm(n,e){return Em(Xe(n),Xe(e))}function Mn(n){var e=[1/0,1/0,-1/0,-1/0];return rl(n,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}Mn.default=Mn;function xn(n,e,t){if(t===void 0&&(t={}),!n)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=lr(n),i=Wr(e),s=i.type,o=e.bbox,a=i.coordinates;if(o&&Cm(r,o)===!1)return!1;s==="Polygon"&&(a=[a]);for(var l=!1,u=0;u<a.length&&!l;u++)if(Ef(r,a[u][0],t.ignoreBoundary)){for(var h=!1,f=1;f<a[u].length&&!h;)Ef(r,a[u][f],!t.ignoreBoundary)&&(h=!0),f++;h||(l=!0)}return l}function Ef(n,e,t){var r=!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],l=e[s][0],u=e[s][1],h=n[1]*(o-l)+a*(l-n[0])+u*(n[0]-o)===0&&(o-n[0])*(l-n[0])<=0&&(a-n[1])*(u-n[1])<=0;if(h)return!t;var f=a>n[1]!=u>n[1]&&n[0]<(l-o)*(n[1]-a)/(u-a)+o;f&&(r=!r)}return r}function Cm(n,e){return e[0]<=n[0]&&e[1]<=n[1]&&e[2]>=n[0]&&e[3]>=n[1]}function Li(n,e,t){t===void 0&&(t={});for(var r=lr(n),i=Hs(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")),Pm(i[s],i[s+1],r,o,typeof t.epsilon>"u"?null:t.epsilon))return!0}return!1}function Pm(n,e,t,r,i){var s=t[0],o=t[1],a=n[0],l=n[1],u=e[0],h=e[1],f=t[0]-a,p=t[1]-l,v=u-a,w=h-l,I=f*w-p*v;if(i!==null){if(Math.abs(I)>i)return!1}else if(I!==0)return!1;if(r){if(r==="start")return Math.abs(v)>=Math.abs(w)?v>0?a<s&&s<=u:u<=s&&s<a:w>0?l<o&&o<=h:h<=o&&o<l;if(r==="end")return Math.abs(v)>=Math.abs(w)?v>0?a<=s&&s<u:u<s&&s<=a:w>0?l<=o&&o<h:h<o&&o<=l;if(r==="both")return Math.abs(v)>=Math.abs(w)?v>0?a<s&&s<u:u<s&&s<a:w>0?l<o&&o<h:h<o&&o<l}else return Math.abs(v)>=Math.abs(w)?v>0?a<=s&&s<=u:u<=s&&s<=a:w>0?l<=o&&o<=h:h<=o&&o<=l;return!1}function Im(n,e){var t=Wr(n),r=Wr(e),i=t.type,s=r.type,o=t.coordinates,a=r.coordinates;switch(i){case"Point":switch(s){case"Point":return kc(o,a);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"Point":return Tm(t,r);case"MultiPoint":return Nm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return Li(r,t,{ignoreEndVertices:!0});case"LineString":return Om(t,r);case"MultiPoint":return Dm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return xn(r,t,{ignoreBoundary:!0});case"LineString":return Mm(t,r);case"Polygon":return xm(t,r);case"MultiPoint":return bm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Tm(n,e){var t,r=!1;for(t=0;t<n.coordinates.length;t++)if(kc(n.coordinates[t],e.coordinates)){r=!0;break}return r}function Nm(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){for(var i=r[t],s=!1,o=0,a=n.coordinates;o<a.length;o++){var l=a[o];if(kc(i,l)){s=!0;break}}if(!s)return!1}return!0}function Dm(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var s=i[r];if(Li(s,n,{ignoreEndVertices:!0})&&(t=!0),!Li(s,n))return!1}return!!t}function bm(n,e){for(var t=0,r=e.coordinates;t<r.length;t++){var i=r[t];if(!xn(i,n,{ignoreBoundary:!0}))return!1}return!0}function Om(n,e){for(var t=!1,r=0,i=e.coordinates;r<i.length;r++){var s=i[r];if(Li({type:"Point",coordinates:s},n,{ignoreEndVertices:!0})&&(t=!0),!Li({type:"Point",coordinates:s},n,{ignoreEndVertices:!1}))return!1}return t}function Mm(n,e){var t=!1,r=0,i=Mn(n),s=Mn(e);if(!Sf(i,s))return!1;for(r;r<e.coordinates.length-1;r++){var o=Lm(e.coordinates[r],e.coordinates[r+1]);if(xn({type:"Point",coordinates:o},n,{ignoreBoundary:!0})){t=!0;break}}return t}function xm(n,e){if(n.type==="Feature"&&n.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;var t=Mn(n),r=Mn(e);if(!Sf(t,r))return!1;for(var i=Wr(e).coordinates,s=0,o=i;s<o.length;s++)for(var a=o[s],l=0,u=a;l<u.length;l++){var h=u[l];if(!xn(h,n))return!1}return!0}function Sf(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function kc(n,e){return n[0]===e[0]&&n[1]===e[1]}function Lm(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function Am(n,e){var t=Wr(n),r=Wr(e),i=t.type,s=r.type;switch(i){case"Point":switch(s){case"MultiPoint":return Rm(t,r);case"LineString":return Li(t,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return xn(t,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Fm(t,r);case"LineString":return km(t,r);case"Polygon":case"MultiPolygon":return Vm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return zm(t,r);case"Polygon":case"MultiPolygon":return Um(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Gm(t,r);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Rm(n,e){var t,r=!1;for(t=0;t<e.coordinates.length;t++)if(Pf(e.coordinates[t],n.coordinates)){r=!0;break}return r}function Fm(n,e){for(var t=0;t<n.coordinates.length;t++){for(var r=!1,i=0;i<e.coordinates.length;i++)Pf(n.coordinates[t],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}function km(n,e){for(var t=!1,r=0;r<n.coordinates.length;r++){if(!Li(n.coordinates[r],e))return!1;t||(t=Li(n.coordinates[r],e,{ignoreEndVertices:!0}))}return t}function Vm(n,e){for(var t=!0,r=!1,i=0;i<n.coordinates.length;i++){if(r=xn(n.coordinates[1],e),!r){t=!1;break}r=xn(n.coordinates[1],e,{ignoreBoundary:!0})}return t&&r}function zm(n,e){for(var t=0;t<n.coordinates.length;t++)if(!Li(n.coordinates[t],e))return!1;return!0}function Um(n,e){var t=Mn(e),r=Mn(n);if(!Cf(t,r))return!1;for(var i=!1,s=0;s<n.coordinates.length-1;s++){if(!xn(n.coordinates[s],e))return!1;if(i||(i=xn(n.coordinates[s],e,{ignoreBoundary:!0})),!i){var o=Wm(n.coordinates[s],n.coordinates[s+1]);i=xn(o,e,{ignoreBoundary:!0})}}return i}function Gm(n,e){var t=Mn(n),r=Mn(e);if(!Cf(r,t))return!1;for(var i=0;i<n.coordinates[0].length;i++)if(!xn(n.coordinates[0][i],e))return!1;return!0}function Cf(n,e){return!(n[0]>e[0]||n[2]<e[2]||n[1]>e[1]||n[3]<e[3])}function Pf(n,e){return n[0]===e[0]&&n[1]===e[1]}function Wm(n,e){return[(n[0]+e[0])/2,(n[1]+e[1])/2]}function qm(n,e){e===void 0&&(e={});var t=Mn(n),r=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return Xe([r,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),r=Math.max(Math.min(t.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(r+i,0):Math.min(i,r);var s=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:r;for(s=s<0?Math.max(r+arguments[2],0):Math.min(s,r);i<s;)t[i]=e,++i;return t},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!==n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var Js=function(){};Js.prototype.interfaces_=function(){return[]},Js.prototype.getClass=function(){return Js},Js.prototype.equalsWithTolerance=function(e,t,r){return Math.abs(e-t)<=r};var Ue=function(n){function e(t){n.call(this,t),this.name="IllegalArgumentException",this.message=t,this.stack=new n().stack}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(Error),ue=function(){},If={MAX_VALUE:{configurable:!0}};ue.isNaN=function(e){return Number.isNaN(e)},ue.doubleToLongBits=function(e){return e},ue.longBitsToDouble=function(e){return e},ue.isInfinite=function(e){return!Number.isFinite(e)},If.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(ue,If);var Sr=function(){},xu=function(){},nl=function(){};function Cr(){}var M=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.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=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Zs={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 Ue("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],r=arguments[1];return!(!Js.equalsWithTolerance(this.x,t.x,r)||!Js.equalsWithTolerance(this.y,t.y,r))}},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 Ue("Invalid ordinate index: "+e)},M.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||ue.isNaN(this.z))&&ue.isNaN(e.z)},M.prototype.equals=function(e){return e instanceof M?this.equals2D(e):!1},M.prototype.equalInZ=function(e,t){return Js.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,r=this.y-e.y,i=this.z-e.z;return Math.sqrt(t*t+r*r+i*i)},M.prototype.distance=function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},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[Sr,xu,Cr]},M.prototype.getClass=function(){return M},M.hashCode=function(){if(arguments.length===1){var e=arguments[0],t=ue.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},Zs.DimensionalComparator.get=function(){return Ai},Zs.serialVersionUID.get=function(){return 6683108902428367e3},Zs.NULL_ORDINATE.get=function(){return ue.NaN},Zs.X.get=function(){return 0},Zs.Y.get=function(){return 1},Zs.Z.get=function(){return 2},Object.defineProperties(M,Zs);var Ai=function(e){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t!==2&&t!==3)throw new Ue("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}};Ai.prototype.compare=function(e,t){var r=e,i=t,s=Ai.compare(r.x,i.x);if(s!==0)return s;var o=Ai.compare(r.y,i.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var a=Ai.compare(r.z,i.z);return a},Ai.prototype.interfaces_=function(){return[nl]},Ai.prototype.getClass=function(){return Ai},Ai.compare=function(e,t){return e<t?-1:e>t?1:ue.isNaN(e)?ue.isNaN(t)?0:-1:ue.isNaN(t)?1:0};var il=function(){};il.prototype.create=function(){},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var R=function(){},ql={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.toLocationSymbol=function(e){switch(e){case R.EXTERIOR:return"e";case R.BOUNDARY:return"b";case R.INTERIOR:return"i";case R.NONE:return"-"}throw new Ue("Unknown location value: "+e)},ql.INTERIOR.get=function(){return 0},ql.BOUNDARY.get=function(){return 1},ql.EXTERIOR.get=function(){return 2},ql.NONE.get=function(){return-1},Object.defineProperties(R,ql);var ae=function(n,e){return n.interfaces_&&n.interfaces_().indexOf(e)>-1},ur=function(){},Tf={LOG_10:{configurable:!0}};ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},ur.log10=function(e){var t=Math.log(e);return ue.isInfinite(t)||ue.isNaN(t)?t:t/ur.LOG_10},ur.min=function(e,t,r,i){var s=e;return t<s&&(s=t),r<s&&(s=r),i<s&&(s=i),s},ur.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1],r=arguments[2];return e<t?t:e>r?r: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}},ur.wrap=function(e,t){return e<0?t- -e%t:e%t},ur.max=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2],i=e;return t>i&&(i=t),r>i&&(i=r),i}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=s;return o>u&&(u=o),a>u&&(u=a),l>u&&(u=l),u}},ur.average=function(e,t){return(e+t)/2},Tf.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(ur,Tf);var on=function(e){this.str=e};on.prototype.append=function(e){this.str+=e},on.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},on.prototype.toString=function(e){return this.str};var an=function(e){this.value=e};an.prototype.intValue=function(){return this.value},an.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},an.isNaN=function(e){return Number.isNaN(e)};var Xl=function(){};Xl.isWhitespace=function(e){return e<=32&&e>=0||e===127},Xl.toUpperCase=function(e){return e.toUpperCase()};var V=function n(){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 n){var t=arguments[0];this.init(t)}else if(typeof arguments[0]=="string"){var r=arguments[0];n.call(this,n.parse(r))}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.init(i,s)}},qr={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}};V.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},V.prototype.extractSignificantDigits=function(e,t){var r=this.abs(),i=V.magnitude(r._hi),s=V.TEN.pow(i);r=r.divide(s),r.gt(V.TEN)?(r=r.divide(V.TEN),i+=1):r.lt(V.ONE)&&(r=r.multiply(V.TEN),i-=1);for(var o=i+1,a=new on,l=V.MAX_PRINT_DIGITS-1,u=0;u<=l;u++){e&&u===o&&a.append(".");var h=Math.trunc(r._hi);if(h<0)break;var f=!1,p=0;h>9?(f=!0,p="9"):p="0"+h,a.append(p),r=r.subtract(V.valueOf(h)).multiply(V.TEN),f&&r.selfAdd(V.TEN);var v=!0,w=V.magnitude(r._hi);if(w<0&&Math.abs(w)>=l-u&&(v=!1),!v)break}return t[0]=i,a.toString()},V.prototype.sqr=function(){return this.multiply(this)},V.prototype.doubleValue=function(){return this._hi+this._lo},V.prototype.subtract=function(){if(arguments[0]instanceof V){var e=arguments[0];return this.add(e.negate())}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.add(-t)}},V.prototype.equals=function(){if(arguments.length===1){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},V.prototype.isZero=function(){return this._hi===0&&this._lo===0},V.prototype.selfSubtract=function(){if(arguments[0]instanceof V){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)}},V.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},V.prototype.min=function(e){return this.le(e)?this:e},V.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof V){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null,f=null,p=null;return u=this._hi/r,h=V.SPLIT*u,s=h-u,p=V.SPLIT*r,s=h-s,o=u-s,a=p-r,f=u*r,a=p-a,l=r-a,p=s*a-f+s*l+o*a+o*l,h=(this._hi-f-p+this._lo-u*i)/r,p=u+h,this._hi=p,this._lo=u-p+h,this}},V.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},V.prototype.divide=function(){if(arguments[0]instanceof V){var e=arguments[0],t=null,r=null,i=null,s=null,o=null,a=null,l=null,u=null;o=this._hi/e._hi,a=V.SPLIT*o,t=a-o,u=V.SPLIT*e._hi,t=a-t,r=o-t,i=u-e._hi,l=o*e._hi,i=u-i,s=e._hi-i,u=t*i-l+t*s+r*i+r*s,a=(this._hi-l-u+this._lo-o*e._lo)/e._hi,u=o+a;var h=u,f=o-u+a;return new V(h,f)}else if(typeof arguments[0]=="number"){var p=arguments[0];return ue.isNaN(p)?V.createNaN():V.copy(this).selfDivide(p,0)}},V.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},V.prototype.pow=function(e){if(e===0)return V.valueOf(1);var t=new V(this),r=V.valueOf(1),i=Math.abs(e);if(i>1)for(;i>0;)i%2===1&&r.selfMultiply(t),i/=2,i>0&&(t=t.sqr());else r=t;return e<0?r.reciprocal():r},V.prototype.ceil=function(){if(this.isNaN())return V.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new V(e,t)},V.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},V.prototype.rint=function(){if(this.isNaN())return this;var e=this.add(.5);return e.floor()},V.prototype.setValue=function(){if(arguments[0]instanceof V){var e=arguments[0];return this.init(e),this}else if(typeof arguments[0]=="number"){var t=arguments[0];return this.init(t),this}},V.prototype.max=function(e){return this.ge(e)?this:e},V.prototype.sqrt=function(){if(this.isZero())return V.valueOf(0);if(this.isNegative())return V.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,r=V.valueOf(t),i=this.subtract(r.sqr()),s=i._hi*(e*.5);return r.add(s)},V.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof V){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}else if(typeof arguments[0]=="number"){var t=arguments[0],r=null,i=null,s=null,o=null,a=null,l=null;return s=this._hi+t,a=s-this._hi,o=s-a,o=t-a+(this._hi-o),l=o+this._lo,r=s+l,i=l+(s-r),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(arguments.length===2){var u=arguments[0],h=arguments[1],f=null,p=null,v=null,w=null,I=null,T=null,L=null,m=null;I=this._hi+u,v=this._lo+h,L=I-this._hi,m=v-this._lo,T=I-L,w=v-m,T=u-L+(this._hi-T),w=h-m+(this._lo-w),L=T+v,f=I+L,p=L+(I-f),L=w+p;var _=f+L,g=L+(f-_);return this._hi=_,this._lo=g,this}},V.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof V){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 r=arguments[0],i=arguments[1],s=null,o=null,a=null,l=null,u=null,h=null;u=V.SPLIT*this._hi,s=u-this._hi,h=V.SPLIT*r,s=u-s,o=this._hi-s,a=h-r,u=this._hi*r,a=h-a,l=r-a,h=s*a-u+s*l+o*a+o*l+(this._hi*i+this._lo*r);var f=u+h;s=u-f;var p=h+s;return this._hi=f,this._lo=p,this}},V.prototype.selfSqr=function(){return this.selfMultiply(this)},V.prototype.floor=function(){if(this.isNaN())return V.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new V(e,t)},V.prototype.negate=function(){return this.isNaN()?this:new V(-this._hi,-this._lo)},V.prototype.clone=function(){},V.prototype.multiply=function(){if(arguments[0]instanceof V){var e=arguments[0];return e.isNaN()?V.createNaN():V.copy(this).selfMultiply(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return ue.isNaN(t)?V.createNaN():V.copy(this).selfMultiply(t,0)}},V.prototype.isNaN=function(){return ue.isNaN(this._hi)},V.prototype.intValue=function(){return Math.trunc(this._hi)},V.prototype.toString=function(){var e=V.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},V.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!0,t),i=t[0]+1,s=r;if(r.charAt(0)===".")s="0"+r;else if(i<0)s="0."+V.stringOfChar("0",-i)+r;else if(r.indexOf(".")===-1){var o=i-r.length,a=V.stringOfChar("0",o);s=r+a+".0"}return this.isNegative()?"-"+s:s},V.prototype.reciprocal=function(){var e=null,t=null,r=null,i=null,s=null,o=null,a=null,l=null;s=1/this._hi,o=V.SPLIT*s,e=o-s,l=V.SPLIT*this._hi,e=o-e,t=s-e,r=l-this._hi,a=s*this._hi,r=l-r,i=this._hi-r,l=e*r-a+e*i+t*r+t*i,o=(1-a-l-s*this._lo)/this._hi;var u=s+o,h=s-u+o;return new V(u,h)},V.prototype.toSciNotation=function(){if(this.isZero())return V.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(e!==null)return e;var t=new Array(1).fill(null),r=this.extractSignificantDigits(!1,t),i=V.SCI_NOT_EXPONENT_CHAR+t[0];if(r.charAt(0)==="0")throw new Error("Found leading zero: "+r);var s="";r.length>1&&(s=r.substring(1));var o=r.charAt(0)+"."+s;return this.isNegative()?"-"+o+i:o+i},V.prototype.abs=function(){return this.isNaN()?V.NaN:this.isNegative()?this.negate():new V(this)},V.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},V.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},V.prototype.add=function(){if(arguments[0]instanceof V){var e=arguments[0];return V.copy(this).selfAdd(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return V.copy(this).selfAdd(t)}},V.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 V){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._hi=r,this._lo=i}},V.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},V.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},V.prototype.trunc=function(){return this.isNaN()?V.NaN:this.isPositive()?this.floor():this.ceil()},V.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},V.prototype.interfaces_=function(){return[Cr,Sr,xu]},V.prototype.getClass=function(){return V},V.sqr=function(e){return V.valueOf(e).selfMultiply(e)},V.valueOf=function(){if(typeof arguments[0]=="string"){var e=arguments[0];return V.parse(e)}else if(typeof arguments[0]=="number"){var t=arguments[0];return new V(t)}},V.sqrt=function(e){return V.valueOf(e).sqrt()},V.parse=function(e){for(var t=0,r=e.length;Xl.isWhitespace(e.charAt(t));)t++;var i=!1;if(t<r){var s=e.charAt(t);(s==="-"||s==="+")&&(t++,s==="-"&&(i=!0))}for(var o=new V,a=0,l=0,u=0;!(t>=r);){var h=e.charAt(t);if(t++,Xl.isDigit(h)){var f=h-"0";o.selfMultiply(V.TEN),o.selfAdd(f),a++;continue}if(h==="."){l=a;continue}if(h==="e"||h==="E"){var p=e.substring(t);try{u=an.parseInt(p)}catch(L){throw L instanceof Error?new Error("Invalid exponent "+p+" in string "+e):L}finally{}break}throw new Error("Unexpected character '"+h+"' at position "+t+" in string "+e)}var v=o,w=a-l-u;if(w===0)v=o;else if(w>0){var I=V.TEN.pow(w);v=o.divide(I)}else if(w<0){var T=V.TEN.pow(-w);v=o.multiply(T)}return i?v.negate():v},V.createNaN=function(){return new V(ue.NaN,ue.NaN)},V.copy=function(e){return new V(e)},V.magnitude=function(e){var t=Math.abs(e),r=Math.log(t)/Math.log(10),i=Math.trunc(Math.floor(r)),s=Math.pow(10,i);return s*10<=t&&(i+=1),i},V.stringOfChar=function(e,t){for(var r=new on,i=0;i<t;i++)r.append(e);return r.toString()},qr.PI.get=function(){return new V(3.141592653589793,12246467991473532e-32)},qr.TWO_PI.get=function(){return new V(6.283185307179586,24492935982947064e-32)},qr.PI_2.get=function(){return new V(1.5707963267948966,6123233995736766e-32)},qr.E.get=function(){return new V(2.718281828459045,14456468917292502e-32)},qr.NaN.get=function(){return new V(ue.NaN,ue.NaN)},qr.EPS.get=function(){return 123259516440783e-46},qr.SPLIT.get=function(){return 134217729},qr.MAX_PRINT_DIGITS.get=function(){return 32},qr.TEN.get=function(){return V.valueOf(10)},qr.ONE.get=function(){return V.valueOf(1)},qr.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},qr.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(V,qr);var Gt=function(){},Nf={DP_SAFE_EPSILON:{configurable:!0}};Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.orientationIndex=function(e,t,r){var i=Gt.orientationIndexFilter(e,t,r);if(i<=1)return i;var s=V.valueOf(t.x).selfAdd(-e.x),o=V.valueOf(t.y).selfAdd(-e.y),a=V.valueOf(r.x).selfAdd(-t.x),l=V.valueOf(r.y).selfAdd(-t.y);return s.selfMultiply(l).selfSubtract(o.selfMultiply(a)).signum()},Gt.signOfDet2x2=function(e,t,r,i){var s=e.multiply(i).selfSubtract(t.multiply(r));return s.signum()},Gt.intersection=function(e,t,r,i){var s=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(t.x).selfSubtract(e.x)),o=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(t.y).selfSubtract(e.y)),a=s.subtract(o),l=V.valueOf(i.x).selfSubtract(r.x).selfMultiply(V.valueOf(e.y).selfSubtract(r.y)),u=V.valueOf(i.y).selfSubtract(r.y).selfMultiply(V.valueOf(e.x).selfSubtract(r.x)),h=l.subtract(u),f=h.selfDivide(a).doubleValue(),p=V.valueOf(e.x).selfAdd(V.valueOf(t.x).selfSubtract(e.x).selfMultiply(f)).doubleValue(),v=V.valueOf(t.x).selfSubtract(e.x).selfMultiply(V.valueOf(e.y).selfSubtract(r.y)),w=V.valueOf(t.y).selfSubtract(e.y).selfMultiply(V.valueOf(e.x).selfSubtract(r.x)),I=v.subtract(w),T=I.selfDivide(a).doubleValue(),L=V.valueOf(r.y).selfAdd(V.valueOf(i.y).selfSubtract(r.y).selfMultiply(T)).doubleValue();return new M(p,L)},Gt.orientationIndexFilter=function(e,t,r){var i=null,s=(e.x-r.x)*(t.y-r.y),o=(e.y-r.y)*(t.x-r.x),a=s-o;if(s>0){if(o<=0)return Gt.signum(a);i=s+o}else if(s<0){if(o>=0)return Gt.signum(a);i=-s-o}else return Gt.signum(a);var l=Gt.DP_SAFE_EPSILON*i;return a>=l||-a>=l?Gt.signum(a):2},Gt.signum=function(e){return e>0?1:e<0?-1:0},Nf.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Gt,Nf);var Se=function(){},Yl={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Yl.X.get=function(){return 0},Yl.Y.get=function(){return 1},Yl.Z.get=function(){return 2},Yl.M.get=function(){return 3},Se.prototype.setOrdinate=function(e,t,r){},Se.prototype.size=function(){},Se.prototype.getOrdinate=function(e,t){},Se.prototype.getCoordinate=function(){},Se.prototype.getCoordinateCopy=function(e){},Se.prototype.getDimension=function(){},Se.prototype.getX=function(e){},Se.prototype.clone=function(){},Se.prototype.expandEnvelope=function(e){},Se.prototype.copy=function(){},Se.prototype.getY=function(e){},Se.prototype.toCoordinateArray=function(){},Se.prototype.interfaces_=function(){return[xu]},Se.prototype.getClass=function(){return Se},Object.defineProperties(Se,Yl);var Df=function(){},sl=function(n){function e(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Df),vt=function(){};vt.arraycopy=function(e,t,r,i,s){for(var o=0,a=t;a<t+s;a++)r[i+o]=e[a],o++},vt.getProperty=function(e){return{"line.separator":`
4
4
  `}[e]};var Xr=function n(){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],r=arguments[1];this.x=t,this.y=r,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){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 l=arguments[0],u=arguments[1],h=arguments[2];this.x=l,this.y=u,this.w=h}else if(arguments.length===4){var f=arguments[0],p=arguments[1],v=arguments[2],w=arguments[3],I=f.y-p.y,T=p.x-f.x,L=f.x*p.y-p.x*f.y,m=v.y-w.y,_=w.x-v.x,g=v.x*w.y-w.x*v.y;this.x=T*g-_*L,this.y=m*L-I*g,this.w=I*_-m*T}};Xr.prototype.getY=function(){var e=this.y/this.w;if(ue.isNaN(e)||ue.isInfinite(e))throw new sl;return e},Xr.prototype.getX=function(){var e=this.x/this.w;if(ue.isNaN(e)||ue.isInfinite(e))throw new sl;return e},Xr.prototype.getCoordinate=function(){var e=new M;return e.x=this.getX(),e.y=this.getY(),e},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.intersection=function(e,t,r,i){var s=e.y-t.y,o=t.x-e.x,a=e.x*t.y-t.x*e.y,l=r.y-i.y,u=i.x-r.x,h=r.x*i.y-i.x*r.y,f=o*h-u*a,p=l*a-s*h,v=s*u-l*o,w=f/v,I=p/v;if(ue.isNaN(w)||ue.isInfinite(w)||ue.isNaN(I)||ue.isInfinite(I))throw new sl;return new M(w,I)};var te=function n(){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 n){var t=arguments[0];this.init(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];this.init(s,o,a,l)}},bf={serialVersionUID:{configurable:!0}};te.prototype.getArea=function(){return this.getWidth()*this.getHeight()},te.prototype.equals=function(e){if(!(e instanceof te))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()},te.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new te;var t=this._minx>e._minx?this._minx:e._minx,r=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 te(t,i,r,s)},te.prototype.isNull=function(){return this._maxx<this._minx},te.prototype.getMaxX=function(){return this._maxx},te.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 te){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 r=arguments[0],i=arguments[1];return this.isNull()?!1:r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}},te.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof te){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 r=arguments[0],i=arguments[1];return this.isNull()?!1:!(r>this._maxx||r<this._minx||i>this._maxy||i<this._miny)}},te.prototype.getMinY=function(){return this._miny},te.prototype.getMinX=function(){return this._minx},te.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 te){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 r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(r<this._minx&&(this._minx=r),r>this._maxx&&(this._maxx=r),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},te.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},te.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},te.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},te.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},te.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},te.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},te.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},te.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},te.prototype.expandBy=function(){if(arguments.length===1){var e=arguments[0];this.expandBy(e,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},te.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof te){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 r=arguments[0],i=arguments[1];return this.covers(r,i)}},te.prototype.centre=function(){return this.isNull()?null:new M((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},te.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 te){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 r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(arguments.length===4){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3];s<o?(this._minx=s,this._maxx=o):(this._minx=o,this._maxx=s),a<l?(this._miny=a,this._maxy=l):(this._miny=l,this._maxy=a)}},te.prototype.getMaxY=function(){return this._maxy},te.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 r=0;return this._maxy<e._miny?r=e._miny-this._maxy:this._miny>e._maxy&&(r=this._miny-e._maxy),t===0?r:r===0?t:Math.sqrt(t*t+r*r)},te.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},te.prototype.interfaces_=function(){return[Sr,Cr]},te.prototype.getClass=function(){return te},te.intersects=function(){if(arguments.length===3){var e=arguments[0],t=arguments[1],r=arguments[2];return r.x>=(e.x<t.x?e.x:t.x)&&r.x<=(e.x>t.x?e.x:t.x)&&r.y>=(e.y<t.y?e.y:t.y)&&r.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],l=Math.min(o.x,a.x),u=Math.max(o.x,a.x),h=Math.min(i.x,s.x),f=Math.max(i.x,s.x);return!(h>u||f<l||(l=Math.min(o.y,a.y),u=Math.max(o.y,a.y),h=Math.min(i.y,s.y),f=Math.max(i.y,s.y),h>u)||f<l)}},bf.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(te,bf);var ln={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*$/},Lu=function(e){this.geometryFactory=e||new me};Lu.prototype.read=function(e){var t,r,i;e=e.replace(/[\n\r]/g," ");var s=ln.typeStr.exec(e);if(e.search("EMPTY")!==-1&&(s=ln.emptyTypeStr.exec(e),s[2]=void 0),s&&(r=s[1].toLowerCase(),i=s[2],ol[r]&&(t=ol[r].apply(this,[i]))),t===void 0)throw new Error("Could not parse WKT "+e);return t},Lu.prototype.write=function(e){return this.extractGeometry(e)},Lu.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!si[t])return null;var r=t.toUpperCase(),i;return e.isEmpty()?i=r+" EMPTY":i=r+"("+si[t].apply(this,[e])+")",i};var si={coordinate:function(e){return e.x+" "+e.y},point:function(e){return si.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=this,r=[],i=0,s=e._geometries.length;i<s;++i)r.push("("+si.point.apply(t,[e._geometries[i]])+")");return r.join(",")},linestring:function(e){for(var t=this,r=[],i=0,s=e._points._coordinates.length;i<s;++i)r.push(si.coordinate.apply(t,[e._points._coordinates[i]]));return r.join(",")},linearring:function(e){for(var t=this,r=[],i=0,s=e._points._coordinates.length;i<s;++i)r.push(si.coordinate.apply(t,[e._points._coordinates[i]]));return r.join(",")},multilinestring:function(e){for(var t=this,r=[],i=0,s=e._geometries.length;i<s;++i)r.push("("+si.linestring.apply(t,[e._geometries[i]])+")");return r.join(",")},polygon:function(e){var t=this,r=[];r.push("("+si.linestring.apply(this,[e._shell])+")");for(var i=0,s=e._holes.length;i<s;++i)r.push("("+si.linestring.apply(t,[e._holes[i]])+")");return r.join(",")},multipolygon:function(e){for(var t=this,r=[],i=0,s=e._geometries.length;i<s;++i)r.push("("+si.polygon.apply(t,[e._geometries[i]])+")");return r.join(",")},geometrycollection:function(e){for(var t=this,r=[],i=0,s=e._geometries.length;i<s;++i)r.push(t.extractGeometry(e._geometries[i]));return r.join(",")}},ol={point:function(e){if(e===void 0)return this.geometryFactory.createPoint();var t=e.trim().split(ln.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 r,i=e.trim().split(","),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ln.trimParens,"$1"),s.push(ol.point.apply(t,[r]));return this.geometryFactory.createMultiPoint(s)},linestring:function(e){if(e===void 0)return this.geometryFactory.createLineString();for(var t=e.trim().split(","),r=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ln.spaces),r.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(r)},linearring:function(e){if(e===void 0)return this.geometryFactory.createLinearRing();for(var t=e.trim().split(","),r=[],i,s=0,o=t.length;s<o;++s)i=t[s].trim().split(ln.spaces),r.push(new M(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiLineString();for(var r,i=e.trim().split(ln.parenComma),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ln.trimParens,"$1"),s.push(ol.linestring.apply(t,[r]));return this.geometryFactory.createMultiLineString(s)},polygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createPolygon();for(var r,i,s,o=e.trim().split(ln.parenComma),a,l=[],u=0,h=o.length;u<h;++u)r=o[u].replace(ln.trimParens,"$1"),i=ol.linestring.apply(t,[r]),s=t.geometryFactory.createLinearRing(i._points),u===0?a=s:l.push(s);return this.geometryFactory.createPolygon(a,l)},multipolygon:function(e){var t=this;if(e===void 0)return this.geometryFactory.createMultiPolygon();for(var r,i=e.trim().split(ln.doubleParenComma),s=[],o=0,a=i.length;o<a;++o)r=i[o].replace(ln.trimParens,"$1"),s.push(ol.polygon.apply(t,[r]));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 r=e.trim().split("|"),i=[],s=0,o=r.length;s<o;++s)i.push(t.read(r[s]));return this.geometryFactory.createGeometryCollection(i)}},Yr=function(e){this.parser=new Lu(e)};Yr.prototype.write=function(e){return this.parser.write(e)},Yr.toLineString=function(e,t){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var oi=function(n){function e(t){n.call(this,t),this.name="RuntimeException",this.message=t,this.stack=new n().stack}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}(Error),Au=function(n){function e(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var t=arguments[0];n.call(this,t)}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(oi),fe=function(){};fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.shouldNeverReachHere=function(){if(arguments.length===0)fe.shouldNeverReachHere(null);else if(arguments.length===1){var e=arguments[0];throw new Au("Should never reach here"+(e!==null?": "+e:""))}},fe.isTrue=function(){var e,t;if(arguments.length===1)e=arguments[0],fe.isTrue(e,null);else if(arguments.length===2&&(e=arguments[0],t=arguments[1],!e))throw t===null?new Au:new Au(t)},fe.equals=function(){var e,t,r;if(arguments.length===2)e=arguments[0],t=arguments[1],fe.equals(e,t,null);else if(arguments.length===3&&(e=arguments[0],t=arguments[1],r=arguments[2],!t.equals(e)))throw new Au("Expected "+e+" but encountered "+t+(r!==null?": "+r:""))};var Ye=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},Ks={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Ye.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},Ye.prototype.getTopologySummary=function(){var e=new on;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},Ye.prototype.computeIntersection=function(e,t,r,i){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=r,this._inputLines[1][1]=i,this._result=this.computeIntersect(e,t,r,i)},Ye.prototype.getIntersectionNum=function(){return this._result},Ye.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),r=this.getEdgeDistance(e,1);t>r?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},Ye.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Ye.prototype.setPrecisionModel=function(e){this._precisionModel=e},Ye.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],r=0;r<this._result;r++)if(!(e._intPt[r].equals2D(e._inputLines[t][0])||e._intPt[r].equals2D(e._inputLines[t][1])))return!0;return!1}},Ye.prototype.getIntersection=function(e){return this._intPt[e]},Ye.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Ye.prototype.hasIntersection=function(){return this._result!==Ye.NO_INTERSECTION},Ye.prototype.getEdgeDistance=function(e,t){var r=Ye.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1]);return r},Ye.prototype.isCollinear=function(){return this._result===Ye.COLLINEAR_INTERSECTION},Ye.prototype.toString=function(){return Yr.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Yr.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Ye.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},Ye.prototype.isIntersection=function(e){for(var t=this,r=0;r<this._result;r++)if(t._intPt[r].equals2D(e))return!0;return!1},Ye.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.computeEdgeDistance=function(e,t,r){var i=Math.abs(r.x-t.x),s=Math.abs(r.y-t.y),o=-1;if(e.equals(t))o=0;else if(e.equals(r))i>s?o=i:o=s;else{var a=Math.abs(e.x-t.x),l=Math.abs(e.y-t.y);i>s?o=a:o=l,o===0&&!e.equals(t)&&(o=Math.max(a,l))}return fe.isTrue(!(o===0&&!e.equals(t)),"Bad distance calculation"),o},Ye.nonRobustComputeEdgeDistance=function(e,t,r){var i=e.x-t.x,s=e.y-t.y,o=Math.sqrt(i*i+s*s);return fe.isTrue(!(o===0&&!e.equals(t)),"Invalid distance calculation"),o},Ks.DONT_INTERSECT.get=function(){return 0},Ks.DO_INTERSECT.get=function(){return 1},Ks.COLLINEAR.get=function(){return 2},Ks.NO_INTERSECTION.get=function(){return 0},Ks.POINT_INTERSECTION.get=function(){return 1},Ks.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Ye,Ks);var hs=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(r){var i=new te(this._inputLines[0][0],this._inputLines[0][1]),s=new te(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(r)&&s.contains(r)},e.prototype.computeIntersection=function(){if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];if(this._isProper=!1,te.intersects(i,s,r)&&H.orientationIndex(i,s,r)===0&&H.orientationIndex(s,i,r)===0)return this._isProper=!0,(r.equals(i)||r.equals(s))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION}else return n.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(r,i,s,o,a){a.x=this.smallestInAbsValue(r.x,i.x,s.x,o.x),a.y=this.smallestInAbsValue(r.y,i.y,s.y,o.y),r.x-=a.x,r.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(r,i,s,o){var a=null;try{a=Xr.intersection(r,i,s,o)}catch(l){if(l instanceof sl)a=e.nearestEndpoint(r,i,s,o);else throw l}finally{}return a},e.prototype.intersection=function(r,i,s,o){var a=this.intersectionWithNormalization(r,i,s,o);return this.isInSegmentEnvelopes(a)||(a=new M(e.nearestEndpoint(r,i,s,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},e.prototype.smallestInAbsValue=function(r,i,s,o){var a=r,l=Math.abs(a);return Math.abs(i)<l&&(a=i,l=Math.abs(i)),Math.abs(s)<l&&(a=s,l=Math.abs(s)),Math.abs(o)<l&&(a=o),a},e.prototype.checkDD=function(r,i,s,o,a){var l=Gt.intersection(r,i,s,o),u=this.isInSegmentEnvelopes(l);vt.out.println("DD in env = "+u+" --------------------- "+l),a.distance(l)>1e-4&&vt.out.println("Distance = "+a.distance(l))},e.prototype.intersectionWithNormalization=function(r,i,s,o){var a=new M(r),l=new M(i),u=new M(s),h=new M(o),f=new M;this.normalizeToEnvCentre(a,l,u,h,f);var p=this.safeHCoordinateIntersection(a,l,u,h);return p.x+=f.x,p.y+=f.y,p},e.prototype.computeCollinearIntersection=function(r,i,s,o){var a=te.intersects(r,i,s),l=te.intersects(r,i,o),u=te.intersects(s,o,r),h=te.intersects(s,o,i);return a&&l?(this._intPt[0]=s,this._intPt[1]=o,n.COLLINEAR_INTERSECTION):u&&h?(this._intPt[0]=r,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=s,this._intPt[1]=r,s.equals(r)&&!l&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):a&&h?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!l&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&u?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!a&&!h?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):l&&h?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!a&&!u?n.POINT_INTERSECTION:n.COLLINEAR_INTERSECTION):n.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(r,i,s,o,a){var l=r.x<i.x?r.x:i.x,u=r.y<i.y?r.y:i.y,h=r.x>i.x?r.x:i.x,f=r.y>i.y?r.y:i.y,p=s.x<o.x?s.x:o.x,v=s.y<o.y?s.y:o.y,w=s.x>o.x?s.x:o.x,I=s.y>o.y?s.y:o.y,T=l>p?l:p,L=h<w?h:w,m=u>v?u:v,_=f<I?f:I,g=(T+L)/2,y=(m+_)/2;a.x=g,a.y=y,r.x-=a.x,r.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(r,i,s,o){if(this._isProper=!1,!te.intersects(r,i,s,o))return n.NO_INTERSECTION;var a=H.orientationIndex(r,i,s),l=H.orientationIndex(r,i,o);if(a>0&&l>0||a<0&&l<0)return n.NO_INTERSECTION;var u=H.orientationIndex(s,o,r),h=H.orientationIndex(s,o,i);if(u>0&&h>0||u<0&&h<0)return n.NO_INTERSECTION;var f=a===0&&l===0&&u===0&&h===0;return f?this.computeCollinearIntersection(r,i,s,o):(a===0||l===0||u===0||h===0?(this._isProper=!1,r.equals2D(s)||r.equals2D(o)?this._intPt[0]=r:i.equals2D(s)||i.equals2D(o)?this._intPt[0]=i:a===0?this._intPt[0]=new M(s):l===0?this._intPt[0]=new M(o):u===0?this._intPt[0]=new M(r):h===0&&(this._intPt[0]=new M(i))):(this._isProper=!0,this._intPt[0]=this.intersection(r,i,s,o)),n.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(r,i,s,o){var a=r,l=H.distancePointLine(r,s,o),u=H.distancePointLine(i,s,o);return u<l&&(l=u,a=i),u=H.distancePointLine(s,r,i),u<l&&(l=u,a=s),u=H.distancePointLine(o,r,i),u<l&&(l=u,a=o),a},e}(Ye),Qs=function(){};Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs},Qs.orientationIndex=function(e,t,r){var i=t.x-e.x,s=t.y-e.y,o=r.x-t.x,a=r.y-t.y;return Qs.signOfDet2x2(i,s,o,a)},Qs.signOfDet2x2=function(e,t,r,i){var s=null,o=null,a=null;if(s=1,e===0||i===0)return t===0||r===0?0:t>0?r>0?-s:s:r>0?s:-s;if(t===0||r===0)return i>0?e>0?s:-s:e>0?-s:s;if(t>0?i>0?t<=i||(s=-s,o=e,e=r,r=o,o=t,t=i,i=o):t<=-i?(s=-s,r=-r,i=-i):(o=e,e=-r,r=o,o=t,t=-i,i=o):i>0?-t<=i?(s=-s,e=-e,t=-t):(o=-e,e=r,r=o,o=-t,t=i,i=o):t>=i?(e=-e,t=-t,r=-r,i=-i):(s=-s,o=-e,e=-r,r=o,o=-t,t=-i,i=o),e>0)if(r>0){if(!(e<=r))return s}else return s;else{if(r>0)return-s;if(e>=r)s=-s,e=-e,r=-r;else return-s}for(;;){if(a=Math.floor(r/e),r=r-a*e,i=i-a*t,i<0)return-s;if(i>t)return s;if(e>r+r){if(t<i+i)return s}else{if(t>i+i)return-s;r=e-r,i=t-i,s=-s}if(i===0)return r===0?0:-s;if(r===0||(a=Math.floor(e/r),e=e-a*r,t=t-a*i,t<0))return s;if(t>i)return-s;if(r>e+e){if(i<t+t)return-s}else{if(i>t+t)return s;e=r-e,t=i-t,s=-s}if(t===0)return e===0?0:s;if(e===0)return-s}};var un=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};un.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 r=e.x,i=t.x;return r>i&&(r=t.x,i=e.x),this._p.x>=r&&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,l=t.y-this._p.y,u=Qs.signOfDet2x2(s,o,a,l);if(u===0)return this._isPointOnSegment=!0,null;l<o&&(u=-u),u>0&&this._crossingCount++}},un.prototype.isPointInPolygon=function(){return this.getLocation()!==R.EXTERIOR},un.prototype.getLocation=function(){return this._isPointOnSegment?R.BOUNDARY:this._crossingCount%2===1?R.INTERIOR:R.EXTERIOR},un.prototype.isOnSegment=function(){return this._isPointOnSegment},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.locatePointInRing=function(){if(arguments[0]instanceof M&&ae(arguments[1],Se)){for(var e=arguments[0],t=arguments[1],r=new un(e),i=new M,s=new M,o=1;o<t.size();o++)if(t.getCoordinate(o,i),t.getCoordinate(o-1,s),r.countSegment(i,s),r.isOnSegment())return r.getLocation();return r.getLocation()}else if(arguments[0]instanceof M&&arguments[1]instanceof Array){for(var a=arguments[0],l=arguments[1],u=new un(a),h=1;h<l.length;h++){var f=l[h],p=l[h-1];if(u.countSegment(f,p),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var H=function(){},Bs={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,r){return Gt.orientationIndex(e,t,r)},H.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,r=e[0].x,i=1;i<e.length-1;i++){var s=e[i].x-r,o=e[i+1].y,a=e[i-1].y;t+=s*(a-o)}return t/2}else if(ae(arguments[0],Se)){var l=arguments[0],u=l.size();if(u<3)return 0;var h=new M,f=new M,p=new M;l.getCoordinate(0,f),l.getCoordinate(1,p);var v=f.x;p.x-=v;for(var w=0,I=1;I<u-1;I++)h.y=f.y,f.x=p.x,f.y=p.y,l.getCoordinate(I+1,p),p.x-=v,w+=f.x*(h.y-p.y);return w/2}},H.distanceLineLine=function(e,t,r,i){if(e.equals(t))return H.distancePointLine(e,r,i);if(r.equals(i))return H.distancePointLine(i,e,t);var s=!1;if(!te.intersects(e,t,r,i))s=!0;else{var o=(t.x-e.x)*(i.y-r.y)-(t.y-e.y)*(i.x-r.x);if(o===0)s=!0;else{var a=(e.y-r.y)*(i.x-r.x)-(e.x-r.x)*(i.y-r.y),l=(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y),u=l/o,h=a/o;(h<0||h>1||u<0||u>1)&&(s=!0)}}return s?ur.min(H.distancePointLine(e,r,i),H.distancePointLine(t,r,i),H.distancePointLine(r,e,t),H.distancePointLine(i,e,t)):0},H.isPointInRing=function(e,t){return H.locatePointInRing(e,t)!==R.EXTERIOR},H.computeLength=function(e){var t=e.size();if(t<=1)return 0;var r=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 l=i.x,u=i.y,h=l-s,f=u-o;r+=Math.sqrt(h*h+f*f),s=l,o=u}return r},H.isCCW=function(e){var t=e.length-1;if(t<3)throw new Ue("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=e[0],i=0,s=1;s<=t;s++){var o=e[s];o.y>r.y&&(r=o,i=s)}var a=i;do a=a-1,a<0&&(a=t);while(e[a].equals2D(r)&&a!==i);var l=i;do l=(l+1)%t;while(e[l].equals2D(r)&&l!==i);var u=e[a],h=e[l];if(u.equals2D(r)||h.equals2D(r)||u.equals2D(h))return!1;var f=H.computeOrientation(u,r,h),p=!1;return f===0?p=u.x>h.x:p=f>0,p},H.locatePointInRing=function(e,t){return un.locatePointInRing(e,t)},H.distancePointLinePerpendicular=function(e,t,r){var i=(r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y),s=((t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y))/i;return Math.abs(s)*Math.sqrt(i)},H.computeOrientation=function(e,t,r){return H.orientationIndex(e,t,r)},H.distancePointLine=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];if(t.length===0)throw new Ue("Line array must contain at least one vertex");for(var r=e.distance(t[0]),i=0;i<t.length-1;i++){var s=H.distancePointLine(e,t[i],t[i+1]);s<r&&(r=s)}return r}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];if(a.x===l.x&&a.y===l.y)return o.distance(a);var u=(l.x-a.x)*(l.x-a.x)+(l.y-a.y)*(l.y-a.y),h=((o.x-a.x)*(l.x-a.x)+(o.y-a.y)*(l.y-a.y))/u;if(h<=0)return o.distance(a);if(h>=1)return o.distance(l);var f=((a.y-o.y)*(l.x-a.x)-(a.x-o.x)*(l.y-a.y))/u;return Math.abs(f)*Math.sqrt(u)}},H.isOnLine=function(e,t){for(var r=new hs,i=1;i<t.length;i++){var s=t[i-1],o=t[i];if(r.computeIntersection(e,s,o),r.hasIntersection())return!0}return!1},Bs.CLOCKWISE.get=function(){return-1},Bs.RIGHT.get=function(){return H.CLOCKWISE},Bs.COUNTERCLOCKWISE.get=function(){return 1},Bs.LEFT.get=function(){return H.COUNTERCLOCKWISE},Bs.COLLINEAR.get=function(){return 0},Bs.STRAIGHT.get=function(){return H.COLLINEAR},Object.defineProperties(H,Bs);var ai=function(){};ai.prototype.filter=function(e){},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var oe=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},Ln={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}};oe.prototype.isGeometryCollection=function(){return this.getSortIndex()===oe.SORTINDEX_GEOMETRYCOLLECTION},oe.prototype.getFactory=function(){return this._factory},oe.prototype.getGeometryN=function(e){return this},oe.prototype.getArea=function(){return 0},oe.prototype.isRectangle=function(){return!1},oe.prototype.equals=function(){if(arguments[0]instanceof oe){var e=arguments[0];return e===null?!1:this.equalsTopo(e)}else if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof oe))return!1;var r=t;return this.equalsExact(r)}},oe.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},oe.prototype.geometryChanged=function(){this.apply(oe.geometryChangedFilter)},oe.prototype.geometryChangedAction=function(){this._envelope=null},oe.prototype.equalsNorm=function(e){return e===null?!1:this.norm().equalsExact(e.norm())},oe.prototype.getLength=function(){return 0},oe.prototype.getNumGeometries=function(){return 1},oe.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 r=arguments[0],i=arguments[1];return this.getSortIndex()!==r.getSortIndex()?this.getSortIndex()-r.getSortIndex():this.isEmpty()&&r.isEmpty()?0:this.isEmpty()?-1:r.isEmpty()?1:this.compareToSameClass(r,i)}},oe.prototype.getUserData=function(){return this._userData},oe.prototype.getSRID=function(){return this._SRID},oe.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},oe.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===oe.SORTINDEX_GEOMETRYCOLLECTION)throw new Ue("This method does not support GeometryCollection arguments")},oe.prototype.equal=function(e,t,r){return r===0?e.equals(t):e.distance(t)<=r},oe.prototype.norm=function(){var e=this.copy();return e.normalize(),e},oe.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},oe.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new te(this._envelope)},oe.prototype.setSRID=function(e){this._SRID=e},oe.prototype.setUserData=function(e){this._userData=e},oe.prototype.compare=function(e,t){for(var r=e.iterator(),i=t.iterator();r.hasNext()&&i.hasNext();){var s=r.next(),o=i.next(),a=s.compareTo(o);if(a!==0)return a}return r.hasNext()?1:i.hasNext()?-1:0},oe.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},oe.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===oe.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===oe.SORTINDEX_MULTIPOINT||this.getSortIndex()===oe.SORTINDEX_MULTILINESTRING||this.getSortIndex()===oe.SORTINDEX_MULTIPOLYGON},oe.prototype.interfaces_=function(){return[xu,Sr,Cr]},oe.prototype.getClass=function(){return oe},oe.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},oe.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(e[t]===null)return!0;return!1},Ln.serialVersionUID.get=function(){return 8763622679187377e3},Ln.SORTINDEX_POINT.get=function(){return 0},Ln.SORTINDEX_MULTIPOINT.get=function(){return 1},Ln.SORTINDEX_LINESTRING.get=function(){return 2},Ln.SORTINDEX_LINEARRING.get=function(){return 3},Ln.SORTINDEX_MULTILINESTRING.get=function(){return 4},Ln.SORTINDEX_POLYGON.get=function(){return 5},Ln.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Ln.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Ln.geometryChangedFilter.get=function(){return Vc},Object.defineProperties(oe,Ln);var Vc=function(){};Vc.interfaces_=function(){return[ai]},Vc.filter=function(e){e.geometryChangedAction()};var An=function(){};An.prototype.filter=function(e){},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An};var Pr=function(){},li={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}};Pr.prototype.isInBoundary=function(e){},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},li.Mod2BoundaryNodeRule.get=function(){return al},li.EndPointBoundaryNodeRule.get=function(){return ll},li.MultiValentEndPointBoundaryNodeRule.get=function(){return ul},li.MonoValentEndPointBoundaryNodeRule.get=function(){return cl},li.MOD2_BOUNDARY_RULE.get=function(){return new al},li.ENDPOINT_BOUNDARY_RULE.get=function(){return new ll},li.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new ul},li.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new cl},li.OGC_SFS_BOUNDARY_RULE.get=function(){return Pr.MOD2_BOUNDARY_RULE},Object.defineProperties(Pr,li);var al=function(){};al.prototype.isInBoundary=function(e){return e%2===1},al.prototype.interfaces_=function(){return[Pr]},al.prototype.getClass=function(){return al};var ll=function(){};ll.prototype.isInBoundary=function(e){return e>0},ll.prototype.interfaces_=function(){return[Pr]},ll.prototype.getClass=function(){return ll};var ul=function(){};ul.prototype.isInBoundary=function(e){return e>1},ul.prototype.interfaces_=function(){return[Pr]},ul.prototype.getClass=function(){return ul};var cl=function(){};cl.prototype.isInBoundary=function(e){return e===1},cl.prototype.interfaces_=function(){return[Pr]},cl.prototype.getClass=function(){return cl};var nt=function(){};nt.prototype.add=function(){},nt.prototype.addAll=function(){},nt.prototype.isEmpty=function(){},nt.prototype.iterator=function(){},nt.prototype.size=function(){},nt.prototype.toArray=function(){},nt.prototype.remove=function(){};function zc(n){this.message=n||""}zc.prototype=new Error,zc.prototype.name="IndexOutOfBoundsException";var hl=function(){};hl.prototype.hasNext=function(){},hl.prototype.next=function(){},hl.prototype.remove=function(){};var Hr=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(nt);function fl(n){this.message=n||""}fl.prototype=new Error,fl.prototype.name="NoSuchElementException";var W=function(n){function e(){n.call(this),this.array_=[],arguments[0]instanceof nt&&this.addAll(arguments[0])}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[n,nt]},e.prototype.add=function(r){return arguments.length===1?this.array_.push(r):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.set=function(r,i){var s=this.array_[r];return this.array_[r]=i,s},e.prototype.iterator=function(){return new Xm(this)},e.prototype.get=function(r){if(r<0||r>=this.size())throw new zc;return this.array_[r]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var r=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(r.array_[s]);return i},e.prototype.remove=function(r){for(var i=this,s=!1,o=0,a=this.array_.length;o<a;o++)if(i.array_[o]===r){i.array_.splice(o,1),s=!0;break}return s},e}(Hr),Xm=function(n){function e(t){n.call(this),this.arrayList_=t,this.position_=0}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new fl;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(r){return this.arrayList_.set(this.position_-1,r)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(hl),Hl=function(n){function e(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var r=arguments[0];this.ensureCapacity(r.length),this.add(r,!0)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.ensureCapacity(i.length),this.add(i,s)}}}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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,l=s.iterator();l.hasNext();)i.add(l.next(),o),a=!0;return a}else return n.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var i=this,s=n.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];n.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 l=arguments[0],u=arguments[1];if(!u&&this.size()>=1){var h=this.get(this.size()-1);if(h.equals2D(l))return null}n.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],p=arguments[1];return this.add(f,p),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var v=arguments[0],w=arguments[1],I=arguments[2];if(I)for(var T=0;T<v.length;T++)i.add(v[T],w);else for(var L=v.length-1;L>=0;L--)i.add(v[L],w);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof M){var m=arguments[0],_=arguments[1],g=arguments[2];if(!g){var y=this.size();if(y>0){if(m>0){var E=this.get(m-1);if(E.equals2D(_))return null}if(m<y){var C=this.get(m);if(C.equals2D(_))return null}}}n.prototype.add.call(this,m,_)}}else if(arguments.length===4){var N=arguments[0],b=arguments[1],x=arguments[2],D=arguments[3],O=1;x>D&&(O=-1);for(var A=x;A!==D;A+=O)i.add(N[A],b);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),ge=function(){},Ru={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ru.ForwardComparator.get=function(){return Jl},Ru.BidirectionalComparator.get=function(){return dl},Ru.coordArrayType.get=function(){return new Array(0).fill(null)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},ge.ptNotInList=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];if(ge.indexOf(i,t)<0)return i}return null},ge.scroll=function(e,t){var r=ge.indexOf(t,e);if(r<0)return null;var i=new Array(e.length).fill(null);vt.arraycopy(e,r,i,0,e.length-r),vt.arraycopy(e,0,i,e.length-r,r),vt.arraycopy(i,0,e,0,e.length)},ge.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 r=0;r<e.length;r++)if(!e[r].equals(t[r]))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}},ge.intersection=function(e,t){for(var r=new Hl,i=0;i<e.length;i++)t.intersects(e[i])&&r.add(e[i],!0);return r.toCoordinateArray()},ge.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},ge.removeRepeatedPoints=function(e){if(!ge.hasRepeatedPoints(e))return e;var t=new Hl(e,!1);return t.toCoordinateArray()},ge.reverse=function(e){for(var t=e.length-1,r=Math.trunc(t/2),i=0;i<=r;i++){var s=e[i];e[i]=e[t-i],e[t-i]=s}},ge.removeNull=function(e){for(var t=0,r=0;r<e.length;r++)e[r]!==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},ge.copyDeep=function(){if(arguments.length===1){for(var e=arguments[0],t=new Array(e.length).fill(null),r=0;r<e.length;r++)t[r]=new M(e[r]);return t}else if(arguments.length===5)for(var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3],l=arguments[4],u=0;u<l;u++)o[a+u]=new M(i[s+u])},ge.isEqualReversed=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],s=t[e.length-r-1];if(i.compareTo(s)!==0)return!1}return!0},ge.envelope=function(e){for(var t=new te,r=0;r<e.length;r++)t.expandToInclude(e[r]);return t},ge.toCoordinateArray=function(e){return e.toArray(ge.coordArrayType)},ge.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},ge.indexOf=function(e,t){for(var r=0;r<t.length;r++)if(e.equals(t[r]))return r;return-1},ge.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var r=e.length-1-t,i=e[t].compareTo(e[r]);if(i!==0)return i}return 1},ge.compare=function(e,t){for(var r=0;r<e.length&&r<t.length;){var i=e[r].compareTo(t[r]);if(i!==0)return i;r++}return r<t.length?-1:r<e.length?1:0},ge.minCoordinate=function(e){for(var t=null,r=0;r<e.length;r++)(t===null||t.compareTo(e[r])>0)&&(t=e[r]);return t},ge.extract=function(e,t,r){t=ur.clamp(t,0,e.length),r=ur.clamp(r,-1,e.length);var i=r-t+1;r<0&&(i=0),t>=e.length&&(i=0),r<t&&(i=0);var s=new Array(i).fill(null);if(i===0)return s;for(var o=0,a=t;a<=r;a++)s[o++]=e[a];return s},Object.defineProperties(ge,Ru);var Jl=function(){};Jl.prototype.compare=function(e,t){var r=e,i=t;return ge.compare(r,i)},Jl.prototype.interfaces_=function(){return[nl]},Jl.prototype.getClass=function(){return Jl};var dl=function(){};dl.prototype.compare=function(e,t){var r=e,i=t;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;var s=ge.compare(r,i),o=ge.isEqualReversed(r,i);return o?0:s},dl.prototype.OLDcompare=function(e,t){var r=e,i=t;if(r.length<i.length)return-1;if(r.length>i.length)return 1;if(r.length===0)return 0;for(var s=ge.increasingDirection(r),o=ge.increasingDirection(i),a=s>0?0:r.length-1,l=o>0?0:r.length-1,u=0;u<r.length;u++){var h=r[a].compareTo(i[l]);if(h!==0)return h;a+=s,l+=o}return 0},dl.prototype.interfaces_=function(){return[nl]},dl.prototype.getClass=function(){return dl};var $s=function(){};$s.prototype.get=function(){},$s.prototype.put=function(){},$s.prototype.size=function(){},$s.prototype.values=function(){},$s.prototype.entrySet=function(){};var Ym=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e}($s);function Zl(n){this.message=n||""}Zl.prototype=new Error,Zl.prototype.name="OperationNotSupported";function Fu(){}Fu.prototype=new nt,Fu.prototype.contains=function(){};var Uc=function(n){function e(){n.call(this),this.array_=[],arguments[0]instanceof nt&&this.addAll(arguments[0])}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.contains=function(r){for(var i=this,s=0,o=this.array_.length;s<o;s++){var a=i.array_[s];if(a===r)return!0}return!1},e.prototype.add=function(r){return this.contains(r)?!1:(this.array_.push(r),!0)},e.prototype.addAll=function(r){for(var i=this,s=r.iterator();s.hasNext();)i.add(s.next());return!0},e.prototype.remove=function(r){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 r=this,i=[],s=0,o=this.array_.length;s<o;s++)i.push(r.array_[s]);return i},e.prototype.iterator=function(){return new Hm(this)},e}(Fu),Hm=function(n){function e(t){n.call(this),this.hashSet_=t,this.position_=0}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new fl;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Zl},e}(hl),ui=0,fs=1;function Of(n){return n===null?ui:n.color}function Ae(n){return n===null?null:n.parent}function ci(n,e){n!==null&&(n.color=e)}function Gc(n){return n===null?null:n.left}function Mf(n){return n===null?null:n.right}function Tt(){this.root_=null,this.size_=0}Tt.prototype=new Ym,Tt.prototype.get=function(n){for(var e=this.root_;e!==null;){var t=n.compareTo(e.key);if(t<0)e=e.left;else if(t>0)e=e.right;else return e.value}return null},Tt.prototype.put=function(n,e){if(this.root_===null)return this.root_={key:n,value:e,left:null,right:null,parent:null,color:ui,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var t=this.root_,r,i;do if(r=t,i=n.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:n,left:null,right:null,value:e,parent:r,color:ui,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=o:r.right=o,this.fixAfterInsertion(o),this.size_++,null},Tt.prototype.fixAfterInsertion=function(n){var e=this;for(n.color=fs;n!=null&&n!==this.root_&&n.parent.color===fs;)if(Ae(n)===Gc(Ae(Ae(n)))){var t=Mf(Ae(Ae(n)));Of(t)===fs?(ci(Ae(n),ui),ci(t,ui),ci(Ae(Ae(n)),fs),n=Ae(Ae(n))):(n===Mf(Ae(n))&&(n=Ae(n),e.rotateLeft(n)),ci(Ae(n),ui),ci(Ae(Ae(n)),fs),e.rotateRight(Ae(Ae(n))))}else{var r=Gc(Ae(Ae(n)));Of(r)===fs?(ci(Ae(n),ui),ci(r,ui),ci(Ae(Ae(n)),fs),n=Ae(Ae(n))):(n===Gc(Ae(n))&&(n=Ae(n),e.rotateRight(n)),ci(Ae(n),ui),ci(Ae(Ae(n)),fs),e.rotateLeft(Ae(Ae(n))))}this.root_.color=ui},Tt.prototype.values=function(){var n=new W,e=this.getFirstEntry();if(e!==null)for(n.add(e.value);(e=Tt.successor(e))!==null;)n.add(e.value);return n},Tt.prototype.entrySet=function(){var n=new Uc,e=this.getFirstEntry();if(e!==null)for(n.add(e);(e=Tt.successor(e))!==null;)n.add(e);return n},Tt.prototype.rotateLeft=function(n){if(n!=null){var e=n.right;n.right=e.left,e.left!=null&&(e.left.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.left===n?n.parent.left=e:n.parent.right=e,e.left=n,n.parent=e}},Tt.prototype.rotateRight=function(n){if(n!=null){var e=n.left;n.left=e.right,e.right!=null&&(e.right.parent=n),e.parent=n.parent,n.parent===null?this.root_=e:n.parent.right===n?n.parent.right=e:n.parent.left=e,e.right=n,n.parent=e}},Tt.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},Tt.successor=function(n){if(n===null)return null;if(n.right!==null){for(var e=n.right;e.left!==null;)e=e.left;return e}else{for(var t=n.parent,r=n;t!==null&&r===t.right;)r=t,t=t.parent;return t}},Tt.prototype.size=function(){return this.size_};var Kl=function(){};Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl};function xf(){}xf.prototype=new Fu;function cn(){this.array_=[],arguments[0]instanceof nt&&this.addAll(arguments[0])}cn.prototype=new xf,cn.prototype.contains=function(n){for(var e=this,t=0,r=this.array_.length;t<r;t++){var i=e.array_[t];if(i.compareTo(n)===0)return!0}return!1},cn.prototype.add=function(n){var e=this;if(this.contains(n))return!1;for(var t=0,r=this.array_.length;t<r;t++){var i=e.array_[t];if(i.compareTo(n)===1)return e.array_.splice(t,0,n),!0}return this.array_.push(n),!0},cn.prototype.addAll=function(n){for(var e=this,t=n.iterator();t.hasNext();)e.add(t.next());return!0},cn.prototype.remove=function(n){throw new Zl},cn.prototype.size=function(){return this.array_.length},cn.prototype.isEmpty=function(){return this.array_.length===0},cn.prototype.toArray=function(){for(var n=this,e=[],t=0,r=this.array_.length;t<r;t++)e.push(n.array_[t]);return e},cn.prototype.iterator=function(){return new ku(this)};var ku=function(n){this.treeSet_=n,this.position_=0};ku.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new fl;return this.treeSet_.array_[this.position_++]},ku.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},ku.prototype.remove=function(){throw new Zl};var ds=function(){};ds.sort=function(){var e=arguments[0],t,r,i,s;if(arguments.length===1)s=function(a,l){return a.compareTo(l)},e.sort(s);else if(arguments.length===2)i=arguments[1],s=function(a,l){return i.compare(a,l)},e.sort(s);else if(arguments.length===3){r=e.slice(arguments[1],arguments[2]),r.sort();var o=e.slice(0,arguments[1]).concat(r,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(r=e.slice(arguments[1],arguments[2]),i=arguments[3],s=function(a,l){return i.compare(a,l)},r.sort(s),o=e.slice(0,arguments[1]).concat(r,e.slice(arguments[2],e.length)),e.splice(0,e.length),t=0;t<o.length;t++)e.push(o[t])},ds.asList=function(e){for(var t=new W,r=0,i=e.length;r<i;r++)t.add(e[r]);return t};var Ie=function(){},Jr={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}};Jr.P.get=function(){return 0},Jr.L.get=function(){return 1},Jr.A.get=function(){return 2},Jr.FALSE.get=function(){return-1},Jr.TRUE.get=function(){return-2},Jr.DONTCARE.get=function(){return-3},Jr.SYM_FALSE.get=function(){return"F"},Jr.SYM_TRUE.get=function(){return"T"},Jr.SYM_DONTCARE.get=function(){return"*"},Jr.SYM_P.get=function(){return"0"},Jr.SYM_L.get=function(){return"1"},Jr.SYM_A.get=function(){return"2"},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ie.toDimensionSymbol=function(e){switch(e){case Ie.FALSE:return Ie.SYM_FALSE;case Ie.TRUE:return Ie.SYM_TRUE;case Ie.DONTCARE:return Ie.SYM_DONTCARE;case Ie.P:return Ie.SYM_P;case Ie.L:return Ie.SYM_L;case Ie.A:return Ie.SYM_A}throw new Ue("Unknown dimension value: "+e)},Ie.toDimensionValue=function(e){switch(Xl.toUpperCase(e)){case Ie.SYM_FALSE:return Ie.FALSE;case Ie.SYM_TRUE:return Ie.TRUE;case Ie.SYM_DONTCARE:return Ie.DONTCARE;case Ie.SYM_P:return Ie.P;case Ie.SYM_L:return Ie.L;case Ie.SYM_A:return Ie.A}throw new Ue("Unknown dimension symbol: "+e)},Object.defineProperties(Ie,Jr);var hn=function(){};hn.prototype.filter=function(e){},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var Zr=function(){};Zr.prototype.filter=function(e,t){},Zr.prototype.isDone=function(){},Zr.prototype.isGeometryChanged=function(){},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr};var Mt=function(n){function e(r,i){if(n.call(this,i),this._geometries=r||[],n.hasNullElements(this._geometries))throw new Ue("geometries must not contain null elements")}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var i=this,s=new te,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 n.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 l=i._geometries[a].getCoordinates(),u=0;u<l.length;u++)o++,s[o]=l[u];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 l=0;l<this._geometries.length;l++)if(!i._geometries[l].equalsExact(a._geometries[l],o))return!1;return!0}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var i=this,s=0;s<this._geometries.length;s++)i._geometries[s].normalize();ds.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var i=this,s=Ie.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=Ie.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 cn(ds.asList(this._geometries)),a=new cn(ds.asList(s._geometries));return this.compare(o,a)}else if(arguments.length===2){for(var l=arguments[0],u=arguments[1],h=l,f=this.getNumGeometries(),p=h.getNumGeometries(),v=0;v<f&&v<p;){var w=i.getGeometryN(v),I=h.getGeometryN(v),T=w.compareToSameClass(I,u);if(T!==0)return T;v++}return v<f?1:v<p?-1:0}},e.prototype.apply=function(){var i=this;if(ae(arguments[0],An))for(var s=arguments[0],o=0;o<this._geometries.length;o++)i._geometries[o].apply(s);else if(ae(arguments[0],Zr)){var a=arguments[0];if(this._geometries.length===0)return null;for(var l=0;l<this._geometries.length&&(i._geometries[l].apply(a),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(ae(arguments[0],hn)){var u=arguments[0];u.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(u)}else if(ae(arguments[0],ai)){var f=arguments[0];f.filter(this);for(var p=0;p<this._geometries.length;p++)i._geometries[p].apply(f)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),fe.shouldNeverReachHere(),null},e.prototype.clone=function(){var i=this,s=n.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}(oe),ps=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return oe.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.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 Ir(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[Kl]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(e,t),e}(Mt),Ir=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var e=arguments[0],t=Pr.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this._geom=r,this._geomFact=r.getFactory(),this._bnRule=i}};Ir.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)},Ir.prototype.getBoundary=function(){return this._geom instanceof Je?this.boundaryLineString(this._geom):this._geom instanceof ps?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ir.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()])},Ir.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ir.prototype.computeBoundaryCoordinates=function(e){var t=this,r=new W;this._endpointMap=new Tt;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(),l=a.getValue(),u=l.count;t._bnRule.isInBoundary(u)&&r.add(a.getKey())}return ge.toCoordinateArray(r)},Ir.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);t===null&&(t=new Vu,this._endpointMap.put(e,t)),t.count++},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir},Ir.getBoundary=function(){if(arguments.length===1){var e=arguments[0],t=new Ir(e);return t.getBoundary()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new Ir(r,i);return s.getBoundary()}};var Vu=function(){this.count=null};Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu};function Jm(){}function Zm(){}var Km=function(){};function Qm(){}function Bm(){}function $m(){}var Tr=function(){},Wc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.chars=function(e,t){for(var r=new Array(t).fill(null),i=0;i<t;i++)r[i]=e;return String(r)},Tr.getStackTrace=function(){if(arguments.length===1){var e=arguments[0],t=new Qm,r=new Jm;return e.printStackTrace(r),t.toString()}else if(arguments.length===2){var i=arguments[0],s=arguments[1],o="";new Zm(Tr.getStackTrace(i));for(var a=new $m,l=0;l<s;l++)try{o+=a.readLine()+Tr.NEWLINE}catch(u){if(u instanceof Bm)fe.shouldNeverReachHere();else throw u}finally{}return o}},Tr.split=function(e,t){for(var r=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+r),o=s.indexOf(t)}s.length>0&&i.add(s);for(var l=new Array(i.size()).fill(null),u=0;u<l.length;u++)l[u]=i.get(u);return l},Tr.toString=function(){if(arguments.length===1){var e=arguments[0];return Tr.SIMPLE_ORDINATE_FORMAT.format(e)}},Tr.spaces=function(e){return Tr.chars(" ",e)},Wc.NEWLINE.get=function(){return vt.getProperty("line.separator")},Wc.SIMPLE_ORDINATE_FORMAT.get=function(){return new Km},Object.defineProperties(Tr,Wc);var Ke=function(){};Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},Ke.copyCoord=function(e,t,r,i){for(var s=Math.min(e.getDimension(),r.getDimension()),o=0;o<s;o++)r.setOrdinate(i,o,e.getOrdinate(t,o))},Ke.isRing=function(e){var t=e.size();return t===0?!0:t<=3?!1:e.getOrdinate(0,Se.X)===e.getOrdinate(t-1,Se.X)&&e.getOrdinate(0,Se.Y)===e.getOrdinate(t-1,Se.Y)},Ke.isEqual=function(e,t){var r=e.size(),i=t.size();if(r!==i)return!1;for(var s=Math.min(e.getDimension(),t.getDimension()),o=0;o<r;o++)for(var a=0;a<s;a++){var l=e.getOrdinate(o,a),u=t.getOrdinate(o,a);if(e.getOrdinate(o,a)!==t.getOrdinate(o,a)&&!(ue.isNaN(l)&&ue.isNaN(u)))return!1}return!0},Ke.extend=function(e,t,r){var i=e.create(r,t.getDimension()),s=t.size();if(Ke.copy(t,0,i,0,s),s>0)for(var o=s;o<r;o++)Ke.copy(t,s-1,i,o,1);return i},Ke.reverse=function(e){for(var t=e.size()-1,r=Math.trunc(t/2),i=0;i<=r;i++)Ke.swap(e,i,t-i)},Ke.swap=function(e,t,r){if(t===r)return null;for(var i=0;i<e.getDimension();i++){var s=e.getOrdinate(t,i);e.setOrdinate(t,i,e.getOrdinate(r,i)),e.setOrdinate(r,i,s)}},Ke.copy=function(e,t,r,i,s){for(var o=0;o<s;o++)Ke.copyCoord(e,t+o,r,i+o)},Ke.toString=function(){if(arguments.length===1){var e=arguments[0],t=e.size();if(t===0)return"()";var r=e.getDimension(),i=new on;i.append("(");for(var s=0;s<t;s++){s>0&&i.append(" ");for(var o=0;o<r;o++)o>0&&i.append(","),i.append(Tr.toString(e.getOrdinate(s,o)))}return i.append(")"),i.toString()}},Ke.ensureValidRing=function(e,t){var r=t.size();if(r===0)return t;if(r<=3)return Ke.createClosedRing(e,t,4);var i=t.getOrdinate(0,Se.X)===t.getOrdinate(r-1,Se.X)&&t.getOrdinate(0,Se.Y)===t.getOrdinate(r-1,Se.Y);return i?t:Ke.createClosedRing(e,t,r+1)},Ke.createClosedRing=function(e,t,r){var i=e.create(r,t.getDimension()),s=t.size();Ke.copy(t,0,i,0,s);for(var o=s;o<r;o++)Ke.copy(t,0,i,o,1);return i};var Je=function(n){function e(r,i){n.call(this,i),this._points=null,this.init(r)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new te:this._points.expandEnvelope(new te)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return n.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 l=0;l<this._points.size();l++)if(!i.equal(i._points.getCoordinate(l),a._points.getCoordinate(l),o))return!1;return!0}else return n.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&&Ke.reverse(i._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ie.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();Ke.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,l=0;a<this._points.size()&&l<o._points.size();){var u=i._points.getCoordinate(a).compareTo(o._points.getCoordinate(l));if(u!==0)return u;a++,l++}return a<this._points.size()?1:l<o._points.size()?-1:0}else if(arguments.length===2){var h=arguments[0],f=arguments[1],p=h;return f.compare(this._points,p._points)}},e.prototype.apply=function(){var i=this;if(ae(arguments[0],An))for(var s=arguments[0],o=0;o<this._points.size();o++)s.filter(i._points.getCoordinate(o));else if(ae(arguments[0],Zr)){var a=arguments[0];if(this._points.size()===0)return null;for(var l=0;l<this._points.size()&&(a.filter(i._points,l),!a.isDone());l++);a.isGeometryChanged()&&this.geometryChanged()}else if(ae(arguments[0],hn)){var u=arguments[0];u.filter(this)}else if(ae(arguments[0],ai)){var h=arguments[0];h.filter(this)}},e.prototype.getBoundary=function(){return new Ir(this).getBoundary()},e.prototype.isEquivalentClass=function(i){return i instanceof e},e.prototype.clone=function(){var i=n.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 Ue("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[Kl]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,t),e}(oe),Ql=function(){};Ql.prototype.interfaces_=function(){return[]},Ql.prototype.getClass=function(){return Ql};var jt=function(n){function e(r,i){n.call(this,i),this._coordinates=r||null,this.init(this._coordinates)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new te;var i=new te;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},e.prototype.getSortIndex=function(){return n.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 n.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 Ie.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],l=o;return a.compare(this._coordinates,l._coordinates)}},e.prototype.apply=function(){if(ae(arguments[0],An)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(ae(arguments[0],Zr)){var s=arguments[0];if(this.isEmpty())return null;s.filter(this._coordinates,0),s.isGeometryChanged()&&this.geometryChanged()}else if(ae(arguments[0],hn)){var o=arguments[0];o.filter(this)}else if(ae(arguments[0],ai)){var a=arguments[0];a.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var i=n.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([])),fe.isTrue(i.size()<=1),this._coordinates=i},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Ql]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(e,t),e}(oe),Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri};var it=function(n){function e(r,i,s){if(n.call(this,s),this._shell=null,this._holes=null,r===null&&(r=this.getFactory().createLinearRing()),i===null&&(i=[]),n.hasNullElements(i))throw new Ue("holes must not contain null elements");if(r.isEmpty()&&n.hasNonEmptyElements(i))throw new Ue("shell is empty but holes are not");this._shell=r,this._holes=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return n.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(),l=0;l<a.length;l++)o++,s[o]=a[l];for(var u=0;u<this._holes.length;u++)for(var h=i._holes[u].getCoordinates(),f=0;f<h.length;f++)o++,s[o]=h[f];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 l=i.getY(o);if(!(l===s.getMinY()||l===s.getMaxY()))return!1}for(var u=i.getX(0),h=i.getY(0),f=1;f<=4;f++){var p=i.getX(f),v=i.getY(f),w=p!==u,I=v!==h;if(w===I)return!1;u=p,h=v}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,l=this._shell,u=a._shell;if(!l.equalsExact(u,o)||this._holes.length!==a._holes.length)return!1;for(var h=0;h<this._holes.length;h++)if(!i._holes[h].equalsExact(a._holes[h],o))return!1;return!0}else return n.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);ds.sort(this._holes)}else if(arguments.length===2){var o=arguments[0],a=arguments[1];if(o.isEmpty())return null;var l=new Array(o.getCoordinates().length-1).fill(null);vt.arraycopy(o.getCoordinates(),0,l,0,l.length);var u=ge.minCoordinate(o.getCoordinates());ge.scroll(l,u),vt.arraycopy(l,0,o.getCoordinates(),0,l.length),o.getCoordinates()[l.length]=l[0],H.isCCW(o.getCoordinates())===a&&ge.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 l=arguments[0],u=arguments[1],h=l,f=this._shell,p=h._shell,v=f.compareToSameClass(p,u);if(v!==0)return v;for(var w=this.getNumInteriorRing(),I=h.getNumInteriorRing(),T=0;T<w&&T<I;){var L=i.getInteriorRingN(T),m=h.getInteriorRingN(T),_=L.compareToSameClass(m,u);if(_!==0)return _;T++}return T<w?1:T<I?-1:0}},e.prototype.apply=function(i){var s=this;if(ae(i,An)){this._shell.apply(i);for(var o=0;o<this._holes.length;o++)s._holes[o].apply(i)}else if(ae(i,Zr)){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(ae(i,hn))i.filter(this);else if(ae(i,ai)){i.filter(this),this._shell.apply(i);for(var l=0;l<this._holes.length;l++)s._holes[l].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=n.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[Ri]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,t),e}(oe),pl=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return oe.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)?n.prototype.equalsExact.call(this,i,s):!1}else return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return n.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Ie.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[Ql]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(e,t),e}(Mt),Rn=function(n){function e(r,i){r instanceof M&&i instanceof me&&(r=i.getCoordinateSequenceFactory().create(r)),n.call(this,r,i),this.validateConstruction()}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return oe.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Ie.FALSE},e.prototype.isClosed=function(){return this.isEmpty()?!0:n.prototype.isClosed.call(this)},e.prototype.reverse=function(){var i=this._points.copy();Ke.reverse(i);var s=this.getFactory().createLinearRing(i);return s},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new Ue("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Ue("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}(Je),Fn=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return oe.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.isEquivalentClass(i)?n.prototype.equalsExact.call(this,i,s):!1}else return n.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],l=a.getBoundary(),u=0;u<l.getNumGeometries();u++)s.add(l.getGeometryN(u));var h=new Array(s.size()).fill(null);return this.getFactory().createMultiLineString(s.toArray(h))},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[Ri]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,t),e}(Mt),Nr=function(e){this._factory=e||null,this._isUserDataCopied=!1},zu={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Nr.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},Nr.prototype.edit=function(e,t){if(e===null)return null;var r=this.editInternal(e,t);return this._isUserDataCopied&&r.setUserData(e.getUserData()),r},Nr.prototype.editInternal=function(e,t){return this._factory===null&&(this._factory=e.getFactory()),e instanceof Mt?this.editGeometryCollection(e,t):e instanceof it?this.editPolygon(e,t):e instanceof jt?t.edit(e,this._factory):e instanceof Je?t.edit(e,this._factory):(fe.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},Nr.prototype.editGeometryCollection=function(e,t){for(var r=this,i=t.edit(e,this._factory),s=new W,o=0;o<i.getNumGeometries();o++){var a=r.edit(i.getGeometryN(o),t);a===null||a.isEmpty()||s.add(a)}return i.getClass()===pl?this._factory.createMultiPoint(s.toArray([])):i.getClass()===ps?this._factory.createMultiLineString(s.toArray([])):i.getClass()===Fn?this._factory.createMultiPolygon(s.toArray([])):this._factory.createGeometryCollection(s.toArray([]))},Nr.prototype.editPolygon=function(e,t){var r=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 l=r.edit(i.getInteriorRingN(a),t);l===null||l.isEmpty()||o.add(l)}return this._factory.createPolygon(s,o.toArray([]))},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.GeometryEditorOperation=function(){},zu.NoOpGeometryOperation.get=function(){return Bl},zu.CoordinateOperation.get=function(){return $l},zu.CoordinateSequenceOperation.get=function(){return jl},Object.defineProperties(Nr,zu);var Bl=function(){};Bl.prototype.edit=function(e,t){return e},Bl.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},Bl.prototype.getClass=function(){return Bl};var $l=function(){};$l.prototype.edit=function(e,t){var r=this.editCoordinates(e.getCoordinates(),e);return r===null?e:e instanceof Rn?t.createLinearRing(r):e instanceof Je?t.createLineString(r):e instanceof jt?r.length>0?t.createPoint(r[0]):t.createPoint():e},$l.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},$l.prototype.getClass=function(){return $l};var jl=function(){};jl.prototype.edit=function(e,t){return e instanceof Rn?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof Je?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof jt?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},jl.prototype.interfaces_=function(){return[Nr.GeometryEditorOperation]},jl.prototype.getClass=function(){return jl};var Qe=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 r=0;r<t;r++)e._coordinates[r]=new M}else if(ae(arguments[0],Se)){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 l=arguments[0],u=arguments[1];this._coordinates=new Array(l).fill(null),this._dimension=u;for(var h=0;h<l;h++)e._coordinates[h]=new M}}},Lf={serialVersionUID:{configurable:!0}};Qe.prototype.setOrdinate=function(e,t,r){switch(t){case Se.X:this._coordinates[e].x=r;break;case Se.Y:this._coordinates[e].y=r;break;case Se.Z:this._coordinates[e].z=r;break;default:throw new Ue("invalid ordinateIndex")}},Qe.prototype.size=function(){return this._coordinates.length},Qe.prototype.getOrdinate=function(e,t){switch(t){case Se.X:return this._coordinates[e].x;case Se.Y:return this._coordinates[e].y;case Se.Z:return this._coordinates[e].z}return ue.NaN},Qe.prototype.getCoordinate=function(){if(arguments.length===1){var e=arguments[0];return this._coordinates[e]}else if(arguments.length===2){var t=arguments[0],r=arguments[1];r.x=this._coordinates[t].x,r.y=this._coordinates[t].y,r.z=this._coordinates[t].z}},Qe.prototype.getCoordinateCopy=function(e){return new M(this._coordinates[e])},Qe.prototype.getDimension=function(){return this._dimension},Qe.prototype.getX=function(e){return this._coordinates[e].x},Qe.prototype.clone=function(){for(var e=this,t=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)t[r]=e._coordinates[r].clone();return new Qe(t,this._dimension)},Qe.prototype.expandEnvelope=function(e){for(var t=this,r=0;r<this._coordinates.length;r++)e.expandToInclude(t._coordinates[r]);return e},Qe.prototype.copy=function(){for(var e=this,t=new Array(this.size()).fill(null),r=0;r<this._coordinates.length;r++)t[r]=e._coordinates[r].copy();return new Qe(t,this._dimension)},Qe.prototype.toString=function(){var e=this;if(this._coordinates.length>0){var t=new on(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var r=1;r<this._coordinates.length;r++)t.append(", "),t.append(e._coordinates[r]);return t.append(")"),t.toString()}else return"()"},Qe.prototype.getY=function(e){return this._coordinates[e].y},Qe.prototype.toCoordinateArray=function(){return this._coordinates},Qe.prototype.interfaces_=function(){return[Se,Cr]},Qe.prototype.getClass=function(){return Qe},Lf.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Qe,Lf);var kn=function(){},qc={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};kn.prototype.readResolve=function(){return kn.instance()},kn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Qe(e)}else if(ae(arguments[0],Se)){var t=arguments[0];return new Qe(t)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new Qe(r):new Qe(r,i)}},kn.prototype.interfaces_=function(){return[il,Cr]},kn.prototype.getClass=function(){return kn},kn.instance=function(){return kn.instanceObject},qc.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},qc.instanceObject.get=function(){return new kn},Object.defineProperties(kn,qc);var Af=function(n){function e(){n.call(this),this.map_=new Map}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(r){return this.map_.get(r)||null},e.prototype.put=function(r,i){return this.map_.set(r,i),i},e.prototype.values=function(){for(var r=new W,i=this.map_.values(),s=i.next();!s.done;)r.add(s.value),s=i.next();return r},e.prototype.entrySet=function(){var r=new Uc;return this.map_.entries().forEach(function(i){return r.add(i)}),r},e.prototype.size=function(){return this.map_.size()},e}($s),Te=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof fn){var e=arguments[0];this._modelType=e,e===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var t=arguments[0];this._modelType=n.FIXED,this.setScale(t)}else if(arguments[0]instanceof n){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Xc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Te.prototype.equals=function(e){if(!(e instanceof Te))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Te.prototype.compareTo=function(e){var t=e,r=this.getMaximumSignificantDigits(),i=t.getMaximumSignificantDigits();return new an(r).compareTo(new an(i))},Te.prototype.getScale=function(){return this._scale},Te.prototype.isFloating=function(){return this._modelType===Te.FLOATING||this._modelType===Te.FLOATING_SINGLE},Te.prototype.getType=function(){return this._modelType},Te.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Te.FLOATING?e="Floating":this._modelType===Te.FLOATING_SINGLE?e="Floating-Single":this._modelType===Te.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Te.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var e=arguments[0];if(ue.isNaN(e))return e;if(this._modelType===Te.FLOATING_SINGLE){var t=e;return t}return this._modelType===Te.FIXED?Math.round(e*this._scale)/this._scale:e}else if(arguments[0]instanceof M){var r=arguments[0];if(this._modelType===Te.FLOATING)return null;r.x=this.makePrecise(r.x),r.y=this.makePrecise(r.y)}},Te.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Te.FLOATING?e=16:this._modelType===Te.FLOATING_SINGLE?e=6:this._modelType===Te.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Te.prototype.setScale=function(e){this._scale=Math.abs(e)},Te.prototype.interfaces_=function(){return[Cr,Sr]},Te.prototype.getClass=function(){return Te},Te.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},Xc.serialVersionUID.get=function(){return 7777263578777804e3},Xc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Te,Xc);var fn=function n(e){this._name=e||null,n.nameToTypeMap.put(e,this)},Yc={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};fn.prototype.readResolve=function(){return fn.nameToTypeMap.get(this._name)},fn.prototype.toString=function(){return this._name},fn.prototype.interfaces_=function(){return[Cr]},fn.prototype.getClass=function(){return fn},Yc.serialVersionUID.get=function(){return-552860263173159e4},Yc.nameToTypeMap.get=function(){return new Af},Object.defineProperties(fn,Yc),Te.Type=fn,Te.FIXED=new fn("FIXED"),Te.FLOATING=new fn("FLOATING"),Te.FLOATING_SINGLE=new fn("FLOATING SINGLE");var me=function n(){this._precisionModel=new Te,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ae(arguments[0],il)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Te&&(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]))},Rf={serialVersionUID:{configurable:!0}};me.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)},me.prototype.createLineString=function(e){if(e){if(e instanceof Array)return new Je(this.getCoordinateSequenceFactory().create(e),this);if(ae(e,Se))return new Je(e,this)}else return new Je(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){if(arguments.length===0)return new ps(null,this);if(arguments.length===1){var e=arguments[0];return new ps(e,this)}},me.prototype.buildGeometry=function(e){for(var t=null,r=!1,i=!1,s=e.iterator();s.hasNext();){var o=s.next(),a=o.getClass();t===null&&(t=a),a!==t&&(r=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(t===null)return this.createGeometryCollection();if(r||i)return this.createGeometryCollection(me.toGeometryArray(e));var l=e.iterator().next(),u=e.size()>1;if(u){if(l instanceof it)return this.createMultiPolygon(me.toPolygonArray(e));if(l instanceof Je)return this.createMultiLineString(me.toLineStringArray(e));if(l instanceof jt)return this.createMultiPoint(me.toPointArray(e));fe.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l},me.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(e!==null?this.getCoordinateSequenceFactory().create(e):null)},me.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(ae(arguments[0],Se)){var t=arguments[0];return new jt(t,this)}}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(arguments.length===0)return new it(null,null,this);if(arguments.length===1){if(ae(arguments[0],Se)){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 Rn){var r=arguments[0];return this.createPolygon(r,null)}}else if(arguments.length===2){var i=arguments[0],s=arguments[1];return new it(i,s,this)}},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Mt(null,this);if(arguments.length===1){var e=arguments[0];return new Mt(e,this)}},me.prototype.createGeometry=function(e){var t=new Nr(this);return t.edit(e,{edit:function(){if(arguments.length===2){var r=arguments[0];return this._coordinateSequenceFactory.create(r)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.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(ae(arguments[0],Se)){var t=arguments[0];return new Rn(t,this)}}},me.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Fn(null,this);if(arguments.length===1){var e=arguments[0];return new Fn(e,this)}},me.prototype.createMultiPoint=function(){var e=this;if(arguments.length===0)return new pl(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new pl(t,this)}else if(arguments[0]instanceof Array){var r=arguments[0];return this.createMultiPoint(r!==null?this.getCoordinateSequenceFactory().create(r):null)}else if(ae(arguments[0],Se)){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());Ke.copy(i,o,a,0,1),s[o]=e.createPoint(a)}return this.createMultiPoint(s)}}},me.prototype.interfaces_=function(){return[Cr]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toGeometryArray=function(e){if(e===null)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},me.getDefaultCoordinateSequenceFactory=function(){return kn.instance()},me.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},me.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},Rf.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(me,Rf);var jm=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Uu=function(e){this.geometryFactory=e||new me};Uu.prototype.read=function(e){var t;typeof e=="string"?t=JSON.parse(e):t=e;var r=t.type;if(!dn[r])throw new Error("Unknown GeoJSON type: "+t.type);return jm.indexOf(r)!==-1?dn[r].apply(this,[t.coordinates]):r==="GeometryCollection"?dn[r].apply(this,[t.geometries]):dn[r].apply(this,[t])},Uu.prototype.write=function(e){var t=e.getGeometryType();if(!hi[t])throw new Error("Geometry is not supported");return hi[t].apply(this,[e])};var dn={Feature:function(n){var e={};for(var t in n)e[t]=n[t];if(n.geometry){var r=n.geometry.type;if(!dn[r])throw new Error("Unknown GeoJSON type: "+n.type);e.geometry=this.read(n.geometry)}return n.bbox&&(e.bbox=dn.bbox.apply(this,[n.bbox])),e},FeatureCollection:function(n){var e=this,t={};if(n.features){t.features=[];for(var r=0;r<n.features.length;++r)t.features.push(e.read(n.features[r]))}return n.bbox&&(t.bbox=this.parse.bbox.apply(this,[n.bbox])),t},coordinates:function(n){for(var e=[],t=0;t<n.length;++t){var r=n[t];e.push(new M(r[0],r[1]))}return e},bbox:function(n){return this.geometryFactory.createLinearRing([new M(n[0],n[1]),new M(n[2],n[1]),new M(n[2],n[3]),new M(n[0],n[3]),new M(n[0],n[1])])},Point:function(n){var e=new M(n[0],n[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(n){for(var e=this,t=[],r=0;r<n.length;++r)t.push(dn.Point.apply(e,[n[r]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(n){var e=dn.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(e)},MultiLineString:function(n){for(var e=this,t=[],r=0;r<n.length;++r)t.push(dn.LineString.apply(e,[n[r]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(n){for(var e=this,t=dn.coordinates.apply(this,[n[0]]),r=this.geometryFactory.createLinearRing(t),i=[],s=1;s<n.length;++s){var o=n[s],a=dn.coordinates.apply(e,[o]),l=e.geometryFactory.createLinearRing(a);i.push(l)}return this.geometryFactory.createPolygon(r,i)},MultiPolygon:function(n){for(var e=this,t=[],r=0;r<n.length;++r){var i=n[r];t.push(dn.Polygon.apply(e,[i]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(n){for(var e=this,t=[],r=0;r<n.length;++r){var i=n[r];t.push(e.read(i))}return this.geometryFactory.createGeometryCollection(t)}},hi={coordinate:function(n){return[n.x,n.y]},Point:function(n){var e=hi.coordinate.apply(this,[n.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=hi.Point.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(n){for(var e=this,t=[],r=n.getCoordinates(),i=0;i<r.length;++i){var s=r[i];t.push(hi.coordinate.apply(e,[s]))}return{type:"LineString",coordinates:t}},MultiLineString:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=hi.LineString.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(n){var e=this,t=[],r=hi.LineString.apply(this,[n._shell]);t.push(r.coordinates);for(var i=0;i<n._holes.length;++i){var s=n._holes[i],o=hi.LineString.apply(e,[s]);t.push(o.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=hi.Polygon.apply(e,[i]);t.push(s.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(n){for(var e=this,t=[],r=0;r<n._geometries.length;++r){var i=n._geometries[r],s=i.getGeometryType();t.push(hi[s].apply(e,[i]))}return{type:"GeometryCollection",geometries:t}}},Hc=function(e){this.geometryFactory=e||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Uu(this.geometryFactory)};Hc.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Te.FIXED&&this.reducePrecision(t),t},Hc.prototype.reducePrecision=function(e){var t=this,r,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(r=0,i=e.points.length;r<i;r++)t.precisionModel.makePrecise(e.points[r]);else if(e.geometries)for(r=0,i=e.geometries.length;r<i;r++)t.reducePrecision(e.geometries[r])};var Ff=function(){this.parser=new Uu(this.geometryFactory)};Ff.prototype.write=function(e){return this.parser.write(e)};var G=function(){},Gu={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};G.prototype.interfaces_=function(){return[]},G.prototype.getClass=function(){return G},G.opposite=function(e){return e===G.LEFT?G.RIGHT:e===G.RIGHT?G.LEFT:e},Gu.ON.get=function(){return 0},Gu.LEFT.get=function(){return 1},Gu.RIGHT.get=function(){return 2},Object.defineProperties(G,Gu);function Wu(n){this.message=n||""}Wu.prototype=new Error,Wu.prototype.name="EmptyStackException";function pn(){this.array_=[]}pn.prototype=new Hr,pn.prototype.add=function(n){return this.array_.push(n),!0},pn.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},pn.prototype.push=function(n){return this.array_.push(n),n},pn.prototype.pop=function(n){if(this.array_.length===0)throw new Wu;return this.array_.pop()},pn.prototype.peek=function(){if(this.array_.length===0)throw new Wu;return this.array_[this.array_.length-1]},pn.prototype.empty=function(){return this.array_.length===0},pn.prototype.isEmpty=function(){return this.empty()},pn.prototype.search=function(n){return this.array_.indexOf(n)},pn.prototype.size=function(){return this.array_.length},pn.prototype.toArray=function(){for(var n=this,e=[],t=0,r=this.array_.length;t<r;t++)e.push(n.array_[t]);return e};var gn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};gn.prototype.getCoordinate=function(){return this._minCoord},gn.prototype.getRightmostSide=function(e,t){var r=this.getRightmostSideOfSegment(e,t);return r<0&&(r=this.getRightmostSideOfSegment(e,t-1)),r<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),r},gn.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();fe.isTrue(this._minIndex>0&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],r=e[this._minIndex+1],i=H.computeOrientation(this._minCoord,r,t),s=!1;(t.y<this._minCoord.y&&r.y<this._minCoord.y&&i===H.COUNTERCLOCKWISE||t.y>this._minCoord.y&&r.y>this._minCoord.y&&i===H.CLOCKWISE)&&(s=!0),s&&(this._minIndex=this._minIndex-1)},gn.prototype.getRightmostSideOfSegment=function(e,t){var r=e.getEdge(),i=r.getCoordinates();if(t<0||t+1>=i.length||i[t].y===i[t+1].y)return-1;var s=G.LEFT;return i[t].y<i[t+1].y&&(s=G.RIGHT),s},gn.prototype.getEdge=function(){return this._orientedDe},gn.prototype.checkForRightmostCoordinate=function(e){for(var t=this,r=e.getEdge().getCoordinates(),i=0;i<r.length-1;i++)(t._minCoord===null||r[i].x>t._minCoord.x)&&(t._minDe=e,t._minIndex=i,t._minCoord=r[i])},gn.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)},gn.prototype.findEdge=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next();i.isForward()&&t.checkForRightmostCoordinate(i)}fe.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===G.LEFT&&(this._orientedDe=this._minDe.getSym())},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var fi=function(n){function e(t,r){n.call(this,e.msgWithCoord(t,r)),this.pt=r?new M(r):null,this.name="TopologyException"}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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(r,i){return i?r:r+" [ "+i+" ]"},e}(oi),qu=function(){this.array_=[]};qu.prototype.addLast=function(e){this.array_.push(e)},qu.prototype.removeFirst=function(){return this.array_.shift()},qu.prototype.isEmpty=function(){return this.array_.length===0};var xt=function(){this._finder=null,this._dirEdgeList=new W,this._nodes=new W,this._rightMostCoord=null,this._env=null,this._finder=new gn};xt.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.setVisited(!1)}},xt.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},xt.prototype.computeNodeDepth=function(e){for(var t=this,r=null,i=e.getEdges().iterator();i.hasNext();){var s=i.next();if(s.isVisited()||s.getSym().isVisited()){r=s;break}}if(r===null)throw new fi("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(r);for(var o=e.getEdges().iterator();o.hasNext();){var a=o.next();a.setVisited(!0),t.copySymDepths(a)}},xt.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(G.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},xt.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},xt.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(G.RIGHT)>=1&&t.getDepth(G.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},xt.prototype.computeDepths=function(e){var t=this,r=new Uc,i=new qu,s=e.getNode();for(i.addLast(s),r.add(s),e.setVisited(!0);!i.isEmpty();){var o=i.removeFirst();r.add(o),t.computeNodeDepth(o);for(var a=o.getEdges().iterator();a.hasNext();){var l=a.next(),u=l.getSym();if(!u.isVisited()){var h=u.getNode();r.contains(h)||(i.addLast(h),r.add(h))}}}},xt.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},xt.prototype.getEnvelope=function(){if(this._env===null){for(var e=new te,t=this._dirEdgeList.iterator();t.hasNext();)for(var r=t.next(),i=r.getEdge().getCoordinates(),s=0;s<i.length-1;s++)e.expandToInclude(i[s]);this._env=e}return this._env},xt.prototype.addReachable=function(e){var t=this,r=new pn;for(r.add(e);!r.empty();){var i=r.pop();t.add(i,r)}},xt.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(G.LEFT,e.getDepth(G.RIGHT)),t.setDepth(G.RIGHT,e.getDepth(G.LEFT))},xt.prototype.add=function(e,t){var r=this;e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var s=i.next();r._dirEdgeList.add(s);var o=s.getSym(),a=o.getNode();a.isVisited()||t.push(a)}},xt.prototype.getNodes=function(){return this._nodes},xt.prototype.getDirectedEdges=function(){return this._dirEdgeList},xt.prototype.interfaces_=function(){return[Sr]},xt.prototype.getClass=function(){return xt};var Re=function n(){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 r=arguments[0];this.init(1),this.location[G.ON]=r}else if(arguments[0]instanceof n){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],l=arguments[2];this.init(3),this.location[G.ON]=o,this.location[G.LEFT]=a,this.location[G.RIGHT]=l}};Re.prototype.setAllLocations=function(e){for(var t=this,r=0;r<this.location.length;r++)t.location[r]=e},Re.prototype.isNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]!==R.NONE)return!1;return!0},Re.prototype.setAllLocationsIfNull=function(e){for(var t=this,r=0;r<this.location.length;r++)t.location[r]===R.NONE&&(t.location[r]=e)},Re.prototype.isLine=function(){return this.location.length===1},Re.prototype.merge=function(e){var t=this;if(e.location.length>this.location.length){var r=new Array(3).fill(null);r[G.ON]=this.location[G.ON],r[G.LEFT]=R.NONE,r[G.RIGHT]=R.NONE,this.location=r}for(var i=0;i<this.location.length;i++)t.location[i]===R.NONE&&i<e.location.length&&(t.location[i]=e.location[i])},Re.prototype.getLocations=function(){return this.location},Re.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[G.LEFT];this.location[G.LEFT]=this.location[G.RIGHT],this.location[G.RIGHT]=e},Re.prototype.toString=function(){var e=new on;return this.location.length>1&&e.append(R.toLocationSymbol(this.location[G.LEFT])),e.append(R.toLocationSymbol(this.location[G.ON])),this.location.length>1&&e.append(R.toLocationSymbol(this.location[G.RIGHT])),e.toString()},Re.prototype.setLocations=function(e,t,r){this.location[G.ON]=e,this.location[G.LEFT]=t,this.location[G.RIGHT]=r},Re.prototype.get=function(e){return e<this.location.length?this.location[e]:R.NONE},Re.prototype.isArea=function(){return this.location.length>1},Re.prototype.isAnyNull=function(){for(var e=this,t=0;t<this.location.length;t++)if(e.location[t]===R.NONE)return!0;return!1},Re.prototype.setLocation=function(){if(arguments.length===1){var e=arguments[0];this.setLocation(G.ON,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];this.location[t]=r}},Re.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(R.NONE)},Re.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},Re.prototype.allPositionsEqual=function(e){for(var t=this,r=0;r<this.location.length;r++)if(t.location[r]!==e)return!1;return!0},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var be=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Re(e),this.elt[1]=new Re(e)}else if(arguments[0]instanceof n){var t=arguments[0];this.elt[0]=new Re(t.elt[0]),this.elt[1]=new Re(t.elt[1])}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(R.NONE),this.elt[1]=new Re(R.NONE),this.elt[r].setLocation(i)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2];this.elt[0]=new Re(s,o,a),this.elt[1]=new Re(s,o,a)}else if(arguments.length===4){var l=arguments[0],u=arguments[1],h=arguments[2],f=arguments[3];this.elt[0]=new Re(R.NONE,R.NONE,R.NONE),this.elt[1]=new Re(R.NONE,R.NONE,R.NONE),this.elt[l].setLocations(u,h,f)}};be.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},be.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},be.prototype.isNull=function(e){return this.elt[e].isNull()},be.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],r=arguments[1];this.elt[t].setAllLocationsIfNull(r)}},be.prototype.isLine=function(e){return this.elt[e].isLine()},be.prototype.merge=function(e){for(var t=this,r=0;r<2;r++)t.elt[r]===null&&e.elt[r]!==null?t.elt[r]=new Re(e.elt[r]):t.elt[r].merge(e.elt[r])},be.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},be.prototype.getLocation=function(){if(arguments.length===1){var e=arguments[0];return this.elt[e].get(G.ON)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return this.elt[t].get(r)}},be.prototype.toString=function(){var e=new on;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()},be.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()}},be.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},be.prototype.setLocation=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(G.ON,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this.elt[r].setLocation(i,s)}},be.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},be.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},be.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new Re(this.elt[e].location[0]))},be.prototype.interfaces_=function(){return[]},be.prototype.getClass=function(){return be},be.toLineLabel=function(e){for(var t=new be(R.NONE),r=0;r<2;r++)t.setLocation(r,e.getLocation(r));return t};var je=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new W,this._pts=new W,this._label=new be(R.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()};je.prototype.computeRing=function(){var e=this;if(this._ring!==null)return null;for(var t=new Array(this._pts.size()).fill(null),r=0;r<this._pts.size();r++)t[r]=e._pts.get(r);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=H.isCCW(this._ring.getCoordinates())},je.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},je.prototype.computePoints=function(e){var t=this;this._startDe=e;var r=e,i=!0;do{if(r===null)throw new fi("Found null DirectedEdge");if(r.getEdgeRing()===t)throw new fi("Directed Edge visited twice during ring-building at "+r.getCoordinate());t._edges.add(r);var s=r.getLabel();fe.isTrue(s.isArea()),t.mergeLabel(s),t.addPoints(r.getEdge(),r.isForward(),i),i=!1,t.setEdgeRing(r,t),r=t.getNext(r)}while(r!==this._startDe)},je.prototype.getLinearRing=function(){return this._ring},je.prototype.getCoordinate=function(e){return this._pts.get(e)},je.prototype.computeMaxNodeDegree=function(){var e=this;this._maxNodeDegree=0;var t=this._startDe;do{var r=t.getNode(),i=r.getEdges().getOutgoingDegree(e);i>e._maxNodeDegree&&(e._maxNodeDegree=i),t=e.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},je.prototype.addPoints=function(e,t,r){var i=this,s=e.getCoordinates();if(t){var o=1;r&&(o=0);for(var a=o;a<s.length;a++)i._pts.add(s[a])}else{var l=s.length-2;r&&(l=s.length-1);for(var u=l;u>=0;u--)i._pts.add(s[u])}},je.prototype.isHole=function(){return this._isHole},je.prototype.setInResult=function(){var e=this._startDe;do e.getEdge().setInResult(!0),e=e.getNext();while(e!==this._startDe)},je.prototype.containsPoint=function(e){var t=this.getLinearRing(),r=t.getEnvelopeInternal();if(!r.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},je.prototype.addHole=function(e){this._holes.add(e)},je.prototype.isShell=function(){return this._shell===null},je.prototype.getLabel=function(){return this._label},je.prototype.getEdges=function(){return this._edges},je.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},je.prototype.getShell=function(){return this._shell},je.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],r=arguments[1],i=t.getLocation(r,G.RIGHT);if(i===R.NONE)return null;if(this._label.getLocation(r)===R.NONE)return this._label.setLocation(r,i),null}},je.prototype.setShell=function(e){this._shell=e,e!==null&&e.addHole(this)},je.prototype.toPolygon=function(e){for(var t=this,r=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)r[i]=t._holes.get(i).getLinearRing();var s=e.createPolygon(this.getLinearRing(),r);return s},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var ev=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(r,i){r.setMinEdgeRing(i)},e.prototype.getNext=function(r){return r.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),tv=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var r=this,i=new W,s=this._startDe;do{if(s.getMinEdgeRing()===null){var o=new ev(s,r._geometryFactory);i.add(o)}s=s.getNext()}while(s!==this._startDe);return i},e.prototype.setEdgeRing=function(r,i){r.setEdgeRing(i)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var r=this,i=this._startDe;do{var s=i.getNode();s.getEdges().linkMinimalDirectedEdges(r),i=i.getNext()}while(i!==this._startDe)},e.prototype.getNext=function(r){return r.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),cr=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}}};cr.prototype.setVisited=function(e){this._isVisited=e},cr.prototype.setInResult=function(e){this._isInResult=e},cr.prototype.isCovered=function(){return this._isCovered},cr.prototype.isCoveredSet=function(){return this._isCoveredSet},cr.prototype.setLabel=function(e){this._label=e},cr.prototype.getLabel=function(){return this._label},cr.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},cr.prototype.updateIM=function(e){fe.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(e)},cr.prototype.isInResult=function(){return this._isInResult},cr.prototype.isVisited=function(){return this._isVisited},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var Xu=function(n){function e(){n.call(this),this._coord=null,this._edges=null;var t=arguments[0],r=arguments[1];this._coord=t,this._edges=r,this._label=new be(0,R.NONE)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var r=this.getEdges().getEdges().iterator();r.hasNext();){var i=r.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(r){r.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(r){},e.prototype.computeMergedLocation=function(r,i){var s=R.NONE;if(s=this._label.getLocation(i),!r.isNull(i)){var o=r.getLocation(i);s!==R.BOUNDARY&&(s=o)}return s},e.prototype.setLabel=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];this._label===null?this._label=new be(r,i):this._label.setLocation(r,i)}else return n.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var r=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof be)for(var s=arguments[0],o=0;o<2;o++){var a=r.computeMergedLocation(s,o),l=r._label.getLocation(o);l===R.NONE&&r._label.setLocation(o,a)}},e.prototype.add=function(r){this._edges.insert(r),r.setNode(this)},e.prototype.setLabelBoundary=function(r){if(this._label===null)return null;var i=R.NONE;this._label!==null&&(i=this._label.getLocation(r));var s=null;switch(i){case R.BOUNDARY:s=R.INTERIOR;break;case R.INTERIOR:s=R.BOUNDARY;break;default:s=R.BOUNDARY;break}this._label.setLocation(r,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),mn=function(){this.nodeMap=new Tt,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};mn.prototype.find=function(e){return this.nodeMap.get(e)},mn.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 Xu){var r=arguments[0],i=this.nodeMap.get(r.getCoordinate());return i===null?(this.nodeMap.put(r.getCoordinate(),r),r):(i.mergeLabel(r),i)}},mn.prototype.print=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}},mn.prototype.iterator=function(){return this.nodeMap.values().iterator()},mn.prototype.values=function(){return this.nodeMap.values()},mn.prototype.getBoundaryNodes=function(e){for(var t=new W,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(e)===R.BOUNDARY&&t.add(i)}return t},mn.prototype.add=function(e){var t=e.getCoordinate(),r=this.addNode(t);r.add(e)},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var xe=function(){},eu={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe},xe.isNorthern=function(e){return e===xe.NE||e===xe.NW},xe.isOpposite=function(e,t){if(e===t)return!1;var r=(e-t+4)%4;return r===2},xe.commonHalfPlane=function(e,t){if(e===t)return e;var r=(e-t+4)%4;if(r===2)return-1;var i=e<t?e:t,s=e>t?e:t;return i===0&&s===3?3:i},xe.isInHalfPlane=function(e,t){return t===xe.SE?e===xe.SE||e===xe.SW:e===t||e===t+1},xe.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 Ue("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?xe.NE:xe.SE:t>=0?xe.NW:xe.SW}else if(arguments[0]instanceof M&&arguments[1]instanceof M){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new Ue("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?xe.NE:xe.SE:i.y>=r.y?xe.NW:xe.SW}},eu.NE.get=function(){return 0},eu.NW.get=function(){return 1},eu.SW.get=function(){return 2},eu.SE.get=function(){return 3},Object.defineProperties(xe,eu);var Nt=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],r=arguments[1],i=arguments[2],s=null;this._edge=t,this.init(r,i),this._label=s}else if(arguments.length===4){var o=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3];this._edge=o,this.init(a,l),this._label=u}};Nt.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)},Nt.prototype.getDy=function(){return this._dy},Nt.prototype.getCoordinate=function(){return this._p0},Nt.prototype.setNode=function(e){this._node=e},Nt.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),r=this.getClass().getName(),i=r.lastIndexOf("."),s=r.substring(i+1);e.print(" "+s+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},Nt.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},Nt.prototype.getDirectedCoordinate=function(){return this._p1},Nt.prototype.getDx=function(){return this._dx},Nt.prototype.getLabel=function(){return this._label},Nt.prototype.getEdge=function(){return this._edge},Nt.prototype.getQuadrant=function(){return this._quadrant},Nt.prototype.getNode=function(){return this._node},Nt.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),r=t.lastIndexOf("."),i=t.substring(r+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},Nt.prototype.computeLabel=function(e){},Nt.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=xe.quadrant(this._dx,this._dy),fe.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Nt.prototype.interfaces_=function(){return[Sr]},Nt.prototype.getClass=function(){return Nt};var Jc=function(n){function e(){var t=arguments[0],r=arguments[1];if(n.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=r,r)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 n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(r){return this._depth[r]},e.prototype.setVisited=function(r){this._isVisited=r},e.prototype.computeDirectedLabel=function(){this._label=new be(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(r,i){if(this._depth[r]!==-999&&this._depth[r]!==i)throw new fi("assigned depths do not match",this.getCoordinate());this._depth[r]=i},e.prototype.isInteriorAreaEdge=function(){for(var r=this,i=!0,s=0;s<2;s++)r._label.isArea(s)&&r._label.getLocation(s,G.LEFT)===R.INTERIOR&&r._label.getLocation(s,G.RIGHT)===R.INTERIOR||(i=!1);return i},e.prototype.setNextMin=function(r){this._nextMin=r},e.prototype.print=function(r){n.prototype.print.call(this,r),r.print(" "+this._depth[G.LEFT]+"/"+this._depth[G.RIGHT]),r.print(" ("+this.getDepthDelta()+")"),this._isInResult&&r.print(" inResult")},e.prototype.setMinEdgeRing=function(r){this._minEdgeRing=r},e.prototype.isLineEdge=function(){var r=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,R.EXTERIOR),s=!this._label.isArea(1)||this._label.allPositionsEqual(1,R.EXTERIOR);return r&&i&&s},e.prototype.setEdgeRing=function(r){this._edgeRing=r},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var r=this._edge.getDepthDelta();return this._isForward||(r=-r),r},e.prototype.setInResult=function(r){this._isInResult=r},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(r){this.print(r),r.print(" "),this._isForward?this._edge.print(r):this._edge.printReverse(r)},e.prototype.setSym=function(r){this._sym=r},e.prototype.setVisitedEdge=function(r){this.setVisited(r),this._sym.setVisited(r)},e.prototype.setEdgeDepths=function(r,i){var s=this.getEdge().getDepthDelta();this._isForward||(s=-s);var o=1;r===G.LEFT&&(o=-1);var a=G.opposite(r),l=s*o,u=i+l;this.setDepth(r,i),this.setDepth(a,u)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(r){this._next=r},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(r,i){return r===R.EXTERIOR&&i===R.INTERIOR?1:r===R.INTERIOR&&i===R.EXTERIOR?-1:0},e}(Nt),gl=function(){};gl.prototype.createNode=function(e){return new Xu(e,null)},gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl};var He=function(){if(this._edges=new W,this._nodes=null,this._edgeEndList=new W,arguments.length===0)this._nodes=new mn(new gl);else if(arguments.length===1){var e=arguments[0];this._nodes=new mn(e)}};He.prototype.printEdges=function(e){var t=this;e.println("Edges:");for(var r=0;r<this._edges.size();r++){e.println("edge "+r+":");var i=t._edges.get(r);i.print(e),i.eiList.print(e)}},He.prototype.find=function(e){return this._nodes.find(e)},He.prototype.addNode=function(){if(arguments[0]instanceof Xu){var e=arguments[0];return this._nodes.addNode(e)}else if(arguments[0]instanceof M){var t=arguments[0];return this._nodes.addNode(t)}},He.prototype.getNodeIterator=function(){return this._nodes.iterator()},He.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkResultDirectedEdges()}},He.prototype.debugPrintln=function(e){vt.out.println(e)},He.prototype.isBoundaryNode=function(e,t){var r=this._nodes.find(t);if(r===null)return!1;var i=r.getLabel();return i!==null&&i.getLocation(e)===R.BOUNDARY},He.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();){var t=e.next();t.getEdges().linkAllDirectedEdges()}},He.prototype.matchInSameDirection=function(e,t,r,i){return e.equals(r)?H.computeOrientation(e,t,i)===H.COLLINEAR&&xe.quadrant(e,t)===xe.quadrant(r,i):!1},He.prototype.getEdgeEnds=function(){return this._edgeEndList},He.prototype.debugPrint=function(e){vt.out.print(e)},He.prototype.getEdgeIterator=function(){return this._edges.iterator()},He.prototype.findEdgeInSameDirection=function(e,t){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),o=s.getCoordinates();if(r.matchInSameDirection(e,t,o[0],o[1])||r.matchInSameDirection(e,t,o[o.length-1],o[o.length-2]))return s}return null},He.prototype.insertEdge=function(e){this._edges.add(e)},He.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var r=t.next();if(r.getEdge()===e)return r}return null},He.prototype.addEdges=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next();t._edges.add(i);var s=new Jc(i,!0),o=new Jc(i,!1);s.setSym(o),o.setSym(s),t.add(s),t.add(o)}},He.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},He.prototype.getNodes=function(){return this._nodes.values()},He.prototype.findEdge=function(e,t){for(var r=this,i=0;i<this._edges.size();i++){var s=r._edges.get(i),o=s.getCoordinates();if(e.equals(o[0])&&t.equals(o[1]))return s}return null},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He},He.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();){var r=t.next();r.getEdges().linkResultDirectedEdges()}};var er=function(){this._geometryFactory=null,this._shellList=new W;var e=arguments[0];this._geometryFactory=e};er.prototype.sortShellsAndHoles=function(e,t,r){for(var i=e.iterator();i.hasNext();){var s=i.next();s.isHole()?r.add(s):t.add(s)}},er.prototype.computePolygons=function(e){for(var t=this,r=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.toPolygon(t._geometryFactory);r.add(o)}return r},er.prototype.placeFreeHoles=function(e,t){for(var r=this,i=t.iterator();i.hasNext();){var s=i.next();if(s.getShell()===null){var o=r.findEdgeRingContaining(s,e);if(o===null)throw new fi("unable to assign hole to a shell",s.getCoordinate(0));s.setShell(o)}}},er.prototype.buildMinimalEdgeRings=function(e,t,r){for(var i=this,s=new W,o=e.iterator();o.hasNext();){var a=o.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var l=a.buildMinimalRings(),u=i.findShell(l);u!==null?(i.placePolygonHoles(u,l),t.add(u)):r.addAll(l)}else s.add(a)}return s},er.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();){var r=t.next();if(r.containsPoint(e))return!0}return!1},er.prototype.buildMaximalEdgeRings=function(e){for(var t=this,r=new W,i=e.iterator();i.hasNext();){var s=i.next();if(s.isInResult()&&s.getLabel().isArea()&&s.getEdgeRing()===null){var o=new tv(s,t._geometryFactory);r.add(o),o.setInResult()}}return r},er.prototype.placePolygonHoles=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()&&i.setShell(e)}},er.prototype.getPolygons=function(){var e=this.computePolygons(this._shellList);return e},er.prototype.findEdgeRingContaining=function(e,t){for(var r=e.getLinearRing(),i=r.getEnvelopeInternal(),s=r.getCoordinateN(0),o=null,a=null,l=t.iterator();l.hasNext();){var u=l.next(),h=u.getLinearRing(),f=h.getEnvelopeInternal();o!==null&&(a=o.getLinearRing().getEnvelopeInternal());var p=!1;f.contains(i)&&H.isPointInRing(s,h.getCoordinates())&&(p=!0),p&&(o===null||a.contains(f))&&(o=u)}return o},er.prototype.findShell=function(e){for(var t=0,r=null,i=e.iterator();i.hasNext();){var s=i.next();s.isHole()||(r=s,t++)}return fe.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),r},er.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],r=arguments[1];He.linkResultDirectedEdges(r);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)}},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er};var ml=function(){};ml.prototype.getBounds=function(){},ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml};var Kr=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};Kr.prototype.getItem=function(){return this._item},Kr.prototype.getBounds=function(){return this._bounds},Kr.prototype.interfaces_=function(){return[ml,Cr]},Kr.prototype.getClass=function(){return Kr};var di=function(){this._size=null,this._items=null,this._size=0,this._items=new W,this._items.add(null)};di.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},di.prototype.size=function(){return this._size},di.prototype.reorder=function(e){for(var t=this,r=null,i=this._items.get(e);e*2<=this._size&&(r=e*2,r!==t._size&&t._items.get(r+1).compareTo(t._items.get(r))<0&&r++,t._items.get(r).compareTo(i)<0);e=r)t._items.set(e,t._items.get(r));this._items.set(e,i)},di.prototype.clear=function(){this._size=0,this._items.clear()},di.prototype.isEmpty=function(){return this._size===0},di.prototype.add=function(e){var t=this;this._items.add(null),this._size+=1;var r=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(r/2)))<0;r/=2)t._items.set(r,t._items.get(Math.trunc(r/2)));this._items.set(r,e)},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di};var Fi=function(){};Fi.prototype.visitItem=function(e){},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi};var js=function(){};js.prototype.insert=function(e,t){},js.prototype.remove=function(e,t){},js.prototype.query=function(){},js.prototype.interfaces_=function(){return[]},js.prototype.getClass=function(){return js};var st=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}}},kf={serialVersionUID:{configurable:!0}};st.prototype.getLevel=function(){return this._level},st.prototype.size=function(){return this._childBoundables.size()},st.prototype.getChildBoundables=function(){return this._childBoundables},st.prototype.addChildBoundable=function(e){fe.isTrue(this._bounds===null),this._childBoundables.add(e)},st.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},st.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},st.prototype.interfaces_=function(){return[ml,Cr]},st.prototype.getClass=function(){return st},kf.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(st,kf);var Qr=function(){};Qr.reverseOrder=function(){return{compare:function(t,r){return r.compareTo(t)}}},Qr.min=function(e){return Qr.sort(e),e.get(0)},Qr.sort=function(e,t){var r=e.toArray();t?ds.sort(r,t):ds.sort(r);for(var i=e.iterator(),s=0,o=r.length;s<o;s++)i.next(),i.set(r[s])},Qr.singletonList=function(e){var t=new W;return t.add(e),t};var et=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],r=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=r,this._distance=this.distance()};et.prototype.expandToQueue=function(e,t){var r=et.isComposite(this._boundable1),i=et.isComposite(this._boundable2);if(r&&i)return et.area(this._boundable1)>et.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(r)return this.expand(this._boundable1,this._boundable2,e,t),null;if(i)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new Ue("neither boundable is composite")},et.prototype.isLeaves=function(){return!(et.isComposite(this._boundable1)||et.isComposite(this._boundable2))},et.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},et.prototype.expand=function(e,t,r,i){for(var s=this,o=e.getChildBoundables(),a=o.iterator();a.hasNext();){var l=a.next(),u=new et(l,t,s._itemDistance);u.getDistance()<i&&r.add(u)}},et.prototype.getBoundable=function(e){return e===0?this._boundable1:this._boundable2},et.prototype.getDistance=function(){return this._distance},et.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},et.prototype.interfaces_=function(){return[Sr]},et.prototype.getClass=function(){return et},et.area=function(e){return e.getBounds().getArea()},et.isComposite=function(e){return e instanceof st};var ut=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new W,this._nodeCapacity=null,arguments.length===0){var e=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(arguments.length===1){var t=arguments[0];fe.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}},Yu={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};ut.prototype.getNodeCapacity=function(){return this._nodeCapacity},ut.prototype.lastNode=function(e){return e.get(e.size()-1)},ut.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],r=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof st?r+=e.size(s):s instanceof Kr&&(r+=1)}return r}},ut.prototype.removeItem=function(e,t){for(var r=null,i=e.getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Kr&&s.getItem()===t&&(r=s)}return r!==null?(e.getChildBoundables().remove(r),!0):!1},ut.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 r=arguments[0],i=new W,s=r.getChildBoundables().iterator();s.hasNext();){var o=s.next();if(o instanceof st){var a=e.itemsTree(o);a!==null&&i.add(a)}else o instanceof Kr?i.add(o.getItem()):fe.shouldNeverReachHere()}return i.size()<=0?null:i}},ut.prototype.insert=function(e,t){fe.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Kr(e,t))},ut.prototype.boundablesAtLevel=function(){var e=this;if(arguments.length===1){var t=arguments[0],r=new W;return this.boundablesAtLevel(t,this._root,r),r}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];if(fe.isTrue(i>-2),s.getLevel()===i)return o.add(s),null;for(var a=s.getChildBoundables().iterator();a.hasNext();){var l=a.next();l instanceof st?e.boundablesAtLevel(i,l,o):(fe.isTrue(l instanceof Kr),i===-1&&o.add(l))}return null}},ut.prototype.query=function(){var e=this;if(arguments.length===1){var t=arguments[0];this.build();var r=new W;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,r),r}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(ae(arguments[2],Fi)&&arguments[0]instanceof Object&&arguments[1]instanceof st)for(var o=arguments[0],a=arguments[1],l=arguments[2],u=a.getChildBoundables(),h=0;h<u.size();h++){var f=u.get(h);e.getIntersectsOp().intersects(f.getBounds(),o)&&(f instanceof st?e.query(o,f,l):f instanceof Kr?l.visitItem(f.getItem()):fe.shouldNeverReachHere())}else if(ae(arguments[2],Hr)&&arguments[0]instanceof Object&&arguments[1]instanceof st)for(var p=arguments[0],v=arguments[1],w=arguments[2],I=v.getChildBoundables(),T=0;T<I.size();T++){var L=I.get(T);e.getIntersectsOp().intersects(L.getBounds(),p)&&(L instanceof st?e.query(p,L,w):L instanceof Kr?w.add(L.getItem()):fe.shouldNeverReachHere())}}},ut.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},ut.prototype.getRoot=function(){return this.build(),this._root},ut.prototype.remove=function(){var e=this;if(arguments.length===2){var t=arguments[0],r=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),t)?this.remove(t,this._root,r):!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 l=null,u=s.getChildBoundables().iterator();u.hasNext();){var h=u.next();if(e.getIntersectsOp().intersects(h.getBounds(),i)&&h instanceof st&&(a=e.remove(i,h,o),a)){l=h;break}}return l!==null&&l.getChildBoundables().isEmpty()&&s.getChildBoundables().remove(l),a}},ut.prototype.createHigherLevels=function(e,t){fe.isTrue(!e.isEmpty());var r=this.createParentBoundables(e,t+1);return r.size()===1?r.get(0):this.createHigherLevels(r,t+1)},ut.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],r=0,i=t.getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof st){var o=e.depth(s);o>r&&(r=o)}}return r+1}},ut.prototype.createParentBoundables=function(e,t){var r=this;fe.isTrue(!e.isEmpty());var i=new W;i.add(this.createNode(t));var s=new W(e);Qr.sort(s,this.getComparator());for(var o=s.iterator();o.hasNext();){var a=o.next();r.lastNode(i).getChildBoundables().size()===r.getNodeCapacity()&&i.add(r.createNode(t)),r.lastNode(i).addChildBoundable(a)}return i},ut.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},ut.prototype.interfaces_=function(){return[Cr]},ut.prototype.getClass=function(){return ut},ut.compareDoubles=function(e,t){return e>t?1:e<t?-1:0},Yu.IntersectsOp.get=function(){return rv},Yu.serialVersionUID.get=function(){return-3886435814360241e3},Yu.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(ut,Yu);var rv=function(){},vl=function(){};vl.prototype.distance=function(e,t){},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl};var Vf=function(n){function e(r){r=r||e.DEFAULT_NODE_CAPACITY,n.call(this,r)}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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;fe.isTrue(i.length>0);for(var a=new W,l=0;l<i.length;l++)a.addAll(o.createParentBoundablesFromVerticalSlice(i[l],s));return a},e.prototype.createNode=function(i){return new zf(i)},e.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.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;n.prototype.insert.call(this,i,s)}else return n.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),l=i.iterator(),u=0;u<s;u++){a[u]=new W;for(var h=0;l.hasNext()&&h<o;){var f=l.next();a[u].add(f),h++}}return a},e.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return n.prototype.query.call(this,i)}else if(arguments.length===2){var s=arguments[0],o=arguments[1];n.prototype.query.call(this,s,o)}else if(arguments.length===3){if(ae(arguments[2],Fi)&&arguments[0]instanceof Object&&arguments[1]instanceof st){var a=arguments[0],l=arguments[1],u=arguments[2];n.prototype.query.call(this,a,l,u)}else if(ae(arguments[2],Hr)&&arguments[0]instanceof Object&&arguments[1]instanceof st){var h=arguments[0],f=arguments[1],p=arguments[2];n.prototype.query.call(this,h,f,p)}}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(i,s){return n.prototype.createParentBoundables.call(this,i,s)},e.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],s=arguments[1];return n.prototype.remove.call(this,i,s)}else return n.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(i,s){fe.isTrue(!i.isEmpty());var o=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new W(i);Qr.sort(a,e.xComparator);var l=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(o))));return this.createParentBoundablesFromVerticalSlices(l,s)},e.prototype.nearestNeighbour=function(){if(arguments.length===1){if(ae(arguments[0],vl)){var i=arguments[0],s=new et(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(s)}else if(arguments[0]instanceof et){var o=arguments[0];return this.nearestNeighbour(o,ue.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof e&&ae(arguments[1],vl)){var a=arguments[0],l=arguments[1],u=new et(this.getRoot(),a.getRoot(),l);return this.nearestNeighbour(u)}else if(arguments[0]instanceof et&&typeof arguments[1]=="number"){var h=arguments[0],f=arguments[1],p=f,v=null,w=new di;for(w.add(h);!w.isEmpty()&&p>0;){var I=w.poll(),T=I.getDistance();if(T>=p)break;I.isLeaves()?(p=T,v=I):I.expandToQueue(w,p)}return[v.getBoundable(0).getItem(),v.getBoundable(1).getItem()]}}else if(arguments.length===3){var L=arguments[0],m=arguments[1],_=arguments[2],g=new Kr(L,m),y=new et(this.getRoot(),g,_);return this.nearestNeighbour(y)[0]}},e.prototype.interfaces_=function(){return[js,Cr]},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 zf},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[nl]},compare:function(r,i){return n.compareDoubles(e.centreX(r.getBounds()),e.centreX(i.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[nl]},compare:function(r,i){return n.compareDoubles(e.centreY(r.getBounds()),e.centreY(i.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,t),e}(ut),zf=function(n){function e(){var t=arguments[0];n.call(this,t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var r=null,i=this.getChildBoundables().iterator();i.hasNext();){var s=i.next();r===null?r=new te(s.getBounds()):r.expandToInclude(s.getBounds())}return r},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(st),Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.relativeSign=function(e,t){return e<t?-1:e>t?1:0},Wt.compare=function(e,t,r){if(t.equals2D(r))return 0;var i=Wt.relativeSign(t.x,r.x),s=Wt.relativeSign(t.y,r.y);switch(e){case 0:return Wt.compareValue(i,s);case 1:return Wt.compareValue(s,i);case 2:return Wt.compareValue(s,-i);case 3:return Wt.compareValue(-i,s);case 4:return Wt.compareValue(-i,-s);case 5:return Wt.compareValue(-s,-i);case 6:return Wt.compareValue(-s,i);case 7:return Wt.compareValue(i,-s)}return fe.shouldNeverReachHere("invalid octant value"),0},Wt.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0};var ki=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this._segString=e,this.coord=new M(t),this.segmentIndex=r,this._segmentOctant=i,this._isInterior=!t.equals2D(e.getCoordinate(r))};ki.prototype.getCoordinate=function(){return this.coord},ki.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},ki.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:Wt.compare(this._segmentOctant,this.coord,t.coord)},ki.prototype.isEndPoint=function(e){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===e},ki.prototype.isInterior=function(){return this._isInterior},ki.prototype.interfaces_=function(){return[Sr]},ki.prototype.getClass=function(){return ki};var Lt=function(){this._nodeMap=new Tt,this._edge=null;var e=arguments[0];this._edge=e};Lt.prototype.getSplitCoordinates=function(){var e=this,t=new Hl;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next();e.addEdgeCoordinates(i,s,t),i=s}return t.toCoordinateArray()},Lt.prototype.addCollapsedNodes=function(){var e=this,t=new W;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var r=t.iterator();r.hasNext();){var i=r.next().intValue();e.add(e._edge.getCoordinate(i),i)}},Lt.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}},Lt.prototype.findCollapsesFromExistingVertices=function(e){for(var t=this,r=0;r<this._edge.size()-2;r++){var i=t._edge.getCoordinate(r),s=t._edge.getCoordinate(r+2);i.equals2D(s)&&e.add(new an(r+1))}},Lt.prototype.addEdgeCoordinates=function(e,t,r){var i=this,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s);r.add(new M(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)r.add(i._edge.getCoordinate(a));o&&r.add(new M(t.coord))},Lt.prototype.iterator=function(){return this._nodeMap.values().iterator()},Lt.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints(),this.addCollapsedNodes();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},Lt.prototype.findCollapseIndex=function(e,t,r){if(!e.coord.equals2D(t.coord))return!1;var i=t.segmentIndex-e.segmentIndex;return t.isInterior()||i--,i===1?(r[0]=e.segmentIndex+1,!0):!1},Lt.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=this,r=new Array(1).fill(null),i=this.iterator(),s=i.next();i.hasNext();){var o=i.next(),a=t.findCollapseIndex(s,o,r);a&&e.add(new an(r[0])),s=o}},Lt.prototype.getEdge=function(){return this._edge},Lt.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},Lt.prototype.createSplitEdge=function(e,t){var r=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),l=0;a[l++]=new M(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)a[l++]=r._edge.getCoordinate(u);return o&&(a[l]=new M(t.coord)),new Be(a,this._edge.getData())},Lt.prototype.add=function(e,t){var r=new ki(this._edge,e,t,this._edge.getSegmentOctant(t)),i=this._nodeMap.get(r);return i!==null?(fe.isTrue(i.coord.equals2D(e),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(r,r),r)},Lt.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),r=e.get(0),i=r.getCoordinate(0);if(!i.equals2D(t[0]))throw new oi("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 oi("bad split edge end point at "+a)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt};var eo=function(){};eo.prototype.interfaces_=function(){return[]},eo.prototype.getClass=function(){return eo},eo.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 Ue("Cannot compute the octant for point ( "+e+", "+t+" )");var r=Math.abs(e),i=Math.abs(t);return e>=0?t>=0?r>=i?0:1:r>=i?7:6:t>=0?r>=i?3:2:r>=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,l=o.y-s.y;if(a===0&&l===0)throw new Ue("Cannot compute the octant for two identical points "+s);return eo.octant(a,l)}};var Vn=function(){};Vn.prototype.getCoordinates=function(){},Vn.prototype.size=function(){},Vn.prototype.getCoordinate=function(e){},Vn.prototype.isClosed=function(){},Vn.prototype.setData=function(e){},Vn.prototype.getData=function(){},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var tu=function(){};tu.prototype.addIntersection=function(e,t){},tu.prototype.interfaces_=function(){return[Vn]},tu.prototype.getClass=function(){return tu};var Be=function(){this._nodeList=new Lt(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};Be.prototype.getCoordinates=function(){return this._pts},Be.prototype.size=function(){return this._pts.length},Be.prototype.getCoordinate=function(e){return this._pts[e]},Be.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Be.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},Be.prototype.setData=function(e){this._data=e},Be.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:eo.octant(e,t)},Be.prototype.getData=function(){return this._data},Be.prototype.addIntersection=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[3],o=new M(r.getIntersection(s));this.addIntersection(o,i)}},Be.prototype.toString=function(){return Yr.toLineString(new Qe(this._pts))},Be.prototype.getNodeList=function(){return this._nodeList},Be.prototype.addIntersectionNode=function(e,t){var r=t,i=r+1;if(i<this._pts.length){var s=this._pts[i];e.equals2D(s)&&(r=i)}var o=this._nodeList.add(e,r);return o},Be.prototype.addIntersections=function(e,t,r){for(var i=this,s=0;s<e.getIntersectionNum();s++)i.addIntersection(e,t,r,s)},Be.prototype.interfaces_=function(){return[tu]},Be.prototype.getClass=function(){return Be},Be.getNodedSubstrings=function(){if(arguments.length===1){var e=arguments[0],t=new W;return Be.getNodedSubstrings(e,t),t}else if(arguments.length===2)for(var r=arguments[0],i=arguments[1],s=r.iterator();s.hasNext();){var o=s.next();o.getNodeList().addSplitEdges(i)}};var re=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],r=arguments[1],i=arguments[2],s=arguments[3];this.p0=new M(t,r),this.p1=new M(i,s)}},Uf={serialVersionUID:{configurable:!0}};re.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},re.prototype.orientationIndex=function(){if(arguments[0]instanceof re){var e=arguments[0],t=H.orientationIndex(this.p0,this.p1,e.p0),r=H.orientationIndex(this.p0,this.p1,e.p1);return t>=0&&r>=0||t<=0&&r<=0?Math.max(t,r):0}else if(arguments[0]instanceof M){var i=arguments[0];return H.orientationIndex(this.p0,this.p1,i)}},re.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},re.prototype.isVertical=function(){return this.p0.x===this.p1.x},re.prototype.equals=function(e){if(!(e instanceof re))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},re.prototype.intersection=function(e){var t=new hs;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},re.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),r=new M;return r.x=this.p0.x+t*(this.p1.x-this.p0.x),r.y=this.p0.y+t*(this.p1.y-this.p0.y),r}else if(arguments[0]instanceof re){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 l=this.project(i.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new re(a,l)}},re.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},re.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},re.prototype.getCoordinate=function(e){return e===0?this.p0:this.p1},re.prototype.distancePerpendicular=function(e){return H.distancePointLinePerpendicular(e,this.p0,this.p1)},re.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},re.prototype.midPoint=function(){return re.midPoint(this.p0,this.p1)},re.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,r=this.p1.y-this.p0.y,i=t*t+r*r;if(i<=0)return ue.NaN;var s=((e.x-this.p0.x)*t+(e.y-this.p0.y)*r)/i;return s},re.prototype.closestPoints=function(e){var t=this.intersection(e);if(t!==null)return[t,t];var r=new Array(2).fill(null),i=ue.MAX_VALUE,s=null,o=this.closestPoint(e.p0);i=o.distance(e.p0),r[0]=o,r[1]=e.p0;var a=this.closestPoint(e.p1);s=a.distance(e.p1),s<i&&(i=s,r[0]=a,r[1]=e.p1);var l=e.closestPoint(this.p0);s=l.distance(this.p0),s<i&&(i=s,r[0]=this.p0,r[1]=l);var u=e.closestPoint(this.p1);return s=u.distance(this.p1),s<i&&(i=s,r[0]=this.p1,r[1]=u),r},re.prototype.closestPoint=function(e){var t=this.projectionFactor(e);if(t>0&&t<1)return this.project(e);var r=this.p0.distance(e),i=this.p1.distance(e);return r<i?this.p0:this.p1},re.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},re.prototype.getLength=function(){return this.p0.distance(this.p1)},re.prototype.compareTo=function(e){var t=e,r=this.p0.compareTo(t.p0);return r!==0?r:this.p1.compareTo(t.p1)},re.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},re.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)},re.prototype.lineIntersection=function(e){try{var t=Xr.intersection(this.p0,this.p1,e.p0,e.p1);return t}catch(r){if(!(r instanceof sl))throw r}finally{}return null},re.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},re.prototype.pointAlongOffset=function(e,t){var r=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),l=0,u=0;if(t!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");l=t*s/a,u=t*o/a}var h=r-u,f=i+l,p=new M(h,f);return p},re.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],r=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=r.x,this.p1.y=r.y}},re.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(t>1||ue.isNaN(t))&&(t=1),t},re.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},re.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},re.prototype.distance=function(){if(arguments[0]instanceof re){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)}},re.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},re.prototype.hashCode=function(){var e=ue.doubleToLongBits(this.p0.x);e^=ue.doubleToLongBits(this.p0.y)*31;var t=Math.trunc(e)^Math.trunc(e>>32),r=ue.doubleToLongBits(this.p1.x);r^=ue.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(r)^Math.trunc(r>>32);return t^i},re.prototype.interfaces_=function(){return[Sr,Cr]},re.prototype.getClass=function(){return re},re.midPoint=function(e,t){return new M((e.x+t.x)/2,(e.y+t.y)/2)},Uf.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(re,Uf);var ru=function(){this.tempEnv1=new te,this.tempEnv2=new te,this._overlapSeg1=new re,this._overlapSeg2=new re};ru.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];e.getLineSegment(t,this._overlapSeg1),r.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},ru.prototype.interfaces_=function(){return[]},ru.prototype.getClass=function(){return ru};var tr=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],r=arguments[2],i=arguments[3];this._pts=e,this._start=t,this._end=r,this._context=i};tr.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},tr.prototype.computeSelect=function(e,t,r,i){var s=this._pts[t],o=this._pts[r];if(i.tempEnv1.init(s,o),r-t===1)return i.select(this,t),null;if(!e.intersects(i.tempEnv1))return null;var a=Math.trunc((t+r)/2);t<a&&this.computeSelect(e,t,a,i),a<r&&this.computeSelect(e,a,r,i)},tr.prototype.getCoordinates=function(){for(var e=this,t=new Array(this._end-this._start+1).fill(null),r=0,i=this._start;i<=this._end;i++)t[r++]=e._pts[i];return t},tr.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},tr.prototype.setId=function(e){this._id=e},tr.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},tr.prototype.getEnvelope=function(){if(this._env===null){var e=this._pts[this._start],t=this._pts[this._end];this._env=new te(e,t)}return this._env},tr.prototype.getEndIndex=function(){return this._end},tr.prototype.getStartIndex=function(){return this._start},tr.prototype.getContext=function(){return this._context},tr.prototype.getId=function(){return this._id},tr.prototype.computeOverlapsInternal=function(e,t,r,i,s,o){var a=this._pts[e],l=this._pts[t],u=r._pts[i],h=r._pts[s];if(t-e===1&&s-i===1)return o.overlap(this,e,r,i),null;if(o.tempEnv1.init(a,l),o.tempEnv2.init(u,h),!o.tempEnv1.intersects(o.tempEnv2))return null;var f=Math.trunc((e+t)/2),p=Math.trunc((i+s)/2);e<f&&(i<p&&this.computeOverlapsInternal(e,f,r,i,p,o),p<s&&this.computeOverlapsInternal(e,f,r,p,s,o)),f<t&&(i<p&&this.computeOverlapsInternal(f,t,r,i,p,o),p<s&&this.computeOverlapsInternal(f,t,r,p,s,o))},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(e){var t=0,r=new W;r.add(new an(t));do{var i=vn.findChainEnd(e,t);r.add(new an(i)),t=i}while(t<e.length-1);var s=vn.toIntArray(r);return s},vn.findChainEnd=function(e,t){for(var r=t;r<e.length-1&&e[r].equals2D(e[r+1]);)r++;if(r>=e.length-1)return e.length-1;for(var i=xe.quadrant(e[r],e[r+1]),s=t+1;s<e.length;){if(!e[s-1].equals2D(e[s])){var o=xe.quadrant(e[s-1],e[s]);if(o!==i)break}s++}return s-1},vn.getChains=function(){if(arguments.length===1){var e=arguments[0];return vn.getChains(e,null)}else if(arguments.length===2){for(var t=arguments[0],r=arguments[1],i=new W,s=vn.getChainStartIndices(t),o=0;o<s.length-1;o++){var a=new tr(t,s[o],s[o+1],r);i.add(a)}return i}},vn.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),r=0;r<t.length;r++)t[r]=e.get(r).intValue();return t};var gs=function(){};gs.prototype.computeNodes=function(e){},gs.prototype.getNodedSubstrings=function(){},gs.prototype.interfaces_=function(){return[]},gs.prototype.getClass=function(){return gs};var nu=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setSegmentIntersector(e)}}};nu.prototype.setSegmentIntersector=function(e){this._segInt=e},nu.prototype.interfaces_=function(){return[gs]},nu.prototype.getClass=function(){return nu};var Zc=function(n){function e(r){r?n.call(this,r):n.call(this),this._monoChains=new W,this._index=new Vf,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return Be.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(i){for(var s=this,o=vn.getChains(i.getCoordinates(),i),a=o.iterator();a.hasNext();){var l=a.next();l.setId(s._idCounter++),s._index.insert(l.getEnvelope(),l),s._monoChains.add(l)}},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 Gf(this._segInt),o=this._monoChains.iterator();o.hasNext();)for(var a=o.next(),l=i._index.query(a.getEnvelope()),u=l.iterator();u.hasNext();){var h=u.next();if(h.getId()>a.getId()&&(a.computeOverlaps(h,s),i._nOverlaps++),i._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.SegmentOverlapAction.get=function(){return Gf},Object.defineProperties(e,t),e}(nu),Gf=function(n){function e(){n.call(this),this._si=null;var t=arguments[0];this._si=t}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3],a=r.getContext(),l=s.getContext();this._si.processIntersections(a,i,l,o)}else return n.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ru),Ne=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.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],r=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(r)}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)}}},pi={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}};Ne.prototype.getEndCapStyle=function(){return this._endCapStyle},Ne.prototype.isSingleSided=function(){return this._isSingleSided},Ne.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,this._quadrantSegments===0&&(this._joinStyle=Ne.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Ne.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Ne.JOIN_ROUND&&(this._quadrantSegments=Ne.DEFAULT_QUADRANT_SEGMENTS)},Ne.prototype.getJoinStyle=function(){return this._joinStyle},Ne.prototype.setJoinStyle=function(e){this._joinStyle=e},Ne.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Ne.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Ne.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Ne.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Ne.prototype.getMitreLimit=function(){return this._mitreLimit},Ne.prototype.setMitreLimit=function(e){this._mitreLimit=e},Ne.prototype.setSingleSided=function(e){this._isSingleSided=e},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},pi.CAP_ROUND.get=function(){return 1},pi.CAP_FLAT.get=function(){return 2},pi.CAP_SQUARE.get=function(){return 3},pi.JOIN_ROUND.get=function(){return 1},pi.JOIN_MITRE.get=function(){return 2},pi.JOIN_BEVEL.get=function(){return 3},pi.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},pi.DEFAULT_MITRE_LIMIT.get=function(){return 5},pi.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Ne,pi);var Ze=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=H.COUNTERCLOCKWISE,this._inputLine=e||null},iu={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Ze.prototype.isDeletable=function(e,t,r,i){var s=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[r];return!this.isConcave(s,o,a)||!this.isShallow(s,o,a,i)?!1:this.isShallowSampled(s,o,e,r,i)},Ze.prototype.deleteShallowConcavities=function(){for(var e=this,t=1,r=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(r),s=!1;i<this._inputLine.length;){var o=!1;e.isDeletable(t,r,i,e._distanceTol)&&(e._isDeleted[r]=Ze.DELETE,o=!0,s=!0),o?t=i:t=r,r=e.findNextNonDeletedIndex(t),i=e.findNextNonDeletedIndex(r)}return s},Ze.prototype.isShallowConcavity=function(e,t,r,i){var s=H.computeOrientation(e,t,r),o=s===this._angleOrientation;if(!o)return!1;var a=H.distancePointLine(t,e,r);return a<i},Ze.prototype.isShallowSampled=function(e,t,r,i,s){var o=this,a=Math.trunc((i-r)/Ze.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var l=r;l<i;l+=a)if(!o.isShallow(e,t,o._inputLine[l],s))return!1;return!0},Ze.prototype.isConcave=function(e,t,r){var i=H.computeOrientation(e,t,r),s=i===this._angleOrientation;return s},Ze.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 r=!1;do r=t.deleteShallowConcavities();while(r);return this.collapseLine()},Ze.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===Ze.DELETE;)t++;return t},Ze.prototype.isShallow=function(e,t,r,i){var s=H.distancePointLine(t,e,r);return s<i},Ze.prototype.collapseLine=function(){for(var e=this,t=new Hl,r=0;r<this._inputLine.length;r++)e._isDeleted[r]!==Ze.DELETE&&t.add(e._inputLine[r]);return t.toCoordinateArray()},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.simplify=function(e,t){var r=new Ze(e);return r.simplify(t)},iu.INIT.get=function(){return 0},iu.DELETE.get=function(){return 1},iu.KEEP.get=function(){return 1},iu.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Ze,iu);var hr=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new W},Wf={COORDINATE_ARRAY_TYPE:{configurable:!0}};hr.prototype.getCoordinates=function(){var e=this._ptList.toArray(hr.COORDINATE_ARRAY_TYPE);return e},hr.prototype.setPrecisionModel=function(e){this._precisionModel=e},hr.prototype.addPt=function(e){var t=new M(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},hr.prototype.revere=function(){},hr.prototype.addPts=function(e,t){var r=this;if(t)for(var i=0;i<e.length;i++)r.addPt(e[i]);else for(var s=e.length-1;s>=0;s--)r.addPt(e[s])},hr.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1),r=e.distance(t);return r<this._minimimVertexDistance},hr.prototype.toString=function(){var e=new me,t=e.createLineString(this.getCoordinates());return t.toString()},hr.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)},hr.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr},Wf.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(hr,Wf);var we=function(){},to={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},we.toDegrees=function(e){return e*180/Math.PI},we.normalize=function(e){for(;e>Math.PI;)e-=we.PI_TIMES_2;for(;e<=-Math.PI;)e+=we.PI_TIMES_2;return e},we.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],r=arguments[1],i=r.x-t.x,s=r.y-t.y;return Math.atan2(s,i)}},we.isAcute=function(e,t,r){var i=e.x-t.x,s=e.y-t.y,o=r.x-t.x,a=r.y-t.y,l=i*o+s*a;return l>0},we.isObtuse=function(e,t,r){var i=e.x-t.x,s=e.y-t.y,o=r.x-t.x,a=r.y-t.y,l=i*o+s*a;return l<0},we.interiorAngle=function(e,t,r){var i=we.angle(t,e),s=we.angle(t,r);return Math.abs(s-i)},we.normalizePositive=function(e){if(e<0){for(;e<0;)e+=we.PI_TIMES_2;e>=we.PI_TIMES_2&&(e=0)}else{for(;e>=we.PI_TIMES_2;)e-=we.PI_TIMES_2;e<0&&(e=0)}return e},we.angleBetween=function(e,t,r){var i=we.angle(t,e),s=we.angle(t,r);return we.diff(i,s)},we.diff=function(e,t){var r=null;return e<t?r=t-e:r=e-t,r>Math.PI&&(r=2*Math.PI-r),r},we.toRadians=function(e){return e*Math.PI/180},we.getTurn=function(e,t){var r=Math.sin(t-e);return r>0?we.COUNTERCLOCKWISE:r<0?we.CLOCKWISE:we.NONE},we.angleBetweenOriented=function(e,t,r){var i=we.angle(t,e),s=we.angle(t,r),o=s-i;return o<=-Math.PI?o+we.PI_TIMES_2:o>Math.PI?o-we.PI_TIMES_2:o},to.PI_TIMES_2.get=function(){return 2*Math.PI},to.PI_OVER_2.get=function(){return Math.PI/2},to.PI_OVER_4.get=function(){return Math.PI/4},to.COUNTERCLOCKWISE.get=function(){return H.COUNTERCLOCKWISE},to.CLOCKWISE.get=function(){return H.CLOCKWISE},to.NONE.get=function(){return H.COLLINEAR},Object.defineProperties(we,to);var ke=function n(){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 re,this._seg1=new re,this._offset0=new re,this._offset1=new re,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],t=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=t,this._li=new hs,this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments(),t.getQuadrantSegments()>=8&&t.getJoinStyle()===Ne.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},su={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}};ke.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 r=H.computeOrientation(this._s0,this._s1,this._s2),i=r===H.CLOCKWISE&&this._side===G.LEFT||r===H.COUNTERCLOCKWISE&&this._side===G.RIGHT;r===0?this.addCollinear(t):i?this.addOutsideTurn(r,t):this.addInsideTurn(r,t)},ke.prototype.addLineEndCap=function(e,t){var r=new re(e,t),i=new re;this.computeOffsetSegment(r,G.LEFT,this._distance,i);var s=new re;this.computeOffsetSegment(r,G.RIGHT,this._distance,s);var o=t.x-e.x,a=t.y-e.y,l=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Ne.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(t,l+Math.PI/2,l-Math.PI/2,H.CLOCKWISE,this._distance),this._segList.addPt(s.p1);break;case Ne.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(s.p1);break;case Ne.CAP_SQUARE:var u=new M;u.x=Math.abs(this._distance)*Math.cos(l),u.y=Math.abs(this._distance)*Math.sin(l);var h=new M(i.p1.x+u.x,i.p1.y+u.y),f=new M(s.p1.x+u.x,s.p1.y+u.y);this._segList.addPt(h),this._segList.addPt(f);break}},ke.prototype.getCoordinates=function(){var e=this._segList.getCoordinates();return e},ke.prototype.addMitreJoin=function(e,t,r,i){var s=!0,o=null;try{o=Xr.intersection(t.p0,t.p1,r.p0,r.p1);var a=i<=0?1:o.distance(e)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(s=!1)}catch(l){if(l instanceof sl)o=new M(0,0),s=!1;else throw l}finally{}s?this._segList.addPt(o):this.addLimitedMitreJoin(t,r,i,this._bufParams.getMitreLimit())},ke.prototype.addFilletCorner=function(e,t,r,i,s){var o=t.x-e.x,a=t.y-e.y,l=Math.atan2(a,o),u=r.x-e.x,h=r.y-e.y,f=Math.atan2(h,u);i===H.CLOCKWISE?l<=f&&(l+=2*Math.PI):l>=f&&(l-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,l,f,i,s),this._segList.addPt(r)},ke.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ke.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Ne.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Ne.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))},ke.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()},ke.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},ke.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ke.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ke.prototype.initSideSegments=function(e,t,r){this._s1=e,this._s2=t,this._side=r,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,r,this._distance,this._offset1)},ke.prototype.addLimitedMitreJoin=function(e,t,r,i){var s=this._seg0.p1,o=we.angle(s,this._seg0.p0),a=we.angleBetweenOriented(this._seg0.p0,s,this._seg1.p1),l=a/2,u=we.normalize(o+l),h=we.normalize(u+Math.PI),f=i*r,p=f*Math.abs(Math.sin(l)),v=r-p,w=s.x+f*Math.cos(h),I=s.y+f*Math.sin(h),T=new M(w,I),L=new re(s,T),m=L.pointAlongOffset(1,v),_=L.pointAlongOffset(1,-v);this._side===G.LEFT?(this._segList.addPt(m),this._segList.addPt(_)):(this._segList.addPt(_),this._segList.addPt(m))},ke.prototype.computeOffsetSegment=function(e,t,r,i){var s=t===G.LEFT?1:-1,o=e.p1.x-e.p0.x,a=e.p1.y-e.p0.y,l=Math.sqrt(o*o+a*a),u=s*r*o/l,h=s*r*a/l;i.p0.x=e.p0.x-h,i.p0.y=e.p0.y+u,i.p1.x=e.p1.x-h,i.p1.y=e.p1.y+u},ke.prototype.addFilletArc=function(e,t,r,i,s){var o=this,a=i===H.CLOCKWISE?-1:1,l=Math.abs(t-r),u=Math.trunc(l/this._filletAngleQuantum+.5);if(u<1)return null;for(var h=0,f=l/u,p=h,v=new M;p<l;){var w=t+a*p;v.x=e.x+s*Math.cos(w),v.y=e.y+s*Math.sin(w),o._segList.addPt(v),p+=f}},ke.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*ke.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var r=new 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(r);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)}},ke.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()},ke.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},ke.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new hr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*ke.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ke.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()===Ne.JOIN_BEVEL||this._bufParams.getJoinStyle()===Ne.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))},ke.prototype.closeRing=function(){this._segList.closeRing()},ke.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},su.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},su.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},su.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},su.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ke,su);var qt=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};qt.prototype.getOffsetCurve=function(e,t){if(this._distance=t,t===0)return null;var r=t<0,i=Math.abs(t),s=this.getSegGen(i);e.length<=1?this.computePointCurve(e[0],s):this.computeOffsetCurve(e,r,s);var o=s.getCoordinates();return r&&ge.reverse(o),o},qt.prototype.computeSingleSidedBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){r.addSegments(e,!0);var s=Ze.simplify(e,-i),o=s.length-1;r.initSideSegments(s[o],s[o-1],G.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(s[a],!0)}else{r.addSegments(e,!1);var l=Ze.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],G.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment(),r.closeRing()},qt.prototype.computeRingBufferCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);t===G.RIGHT&&(i=-i);var s=Ze.simplify(e,i),o=s.length-1;r.initSideSegments(s[o-1],s[0],t);for(var a=1;a<=o;a++){var l=a!==1;r.addNextSegment(s[a],l)}r.closeRing()},qt.prototype.computeLineBufferCurve=function(e,t){var r=this.simplifyTolerance(this._distance),i=Ze.simplify(e,r),s=i.length-1;t.initSideSegments(i[0],i[1],G.LEFT);for(var o=2;o<=s;o++)t.addNextSegment(i[o],!0);t.addLastSegment(),t.addLineEndCap(i[s-1],i[s]);var a=Ze.simplify(e,-r),l=a.length-1;t.initSideSegments(a[l],a[l-1],G.LEFT);for(var u=l-2;u>=0;u--)t.addNextSegment(a[u],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},qt.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Ne.CAP_ROUND:t.createCircle(e);break;case Ne.CAP_SQUARE:t.createSquare(e);break}},qt.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided()||t===0)return null;var r=Math.abs(t),i=this.getSegGen(r);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},qt.prototype.getBufferParameters=function(){return this._bufParams},qt.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},qt.prototype.getRingCurve=function(e,t,r){if(this._distance=r,e.length<=2)return this.getLineCurve(e,r);if(r===0)return qt.copyCoordinates(e);var i=this.getSegGen(r);return this.computeRingBufferCurve(e,t,i),i.getCoordinates()},qt.prototype.computeOffsetCurve=function(e,t,r){var i=this.simplifyTolerance(this._distance);if(t){var s=Ze.simplify(e,-i),o=s.length-1;r.initSideSegments(s[o],s[o-1],G.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(s[a],!0)}else{var l=Ze.simplify(e,i),u=l.length-1;r.initSideSegments(l[0],l[1],G.LEFT),r.addFirstSegment();for(var h=2;h<=u;h++)r.addNextSegment(l[h],!0)}r.addLastSegment()},qt.prototype.getSegGen=function(e){return new ke(this._precisionModel,this._bufParams,e)},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),r=0;r<t.length;r++)t[r]=new M(e[r]);return t};var ro=function(){this._subgraphs=null,this._seg=new re,this._cga=new H;var e=arguments[0];this._subgraphs=e},qf={DepthSegment:{configurable:!0}};ro.prototype.findStabbedSegments=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],r=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(),r)}return r}else if(arguments.length===3){if(ae(arguments[2],Hr)&&arguments[0]instanceof M&&arguments[1]instanceof Jc)for(var a=arguments[0],l=arguments[1],u=arguments[2],h=l.getEdge().getCoordinates(),f=0;f<h.length-1;f++){e._seg.p0=h[f],e._seg.p1=h[f+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var p=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(p<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 v=l.getDepth(G.LEFT);e._seg.p0.equals(h[f])||(v=l.getDepth(G.RIGHT));var w=new ms(e._seg,v);u.add(w)}}else if(ae(arguments[2],Hr)&&arguments[0]instanceof M&&ae(arguments[1],Hr))for(var I=arguments[0],T=arguments[1],L=arguments[2],m=T.iterator();m.hasNext();){var _=m.next();_.isForward()&&e.findStabbedSegments(I,_,L)}}},ro.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(t.size()===0)return 0;var r=Qr.min(t);return r._leftDepth},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},qf.DepthSegment.get=function(){return ms},Object.defineProperties(ro,qf);var ms=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new re(e),this._leftDepth=t};ms.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 r=this._upwardSeg.orientationIndex(t._upwardSeg);return r!==0||(r=-1*t._upwardSeg.orientationIndex(this._upwardSeg),r!==0)?r:this._upwardSeg.compareTo(t._upwardSeg)},ms.prototype.compareX=function(e,t){var r=e.p0.compareTo(t.p0);return r!==0?r:e.p1.compareTo(t.p1)},ms.prototype.toString=function(){return this._upwardSeg.toString()},ms.prototype.interfaces_=function(){return[Sr]},ms.prototype.getClass=function(){return ms};var De=function(e,t,r){this.p0=e||null,this.p1=t||null,this.p2=r||null};De.prototype.area=function(){return De.area(this.p0,this.p1,this.p2)},De.prototype.signedArea=function(){return De.signedArea(this.p0,this.p1,this.p2)},De.prototype.interpolateZ=function(e){if(e===null)throw new Ue("Supplied point is null.");return De.interpolateZ(e,this.p0,this.p1,this.p2)},De.prototype.longestSideLength=function(){return De.longestSideLength(this.p0,this.p1,this.p2)},De.prototype.isAcute=function(){return De.isAcute(this.p0,this.p1,this.p2)},De.prototype.circumcentre=function(){return De.circumcentre(this.p0,this.p1,this.p2)},De.prototype.area3D=function(){return De.area3D(this.p0,this.p1,this.p2)},De.prototype.centroid=function(){return De.centroid(this.p0,this.p1,this.p2)},De.prototype.inCentre=function(){return De.inCentre(this.p0,this.p1,this.p2)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.area=function(e,t,r){return Math.abs(((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2)},De.signedArea=function(e,t,r){return((r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y))/2},De.det=function(e,t,r,i){return e*i-t*r},De.interpolateZ=function(e,t,r,i){var s=t.x,o=t.y,a=r.x-s,l=i.x-s,u=r.y-o,h=i.y-o,f=a*h-l*u,p=e.x-s,v=e.y-o,w=(h*p-l*v)/f,I=(-u*p+a*v)/f,T=t.z+w*(r.z-t.z)+I*(i.z-t.z);return T},De.longestSideLength=function(e,t,r){var i=e.distance(t),s=t.distance(r),o=r.distance(e),a=i;return s>a&&(a=s),o>a&&(a=o),a},De.isAcute=function(e,t,r){return!(!we.isAcute(e,t,r)||!we.isAcute(t,r,e)||!we.isAcute(r,e,t))},De.circumcentre=function(e,t,r){var i=r.x,s=r.y,o=e.x-i,a=e.y-s,l=t.x-i,u=t.y-s,h=2*De.det(o,a,l,u),f=De.det(a,o*o+a*a,u,l*l+u*u),p=De.det(o,o*o+a*a,l,l*l+u*u),v=i-f/h,w=s+p/h;return new M(v,w)},De.perpendicularBisector=function(e,t){var r=t.x-e.x,i=t.y-e.y,s=new Xr(e.x+r/2,e.y+i/2,1),o=new Xr(e.x-i+r/2,e.y+r+i/2,1);return new Xr(s,o)},De.angleBisector=function(e,t,r){var i=t.distance(e),s=t.distance(r),o=i/(i+s),a=r.x-e.x,l=r.y-e.y,u=new M(e.x+o*a,e.y+o*l);return u},De.area3D=function(e,t,r){var i=t.x-e.x,s=t.y-e.y,o=t.z-e.z,a=r.x-e.x,l=r.y-e.y,u=r.z-e.z,h=s*u-o*l,f=o*a-i*u,p=i*l-s*a,v=h*h+f*f+p*p,w=Math.sqrt(v)/2;return w},De.centroid=function(e,t,r){var i=(e.x+t.x+r.x)/3,s=(e.y+t.y+r.y)/3;return new M(i,s)},De.inCentre=function(e,t,r){var i=t.distance(r),s=e.distance(r),o=e.distance(t),a=i+s+o,l=(i*e.x+s*t.x+o*r.x)/a,u=(i*e.y+s*t.y+o*r.y)/a;return new M(l,u)};var Dr=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new W;var e=arguments[0],t=arguments[1],r=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=r};Dr.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),r=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(r,R.EXTERIOR,R.INTERIOR)},Dr.prototype.addPolygon=function(e){var t=this,r=this._distance,i=G.LEFT;this._distance<0&&(r=-this._distance,i=G.RIGHT);var s=e.getExteriorRing(),o=ge.removeRepeatedPoints(s.getCoordinates());if(this._distance<0&&this.isErodedCompletely(s,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,r,i,R.EXTERIOR,R.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var l=e.getInteriorRingN(a),u=ge.removeRepeatedPoints(l.getCoordinates());t._distance>0&&t.isErodedCompletely(l,-t._distance)||t.addPolygonRing(u,r,G.opposite(i),R.INTERIOR,R.EXTERIOR)}},Dr.prototype.isTriangleErodedCompletely=function(e,t){var r=new De(e[0],e[1],e[2]),i=r.inCentre(),s=H.distancePointLine(i,r.p0,r.p1);return s<Math.abs(t)},Dr.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=ge.removeRepeatedPoints(e.getCoordinates()),r=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(r,R.EXTERIOR,R.INTERIOR)},Dr.prototype.addCurve=function(e,t,r){if(e===null||e.length<2)return null;var i=new Be(e,new be(0,R.BOUNDARY,t,r));this._curveList.add(i)},Dr.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Dr.prototype.addPolygonRing=function(e,t,r,i,s){if(t===0&&e.length<Rn.MINIMUM_VALID_SIZE)return null;var o=i,a=s;e.length>=Rn.MINIMUM_VALID_SIZE&&H.isCCW(e)&&(o=s,a=i,r=G.opposite(r));var l=this._curveBuilder.getRingCurve(e,r,t);this.addCurve(l,o,a)},Dr.prototype.add=function(e){if(e.isEmpty())return null;e instanceof it?this.addPolygon(e):e instanceof Je?this.addLineString(e):e instanceof jt?this.addPoint(e):e instanceof pl?this.addCollection(e):e instanceof ps?this.addCollection(e):e instanceof Fn?this.addCollection(e):e instanceof Mt&&this.addCollection(e)},Dr.prototype.isErodedCompletely=function(e,t){var r=e.getCoordinates();if(r.length<4)return t<0;if(r.length===4)return this.isTriangleErodedCompletely(r,t);var i=e.getEnvelopeInternal(),s=Math.min(i.getHeight(),i.getWidth());return t<0&&2*Math.abs(t)>s},Dr.prototype.addCollection=function(e){for(var t=this,r=0;r<e.getNumGeometries();r++){var i=e.getGeometryN(r);t.add(i)}},Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr};var yl=function(){};yl.prototype.locate=function(e){},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var zn=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()};zn.prototype.next=function(){if(this._atStart)return this._atStart=!1,zn.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 fl;var e=this._parent.getGeometryN(this._index++);return e instanceof Mt?(this._subcollectionIterator=new zn(e),this._subcollectionIterator.next()):e},zn.prototype.remove=function(){throw new Error(this.getClass().getName())},zn.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)},zn.prototype.interfaces_=function(){return[hl]},zn.prototype.getClass=function(){return zn},zn.isAtomic=function(e){return!(e instanceof Mt)};var fr=function(){this._geom=null;var e=arguments[0];this._geom=e};fr.prototype.locate=function(e){return fr.locate(e,this._geom)},fr.prototype.interfaces_=function(){return[yl]},fr.prototype.getClass=function(){return fr},fr.isPointInRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.isPointInRing(e,t.getCoordinates()):!1},fr.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var r=t.getExteriorRing();if(!fr.isPointInRing(e,r))return!1;for(var i=0;i<t.getNumInteriorRing();i++){var s=t.getInteriorRingN(i);if(fr.isPointInRing(e,s))return!1}return!0},fr.containsPoint=function(e,t){if(t instanceof it)return fr.containsPointInPolygon(e,t);if(t instanceof Mt)for(var r=new zn(t);r.hasNext();){var i=r.next();if(i!==t&&fr.containsPoint(e,i))return!0}return!1},fr.locate=function(e,t){return t.isEmpty()?R.EXTERIOR:fr.containsPoint(e,t)?R.INTERIOR:R.EXTERIOR};var Dt=function(){this._edgeMap=new Tt,this._edgeList=null,this._ptInAreaLocation=[R.NONE,R.NONE]};Dt.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),r=t-1;return t===0&&(r=this._edgeList.size()-1),this._edgeList.get(r)},Dt.prototype.propagateSideLabels=function(e){for(var t=R.NONE,r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.isArea(e)&&s.getLocation(e,G.LEFT)!==R.NONE&&(t=s.getLocation(e,G.LEFT))}if(t===R.NONE)return null;for(var o=t,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();if(u.getLocation(e,G.ON)===R.NONE&&u.setLocation(e,G.ON,o),u.isArea(e)){var h=u.getLocation(e,G.LEFT),f=u.getLocation(e,G.RIGHT);if(f!==R.NONE){if(f!==o)throw new fi("side location conflict",l.getCoordinate());h===R.NONE&&fe.shouldNeverReachHere("found single null side (at "+l.getCoordinate()+")"),o=h}else fe.isTrue(u.getLocation(e,G.LEFT)===R.NONE,"found single null side"),u.setLocation(e,G.RIGHT,o),u.setLocation(e,G.LEFT,o)}}},Dt.prototype.getCoordinate=function(){var e=this.iterator();if(!e.hasNext())return null;var t=e.next();return t.getCoordinate()},Dt.prototype.print=function(e){vt.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}},Dt.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Dt.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var r=t.size()-1,i=t.get(r).getLabel(),s=i.getLocation(e,G.LEFT);fe.isTrue(s!==R.NONE,"Found unlabelled area edge");for(var o=s,a=this.iterator();a.hasNext();){var l=a.next(),u=l.getLabel();fe.isTrue(u.isArea(e),"Found non-area edge");var h=u.getLocation(e,G.LEFT),f=u.getLocation(e,G.RIGHT);if(h===f||f!==o)return!1;o=h}return!0},Dt.prototype.findIndex=function(e){var t=this;this.iterator();for(var r=0;r<this._edgeList.size();r++){var i=t._edgeList.get(r);if(i===e)return r}return-1},Dt.prototype.iterator=function(){return this.getEdges().iterator()},Dt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new W(this._edgeMap.values())),this._edgeList},Dt.prototype.getLocation=function(e,t,r){return this._ptInAreaLocation[e]===R.NONE&&(this._ptInAreaLocation[e]=fr.locate(t,r[e].getGeometry())),this._ptInAreaLocation[e]},Dt.prototype.toString=function(){var e=new on;e.append("EdgeEndStar: "+this.getCoordinate()),e.append(`
5
5
  `);for(var t=this.iterator();t.hasNext();){var r=t.next();e.append(r),e.append(`
6
- `)}return e.toString()},Dt.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.computeLabel(e)}},Dt.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!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)===R.BOUNDARY&&(r[a]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),h=u.getLabel(),f=0;f<2;f++)if(h.isAnyNull(f)){var p=R.NONE;if(r[f])p=R.EXTERIOR;else{var v=u.getCoordinate();p=t.getLocation(f,v,e)}h.setAllLocationsIfNull(f,p)}},Dt.prototype.getDegree=function(){return this._edgeMap.size()},Dt.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt};var nv=function(n){function e(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var l=r._resultAreaEdgeList.get(a),u=l.getSym();if(l.getLabel().isArea())switch(i===null&&l.isInResult()&&(i=l),o){case r._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!l.isInResult())continue;s.setNext(l),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new fi("no outgoing dirEdge found",this.getCoordinate());fe.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},e.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var s=r.get(0);if(i===1)return s;var o=r.get(i-1),a=s.getQuadrant(),l=o.getQuadrant();return xe.isNorthern(a)&&xe.isNorthern(l)?s:!xe.isNorthern(a)&&!xe.isNorthern(l)?o:s.getDy()!==0?s:o.getDy()!==0?o:(fe.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(r){vt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();r.print("out "),s.print(r),r.println(),r.print("in "),s.getSym().print(r),r.println()}},e.prototype.getResultAreaEdges=function(){var r=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())&&r._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=r._edgeList.get(o),l=a.getSym();s===null&&(s=l),i!==null&&l.setNext(i),i=a}s.setNext(i)},e.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(G.LEFT),a=i.getDepth(G.RIGHT),l=this.computeDepths(s+1,this._edgeList.size(),o),u=this.computeDepths(0,s,l);if(u!==a)throw new fi("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],f=arguments[1],p=arguments[2],v=p,w=h;w<f;w++){var I=r._edgeList.get(w);I.setEdgeDepths(G.RIGHT,v),v=I.getDepth(G.LEFT)}return v}},e.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=i._resultAreaEdgeList.get(l),h=u.getSym();switch(s===null&&u.getEdgeRing()===r&&(s=u),a){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==r)continue;o=h,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==r)continue;o.setNextMin(u),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(fe.isTrue(s!==null,"found null for first outgoing dirEdge"),fe.isTrue(s.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],a=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&a++}return a}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var r=R.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){r=R.INTERIOR;break}if(o.isInResult()){r=R.EXTERIOR;break}}}if(r===R.NONE)return null;for(var a=r,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(a===R.INTERIOR):(u.isInResult()&&(a=R.EXTERIOR),h.isInResult()&&(a=R.INTERIOR))}},e.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new be(R.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),l=a.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===R.INTERIOR||h===R.BOUNDARY)&&i._label.setLocation(u,R.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Dt),Xf=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.createNode=function(r){return new Xu(r,new nv)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gl),Vi=function n(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=n.orientation(e)};Vi.prototype.compareTo=function(e){var t=e,r=Vi.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return r},Vi.prototype.interfaces_=function(){return[Sr]},Vi.prototype.getClass=function(){return Vi},Vi.orientation=function(e){return ge.increasingDirection(e)===1},Vi.compareOriented=function(e,t,r,i){for(var s=t?1:-1,o=i?1:-1,a=t?e.length:-1,l=i?r.length:-1,u=t?0:e.length-1,h=i?0:r.length-1;;){var f=e[u].compareTo(r[h]);if(f!==0)return f;u+=s,h+=o;var p=u===a,v=h===l;if(p&&!v)return-1;if(!p&&v)return 1;if(p&&v)return 0}};var Br=function(){this._edges=new W,this._ocaMap=new Tt};Br.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=t._edges.get(r);r>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(") ")},Br.prototype.addAll=function(e){for(var t=this,r=e.iterator();r.hasNext();)t.add(r.next())},Br.prototype.findEdgeIndex=function(e){for(var t=this,r=0;r<this._edges.size();r++)if(t._edges.get(r).equals(e))return r;return-1},Br.prototype.iterator=function(){return this._edges.iterator()},Br.prototype.getEdges=function(){return this._edges},Br.prototype.get=function(e){return this._edges.get(e)},Br.prototype.findEqualEdge=function(e){var t=new Vi(e.getCoordinates()),r=this._ocaMap.get(t);return r},Br.prototype.add=function(e){this._edges.add(e);var t=new Vi(e.getCoordinates());this._ocaMap.put(t,e)},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var vs=function(){};vs.prototype.processIntersections=function(e,t,r,i){},vs.prototype.isDone=function(){},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var dr=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};dr.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(dr.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},dr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},dr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},dr.prototype.getLineIntersector=function(){return this._li},dr.prototype.hasProperIntersection=function(){return this._hasProper},dr.prototype.processIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},dr.prototype.hasIntersection=function(){return this._hasIntersection},dr.prototype.isDone=function(){return!1},dr.prototype.hasInteriorIntersection=function(){return this._hasInterior},dr.prototype.interfaces_=function(){return[vs]},dr.prototype.getClass=function(){return dr},dr.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var yn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],r=arguments[2];this.coord=new M(e),this.segmentIndex=t,this.dist=r};yn.prototype.getSegmentIndex=function(){return this.segmentIndex},yn.prototype.getCoordinate=function(){return this.coord},yn.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},yn.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},yn.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e},yn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},yn.prototype.getDistance=function(){return this.dist},yn.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},yn.prototype.interfaces_=function(){return[Sr]},yn.prototype.getClass=function(){return yn};var Un=function(){this._nodeMap=new Tt,this.edge=null;var e=arguments[0];this.edge=e};Un.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}},Un.prototype.iterator=function(){return this._nodeMap.values().iterator()},Un.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},Un.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)},Un.prototype.createSplitEdge=function(e,t){var r=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),l=0;a[l++]=new M(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)a[l++]=r.edge.pts[u];return o&&(a[l]=t.coord),new Hu(a,new be(this.edge._label))},Un.prototype.add=function(e,t,r){var i=new yn(e,t,r),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},Un.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();if(r.coord.equals(e))return!0}return!1},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var ys=function(){};ys.prototype.getChainStartIndices=function(e){var t=this,r=0,i=new W;i.add(new an(r));do{var s=t.findChainEnd(e,r);i.add(new an(s)),r=s}while(r<e.length-1);var o=ys.toIntArray(i);return o},ys.prototype.findChainEnd=function(e,t){for(var r=xe.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var s=xe.quadrant(e[i-1],e[i]);if(s!==r)break;i++}return i-1},ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys},ys.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),r=0;r<t.length;r++)t[r]=e.get(r).intValue();return t};var gi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new te,this.env2=new te;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new ys;this.startIndex=t.getChainStartIndices(this.pts)};gi.prototype.getCoordinates=function(){return this.pts},gi.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t>r?t:r},gi.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t<r?t:r},gi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[r],t.startIndex[r+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=arguments[4],h=arguments[5],f=this.pts[s],p=this.pts[o],v=a.pts[l],w=a.pts[u];if(o-s===1&&u-l===1)return h.addIntersections(this.e,s,a.e,l),null;if(this.env1.init(f,p),this.env2.init(v,w),!this.env1.intersects(this.env2))return null;var I=Math.trunc((s+o)/2),T=Math.trunc((l+u)/2);s<I&&(l<T&&this.computeIntersectsForChain(s,I,a,l,T,h),T<u&&this.computeIntersectsForChain(s,I,a,T,u,h)),I<o&&(l<T&&this.computeIntersectsForChain(I,o,a,l,T,h),T<u&&this.computeIntersectsForChain(I,o,a,T,u,h))}},gi.prototype.getStartIndexes=function(){return this.startIndex},gi.prototype.computeIntersects=function(e,t){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<e.startIndex.length-1;s++)r.computeIntersectsForChain(i,e,s,t)},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi};var yt=function n(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var r=0;r<3;r++)e._depth[t][r]=n.NULL_VALUE},Yf={NULL_VALUE:{configurable:!0}};yt.prototype.getDepth=function(e,t){return this._depth[e][t]},yt.prototype.setDepth=function(e,t,r){this._depth[e][t]=r},yt.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var r=0;r<3;r++)if(e._depth[t][r]!==yt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===yt.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===yt.NULL_VALUE}},yt.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var r=e._depth[t][1];e._depth[t][2]<r&&(r=e._depth[t][2]),r<0&&(r=0);for(var i=1;i<3;i++){var s=0;e._depth[t][i]>r&&(s=1),e._depth[t][i]=s}}},yt.prototype.getDelta=function(e){return this._depth[e][G.RIGHT]-this._depth[e][G.LEFT]},yt.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?R.EXTERIOR:R.INTERIOR},yt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},yt.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var s=t.getLocation(r,i);(s===R.EXTERIOR||s===R.INTERIOR)&&(e.isNull(r,i)?e._depth[r][i]=yt.depthAtLocation(s):e._depth[r][i]+=yt.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];l===R.INTERIOR&&this._depth[o][a]++}},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.depthAtLocation=function(e){return e===R.EXTERIOR?0:e===R.INTERIOR?1:yt.NULL_VALUE},Yf.NULL_VALUE.get=function(){return-1},Object.defineProperties(yt,Yf);var Hu=function(n){function e(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new Un(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new yt,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new e(r,be.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(r){this._isIsolated=r},e.prototype.setName=function(r){this._name=r},e.prototype.equals=function(r){var i=this;if(!(r instanceof e))return!1;var s=r;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(i.pts[u].equals2D(s.pts[u])||(o=!1),i.pts[u].equals2D(s.pts[--l])||(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 r=arguments[0];return this.pts[r]}},e.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.print(","),r.print(i.pts[s].x+" "+i.pts[s].y);r.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(r){e.updateIM(this._label,r)},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(r){var i=this;r.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)r.print(i.pts[s]+" ");r.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new gi(this)),this._mce},e.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new te;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},e.prototype.addIntersection=function(r,i,s,o){var a=new M(r.getIntersection(o)),l=i,u=r.getEdgeDistance(s,o),h=l+1;if(h<this.pts.length){var f=this.pts[h];a.equals2D(f)&&(l=h,u=0)}this.eiList.add(a,l,u)},e.prototype.toString=function(){var r=this,i=new on;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(r.pts[s].x+" "+r.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(r.pts[s]))return!1;return!0},e.prototype.setDepthDelta=function(r){this._depthDelta=r},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(r,i,s){for(var o=this,a=0;a<r.getIntersectionNum();a++)o.addIntersection(r,i,s,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,G.ON),r.getLocation(1,G.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,G.LEFT),r.getLocation(1,G.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,G.RIGHT),r.getLocation(1,G.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},e}(cr),At=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Br,this._bufParams=e||null};At.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},At.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var r=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new be(e.getLabel()),i.flip()),r.merge(i);var s=At.depthDelta(i),o=t.getDepthDelta(),a=o+s;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(At.depthDelta(e.getLabel()))},At.prototype.buildSubgraphs=function(e,t){for(var r=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new ro(r),l=a.getDepth(o);s.computeDepth(l),s.findResultEdges(),r.add(s),t.add(s.getDirectedEdges(),s.getNodes())}},At.prototype.createSubgraphs=function(e){for(var t=new W,r=e.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var s=new xt;s.create(i),t.add(s)}}return Qr.sort(t,Qr.reverseOrder()),t},At.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e},At.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new Zc,r=new hs;return r.setPrecisionModel(e),t.setSegmentIntersector(new dr(r)),t},At.prototype.buffer=function(e,t){var r=this._workingPrecisionModel;r===null&&(r=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new qt(r,this._bufParams),s=new Dr(e,t,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new He(new Xf),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),l=new er(this._geomFact);this.buildSubgraphs(a,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(u);return h},At.prototype.computeNodedEdges=function(e,t){var r=this,i=this.getNoder(t);i.computeNodes(e);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),l=a.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=a.getData(),h=new Hu(a.getCoordinates(),new be(u));r.insertUniqueEdge(h)}}},At.prototype.setNoder=function(e){this._workingNoder=e},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.depthDelta=function(e){var t=e.getLocation(0,G.LEFT),r=e.getLocation(0,G.RIGHT);return t===R.INTERIOR&&r===R.EXTERIOR?1:t===R.EXTERIOR&&r===R.INTERIOR?-1:0},At.convertSegStrings=function(e){for(var t=new me,r=new W;e.hasNext();){var i=e.next(),s=t.createLineString(i.getCoordinates());r.add(s)}return t.buildGeometry(r)};var zi=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 r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};zi.prototype.rescale=function(){var e=this;if(ae(arguments[0],nt))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.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])&&vt.out.println(s)}},zi.prototype.scale=function(){var e=this;if(ae(arguments[0],nt)){for(var t=arguments[0],r=new W,i=t.iterator();i.hasNext();){var s=i.next();r.add(new Be(e.scale(s.getCoordinates()),s.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),l=0;l<o.length;l++)a[l]=new M(Math.round((o[l].x-e._offsetX)*e._scaleFactor),Math.round((o[l].y-e._offsetY)*e._scaleFactor),o[l].z);var u=ge.removeRepeatedPoints(a);return u}},zi.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},zi.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},zi.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},zi.prototype.interfaces_=function(){return[gs]},zi.prototype.getClass=function(){return zi};var _n=function(){this._li=new hs,this._segStrings=null;var e=arguments[0];this._segStrings=e},Hf={fact:{configurable:!0}};_n.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next(),i=r.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 l=a.next(),u=l.getCoordinates(),h=1;h<u.length-1;h++)if(u[h].equals(s))throw new oi("found endpt/interior pt intersection at index "+h+" :pt "+s)}},_n.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var r=t.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();e.checkInteriorIntersections(r,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],l=o.getCoordinates(),u=a.getCoordinates(),h=0;h<l.length-1;h++)for(var f=0;f<u.length-1;f++)e.checkInteriorIntersections(o,h,a,f);else if(arguments.length===4){var p=arguments[0],v=arguments[1],w=arguments[2],I=arguments[3];if(p===w&&v===I)return null;var T=p.getCoordinates()[v],L=p.getCoordinates()[v+1],m=w.getCoordinates()[I],_=w.getCoordinates()[I+1];if(this._li.computeIntersection(T,L,m,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,T,L)||this.hasInteriorIntersection(this._li,m,_)))throw new oi("found non-noded intersection at "+T+"-"+L+" and "+m+"-"+_)}},_n.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},_n.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next();e.checkCollapses(r)}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])},_n.prototype.hasInteriorIntersection=function(e,t,r){for(var i=0;i<e.getIntersectionNum();i++){var s=e.getIntersection(i);if(!(s.equals(t)||s.equals(r)))return!0}return!1},_n.prototype.checkCollapse=function(e,t,r){if(e.equals(r))throw new oi("found non-noded collapse at "+_n.fact.createLineString([e,t,r]))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},Hf.fact.get=function(){return new me},Object.defineProperties(_n,Hf);var Xt=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],r=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=r,t<=0)throw new Ue("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)},Jf={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Xt.prototype.intersectsScaled=function(e,t){var r=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<r||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var l=this.intersectsToleranceSquare(e,t);return fe.isTrue(!(a&&l),"Found bad envelope test"),l},Xt.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)},Xt.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))},Xt.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},Xt.prototype.getCoordinate=function(){return this._originalPt},Xt.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},Xt.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=Xt.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new te(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},Xt.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()))},Xt.prototype.intersectsToleranceSquare=function(e,t){var r=!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()&&(r=!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())||r&&i||e.equals(this._pt)||t.equals(this._pt))},Xt.prototype.addSnappedNode=function(e,t){var r=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(r,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Jf.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Xt,Jf);var ou=function(){this.tempEnv1=new te,this.selectedSegment=new re};ou.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)}}},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var _l=function(){this._index=null;var e=arguments[0];this._index=e},Zf={HotPixelSnapAction:{configurable:!0}};_l.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],r=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),o=new Kf(t,r,i);return this._index.query(s,{interfaces_:function(){return[Fi]},visitItem:function(a){var l=a;l.select(s,o)}}),o.isNodeAdded()}},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l},Zf.HotPixelSnapAction.get=function(){return Kf},Object.defineProperties(_l,Zf);var Kf=function(n){function e(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],s=r.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return n.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ou),no=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new W};no.prototype.processIntersections=function(e,t,r,i){var s=this;if(e===r&&t===i)return null;var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1)}},no.prototype.isDone=function(){return!1},no.prototype.getInteriorIntersections=function(){return this._interiorIntersections},no.prototype.interfaces_=function(){return[vs]},no.prototype.getClass=function(){return no};var Gn=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 hs,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};Gn.prototype.checkCorrectness=function(e){var t=Be.getNodedSubstrings(e),r=new _n(t);try{r.checkValid()}catch(i){if(i instanceof Df)i.printStackTrace();else throw i}finally{}},Gn.prototype.getNodedSubstrings=function(){return Be.getNodedSubstrings(this._nodedSegStrings)},Gn.prototype.snapRound=function(e,t){var r=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(r),this.computeVertexSnaps(e)},Gn.prototype.findInteriorIntersections=function(e,t){var r=new no(t);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(e),r.getInteriorIntersections()},Gn.prototype.computeVertexSnaps=function(){var e=this;if(ae(arguments[0],nt))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof Be)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var l=new Xt(o[a],e._scaleFactor,e._li),u=e._pointSnapper.snap(l,s,a);u&&s.addIntersection(o[a],a)}},Gn.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new Zc,this._pointSnapper=new _l(this._noder.getIndex()),this.snapRound(e,this._li)},Gn.prototype.computeIntersectionSnaps=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),s=new Xt(i,t._scaleFactor,t._li);t._pointSnapper.snap(s)}},Gn.prototype.interfaces_=function(){return[gs]},Gn.prototype.getClass=function(){return Gn};var _t=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Ne,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],r=arguments[1];this._argGeom=t,this._bufParams=r}},wl={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};_t.prototype.bufferFixedPrecision=function(e){var t=new zi(new Gn(new Te(1)),e.getScale()),r=new At(this._bufParams);r.setWorkingPrecisionModel(e),r.setNoder(t),this._resultGeometry=r.buffer(this._argGeom,this._distance)},_t.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=_t.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof fi)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=_t.precisionScaleFactor(this._argGeom,this._distance,r),s=new Te(i);this.bufferFixedPrecision(s)}},_t.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Te.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},_t.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},_t.prototype.bufferOriginalPrecision=function(){try{var e=new At(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof oi)this._saveException=t;else throw t}finally{}},_t.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},_t.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new _t(e),i=r.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof oe&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],l=new _t(s);l.setQuadrantSegments(a);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof Ne&&arguments[0]instanceof oe&&typeof arguments[1]=="number"){var h=arguments[0],f=arguments[1],p=arguments[2],v=new _t(h,p),w=v.getResultGeometry(f);return w}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],L=arguments[2],m=arguments[3],_=new _t(I);_.setQuadrantSegments(L),_.setEndCapStyle(m);var g=_.getResultGeometry(T);return g}},_t.precisionScaleFactor=function(e,t,r){var i=e.getEnvelopeInternal(),s=ur.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,l=Math.trunc(Math.log(a)/Math.log(10)+1),u=r-l,h=Math.pow(10,u);return h},wl.CAP_ROUND.get=function(){return Ne.CAP_ROUND},wl.CAP_BUTT.get=function(){return Ne.CAP_FLAT},wl.CAP_FLAT.get=function(){return Ne.CAP_FLAT},wl.CAP_SQUARE.get=function(){return Ne.CAP_SQUARE},wl.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(_t,wl);var Rt=function(){this._pt=[new M,new M],this._distance=ue.NaN,this._isNull=!0};Rt.prototype.getCoordinates=function(){return this._pt},Rt.prototype.getCoordinate=function(e){return this._pt[e]},Rt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}},Rt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Rt.prototype.getDistance=function(){return this._distance},Rt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt};var Wn=function(){};Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},Wn.computeDistance=function(){if(arguments[2]instanceof Rt&&arguments[0]instanceof Je&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=e.getCoordinates(),s=new re,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(t);r.setMinimum(a,t)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof it&&arguments[1]instanceof M){var l=arguments[0],u=arguments[1],h=arguments[2];Wn.computeDistance(l.getExteriorRing(),u,h);for(var f=0;f<l.getNumInteriorRing();f++)Wn.computeDistance(l.getInteriorRingN(f),u,h)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof oe&&arguments[1]instanceof M){var p=arguments[0],v=arguments[1],w=arguments[2];if(p instanceof Je)Wn.computeDistance(p,v,w);else if(p instanceof it)Wn.computeDistance(p,v,w);else if(p instanceof Mt)for(var I=p,T=0;T<I.getNumGeometries();T++){var L=I.getGeometryN(T);Wn.computeDistance(L,v,w)}else w.setMinimum(p.getCoordinate(),v)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof re&&arguments[1]instanceof M){var m=arguments[0],_=arguments[1],g=arguments[2],y=m.closestPoint(_);g.setMinimum(y,_)}};var _s=function(e){this._maxPtDist=new Rt,this._inputGeom=e||null},Kc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_s.prototype.computeMaxMidpointDistance=function(e){var t=new Ui(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},_s.prototype.computeMaxVertexDistance=function(e){var t=new io(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},_s.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},_s.prototype.getDistancePoints=function(){return this._maxPtDist},_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},Kc.MaxPointDistanceFilter.get=function(){return io},Kc.MaxMidpointDistanceFilter.get=function(){return Ui},Object.defineProperties(_s,Kc);var io=function(e){this._maxPtDist=new Rt,this._minPtDist=new Rt,this._geom=e||null};io.prototype.filter=function(e){this._minPtDist.initialize(),Wn.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},io.prototype.getMaxPointDistance=function(){return this._maxPtDist},io.prototype.interfaces_=function(){return[An]},io.prototype.getClass=function(){return io};var Ui=function(e){this._maxPtDist=new Rt,this._minPtDist=new Rt,this._geom=e||null};Ui.prototype.filter=function(e,t){if(t===0)return null;var r=e.getCoordinate(t-1),i=e.getCoordinate(t),s=new M((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),Wn.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ui.prototype.isDone=function(){return!1},Ui.prototype.isGeometryChanged=function(){return!1},Ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ui.prototype.interfaces_=function(){return[Zr]},Ui.prototype.getClass=function(){return Ui};var mi=function(e){this._comps=e||null};mi.prototype.filter=function(e){e instanceof it&&this._comps.add(e)},mi.prototype.interfaces_=function(){return[hn]},mi.prototype.getClass=function(){return mi},mi.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return mi.getPolygons(e,new W)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof it?r.add(t):t instanceof Mt&&t.apply(new mi(r)),r}};var wt=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],r=arguments[1];this._lines=t,this._isForcedToLineString=r}};wt.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof Rn){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof Je&&this._lines.add(e)},wt.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},wt.prototype.interfaces_=function(){return[ai]},wt.prototype.getClass=function(){return wt},wt.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(wt.getLines(e))}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t.getFactory().buildGeometry(wt.getLines(t,r))}},wt.getLines=function(){if(arguments.length===1){var e=arguments[0];return wt.getLines(e,!1)}else if(arguments.length===2){if(ae(arguments[0],nt)&&ae(arguments[1],nt)){for(var t=arguments[0],r=arguments[1],i=t.iterator();i.hasNext();){var s=i.next();wt.getLines(s,r)}return r}else if(arguments[0]instanceof oe&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],l=new W;return o.apply(new wt(l,a)),l}else if(arguments[0]instanceof oe&&ae(arguments[1],nt)){var u=arguments[0],h=arguments[1];return u instanceof Je?h.add(u):u.apply(new wt(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ae(arguments[0],nt)&&ae(arguments[1],nt)){for(var f=arguments[0],p=arguments[1],v=arguments[2],w=f.iterator();w.hasNext();){var I=w.next();wt.getLines(I,p,v)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof oe&&ae(arguments[1],nt)){var T=arguments[0],L=arguments[1],m=arguments[2];return T.apply(new wt(L,m)),L}}};var $r=function(){if(this._boundaryRule=Pr.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 Ue("Rule must be non-null");this._boundaryRule=e}}};$r.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof M&&arguments[1]instanceof it){var t=arguments[0],r=arguments[1];if(r.isEmpty())return R.EXTERIOR;var i=r.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===R.EXTERIOR)return R.EXTERIOR;if(s===R.BOUNDARY)return R.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var a=r.getInteriorRingN(o),l=e.locateInPolygonRing(t,a);if(l===R.INTERIOR)return R.EXTERIOR;if(l===R.BOUNDARY)return R.BOUNDARY}return R.INTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof Je){var u=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(u))return R.EXTERIOR;var f=h.getCoordinates();return!h.isClosed()&&(u.equals(f[0])||u.equals(f[f.length-1]))?R.BOUNDARY:H.isOnLine(u,f)?R.INTERIOR:R.EXTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof jt){var p=arguments[0],v=arguments[1],w=v.getCoordinate();return w.equals2D(p)?R.INTERIOR:R.EXTERIOR}},$r.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.locatePointInRing(e,t.getCoordinates()):R.EXTERIOR},$r.prototype.intersects=function(e,t){return this.locate(e,t)!==R.EXTERIOR},$r.prototype.updateLocationInfo=function(e){e===R.INTERIOR&&(this._isIn=!0),e===R.BOUNDARY&&this._numBoundaries++},$r.prototype.computeLocation=function(e,t){var r=this;if(t instanceof jt&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof Je)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof it)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof ps)for(var i=t,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);r.updateLocationInfo(r.locateInternal(e,o))}else if(t instanceof Fn)for(var a=t,l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);r.updateLocationInfo(r.locateInternal(e,u))}else if(t instanceof Mt)for(var h=new zn(t);h.hasNext();){var f=h.next();f!==t&&r.computeLocation(e,f)}},$r.prototype.locate=function(e,t){return t.isEmpty()?R.EXTERIOR:t instanceof Je?this.locateInternal(e,t):t instanceof it?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?R.BOUNDARY:this._numBoundaries>0||this._isIn?R.INTERIOR:R.EXTERIOR)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Ft=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];n.call(this,e,n.INSIDE_AREA,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._component=r,this._segIndex=i,this._pt=s}},Qf={INSIDE_AREA:{configurable:!0}};Ft.prototype.isInsideArea=function(){return this._segIndex===Ft.INSIDE_AREA},Ft.prototype.getCoordinate=function(){return this._pt},Ft.prototype.getGeometryComponent=function(){return this._component},Ft.prototype.getSegmentIndex=function(){return this._segIndex},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Qf.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ft,Qf);var Gi=function(e){this._pts=e||null};Gi.prototype.filter=function(e){e instanceof jt&&this._pts.add(e)},Gi.prototype.interfaces_=function(){return[hn]},Gi.prototype.getClass=function(){return Gi},Gi.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof jt?Qr.singletonList(e):Gi.getPoints(e,new W)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof jt?r.add(t):t instanceof Mt&&t.apply(new Gi(r)),r}};var so=function(){this._locations=null;var e=arguments[0];this._locations=e};so.prototype.filter=function(e){(e instanceof jt||e instanceof Je||e instanceof it)&&this._locations.add(new Ft(e,0,e.getCoordinate()))},so.prototype.interfaces_=function(){return[hn]},so.prototype.getClass=function(){return so},so.getLocations=function(e){var t=new W;return e.apply(new so(t)),t};var Et=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new $r,this._minDistanceLocation=null,this._minDistance=ue.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 r=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=s}};Et.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 r=arguments[0],i=arguments[1],s=1-r,o=mi.getPolygons(this._geom[r]);if(o.size()>0){var a=so.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ae(arguments[0],Hr)&&ae(arguments[1],Hr)){for(var l=arguments[0],u=arguments[1],h=arguments[2],f=0;f<l.size();f++)for(var p=l.get(f),v=0;v<u.size();v++)if(e.computeContainmentDistance(p,u.get(v),h),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ft&&arguments[1]instanceof it){var w=arguments[0],I=arguments[1],T=arguments[2],L=w.getCoordinate();if(R.EXTERIOR!==this._ptLocator.locate(L,I))return this._minDistance=0,T[0]=w,T[1]=new Ft(I,L),null}}},Et.prototype.computeMinDistanceLinesPoints=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}},Et.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=wt.getLines(this._geom[0]),r=wt.getLines(this._geom[1]),i=Gi.getPoints(this._geom[0]),s=Gi.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,r,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(r,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)},Et.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Et.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])},Et.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e},Et.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 Je&&arguments[1]instanceof jt){var t=arguments[0],r=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var s=t.getCoordinates(),o=r.getCoordinate(),a=0;a<s.length-1;a++){var l=H.distancePointLine(o,s[a],s[a+1]);if(l<e._minDistance){e._minDistance=l;var u=new re(s[a],s[a+1]),h=u.closestPoint(o);i[0]=new Ft(t,a,h),i[1]=new Ft(r,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Je&&arguments[1]instanceof Je){var f=arguments[0],p=arguments[1],v=arguments[2];if(f.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var w=f.getCoordinates(),I=p.getCoordinates(),T=0;T<w.length-1;T++)for(var L=0;L<I.length-1;L++){var m=H.distanceLineLine(w[T],w[T+1],I[L],I[L+1]);if(m<e._minDistance){e._minDistance=m;var _=new re(w[T],w[T+1]),g=new re(I[L],I[L+1]),y=_.closestPoints(g);v[0]=new Ft(f,T,y[0]),v[1]=new Ft(p,L,y[1])}if(e._minDistance<=e._terminateDistance)return null}}}},Et.prototype.computeMinDistancePoints=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a),u=o.getCoordinate().distance(l.getCoordinate());if(u<i._minDistance&&(i._minDistance=u,r[0]=new Ft(o,0,o.getCoordinate()),r[1]=new Ft(l,0,l.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Et.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Ue("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Et.prototype.computeMinDistanceLines=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.distance=function(e,t){var r=new Et(e,t);return r.distance()},Et.isWithinDistance=function(e,t,r){var i=new Et(e,t,r);return i.distance()<=r},Et.nearestPoints=function(e,t){var r=new Et(e,t);return r.nearestPoints()};var bt=function(){this._pt=[new M,new M],this._distance=ue.NaN,this._isNull=!0};bt.prototype.getCoordinates=function(){return this._pt},bt.prototype.getCoordinate=function(e){return this._pt[e]},bt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}},bt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},bt.prototype.toString=function(){return Yr.toLineString(this._pt[0],this._pt[1])},bt.prototype.getDistance=function(){return this._distance},bt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}},bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt};var wn=function(){};wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.computeDistance=function(){if(arguments[2]instanceof bt&&arguments[0]instanceof Je&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=new re,s=e.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(t);r.setMinimum(a,t)}else if(arguments[2]instanceof bt&&arguments[0]instanceof it&&arguments[1]instanceof M){var l=arguments[0],u=arguments[1],h=arguments[2];wn.computeDistance(l.getExteriorRing(),u,h);for(var f=0;f<l.getNumInteriorRing();f++)wn.computeDistance(l.getInteriorRingN(f),u,h)}else if(arguments[2]instanceof bt&&arguments[0]instanceof oe&&arguments[1]instanceof M){var p=arguments[0],v=arguments[1],w=arguments[2];if(p instanceof Je)wn.computeDistance(p,v,w);else if(p instanceof it)wn.computeDistance(p,v,w);else if(p instanceof Mt)for(var I=p,T=0;T<I.getNumGeometries();T++){var L=I.getGeometryN(T);wn.computeDistance(L,v,w)}else w.setMinimum(p.getCoordinate(),v)}else if(arguments[2]instanceof bt&&arguments[0]instanceof re&&arguments[1]instanceof M){var m=arguments[0],_=arguments[1],g=arguments[2],y=m.closestPoint(_);g.setMinimum(y,_)}};var br=function(){this._g0=null,this._g1=null,this._ptDist=new bt,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},Qc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};br.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},br.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Ue("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},br.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},br.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},br.prototype.computeOrientedDistance=function(e,t,r){var i=new oo(t);if(e.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new Wi(t,this._densifyFrac);e.apply(s),r.setMaximum(s.getMaxPointDistance())}},br.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},br.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new br(e,t);return r.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new br(i,s);return a.setDensifyFraction(o),a.distance()}},Qc.MaxPointDistanceFilter.get=function(){return oo},Qc.MaxDensifiedByFractionDistanceFilter.get=function(){return Wi},Object.defineProperties(br,Qc);var oo=function(){this._maxPtDist=new bt,this._minPtDist=new bt,this._euclideanDist=new wn,this._geom=null;var e=arguments[0];this._geom=e};oo.prototype.filter=function(e){this._minPtDist.initialize(),wn.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},oo.prototype.getMaxPointDistance=function(){return this._maxPtDist},oo.prototype.interfaces_=function(){return[An]},oo.prototype.getClass=function(){return oo};var Wi=function(){this._maxPtDist=new bt,this._minPtDist=new bt,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Wi.prototype.filter=function(e,t){var r=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,l=0;l<this._numSubSegs;l++){var u=i.x+l*o,h=i.y+l*a,f=new M(u,h);r._minPtDist.initialize(),wn.computeDistance(r._geom,f,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},Wi.prototype.isDone=function(){return!1},Wi.prototype.isGeometryChanged=function(){return!1},Wi.prototype.getMaxPointDistance=function(){return this._maxPtDist},Wi.prototype.interfaces_=function(){return[Zr]},Wi.prototype.getClass=function(){return Wi};var rr=function(e,t,r){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=r||null},Bc={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};rr.prototype.checkMaximumDistance=function(e,t,r){var i=new br(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){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 "+Yr.toLineString(s[0],s[1])+")"}},rr.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=rr.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(),rr.VERBOSE&&vt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},rr.prototype.checkNegativeValid=function(){if(!(this._input instanceof it||this._input instanceof Fn||this._input instanceof Mt))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)},rr.prototype.getErrorIndicator=function(){return this._errorIndicator},rr.prototype.checkMinimumDistance=function(e,t,r){var i=new Et(e,t,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){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 "+Yr.toLineString(s[0],s[1])+" )"}},rr.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)},rr.prototype.getErrorLocation=function(){return this._errorLocation},rr.prototype.getPolygonLines=function(e){for(var t=new W,r=new wt(t),i=mi.getPolygons(e),s=i.iterator();s.hasNext();){var o=s.next();o.apply(r)}return e.getFactory().buildGeometry(t)},rr.prototype.getErrorMessage=function(){return this._errMsg},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},Bc.VERBOSE.get=function(){return!1},Bc.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(rr,Bc);var St=function(e,t,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=r||null},$c={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};St.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},St.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*St.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new te(this._input.getEnvelopeInternal());t.expandBy(this._distance);var r=new te(this._result.getEnvelopeInternal());r.expandBy(e),r.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},St.prototype.checkDistance=function(){var e=new rr(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")},St.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")},St.prototype.checkPolygonal=function(){this._result instanceof it||this._result instanceof Fn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},St.prototype.getErrorIndicator=function(){return this._errorIndicator},St.prototype.getErrorLocation=function(){return this._errorLocation},St.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")},St.prototype.report=function(e){if(!St.VERBOSE)return null;vt.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},St.prototype.getErrorMessage=function(){return this._errorMsg},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.isValidMsg=function(e,t,r){var i=new St(e,t,r);return i.isValid()?null:i.getErrorMessage()},St.isValid=function(e,t,r){var i=new St(e,t,r);return!!i.isValid()},$c.VERBOSE.get=function(){return!1},$c.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(St,$c);var En=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};En.prototype.getCoordinates=function(){return this._pts},En.prototype.size=function(){return this._pts.length},En.prototype.getCoordinate=function(e){return this._pts[e]},En.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},En.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:eo.octant(this.getCoordinate(e),this.getCoordinate(e+1))},En.prototype.setData=function(e){this._data=e},En.prototype.getData=function(){return this._data},En.prototype.toString=function(){return Yr.toLineString(new Qe(this._pts))},En.prototype.interfaces_=function(){return[Vn]},En.prototype.getClass=function(){return En};var ct=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};ct.prototype.getInteriorIntersection=function(){return this._interiorIntersection},ct.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},ct.prototype.getIntersectionSegments=function(){return this._intSegments},ct.prototype.count=function(){return this._intersectionCount},ct.prototype.getIntersections=function(){return this._intersections},ct.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},ct.prototype.setKeepIntersections=function(e){this._keepIntersections=e},ct.prototype.processIntersections=function(e,t,r,i){if(!this._findAllIntersections&&this.hasIntersection()||e===r&&t===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(r,i);if(!s)return null}var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},ct.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2},ct.prototype.hasIntersection=function(){return this._interiorIntersection!==null},ct.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},ct.prototype.interfaces_=function(){return[vs]},ct.prototype.getClass=function(){return ct},ct.createAllIntersectionsFinder=function(e){var t=new ct(e);return t.setFindAllIntersections(!0),t},ct.createAnyIntersectionFinder=function(e){return new ct(e)},ct.createIntersectionCounter=function(e){var t=new ct(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var jr=function(){this._li=new hs,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};jr.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ct(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Zc;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new fi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Yr.toLineString(e[0],e[1])+" and "+Yr.toLineString(e[2],e[3])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(e){var t=new jr(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var ws=function n(){this._nv=null;var e=arguments[0];this._nv=new jr(n.toSegmentStrings(e))};ws.prototype.checkValid=function(){this._nv.checkValid()},ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws},ws.toSegmentStrings=function(e){for(var t=new W,r=e.iterator();r.hasNext();){var i=r.next();t.add(new En(i.getCoordinates(),i))}return t},ws.checkValid=function(e){var t=new ws(e);t.checkValid()};var ao=function(e){this._mapOp=e};ao.prototype.map=function(e){for(var t=this,r=new W,i=0;i<e.getNumGeometries();i++){var s=t._mapOp.map(e.getGeometryN(i));s.isEmpty()||r.add(s)}return e.getFactory().createGeometryCollection(me.toGeometryArray(r))},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.map=function(e,t){var r=new ao(t);return r.map(e)};var Sn=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],r=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=r};Sn.prototype.collectLines=function(e){for(var t=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}},Sn.prototype.labelIsolatedLine=function(e,t){var r=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,r)},Sn.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},Sn.prototype.collectLineEdge=function(e,t,r){var i=e.getLabel(),s=e.getEdge();e.isLineEdge()&&!e.isVisited()&&he.isResultOfOp(i,t)&&!s.isCovered()&&(r.add(s),e.setVisitedEdge(!0))},Sn.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var r=t.next();r.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)}}},Sn.prototype.labelIsolatedLines=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}},Sn.prototype.buildLines=function(e){for(var t=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),s=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(s),i.setInResult(!0)}},Sn.prototype.collectBoundaryTouchEdge=function(e,t,r){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;fe.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),he.isResultOfOp(i,t)&&t===he.INTERSECTION&&(r.add(e.getEdge()),e.setVisitedEdge(!0))},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var lo=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new W;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};lo.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var r=this._geometryFactory.createPoint(t);this._resultPointList.add(r)}},lo.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===he.INTERSECTION)){var s=i.getLabel();he.isResultOfOp(s,e)&&t.filterCoveredNodeToPoint(i)}}},lo.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var Yt=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Yt.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},Yt.prototype.transformPolygon=function(e,t){var r=this,i=!0,s=this.transformLinearRing(e.getExteriorRing(),e);(s===null||!(s instanceof Rn)||s.isEmpty())&&(i=!1);for(var o=new W,a=0;a<e.getNumInteriorRing();a++){var l=r.transformLinearRing(e.getInteriorRingN(a),e);l===null||l.isEmpty()||(l instanceof Rn||(i=!1),o.add(l))}if(i)return this._factory.createPolygon(s,o.toArray([]));var u=new W;return s!==null&&u.add(s),u.addAll(o),this._factory.buildGeometry(u)},Yt.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},Yt.prototype.getInputGeometry=function(){return this._inputGeom},Yt.prototype.transformMultiLineString=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformLineString(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.transformCoordinates=function(e,t){return this.copy(e)},Yt.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},Yt.prototype.transformMultiPoint=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformPoint(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.transformMultiPolygon=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformPolygon(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.copy=function(e){return e.copy()},Yt.prototype.transformGeometryCollection=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transform(e.getGeometryN(s));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(me.toGeometryArray(i)):this._factory.buildGeometry(i)},Yt.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof jt)return this.transformPoint(e,null);if(e instanceof pl)return this.transformMultiPoint(e,null);if(e instanceof Rn)return this.transformLinearRing(e,null);if(e instanceof Je)return this.transformLineString(e,null);if(e instanceof ps)return this.transformMultiLineString(e,null);if(e instanceof it)return this.transformPolygon(e,null);if(e instanceof Fn)return this.transformMultiPolygon(e,null);if(e instanceof Mt)return this.transformGeometryCollection(e,null);throw new Ue("Unknown Geometry subtype: "+e.getClass().getName())},Yt.prototype.transformLinearRing=function(e,t){var r=this.transformCoordinates(e.getCoordinateSequence(),e);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var qn=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new re,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Je&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];n.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};qn.prototype.snapVertices=function(e,t){for(var r=this,i=this._isClosed?e.size()-1:e.size(),s=0;s<i;s++){var o=e.get(s),a=r.findSnapForVertex(o,t);a!==null&&(e.set(s,new M(a)),s===0&&r._isClosed&&e.set(e.size()-1,new M(a)))}},qn.prototype.findSnapForVertex=function(e,t){for(var r=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<r._snapTolerance)return t[i]}return null},qn.prototype.snapTo=function(e){var t=new Hl(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var r=t.toCoordinateArray();return r},qn.prototype.snapSegments=function(e,t){var r=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=r.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new M(o),!1)}},qn.prototype.findSegmentIndexToSnap=function(e,t){for(var r=this,i=ue.MAX_VALUE,s=-1,o=0;o<t.size()-1;o++){if(r._seg.p0=t.get(o),r._seg.p1=t.get(o+1),r._seg.p0.equals2D(e)||r._seg.p1.equals2D(e)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(e);a<r._snapTolerance&&a<i&&(i=a,s=o)}return s},qn.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},qn.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var $e=function(e){this._srcGeom=e||null},Bf={SNAP_PRECISION_FACTOR:{configurable:!0}};$e.prototype.snapTo=function(e,t){var r=this.extractTargetCoordinates(e),i=new $f(t,r);return i.transform(this._srcGeom)},$e.prototype.snapToSelf=function(e,t){var r=this.extractTargetCoordinates(this._srcGeom),i=new $f(e,r,!0),s=i.transform(this._srcGeom),o=s;return t&&ae(o,Ri)&&(o=s.buffer(0)),o},$e.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),r=t/10;return r},$e.prototype.extractTargetCoordinates=function(e){for(var t=new cn,r=e.getCoordinates(),i=0;i<r.length;i++)t.add(r[i]);return t.toArray(new Array(0).fill(null))},$e.prototype.computeMinimumSegmentLength=function(e){for(var t=ue.MAX_VALUE,r=0;r<e.length-1;r++){var i=e[r].distance(e[r+1]);i<t&&(t=i)}return t},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.snap=function(e,t,r){var i=new Array(2).fill(null),s=new $e(e);i[0]=s.snapTo(t,r);var o=new $e(t);return i[1]=o.snapTo(i[0],r),i},$e.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=$e.computeSizeBasedSnapTolerance(e),r=e.getPrecisionModel();if(r.getType()===Te.FIXED){var i=1/r.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($e.computeOverlaySnapTolerance(s),$e.computeOverlaySnapTolerance(o))}},$e.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),r=Math.min(t.getHeight(),t.getWidth()),i=r*$e.SNAP_PRECISION_FACTOR;return i},$e.snapToSelf=function(e,t,r){var i=new $e(e);return i.snapToSelf(t,r)},Bf.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties($e,Bf);var $f=function(n){function e(t,r,i){n.call(this),this._snapTolerance=t||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(r,i){var s=new qn(r,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(r,i){var s=r.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}(Yt),kt=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};kt.prototype.getCommon=function(){return ue.longBitsToDouble(this._commonBits)},kt.prototype.add=function(e){var t=ue.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=kt.signExpBits(this._commonBits),this._isFirst=!1,null;var r=kt.signExpBits(t);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=kt.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=kt.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},kt.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ue.longBitsToDouble(e),r=ue.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+r,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return o}},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.getBit=function(e,t){var r=1<<t;return(e&r)!==0?1:0},kt.signExpBits=function(e){return e>>52},kt.zeroLowerBits=function(e,t){var r=(1<<t)-1,i=~r,s=e&i;return s},kt.numCommonMostSigMantissaBits=function(e,t){for(var r=0,i=52;i>=0;i--){if(kt.getBit(e,i)!==kt.getBit(t,i))return r;r++}return 52};var qi=function(){this._commonCoord=null,this._ccFilter=new uo},jc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};qi.prototype.addCommonBits=function(e){var t=new Xi(this._commonCoord);e.apply(t),e.geometryChanged()},qi.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 r=new Xi(t);return e.apply(r),e.geometryChanged(),e},qi.prototype.getCommonCoordinate=function(){return this._commonCoord},qi.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi},jc.CommonCoordinateFilter.get=function(){return uo},jc.Translater.get=function(){return Xi},Object.defineProperties(qi,jc);var uo=function(){this._commonBitsX=new kt,this._commonBitsY=new kt};uo.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},uo.prototype.getCommonCoordinate=function(){return new M(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},uo.prototype.interfaces_=function(){return[An]},uo.prototype.getClass=function(){return uo};var Xi=function(){this.trans=null;var e=arguments[0];this.trans=e};Xi.prototype.filter=function(e,t){var r=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,r),e.setOrdinate(t,1,i)},Xi.prototype.isDone=function(){return!1},Xi.prototype.isGeometryChanged=function(){return!0},Xi.prototype.interfaces_=function(){return[Zr]},Xi.prototype.getClass=function(){return Xi};var ht=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()};ht.prototype.selfSnap=function(e){var t=new $e(e),r=t.snapTo(e,this._snapTolerance);return r},ht.prototype.removeCommonBits=function(e){this._cbr=new qi,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},ht.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},ht.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),r=he.overlayOp(t[0],t[1],e);return this.prepareResult(r)},ht.prototype.checkValid=function(e){e.isValid()||vt.out.println("Snapped geometry is invalid")},ht.prototype.computeSnapTolerance=function(){this._snapTolerance=$e.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ht.prototype.snap=function(e){var t=this.removeCommonBits(e),r=$e.snap(t[0],t[1],this._snapTolerance);return r},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.overlayOp=function(e,t,r){var i=new ht(e,t);return i.getResultGeometry(r)},ht.union=function(e,t){return ht.overlayOp(e,t,he.UNION)},ht.intersection=function(e,t){return ht.overlayOp(e,t,he.INTERSECTION)},ht.symDifference=function(e,t){return ht.overlayOp(e,t,he.SYMDIFFERENCE)},ht.difference=function(e,t){return ht.overlayOp(e,t,he.DIFFERENCE)};var Vt=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Vt.prototype.getResultGeometry=function(e){var t=null,r=!1,i=null;try{t=he.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(r=!0)}catch(o){if(o instanceof oi)i=o;else throw o}finally{}if(!r)try{t=ht.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof oi?i:o}finally{}return t},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.overlayOp=function(e,t,r){var i=new Vt(e,t);return i.getResultGeometry(r)},Vt.union=function(e,t){return Vt.overlayOp(e,t,he.UNION)},Vt.intersection=function(e,t){return Vt.overlayOp(e,t,he.INTERSECTION)},Vt.symDifference=function(e,t){return Vt.overlayOp(e,t,he.SYMDIFFERENCE)},Vt.difference=function(e,t){return Vt.overlayOp(e,t,he.DIFFERENCE)};var au=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};au.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},au.prototype.interfaces_=function(){return[]},au.prototype.getClass=function(){return au};var nr=function n(){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=n.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=s}},eh={INSERT:{configurable:!0},DELETE:{configurable:!0}};nr.prototype.isDelete=function(){return this._eventType===nr.DELETE},nr.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},nr.prototype.getObject=function(){return this._obj},nr.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},nr.prototype.getInsertEvent=function(){return this._insertEvent},nr.prototype.isInsert=function(){return this._eventType===nr.INSERT},nr.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label},nr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},nr.prototype.interfaces_=function(){return[Sr]},nr.prototype.getClass=function(){return nr},eh.INSERT.get=function(){return 1},eh.DELETE.get=function(){return 2},Object.defineProperties(nr,eh);var Ju=function(){};Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju};var Ct=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],r=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=r};Ct.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(Ct.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},Ct.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ct.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},Ct.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ct.prototype.isBoundaryPointInternal=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next(),s=i.getCoordinate();if(e.isIntersection(s))return!0}return!1},Ct.prototype.hasProperIntersection=function(){return this._hasProper},Ct.prototype.hasIntersection=function(){return this._hasIntersection},Ct.prototype.isDone=function(){return this._isDone},Ct.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))},Ct.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},Ct.prototype.addIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),r.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))))},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var iv=function(n){function e(){n.call(this),this.events=new W,this.nOverlaps=null}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var r=this;Qr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=r.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var r=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=r.events.get(s);if(o.isInsert()&&r.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ct&&ae(arguments[0],Hr)&&ae(arguments[1],Hr)){var a=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(a,a),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&ae(arguments[0],Hr)&&arguments[1]instanceof Ct){var h=arguments[0],f=arguments[1],p=arguments[2];p?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(f)}}},e.prototype.addEdge=function(r,i){for(var s=this,o=r.getMonotoneChainEdge(),a=o.getStartIndexes(),l=0;l<a.length-1;l++){var u=new au(o,l),h=new nr(i,o.getMinX(l),u);s.events.add(h),s.events.add(new nr(o.getMaxX(l),h))}},e.prototype.processOverlaps=function(r,i,s,o){for(var a=this,l=s.getObject(),u=r;u<i;u++){var h=a.events.get(u);if(h.isInsert()){var f=h.getObject();s.isSameLabel(h)||(l.computeIntersections(f,o),a.nOverlaps++)}}},e.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();r.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],u=a.iterator();u.hasNext();){var h=u.next();r.addEdge(h,l)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ju),Xn=function(){this._min=ue.POSITIVE_INFINITY,this._max=ue.NEGATIVE_INFINITY},jf={NodeComparator:{configurable:!0}};Xn.prototype.getMin=function(){return this._min},Xn.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},Xn.prototype.getMax=function(){return this._max},Xn.prototype.toString=function(){return Yr.toLineString(new M(this._min,0),new M(this._max,0))},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn},jf.NodeComparator.get=function(){return lu},Object.defineProperties(Xn,jf);var lu=function(){};lu.prototype.compare=function(e,t){var r=e,i=t,s=(r._min+r._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},lu.prototype.interfaces_=function(){return[nl]},lu.prototype.getClass=function(){return lu};var sv=function(n){function e(){n.call(this),this._item=null;var t=arguments[0],r=arguments[1],i=arguments[2];this._min=t,this._max=r,this._item=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xn),ov=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var t=arguments[0],r=arguments[1];this._node1=t,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},e.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,s),this._node2!==null&&this._node2.query(r,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xn),Yn=function(){this._leaves=new W,this._root=null,this._level=0};Yn.prototype.buildTree=function(){var e=this;Qr.sort(this._leaves,new Xn.NodeComparator);for(var t=this._leaves,r=null,i=new W;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);r=t,t=i,i=r}},Yn.prototype.insert=function(e,t,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new sv(e,t,r))},Yn.prototype.query=function(e,t,r){this.init(),this._root.query(e,t,r)},Yn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Yn.prototype.printNode=function(e){vt.out.println(Yr.toLineString(new M(e._min,this._level),new M(e._max,this._level)))},Yn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Yn.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var r=0;r<e.size();r+=2){var i=e.get(r),s=r+1<e.size()?e.get(r):null;if(s===null)t.add(i);else{var o=new ov(e.get(r),e.get(r+1));t.add(o)}}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var El=function(){this._items=new W};El.prototype.visitItem=function(e){this._items.add(e)},El.prototype.getItems=function(){return this._items},El.prototype.interfaces_=function(){return[Fi]},El.prototype.getClass=function(){return El};var Sl=function(){this._index=null;var e=arguments[0];if(!ae(e,Ri))throw new Ue("Argument must be Polygonal");this._index=new Es(e)},th={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Sl.prototype.locate=function(e){var t=new un(e),r=new Cl(t);return this._index.query(e.y,e.y,r),t.getLocation()},Sl.prototype.interfaces_=function(){return[yl]},Sl.prototype.getClass=function(){return Sl},th.SegmentVisitor.get=function(){return Cl},th.IntervalIndexedGeometry.get=function(){return Es},Object.defineProperties(Sl,th);var Cl=function(){this._counter=null;var e=arguments[0];this._counter=e};Cl.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Cl.prototype.interfaces_=function(){return[Fi]},Cl.prototype.getClass=function(){return Cl};var Es=function(){this._index=new Yn;var e=arguments[0];this.init(e)};Es.prototype.init=function(e){for(var t=this,r=wt.getLines(e),i=r.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();t.addLine(o)}},Es.prototype.addLine=function(e){for(var t=this,r=1;r<e.length;r++){var i=new re(e[r-1],e[r]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(s,o,i)}},Es.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new El;return this._index.query(e,t,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Es.prototype.interfaces_=function(){return[]},Es.prototype.getClass=function(){return Es};var uu=function(n){function e(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new Af,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new $r,arguments.length===2){var t=arguments[0],r=arguments[1],i=Pr.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}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 n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(r,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,l=R.NONE;l=o.getLocation(r,G.ON),l===R.BOUNDARY&&a++;var u=e.determineBoundary(this._boundaryNodeRule,a);o.setLocation(r,u)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],l=new Ct(s,!0,!1);l.setIsDoneIfProperInt(a);var u=this.createEdgeSetIntersector(),h=this._parentGeom instanceof Rn||this._parentGeom instanceof it||this._parentGeom instanceof Fn,f=o||!h;return u.computeIntersections(this._edges,l,f),this.addSelfIntersectionNodes(this._argIndex),l}},e.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(r)}},e.prototype.computeEdgeIntersections=function(r,i,s){var o=new Ct(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._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 jt){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,R.INTERIOR)}else if(arguments[0]instanceof M){var s=arguments[0];this.insertPoint(this._argIndex,s,R.INTERIOR)}},e.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),R.EXTERIOR,R.INTERIOR);for(var s=0;s<r.getNumInteriorRing();s++){var o=r.getInteriorRingN(s);i.addPolygonRing(o,R.INTERIOR,R.EXTERIOR)}},e.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],R.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],R.BOUNDARY)},e.prototype.addLineString=function(r){var i=ge.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Hu(i,new be(this._argIndex,R.INTERIOR));this._lineEdgeMap.put(r,s),this.insertEdge(s),fe.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 r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),s=0,o=r.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(r,i,s){if(this.isBoundaryNode(r,i))return null;s===R.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,s)},e.prototype.addPolygonRing=function(r,i,s){if(r.isEmpty())return null;var o=ge.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,l=s;H.isCCW(o)&&(a=s,l=i);var u=new Hu(o,new be(this._argIndex,R.BOUNDARY,a,l));this._lineEdgeMap.put(r,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],R.BOUNDARY)},e.prototype.insertPoint=function(r,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new be(r,s):a.setLocation(r,s)},e.prototype.createEdgeSetIntersector=function(){return new iv},e.prototype.addSelfIntersectionNodes=function(r){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(r),l=o.eiList.iterator();l.hasNext();){var u=l.next();i.addSelfIntersectionNode(r,u.coord,a)}},e.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Fn&&(this._useBoundaryDeterminationRule=!1),r instanceof it)this.addPolygon(r);else if(r instanceof Je)this.addLineString(r);else if(r instanceof jt)this.addPoint(r);else if(r instanceof pl)this.addCollection(r);else if(r instanceof ps)this.addCollection(r);else if(r instanceof Fn)this.addCollection(r);else if(r instanceof Mt)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(r){for(var i=this,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);i.add(o)}},e.prototype.locate=function(r){return ae(this._parentGeom,Ri)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Sl(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(r,i){return r.isInBoundary(i)?R.BOUNDARY:R.INTERIOR},e}(He),Pl=function(){if(this._li=new hs,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 uu(0,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=Pr.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new uu(0,t,i),this._arg[1]=new uu(1,r,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 uu(0,s,a),this._arg[1]=new uu(1,o,a)}};Pl.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Pl.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Pl.prototype.interfaces_=function(){return[]},Pl.prototype.getClass=function(){return Pl};var Ss=function(){};Ss.prototype.interfaces_=function(){return[]},Ss.prototype.getClass=function(){return Ss},Ss.map=function(){if(arguments[0]instanceof oe&&ae(arguments[1],Ss.MapOp)){for(var e=arguments[0],t=arguments[1],r=new W,i=0;i<e.getNumGeometries();i++){var s=t.map(e.getGeometryN(i));s!==null&&r.add(s)}return e.getFactory().buildGeometry(r)}else if(ae(arguments[0],nt)&&ae(arguments[1],Ss.MapOp)){for(var o=arguments[0],a=arguments[1],l=new W,u=o.iterator();u.hasNext();){var h=u.next(),f=a.map(h);f!==null&&l.add(f)}return l}},Ss.MapOp=function(){};var he=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r),this._ptLocator=new $r,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Br,this._resultPolyList=new W,this._resultLineList=new W,this._resultPointList=new W,this._graph=new He(new Xf),this._geomFact=t.getFactory()}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var s=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new be(r.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(r)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},e.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},e.prototype.computeGeometry=function(r,i,s,o){var a=new W;return a.addAll(r),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 r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(r,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),l=s._ptLocator.locate(r,a);if(l!==R.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var r=new W,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),r.add(s.getCollapsedEdge()))}this._edgeList.addAll(r)},e.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},e.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},e.prototype.insertUniqueEdges=function(r){for(var i=this,s=r.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(r){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(),ws.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var s=new er(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Sn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var a=new lo(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},e.prototype.labelIncompleteNode=function(r,i){var s=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,s)},e.prototype.copyPoints=function(r){for(var i=this,s=this._arg[r].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(r,o.getLabel().getLocation(r))}},e.prototype.findResultAreaEdges=function(r){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,G.RIGHT),o.getLocation(1,G.RIGHT),r)&&s.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.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):(fe.isTrue(!o.isNull(a,G.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,G.LEFT,o.getLocation(a,G.LEFT)),fe.isTrue(!o.isNull(a,G.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,G.RIGHT,o.getLocation(a,G.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(s,0):r.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Pl);he.overlayOp=function(n,e,t){var r=new he(n,e),i=r.getResultGeometry(t);return i},he.intersection=function(n,e){if(n.isEmpty()||e.isEmpty())return he.createEmptyResult(he.INTERSECTION,n,e,n.getFactory());if(n.isGeometryCollection()){var t=e;return ao.map(n,{interfaces_:function(){return[Ss.MapOp]},map:function(r){return r.intersection(t)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.INTERSECTION)},he.symDifference=function(n,e){if(n.isEmpty()||e.isEmpty()){if(n.isEmpty()&&e.isEmpty())return he.createEmptyResult(he.SYMDIFFERENCE,n,e,n.getFactory());if(n.isEmpty())return e.copy();if(e.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.SYMDIFFERENCE)},he.resultDimension=function(n,e,t){var r=e.getDimension(),i=t.getDimension(),s=-1;switch(n){case he.INTERSECTION:s=Math.min(r,i);break;case he.UNION:s=Math.max(r,i);break;case he.DIFFERENCE:s=r;break;case he.SYMDIFFERENCE:s=Math.max(r,i);break}return s},he.createEmptyResult=function(n,e,t,r){var i=null;switch(he.resultDimension(n,e,t)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},he.difference=function(n,e){return n.isEmpty()?he.createEmptyResult(he.DIFFERENCE,n,e,n.getFactory()):e.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.DIFFERENCE))},he.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],e=arguments[1],t=n.getLocation(0),r=n.getLocation(1);return he.isResultOfOp(t,r,e)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===R.BOUNDARY&&(i=R.INTERIOR),s===R.BOUNDARY&&(s=R.INTERIOR),o){case he.INTERSECTION:return i===R.INTERIOR&&s===R.INTERIOR;case he.UNION:return i===R.INTERIOR||s===R.INTERIOR;case he.DIFFERENCE:return i===R.INTERIOR&&s!==R.INTERIOR;case he.SYMDIFFERENCE:return i===R.INTERIOR&&s!==R.INTERIOR||i!==R.INTERIOR&&s===R.INTERIOR}return!1}},he.INTERSECTION=1,he.UNION=2,he.DIFFERENCE=3,he.SYMDIFFERENCE=4;var Yi=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new $r,this._seg=new re;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};Yi.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=t._linework.getGeometryN(r),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},Yi.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?R.BOUNDARY:this._ptLocator.locate(e,this._g)},Yi.prototype.extractLinework=function(e){var t=new Il;e.apply(t);var r=t.getLinework(),i=me.toLineStringArray(r);return e.getFactory().createMultiLineString(i)},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi};var Il=function(){this._linework=null,this._linework=new W};Il.prototype.getLinework=function(){return this._linework},Il.prototype.filter=function(e){var t=this;if(e instanceof it){var r=e;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)t._linework.add(r.getInteriorRingN(i))}},Il.prototype.interfaces_=function(){return[hn]},Il.prototype.getClass=function(){return Il};var Cs=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};Cs.prototype.extractPoints=function(e,t,r){for(var i=this,s=e.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],t,r)},Cs.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},Cs.prototype.getPoints=function(e){for(var t=this,r=new W,i=wt.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();t.extractPoints(o,e,r)}return r},Cs.prototype.computeOffsetPoints=function(e,t,r,i){var s=t.x-e.x,o=t.y-e.y,a=Math.sqrt(s*s+o*o),l=r*s/a,u=r*o/a,h=(t.x+e.x)/2,f=(t.y+e.y)/2;if(this._doLeft){var p=new M(h-u,f+l);i.add(p)}if(this._doRight){var v=new M(h+u,f-l);i.add(v)}},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var pr=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new W;var e=arguments[0],t=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,r],this._locFinder=[new Yi(this._geom[0],this._boundaryDistanceTolerance),new Yi(this._geom[1],this._boundaryDistanceTolerance),new Yi(this._geom[2],this._boundaryDistanceTolerance)]},ed={TOLERANCE:{configurable:!0}};pr.prototype.reportResult=function(e,t,r){vt.out.println("Overlay result invalid - A:"+R.toLocationSymbol(t[0])+" B:"+R.toLocationSymbol(t[1])+" expected:"+(r?"i":"e")+" actual:"+R.toLocationSymbol(t[2]))},pr.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},pr.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],r=0;r<this._testCoords.size();r++){var i=e._testCoords.get(r);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),pr.hasLocation(this._location,R.BOUNDARY)?!0:this.isValidResult(s,this._location)}},pr.prototype.addTestPts=function(e){var t=new Cs(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},pr.prototype.isValidResult=function(e,t){var r=he.isResultOfOp(t[0],t[1],e),i=t[2]===R.INTERIOR,s=!(r^i);return s||this.reportResult(e,t,r),s},pr.prototype.getInvalidLocation=function(){return this._invalidLocation},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},pr.hasLocation=function(e,t){for(var r=0;r<3;r++)if(e[r]===t)return!0;return!1},pr.computeBoundaryDistanceTolerance=function(e,t){return Math.min($e.computeSizeBasedSnapTolerance(e),$e.computeSizeBasedSnapTolerance(t))},pr.isValid=function(e,t,r,i){var s=new pr(e,t,i);return s.isValid(r)},ed.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(pr,ed);var gr=function n(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(e),this._inputGeoms=e};gr.prototype.extractElements=function(e,t){var r=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);r._skipEmpty&&s.isEmpty()||t.add(s)}},gr.prototype.combine=function(){for(var e=this,t=new W,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.combine=function(){if(arguments.length===1){var e=arguments[0],t=new gr(e);return t.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new gr(gr.createList(r,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2],u=new gr(gr.createList(o,a,l));return u.combine()}},gr.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},gr.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new W;return r.add(e),r.add(t),r}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 tt=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new W)},td={STRTREE_NODE_CAPACITY:{configurable:!0}};tt.prototype.reduceToGeometries=function(e){for(var t=this,r=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=null;ae(s,Hr)?o=t.unionTree(s):s instanceof oe&&(o=s),r.add(o)}return r},tt.prototype.extractByEnvelope=function(e,t,r){for(var i=new W,s=0;s<t.getNumGeometries();s++){var o=t.getGeometryN(s);o.getEnvelopeInternal().intersects(e)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},tt.prototype.unionOptimized=function(e,t){var r=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!r.intersects(i)){var s=gr.combine(e,t);return s}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)},tt.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 Vf(tt.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var r=t.next();e.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=e.itemsTree(),s=this.unionTree(i);return s},tt.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],r=arguments[1],i=arguments[2];if(i-r<=1){var s=tt.getGeometry(t,r);return this.unionSafe(s,null)}else{if(i-r===2)return this.unionSafe(tt.getGeometry(t,r),tt.getGeometry(t,r+1));var o=Math.trunc((i+r)/2),a=this.binaryUnion(t,r,o),l=this.binaryUnion(t,o,i);return this.unionSafe(a,l)}}},tt.prototype.repeatedUnion=function(e){for(var t=null,r=e.iterator();r.hasNext();){var i=r.next();t===null?t=i.copy():t=t.union(i)}return t},tt.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)},tt.prototype.unionActual=function(e,t){return tt.restrictToPolygons(e.union(t))},tt.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),r=this.binaryUnion(t);return r},tt.prototype.unionUsingEnvelopeIntersection=function(e,t,r){var i=new W,s=this.extractByEnvelope(r,e,i),o=this.extractByEnvelope(r,t,i),a=this.unionActual(s,o);i.add(a);var l=gr.combine(i);return l},tt.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),r=t.buildGeometry(e),i=r.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),l=a.createGeometryCollection([s,o]),u=l.buffer(0);return u}},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.restrictToPolygons=function(e){if(ae(e,Ri))return e;var t=mi.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(me.toPolygonArray(t))},tt.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},tt.union=function(e){var t=new tt(e);return t.union()},td.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(tt,td);var Zu=function(){};Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu},Zu.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return he.createEmptyResult(he.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Vt.overlayOp(e,t,he.UNION)};function Ps(){return new Ku}function Ku(){this.reset()}Ku.prototype={constructor:Ku,reset:function(){this.s=this.t=0},add:function(n){rd(Qu,n,this.t),rd(this,Qu.s,this.s),this.s?this.t+=Qu.t:this.s=Qu.t},valueOf:function(){return this.s}};var Qu=new Ku;function rd(n,e,t){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}var rt=1e-6,Le=Math.PI,vi=Le/2,nd=Le/4,yi=Le*2,Is=180/Le,Cn=Le/180,zt=Math.abs,av=Math.atan,Tl=Math.atan2,ot=Math.cos,at=Math.sin,Nl=Math.sqrt;function id(n){return n>1?0:n<-1?Le:Math.acos(n)}function co(n){return n>1?vi:n<-1?-vi:Math.asin(n)}function cu(){}function Bu(n,e){n&&od.hasOwnProperty(n.type)&&od[n.type](n,e)}var sd={Feature:function(n,e){Bu(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)Bu(t[r].geometry,e)}},od={Sphere:function(n,e){e.sphere()},Point:function(n,e){n=n.coordinates,e.point(n[0],n[1],n[2])},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)n=t[r],e.point(n[0],n[1],n[2])},LineString:function(n,e){rh(n.coordinates,e,0)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)rh(t[r],e,0)},Polygon:function(n,e){ad(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)ad(t[r],e)},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)Bu(t[r],e)}};function rh(n,e,t){var r=-1,i=n.length-t,s;for(e.lineStart();++r<i;)s=n[r],e.point(s[0],s[1],s[2]);e.lineEnd()}function ad(n,e){var t=-1,r=n.length;for(e.polygonStart();++t<r;)rh(n[t],e,1);e.polygonEnd()}function lv(n,e){n&&sd.hasOwnProperty(n.type)?sd[n.type](n,e):Bu(n,e)}Ps(),Ps();function nh(n){return[Tl(n[1],n[0]),co(n[2])]}function Dl(n){var e=n[0],t=n[1],r=ot(t);return[r*ot(e),r*at(e),at(t)]}function $u(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function ju(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function ih(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}function ec(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function sh(n){var e=Nl(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}Ps();function ld(n,e){function t(r,i){return r=n(r,i),e(r[0],r[1])}return n.invert&&e.invert&&(t.invert=function(r,i){return r=e.invert(r,i),r&&n.invert(r[0],r[1])}),t}function oh(n,e){return[n>Le?n-yi:n<-Le?n+yi:n,e]}oh.invert=oh;function uv(n,e,t){return(n%=yi)?e||t?ld(cd(n),hd(e,t)):cd(n):e||t?hd(e,t):oh}function ud(n){return function(e,t){return e+=n,[e>Le?e-yi:e<-Le?e+yi:e,t]}}function cd(n){var e=ud(n);return e.invert=ud(-n),e}function hd(n,e){var t=ot(n),r=at(n),i=ot(e),s=at(e);function o(a,l){var u=ot(l),h=ot(a)*u,f=at(a)*u,p=at(l),v=p*t+h*r;return[Tl(f*i-v*s,h*t-p*r),co(v*i+f*s)]}return o.invert=function(a,l){var u=ot(l),h=ot(a)*u,f=at(a)*u,p=at(l),v=p*i-f*s;return[Tl(f*i+p*s,h*t+v*r),co(v*t-h*r)]},o}function cv(n,e,t,r,i,s){if(t){var o=ot(e),a=at(e),l=r*t;i==null?(i=e+r*yi,s=e-l/2):(i=fd(o,i),s=fd(o,s),(r>0?i<s:i>s)&&(i+=r*yi));for(var u,h=i;r>0?h>s:h<s;h-=l)u=nh([o,-a*ot(h),-a*at(h)]),n.point(u[0],u[1])}}function fd(n,e){e=Dl(e),e[0]-=n,sh(e);var t=id(-e[1]);return((-e[2]<0?-t:t)+yi-rt)%yi}function dd(){var n=[],e;return{point:function(t,r){e.push([t,r])},lineStart:function(){n.push(e=[])},lineEnd:cu,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function hv(n,e,t,r,i,s){var o=n[0],a=n[1],l=e[0],u=e[1],h=0,f=1,p=l-o,v=u-a,w;if(w=t-o,!(!p&&w>0)){if(w/=p,p<0){if(w<h)return;w<f&&(f=w)}else if(p>0){if(w>f)return;w>h&&(h=w)}if(w=i-o,!(!p&&w<0)){if(w/=p,p<0){if(w>f)return;w>h&&(h=w)}else if(p>0){if(w<h)return;w<f&&(f=w)}if(w=r-a,!(!v&&w>0)){if(w/=v,v<0){if(w<h)return;w<f&&(f=w)}else if(v>0){if(w>f)return;w>h&&(h=w)}if(w=s-a,!(!v&&w<0)){if(w/=v,v<0){if(w>f)return;w>h&&(h=w)}else if(v>0){if(w<h)return;w<f&&(f=w)}return h>0&&(n[0]=o+h*p,n[1]=a+h*v),f<1&&(e[0]=o+f*p,e[1]=a+f*v),!0}}}}}function tc(n,e){return zt(n[0]-e[0])<rt&&zt(n[1]-e[1])<rt}function rc(n,e,t,r){this.x=n,this.z=e,this.o=t,this.e=r,this.v=!1,this.n=this.p=null}function pd(n,e,t,r,i){var s=[],o=[],a,l;if(n.forEach(function(w){if(!((I=w.length-1)<=0)){var I,T=w[0],L=w[I],m;if(tc(T,L)){for(i.lineStart(),a=0;a<I;++a)i.point((T=w[a])[0],T[1]);i.lineEnd();return}s.push(m=new rc(T,w,null,!0)),o.push(m.o=new rc(T,null,m,!1)),s.push(m=new rc(L,w,null,!1)),o.push(m.o=new rc(L,null,m,!0))}}),!!s.length){for(o.sort(e),gd(s),gd(o),a=0,l=o.length;a<l;++a)o[a].e=t=!t;for(var u=s[0],h,f;;){for(var p=u,v=!0;p.v;)if((p=p.n)===u)return;h=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(v)for(a=0,l=h.length;a<l;++a)i.point((f=h[a])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(v)for(h=p.p.z,a=h.length-1;a>=0;--a)i.point((f=h[a])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,h=p.z,v=!v}while(!p.v);i.lineEnd()}}}function gd(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t<e;)r.n=i=n[t],i.p=r,r=i;r.n=i=n[0],i.p=r}}function md(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function fv(n){return n.length===1&&(n=dv(n)),{left:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var s=r+i>>>1;n(e[s],t)<0?r=s+1:i=s}return r},right:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var s=r+i>>>1;n(e[s],t)>0?i=s:r=s+1}return r}}}function dv(n){return function(e,t){return md(n(e),t)}}fv(md);function vd(n){for(var e=n.length,t,r=-1,i=0,s,o;++r<e;)i+=n[r].length;for(s=new Array(i);--e>=0;)for(o=n[e],t=o.length;--t>=0;)s[--i]=o[t];return s}var nc=1e9,ic=-1e9;function pv(n,e,t,r){function i(u,h){return n<=u&&u<=t&&e<=h&&h<=r}function s(u,h,f,p){var v=0,w=0;if(u==null||(v=o(u,f))!==(w=o(h,f))||l(u,h)<0^f>0)do p.point(v===0||v===3?n:t,v>1?r:e);while((v=(v+f+4)%4)!==w);else p.point(h[0],h[1])}function o(u,h){return zt(u[0]-n)<rt?h>0?0:3:zt(u[0]-t)<rt?h>0?2:1:zt(u[1]-e)<rt?h>0?1:0:h>0?3:2}function a(u,h){return l(u.x,h.x)}function l(u,h){var f=o(u,1),p=o(h,1);return f!==p?f-p:f===0?h[1]-u[1]:f===1?u[0]-h[0]:f===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,f=dd(),p,v,w,I,T,L,m,_,g,y,E,C={point:N,lineStart:O,lineEnd:A,polygonStart:x,polygonEnd:D};function N(B,X){i(B,X)&&h.point(B,X)}function b(){for(var B=0,X=0,ne=v.length;X<ne;++X)for(var ce=v[X],de=1,K=ce.length,$=ce[0],ee,ye,Oe=$[0],Ce=$[1];de<K;++de)ee=Oe,ye=Ce,$=ce[de],Oe=$[0],Ce=$[1],ye<=r?Ce>r&&(Oe-ee)*(r-ye)>(Ce-ye)*(n-ee)&&++B:Ce<=r&&(Oe-ee)*(r-ye)<(Ce-ye)*(n-ee)&&--B;return B}function x(){h=f,p=[],v=[],E=!0}function D(){var B=b(),X=E&&B,ne=(p=vd(p)).length;(X||ne)&&(u.polygonStart(),X&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),ne&&pd(p,a,B,s,u),u.polygonEnd()),h=u,p=v=w=null}function O(){C.point=k,v&&v.push(w=[]),y=!0,g=!1,m=_=NaN}function A(){p&&(k(I,T),L&&g&&f.rejoin(),p.push(f.result())),C.point=N,g&&h.lineEnd()}function k(B,X){var ne=i(B,X);if(v&&w.push([B,X]),y)I=B,T=X,L=ne,y=!1,ne&&(h.lineStart(),h.point(B,X));else if(ne&&g)h.point(B,X);else{var ce=[m=Math.max(ic,Math.min(nc,m)),_=Math.max(ic,Math.min(nc,_))],de=[B=Math.max(ic,Math.min(nc,B)),X=Math.max(ic,Math.min(nc,X))];hv(ce,de,n,e,t,r)?(g||(h.lineStart(),h.point(ce[0],ce[1])),h.point(de[0],de[1]),ne||h.lineEnd(),E=!1):ne&&(h.lineStart(),h.point(B,X),E=!1)}m=B,_=X,g=ne}return C}}var ah=Ps();function gv(n,e){var t=e[0],r=e[1],i=[at(t),-ot(t),0],s=0,o=0;ah.reset();for(var a=0,l=n.length;a<l;++a)if(h=(u=n[a]).length)for(var u,h,f=u[h-1],p=f[0],v=f[1]/2+nd,w=at(v),I=ot(v),T=0;T<h;++T,p=m,w=g,I=y,f=L){var L=u[T],m=L[0],_=L[1]/2+nd,g=at(_),y=ot(_),E=m-p,C=E>=0?1:-1,N=C*E,b=N>Le,x=w*g;if(ah.add(Tl(x*C*at(N),I*y+x*ot(N))),s+=b?E+C*yi:E,b^p>=t^m>=t){var D=ju(Dl(f),Dl(L));sh(D);var O=ju(i,D);sh(O);var A=(b^E>=0?-1:1)*co(O[2]);(r>A||r===A&&(D[0]||D[1]))&&(o+=b^E>=0?1:-1)}}return(s<-1e-6||s<rt&&ah<-1e-6)^o&1}Ps();function yd(n){return n}Ps(),Ps();var bl=1/0,sc=bl,hu=-bl,oc=hu,_d={point:mv,lineStart:cu,lineEnd:cu,polygonStart:cu,polygonEnd:cu,result:function(){var n=[[bl,sc],[hu,oc]];return hu=oc=-(sc=bl=1/0),n}};function mv(n,e){n<bl&&(bl=n),n>hu&&(hu=n),e<sc&&(sc=e),e>oc&&(oc=e)}Ps();function wd(n,e,t,r){return function(i,s){var o=e(s),a=i.invert(r[0],r[1]),l=dd(),u=e(l),h=!1,f,p,v,w={point:I,lineStart:L,lineEnd:m,polygonStart:function(){w.point=_,w.lineStart=g,w.lineEnd=y,p=[],f=[]},polygonEnd:function(){w.point=I,w.lineStart=L,w.lineEnd=m,p=vd(p);var E=gv(f,a);p.length?(h||(s.polygonStart(),h=!0),pd(p,yv,E,t,s)):E&&(h||(s.polygonStart(),h=!0),s.lineStart(),t(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),p=f=null},sphere:function(){s.polygonStart(),s.lineStart(),t(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function I(E,C){var N=i(E,C);n(E=N[0],C=N[1])&&s.point(E,C)}function T(E,C){var N=i(E,C);o.point(N[0],N[1])}function L(){w.point=T,o.lineStart()}function m(){w.point=I,o.lineEnd()}function _(E,C){v.push([E,C]);var N=i(E,C);u.point(N[0],N[1])}function g(){u.lineStart(),v=[]}function y(){_(v[0][0],v[0][1]),u.lineEnd();var E=u.clean(),C=l.result(),N,b=C.length,x,D,O;if(v.pop(),f.push(v),v=null,!!b){if(E&1){if(D=C[0],(x=D.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),N=0;N<x;++N)s.point((O=D[N])[0],O[1]);s.lineEnd()}return}b>1&&E&2&&C.push(C.pop().concat(C.shift())),p.push(C.filter(vv))}}return w}}function vv(n){return n.length>1}function yv(n,e){return((n=n.x)[0]<0?n[1]-vi-rt:vi-n[1])-((e=e.x)[0]<0?e[1]-vi-rt:vi-e[1])}const Ed=wd(function(){return!0},_v,Ev,[-Le,-vi]);function _v(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,o){var a=s>0?Le:-Le,l=zt(s-e);zt(l-Le)<rt?(n.point(e,t=(t+o)/2>0?vi:-vi),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(a,t),n.point(s,t),i=0):r!==a&&l>=Le&&(zt(e-r)<rt&&(e-=r*rt),zt(s-a)<rt&&(s-=a*rt),t=wv(e,t,s,o),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(a,t),i=0),n.point(e=s,t=o),r=a},lineEnd:function(){n.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function wv(n,e,t,r){var i,s,o=at(n-t);return zt(o)>rt?av((at(e)*(s=ot(r))*at(t)-at(r)*(i=ot(e))*at(n))/(i*s*o)):(e+r)/2}function Ev(n,e,t,r){var i;if(n==null)i=t*vi,r.point(-Le,i),r.point(0,i),r.point(Le,i),r.point(Le,0),r.point(Le,-i),r.point(0,-i),r.point(-Le,-i),r.point(-Le,0),r.point(-Le,i);else if(zt(n[0]-e[0])>rt){var s=n[0]<e[0]?Le:-Le;i=t*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(e[0],e[1])}function Sv(n,e){var t=ot(n),r=t>0,i=zt(t)>rt;function s(h,f,p,v){cv(v,n,e,p,h,f)}function o(h,f){return ot(h)*ot(f)>t}function a(h){var f,p,v,w,I;return{lineStart:function(){w=v=!1,I=1},point:function(T,L){var m=[T,L],_,g=o(T,L),y=r?g?0:u(T,L):g?u(T+(T<0?Le:-Le),L):0;if(!f&&(w=v=g)&&h.lineStart(),g!==v&&(_=l(f,m),(!_||tc(f,_)||tc(m,_))&&(m[0]+=rt,m[1]+=rt,g=o(m[0],m[1]))),g!==v)I=0,g?(h.lineStart(),_=l(m,f),h.point(_[0],_[1])):(_=l(f,m),h.point(_[0],_[1]),h.lineEnd()),f=_;else if(i&&f&&r^g){var E;!(y&p)&&(E=l(m,f,!0))&&(I=0,r?(h.lineStart(),h.point(E[0][0],E[0][1]),h.point(E[1][0],E[1][1]),h.lineEnd()):(h.point(E[1][0],E[1][1]),h.lineEnd(),h.lineStart(),h.point(E[0][0],E[0][1])))}g&&(!f||!tc(f,m))&&h.point(m[0],m[1]),f=m,v=g,p=y},lineEnd:function(){v&&h.lineEnd(),f=null},clean:function(){return I|(w&&v)<<1}}}function l(h,f,p){var v=Dl(h),w=Dl(f),I=[1,0,0],T=ju(v,w),L=$u(T,T),m=T[0],_=L-m*m;if(!_)return!p&&h;var g=t*L/_,y=-t*m/_,E=ju(I,T),C=ec(I,g),N=ec(T,y);ih(C,N);var b=E,x=$u(C,b),D=$u(b,b),O=x*x-D*($u(C,C)-1);if(!(O<0)){var A=Nl(O),k=ec(b,(-x-A)/D);if(ih(k,C),k=nh(k),!p)return k;var B=h[0],X=f[0],ne=h[1],ce=f[1],de;X<B&&(de=B,B=X,X=de);var K=X-B,$=zt(K-Le)<rt,ee=$||K<rt;if(!$&&ce<ne&&(de=ne,ne=ce,ce=de),ee?$?ne+ce>0^k[1]<(zt(k[0]-B)<rt?ne:ce):ne<=k[1]&&k[1]<=ce:K>Le^(B<=k[0]&&k[0]<=X)){var ye=ec(b,(-x+A)/D);return ih(ye,C),[k,nh(ye)]}}}function u(h,f){var p=r?n:Le-n,v=0;return h<-p?v|=1:h>p&&(v|=2),f<-p?v|=4:f>p&&(v|=8),v}return wd(o,a,s,r?[0,-n]:[-Le,n-Le])}function Sd(n){return function(e){var t=new lh;for(var r in n)t[r]=n[r];return t.stream=e,t}}function lh(){}lh.prototype={constructor:lh,point:function(n,e){this.stream.point(n,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 Cd(n,e,t){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),s!=null&&n.clipExtent(null),lv(t,n.stream(_d));var o=_d.result(),a=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+e[0][0]+(r-a*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&n.clipExtent(s),n.scale(a*150).translate([l,u])}function Cv(n,e,t){return Cd(n,[[0,0],e],t)}var Pd=16,Pv=ot(30*Cn);function Id(n,e){return+e?Tv(n,e):Iv(n)}function Iv(n){return Sd({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function Tv(n,e){function t(r,i,s,o,a,l,u,h,f,p,v,w,I,T){var L=u-r,m=h-i,_=L*L+m*m;if(_>4*e&&I--){var g=o+p,y=a+v,E=l+w,C=Nl(g*g+y*y+E*E),N=co(E/=C),b=zt(zt(E)-1)<rt||zt(s-f)<rt?(s+f)/2:Tl(y,g),x=n(b,N),D=x[0],O=x[1],A=D-r,k=O-i,B=m*A-L*k;(B*B/_>e||zt((L*A+m*k)/_-.5)>.3||o*p+a*v+l*w<Pv)&&(t(r,i,s,o,a,l,D,O,b,g/=C,y/=C,E,I,T),T.point(D,O),t(D,O,b,g,y,E,u,h,f,p,v,w,I,T))}}return function(r){var i,s,o,a,l,u,h,f,p,v,w,I,T={point:L,lineStart:m,lineEnd:g,polygonStart:function(){r.polygonStart(),T.lineStart=y},polygonEnd:function(){r.polygonEnd(),T.lineStart=m}};function L(N,b){N=n(N,b),r.point(N[0],N[1])}function m(){f=NaN,T.point=_,r.lineStart()}function _(N,b){var x=Dl([N,b]),D=n(N,b);t(f,p,h,v,w,I,f=D[0],p=D[1],h=N,v=x[0],w=x[1],I=x[2],Pd,r),r.point(f,p)}function g(){T.point=L,r.lineEnd()}function y(){m(),T.point=E,T.lineEnd=C}function E(N,b){_(i=N,b),s=f,o=p,a=v,l=w,u=I,T.point=_}function C(){t(f,p,h,v,w,I,s,o,i,a,l,u,Pd,r),T.lineEnd=g,g()}return T}}var Nv=Sd({point:function(n,e){this.stream.point(n*Cn,e*Cn)}});function Dv(n){return bv(function(){return n})()}function bv(n){var e,t=150,r=480,i=250,s,o,a=0,l=0,u=0,h=0,f=0,p,v,w=null,I=Ed,T=null,L,m,_,g=yd,y=.5,E=Id(D,y),C,N;function b(k){return k=v(k[0]*Cn,k[1]*Cn),[k[0]*t+s,o-k[1]*t]}function x(k){return k=v.invert((k[0]-s)/t,(o-k[1])/t),k&&[k[0]*Is,k[1]*Is]}function D(k,B){return k=e(k,B),[k[0]*t+s,o-k[1]*t]}b.stream=function(k){return C&&N===k?C:C=Nv(I(p,E(g(N=k))))},b.clipAngle=function(k){return arguments.length?(I=+k?Sv(w=k*Cn,6*Cn):(w=null,Ed),A()):w*Is},b.clipExtent=function(k){return arguments.length?(g=k==null?(T=L=m=_=null,yd):pv(T=+k[0][0],L=+k[0][1],m=+k[1][0],_=+k[1][1]),A()):T==null?null:[[T,L],[m,_]]},b.scale=function(k){return arguments.length?(t=+k,O()):t},b.translate=function(k){return arguments.length?(r=+k[0],i=+k[1],O()):[r,i]},b.center=function(k){return arguments.length?(a=k[0]%360*Cn,l=k[1]%360*Cn,O()):[a*Is,l*Is]},b.rotate=function(k){return arguments.length?(u=k[0]%360*Cn,h=k[1]%360*Cn,f=k.length>2?k[2]%360*Cn:0,O()):[u*Is,h*Is,f*Is]},b.precision=function(k){return arguments.length?(E=Id(D,y=k*k),A()):Nl(y)},b.fitExtent=function(k,B){return Cd(b,k,B)},b.fitSize=function(k,B){return Cv(b,k,B)};function O(){v=ld(p=uv(u,h,f),e);var k=e(a,l);return s=r-k[0]*t,o=i+k[1]*t,A()}function A(){return C=N=null,b}return function(){return e=n.apply(this,arguments),b.invert=e.invert&&x,O()}}function Td(n){return function(e,t){var r=ot(e),i=ot(t),s=n(r*i);return[s*i*at(e),s*at(t)]}}function Nd(n){return function(e,t){var r=Nl(e*e+t*t),i=n(r),s=at(i),o=ot(i);return[Tl(e*s,r*o),co(r&&t*s/r)]}}var Ov=Td(function(n){return Nl(2/(1+n))});Ov.invert=Nd(function(n){return 2*co(n/2)});var Dd=Td(function(n){return(n=id(n))&&n/at(n)});Dd.invert=Nd(function(n){return n});function Mv(){return Dv(Dd).scale(79.4188).clipAngle(180-.001)}function bd(n,e){return[n,e]}bd.invert=bd;function xv(n,e,t){t=t||{};var r=t.units||"kilometers",i=t.steps||8;if(!n)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(n.type){case"GeometryCollection":return Tu(n,function(o){var a=ac(o,e,r,i);a&&s.push(a)}),el(s);case"FeatureCollection":return Iu(n,function(o){var a=ac(o,e,r,i);a&&Iu(a,function(l){l&&s.push(l)})}),el(s)}return ac(n,e,r,i)}function ac(n,e,t,r){var i=n.properties||{},s=n.type==="Feature"?n.geometry:n;if(s.type==="GeometryCollection"){var o=[];return Tu(n,function(I){var T=ac(I,e,t,r);T&&o.push(T)}),el(o)}var a=Lv(s),l={type:s.type,coordinates:Md(s.coordinates,a)},u=new Hc,h=u.read(l),f=Tc(Nc(e,t),"meters"),p=_t.bufferOp(h,f,r),v=new Ff;if(p=v.write(p),!Od(p.coordinates)){var w={type:p.type,coordinates:xd(p.coordinates,a)};return bn(w,i)}}function Od(n){return Array.isArray(n[0])?Od(n[0]):isNaN(n[0])}function Md(n,e){return typeof n[0]!="object"?e(n):n.map(function(t){return Md(t,e)})}function xd(n,e){return typeof n[0]!="object"?e.invert(n):n.map(function(t){return xd(t,e)})}function Lv(n){var e=qm(n).geometry.coordinates,t=[-e[0],-e[1]];return Mv().rotate(t).scale(Ut)}function Av(n,e,t){t===void 0&&(t={});for(var r=t.steps||64,i=t.properties?t.properties:!Array.isArray(n)&&n.type==="Feature"&&n.properties?n.properties:{},s=[],o=0;o<r;o++)s.push(tl(n,e,o*-360/r,t).geometry.coordinates);return s.push(s[0]),ar([s],i)}/**
6
+ `)}return e.toString()},Dt.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();r.computeLabel(e)}},Dt.prototype.computeLabelling=function(e){var t=this;this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!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)===R.BOUNDARY&&(r[a]=!0);for(var l=this.iterator();l.hasNext();)for(var u=l.next(),h=u.getLabel(),f=0;f<2;f++)if(h.isAnyNull(f)){var p=R.NONE;if(r[f])p=R.EXTERIOR;else{var v=u.getCoordinate();p=t.getLocation(f,v,e)}h.setAllLocationsIfNull(f,p)}},Dt.prototype.getDegree=function(){return this._edgeMap.size()},Dt.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt};var nv=function(n){function e(){n.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,s=null,o=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var l=r._resultAreaEdgeList.get(a),u=l.getSym();if(l.getLabel().isArea())switch(i===null&&l.isInResult()&&(i=l),o){case r._SCANNING_FOR_INCOMING:if(!u.isInResult())continue;s=u,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!l.isInResult())continue;s.setNext(l),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new fi("no outgoing dirEdge found",this.getCoordinate());fe.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),s.setNext(i)}},e.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},e.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var s=r.get(0);if(i===1)return s;var o=r.get(i-1),a=s.getQuadrant(),l=o.getQuadrant();return xe.isNorthern(a)&&xe.isNorthern(l)?s:!xe.isNorthern(a)&&!xe.isNorthern(l)?o:s.getDy()!==0?s:o.getDy()!==0?o:(fe.shouldNeverReachHere("found two horizontal edges incident on node"),null)},e.prototype.print=function(r){vt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var s=i.next();r.print("out "),s.print(r),r.println(),r.print("in "),s.getSym().print(r),r.println()}},e.prototype.getResultAreaEdges=function(){var r=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())&&r._resultAreaEdgeList.add(s)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var s=i.next(),o=s.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,s=null,o=this._edgeList.size()-1;o>=0;o--){var a=r._edgeList.get(o),l=a.getSym();s===null&&(s=l),i!==null&&l.setNext(i),i=a}s.setNext(i)},e.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],s=this.findIndex(i),o=i.getDepth(G.LEFT),a=i.getDepth(G.RIGHT),l=this.computeDepths(s+1,this._edgeList.size(),o),u=this.computeDepths(0,s,l);if(u!==a)throw new fi("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var h=arguments[0],f=arguments[1],p=arguments[2],v=p,w=h;w<f;w++){var I=r._edgeList.get(w);I.setEdgeDepths(G.RIGHT,v),v=I.getDepth(G.LEFT)}return v}},e.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();s.merge(i.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,s=null,o=null,a=this._SCANNING_FOR_INCOMING,l=this._resultAreaEdgeList.size()-1;l>=0;l--){var u=i._resultAreaEdgeList.get(l),h=u.getSym();switch(s===null&&u.getEdgeRing()===r&&(s=u),a){case i._SCANNING_FOR_INCOMING:if(h.getEdgeRing()!==r)continue;o=h,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(u.getEdgeRing()!==r)continue;o.setNextMin(u),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(fe.isTrue(s!==null,"found null for first outgoing dirEdge"),fe.isTrue(s.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(s))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var s=i.next();s.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],a=0,l=this.iterator();l.hasNext();){var u=l.next();u.getEdgeRing()===o&&a++}return a}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var r=R.NONE,i=this.iterator();i.hasNext();){var s=i.next(),o=s.getSym();if(!s.isLineEdge()){if(s.isInResult()){r=R.INTERIOR;break}if(o.isInResult()){r=R.EXTERIOR;break}}}if(r===R.NONE)return null;for(var a=r,l=this.iterator();l.hasNext();){var u=l.next(),h=u.getSym();u.isLineEdge()?u.getEdge().setCovered(a===R.INTERIOR):(u.isInResult()&&(a=R.EXTERIOR),h.isInResult()&&(a=R.INTERIOR))}},e.prototype.computeLabelling=function(r){var i=this;n.prototype.computeLabelling.call(this,r),this._label=new be(R.NONE);for(var s=this.iterator();s.hasNext();)for(var o=s.next(),a=o.getEdge(),l=a.getLabel(),u=0;u<2;u++){var h=l.getLocation(u);(h===R.INTERIOR||h===R.BOUNDARY)&&i._label.setLocation(u,R.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Dt),Xf=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.createNode=function(r){return new Xu(r,new nv)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(gl),Vi=function n(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=n.orientation(e)};Vi.prototype.compareTo=function(e){var t=e,r=Vi.compareOriented(this._pts,this._orientation,t._pts,t._orientation);return r},Vi.prototype.interfaces_=function(){return[Sr]},Vi.prototype.getClass=function(){return Vi},Vi.orientation=function(e){return ge.increasingDirection(e)===1},Vi.compareOriented=function(e,t,r,i){for(var s=t?1:-1,o=i?1:-1,a=t?e.length:-1,l=i?r.length:-1,u=t?0:e.length-1,h=i?0:r.length-1;;){var f=e[u].compareTo(r[h]);if(f!==0)return f;u+=s,h+=o;var p=u===a,v=h===l;if(p&&!v)return-1;if(!p&&v)return 1;if(p&&v)return 0}};var Br=function(){this._edges=new W,this._ocaMap=new Tt};Br.prototype.print=function(e){var t=this;e.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=t._edges.get(r);r>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(") ")},Br.prototype.addAll=function(e){for(var t=this,r=e.iterator();r.hasNext();)t.add(r.next())},Br.prototype.findEdgeIndex=function(e){for(var t=this,r=0;r<this._edges.size();r++)if(t._edges.get(r).equals(e))return r;return-1},Br.prototype.iterator=function(){return this._edges.iterator()},Br.prototype.getEdges=function(){return this._edges},Br.prototype.get=function(e){return this._edges.get(e)},Br.prototype.findEqualEdge=function(e){var t=new Vi(e.getCoordinates()),r=this._ocaMap.get(t);return r},Br.prototype.add=function(e){this._edges.add(e);var t=new Vi(e.getCoordinates());this._ocaMap.put(t,e)},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br};var vs=function(){};vs.prototype.processIntersections=function(e,t,r,i){},vs.prototype.isDone=function(){},vs.prototype.interfaces_=function(){return[]},vs.prototype.getClass=function(){return vs};var dr=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};dr.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(dr.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},dr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},dr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},dr.prototype.getLineIntersector=function(){return this._li},dr.prototype.hasProperIntersection=function(){return this._hasProper},dr.prototype.processIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},dr.prototype.hasIntersection=function(){return this._hasIntersection},dr.prototype.isDone=function(){return!1},dr.prototype.hasInteriorIntersection=function(){return this._hasInterior},dr.prototype.interfaces_=function(){return[vs]},dr.prototype.getClass=function(){return dr},dr.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var yn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],r=arguments[2];this.coord=new M(e),this.segmentIndex=t,this.dist=r};yn.prototype.getSegmentIndex=function(){return this.segmentIndex},yn.prototype.getCoordinate=function(){return this.coord},yn.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},yn.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},yn.prototype.isEndPoint=function(e){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===e},yn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},yn.prototype.getDistance=function(){return this.dist},yn.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},yn.prototype.interfaces_=function(){return[Sr]},yn.prototype.getClass=function(){return yn};var Un=function(){this._nodeMap=new Tt,this.edge=null;var e=arguments[0];this.edge=e};Un.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();){var r=t.next();r.print(e)}},Un.prototype.iterator=function(){return this._nodeMap.values().iterator()},Un.prototype.addSplitEdges=function(e){var t=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var s=r.next(),o=t.createSplitEdge(i,s);e.add(o),i=s}},Un.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)},Un.prototype.createSplitEdge=function(e,t){var r=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),l=0;a[l++]=new M(e.coord);for(var u=e.segmentIndex+1;u<=t.segmentIndex;u++)a[l++]=r.edge.pts[u];return o&&(a[l]=t.coord),new Hu(a,new be(this.edge._label))},Un.prototype.add=function(e,t,r){var i=new yn(e,t,r),s=this._nodeMap.get(i);return s!==null?s:(this._nodeMap.put(i,i),i)},Un.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();){var r=t.next();if(r.coord.equals(e))return!0}return!1},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var ys=function(){};ys.prototype.getChainStartIndices=function(e){var t=this,r=0,i=new W;i.add(new an(r));do{var s=t.findChainEnd(e,r);i.add(new an(s)),r=s}while(r<e.length-1);var o=ys.toIntArray(i);return o},ys.prototype.findChainEnd=function(e,t){for(var r=xe.quadrant(e[t],e[t+1]),i=t+1;i<e.length;){var s=xe.quadrant(e[i-1],e[i]);if(s!==r)break;i++}return i-1},ys.prototype.interfaces_=function(){return[]},ys.prototype.getClass=function(){return ys},ys.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),r=0;r<t.length;r++)t[r]=e.get(r).intValue();return t};var gi=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new te,this.env2=new te;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new ys;this.startIndex=t.getChainStartIndices(this.pts)};gi.prototype.getCoordinates=function(){return this.pts},gi.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t>r?t:r},gi.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,r=this.pts[this.startIndex[e+1]].x;return t<r?t:r},gi.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var e=arguments[0],t=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[r],t.startIndex[r+1],i)}else if(arguments.length===6){var s=arguments[0],o=arguments[1],a=arguments[2],l=arguments[3],u=arguments[4],h=arguments[5],f=this.pts[s],p=this.pts[o],v=a.pts[l],w=a.pts[u];if(o-s===1&&u-l===1)return h.addIntersections(this.e,s,a.e,l),null;if(this.env1.init(f,p),this.env2.init(v,w),!this.env1.intersects(this.env2))return null;var I=Math.trunc((s+o)/2),T=Math.trunc((l+u)/2);s<I&&(l<T&&this.computeIntersectsForChain(s,I,a,l,T,h),T<u&&this.computeIntersectsForChain(s,I,a,T,u,h)),I<o&&(l<T&&this.computeIntersectsForChain(I,o,a,l,T,h),T<u&&this.computeIntersectsForChain(I,o,a,T,u,h))}},gi.prototype.getStartIndexes=function(){return this.startIndex},gi.prototype.computeIntersects=function(e,t){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var s=0;s<e.startIndex.length-1;s++)r.computeIntersectsForChain(i,e,s,t)},gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi};var yt=function n(){var e=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var r=0;r<3;r++)e._depth[t][r]=n.NULL_VALUE},Yf={NULL_VALUE:{configurable:!0}};yt.prototype.getDepth=function(e,t){return this._depth[e][t]},yt.prototype.setDepth=function(e,t,r){this._depth[e][t]=r},yt.prototype.isNull=function(){var e=this;if(arguments.length===0){for(var t=0;t<2;t++)for(var r=0;r<3;r++)if(e._depth[t][r]!==yt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===yt.NULL_VALUE}else if(arguments.length===2){var s=arguments[0],o=arguments[1];return this._depth[s][o]===yt.NULL_VALUE}},yt.prototype.normalize=function(){for(var e=this,t=0;t<2;t++)if(!e.isNull(t)){var r=e._depth[t][1];e._depth[t][2]<r&&(r=e._depth[t][2]),r<0&&(r=0);for(var i=1;i<3;i++){var s=0;e._depth[t][i]>r&&(s=1),e._depth[t][i]=s}}},yt.prototype.getDelta=function(e){return this._depth[e][G.RIGHT]-this._depth[e][G.LEFT]},yt.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?R.EXTERIOR:R.INTERIOR},yt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},yt.prototype.add=function(){var e=this;if(arguments.length===1)for(var t=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var s=t.getLocation(r,i);(s===R.EXTERIOR||s===R.INTERIOR)&&(e.isNull(r,i)?e._depth[r][i]=yt.depthAtLocation(s):e._depth[r][i]+=yt.depthAtLocation(s))}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2];l===R.INTERIOR&&this._depth[o][a]++}},yt.prototype.interfaces_=function(){return[]},yt.prototype.getClass=function(){return yt},yt.depthAtLocation=function(e){return e===R.EXTERIOR?0:e===R.INTERIOR?1:yt.NULL_VALUE},Yf.NULL_VALUE.get=function(){return-1},Object.defineProperties(yt,Yf);var Hu=function(n){function e(){if(n.call(this),this.pts=null,this._env=null,this.eiList=new Un(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new yt,this._depthDelta=0,arguments.length===1){var t=arguments[0];e.call(this,t,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new e(r,be.toLineLabel(this._label));return i},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(r){this._isIsolated=r},e.prototype.setName=function(r){this._name=r},e.prototype.equals=function(r){var i=this;if(!(r instanceof e))return!1;var s=r;if(this.pts.length!==s.pts.length)return!1;for(var o=!0,a=!0,l=this.pts.length,u=0;u<this.pts.length;u++)if(i.pts[u].equals2D(s.pts[u])||(o=!1),i.pts[u].equals2D(s.pts[--l])||(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 r=arguments[0];return this.pts[r]}},e.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&r.print(","),r.print(i.pts[s].x+" "+i.pts[s].y);r.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(r){e.updateIM(this._label,r)},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(r){var i=this;r.print("edge "+this._name+": ");for(var s=this.pts.length-1;s>=0;s--)r.print(i.pts[s]+" ");r.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new gi(this)),this._mce},e.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new te;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},e.prototype.addIntersection=function(r,i,s,o){var a=new M(r.getIntersection(o)),l=i,u=r.getEdgeDistance(s,o),h=l+1;if(h<this.pts.length){var f=this.pts[h];a.equals2D(f)&&(l=h,u=0)}this.eiList.add(a,l,u)},e.prototype.toString=function(){var r=this,i=new on;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var s=0;s<this.pts.length;s++)s>0&&i.append(","),i.append(r.pts[s].x+" "+r.pts[s].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},e.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var s=0;s<this.pts.length;s++)if(!i.pts[s].equals2D(r.pts[s]))return!1;return!0},e.prototype.setDepthDelta=function(r){this._depthDelta=r},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(r,i,s){for(var o=this,a=0;a<r.getIntersectionNum();a++)o.addIntersection(r,i,s,a)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,G.ON),r.getLocation(1,G.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,G.LEFT),r.getLocation(1,G.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,G.RIGHT),r.getLocation(1,G.RIGHT),2))}else return n.prototype.updateIM.apply(this,arguments)},e}(cr),At=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Br,this._bufParams=e||null};At.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},At.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(t!==null){var r=t.getLabel(),i=e.getLabel();t.isPointwiseEqual(e)||(i=new be(e.getLabel()),i.flip()),r.merge(i);var s=At.depthDelta(i),o=t.getDepthDelta(),a=o+s;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(At.depthDelta(e.getLabel()))},At.prototype.buildSubgraphs=function(e,t){for(var r=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=s.getRightmostCoordinate(),a=new ro(r),l=a.getDepth(o);s.computeDepth(l),s.findResultEdges(),r.add(s),t.add(s.getDirectedEdges(),s.getNodes())}},At.prototype.createSubgraphs=function(e){for(var t=new W,r=e.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var s=new xt;s.create(i),t.add(s)}}return Qr.sort(t,Qr.reverseOrder()),t},At.prototype.createEmptyResultGeometry=function(){var e=this._geomFact.createPolygon();return e},At.prototype.getNoder=function(e){if(this._workingNoder!==null)return this._workingNoder;var t=new Zc,r=new hs;return r.setPrecisionModel(e),t.setSegmentIntersector(new dr(r)),t},At.prototype.buffer=function(e,t){var r=this._workingPrecisionModel;r===null&&(r=e.getPrecisionModel()),this._geomFact=e.getFactory();var i=new qt(r,this._bufParams),s=new Dr(e,t,i),o=s.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new He(new Xf),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),l=new er(this._geomFact);this.buildSubgraphs(a,l);var u=l.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var h=this._geomFact.buildGeometry(u);return h},At.prototype.computeNodedEdges=function(e,t){var r=this,i=this.getNoder(t);i.computeNodes(e);for(var s=i.getNodedSubstrings(),o=s.iterator();o.hasNext();){var a=o.next(),l=a.getCoordinates();if(!(l.length===2&&l[0].equals2D(l[1]))){var u=a.getData(),h=new Hu(a.getCoordinates(),new be(u));r.insertUniqueEdge(h)}}},At.prototype.setNoder=function(e){this._workingNoder=e},At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},At.depthDelta=function(e){var t=e.getLocation(0,G.LEFT),r=e.getLocation(0,G.RIGHT);return t===R.INTERIOR&&r===R.EXTERIOR?1:t===R.EXTERIOR&&r===R.INTERIOR?-1:0},At.convertSegStrings=function(e){for(var t=new me,r=new W;e.hasNext();){var i=e.next(),s=t.createLineString(i.getCoordinates());r.add(s)}return t.buildGeometry(r)};var zi=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 r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=s,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};zi.prototype.rescale=function(){var e=this;if(ae(arguments[0],nt))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.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])&&vt.out.println(s)}},zi.prototype.scale=function(){var e=this;if(ae(arguments[0],nt)){for(var t=arguments[0],r=new W,i=t.iterator();i.hasNext();){var s=i.next();r.add(new Be(e.scale(s.getCoordinates()),s.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],a=new Array(o.length).fill(null),l=0;l<o.length;l++)a[l]=new M(Math.round((o[l].x-e._offsetX)*e._scaleFactor),Math.round((o[l].y-e._offsetY)*e._scaleFactor),o[l].z);var u=ge.removeRepeatedPoints(a);return u}},zi.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},zi.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},zi.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},zi.prototype.interfaces_=function(){return[gs]},zi.prototype.getClass=function(){return zi};var _n=function(){this._li=new hs,this._segStrings=null;var e=arguments[0];this._segStrings=e},Hf={fact:{configurable:!0}};_n.prototype.checkEndPtVertexIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next(),i=r.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 l=a.next(),u=l.getCoordinates(),h=1;h<u.length-1;h++)if(u[h].equals(s))throw new oi("found endpt/interior pt intersection at index "+h+" :pt "+s)}},_n.prototype.checkInteriorIntersections=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();)for(var r=t.next(),i=this._segStrings.iterator();i.hasNext();){var s=i.next();e.checkInteriorIntersections(r,s)}else if(arguments.length===2)for(var o=arguments[0],a=arguments[1],l=o.getCoordinates(),u=a.getCoordinates(),h=0;h<l.length-1;h++)for(var f=0;f<u.length-1;f++)e.checkInteriorIntersections(o,h,a,f);else if(arguments.length===4){var p=arguments[0],v=arguments[1],w=arguments[2],I=arguments[3];if(p===w&&v===I)return null;var T=p.getCoordinates()[v],L=p.getCoordinates()[v+1],m=w.getCoordinates()[I],_=w.getCoordinates()[I+1];if(this._li.computeIntersection(T,L,m,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,T,L)||this.hasInteriorIntersection(this._li,m,_)))throw new oi("found non-noded intersection at "+T+"-"+L+" and "+m+"-"+_)}},_n.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},_n.prototype.checkCollapses=function(){var e=this;if(arguments.length===0)for(var t=this._segStrings.iterator();t.hasNext();){var r=t.next();e.checkCollapses(r)}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])},_n.prototype.hasInteriorIntersection=function(e,t,r){for(var i=0;i<e.getIntersectionNum();i++){var s=e.getIntersection(i);if(!(s.equals(t)||s.equals(r)))return!0}return!1},_n.prototype.checkCollapse=function(e,t,r){if(e.equals(r))throw new oi("found non-noded collapse at "+_n.fact.createLineString([e,t,r]))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},Hf.fact.get=function(){return new me},Object.defineProperties(_n,Hf);var Xt=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],r=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=r,t<=0)throw new Ue("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)},Jf={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};Xt.prototype.intersectsScaled=function(e,t){var r=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<r||this._minx>i||this._maxy<s||this._miny>o;if(a)return!1;var l=this.intersectsToleranceSquare(e,t);return fe.isTrue(!(a&&l),"Found bad envelope test"),l},Xt.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)},Xt.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))},Xt.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},Xt.prototype.getCoordinate=function(){return this._originalPt},Xt.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},Xt.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var e=Xt.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new te(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},Xt.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()))},Xt.prototype.intersectsToleranceSquare=function(e,t){var r=!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()&&(r=!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())||r&&i||e.equals(this._pt)||t.equals(this._pt))},Xt.prototype.addSnappedNode=function(e,t){var r=e.getCoordinate(t),i=e.getCoordinate(t+1);return this.intersects(r,i)?(e.addIntersection(this.getCoordinate(),t),!0):!1},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Jf.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Xt,Jf);var ou=function(){this.tempEnv1=new te,this.selectedSegment=new re};ou.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)}}},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var _l=function(){this._index=null;var e=arguments[0];this._index=e},Zf={HotPixelSnapAction:{configurable:!0}};_l.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],r=arguments[1],i=arguments[2],s=t.getSafeEnvelope(),o=new Kf(t,r,i);return this._index.query(s,{interfaces_:function(){return[Fi]},visitItem:function(a){var l=a;l.select(s,o)}}),o.isNodeAdded()}},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l},Zf.HotPixelSnapAction.get=function(){return Kf},Object.defineProperties(_l,Zf);var Kf=function(n){function e(){n.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=t,this._parentEdge=r,this._hotPixelVertexIndex=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],s=r.getContext();if(this._parentEdge!==null&&s===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(s,i)}else return n.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ou),no=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new W};no.prototype.processIntersections=function(e,t,r,i){var s=this;if(e===r&&t===i)return null;var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var h=0;h<this._li.getIntersectionNum();h++)s._interiorIntersections.add(s._li.getIntersection(h));e.addIntersections(this._li,t,0),r.addIntersections(this._li,i,1)}},no.prototype.isDone=function(){return!1},no.prototype.getInteriorIntersections=function(){return this._interiorIntersections},no.prototype.interfaces_=function(){return[vs]},no.prototype.getClass=function(){return no};var Gn=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 hs,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};Gn.prototype.checkCorrectness=function(e){var t=Be.getNodedSubstrings(e),r=new _n(t);try{r.checkValid()}catch(i){if(i instanceof Df)i.printStackTrace();else throw i}finally{}},Gn.prototype.getNodedSubstrings=function(){return Be.getNodedSubstrings(this._nodedSegStrings)},Gn.prototype.snapRound=function(e,t){var r=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(r),this.computeVertexSnaps(e)},Gn.prototype.findInteriorIntersections=function(e,t){var r=new no(t);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(e),r.getInteriorIntersections()},Gn.prototype.computeVertexSnaps=function(){var e=this;if(ae(arguments[0],nt))for(var t=arguments[0],r=t.iterator();r.hasNext();){var i=r.next();e.computeVertexSnaps(i)}else if(arguments[0]instanceof Be)for(var s=arguments[0],o=s.getCoordinates(),a=0;a<o.length;a++){var l=new Xt(o[a],e._scaleFactor,e._li),u=e._pointSnapper.snap(l,s,a);u&&s.addIntersection(o[a],a)}},Gn.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new Zc,this._pointSnapper=new _l(this._noder.getIndex()),this.snapRound(e,this._li)},Gn.prototype.computeIntersectionSnaps=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),s=new Xt(i,t._scaleFactor,t._li);t._pointSnapper.snap(s)}},Gn.prototype.interfaces_=function(){return[gs]},Gn.prototype.getClass=function(){return Gn};var _t=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Ne,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],r=arguments[1];this._argGeom=t,this._bufParams=r}},wl={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};_t.prototype.bufferFixedPrecision=function(e){var t=new zi(new Gn(new Te(1)),e.getScale()),r=new At(this._bufParams);r.setWorkingPrecisionModel(e),r.setNoder(t),this._resultGeometry=r.buffer(this._argGeom,this._distance)},_t.prototype.bufferReducedPrecision=function(){var e=this;if(arguments.length===0){for(var t=_t.MAX_PRECISION_DIGITS;t>=0;t--){try{e.bufferReducedPrecision(t)}catch(o){if(o instanceof fi)e._saveException=o;else throw o}finally{}if(e._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=_t.precisionScaleFactor(this._argGeom,this._distance,r),s=new Te(i);this.bufferFixedPrecision(s)}},_t.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Te.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},_t.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},_t.prototype.bufferOriginalPrecision=function(){try{var e=new At(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof oi)this._saveException=t;else throw t}finally{}},_t.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},_t.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t},_t.bufferOp=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new _t(e),i=r.getResultGeometry(t);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof oe&&typeof arguments[1]=="number"){var s=arguments[0],o=arguments[1],a=arguments[2],l=new _t(s);l.setQuadrantSegments(a);var u=l.getResultGeometry(o);return u}else if(arguments[2]instanceof Ne&&arguments[0]instanceof oe&&typeof arguments[1]=="number"){var h=arguments[0],f=arguments[1],p=arguments[2],v=new _t(h,p),w=v.getResultGeometry(f);return w}}else if(arguments.length===4){var I=arguments[0],T=arguments[1],L=arguments[2],m=arguments[3],_=new _t(I);_.setQuadrantSegments(L),_.setEndCapStyle(m);var g=_.getResultGeometry(T);return g}},_t.precisionScaleFactor=function(e,t,r){var i=e.getEnvelopeInternal(),s=ur.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,l=Math.trunc(Math.log(a)/Math.log(10)+1),u=r-l,h=Math.pow(10,u);return h},wl.CAP_ROUND.get=function(){return Ne.CAP_ROUND},wl.CAP_BUTT.get=function(){return Ne.CAP_FLAT},wl.CAP_FLAT.get=function(){return Ne.CAP_FLAT},wl.CAP_SQUARE.get=function(){return Ne.CAP_SQUARE},wl.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(_t,wl);var Rt=function(){this._pt=[new M,new M],this._distance=ue.NaN,this._isNull=!0};Rt.prototype.getCoordinates=function(){return this._pt},Rt.prototype.getCoordinate=function(e){return this._pt[e]},Rt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}},Rt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},Rt.prototype.getDistance=function(){return this._distance},Rt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}},Rt.prototype.interfaces_=function(){return[]},Rt.prototype.getClass=function(){return Rt};var Wn=function(){};Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},Wn.computeDistance=function(){if(arguments[2]instanceof Rt&&arguments[0]instanceof Je&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=e.getCoordinates(),s=new re,o=0;o<i.length-1;o++){s.setCoordinates(i[o],i[o+1]);var a=s.closestPoint(t);r.setMinimum(a,t)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof it&&arguments[1]instanceof M){var l=arguments[0],u=arguments[1],h=arguments[2];Wn.computeDistance(l.getExteriorRing(),u,h);for(var f=0;f<l.getNumInteriorRing();f++)Wn.computeDistance(l.getInteriorRingN(f),u,h)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof oe&&arguments[1]instanceof M){var p=arguments[0],v=arguments[1],w=arguments[2];if(p instanceof Je)Wn.computeDistance(p,v,w);else if(p instanceof it)Wn.computeDistance(p,v,w);else if(p instanceof Mt)for(var I=p,T=0;T<I.getNumGeometries();T++){var L=I.getGeometryN(T);Wn.computeDistance(L,v,w)}else w.setMinimum(p.getCoordinate(),v)}else if(arguments[2]instanceof Rt&&arguments[0]instanceof re&&arguments[1]instanceof M){var m=arguments[0],_=arguments[1],g=arguments[2],y=m.closestPoint(_);g.setMinimum(y,_)}};var _s=function(e){this._maxPtDist=new Rt,this._inputGeom=e||null},Kc={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_s.prototype.computeMaxMidpointDistance=function(e){var t=new Ui(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},_s.prototype.computeMaxVertexDistance=function(e){var t=new io(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},_s.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},_s.prototype.getDistancePoints=function(){return this._maxPtDist},_s.prototype.interfaces_=function(){return[]},_s.prototype.getClass=function(){return _s},Kc.MaxPointDistanceFilter.get=function(){return io},Kc.MaxMidpointDistanceFilter.get=function(){return Ui},Object.defineProperties(_s,Kc);var io=function(e){this._maxPtDist=new Rt,this._minPtDist=new Rt,this._geom=e||null};io.prototype.filter=function(e){this._minPtDist.initialize(),Wn.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},io.prototype.getMaxPointDistance=function(){return this._maxPtDist},io.prototype.interfaces_=function(){return[An]},io.prototype.getClass=function(){return io};var Ui=function(e){this._maxPtDist=new Rt,this._minPtDist=new Rt,this._geom=e||null};Ui.prototype.filter=function(e,t){if(t===0)return null;var r=e.getCoordinate(t-1),i=e.getCoordinate(t),s=new M((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),Wn.computeDistance(this._geom,s,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ui.prototype.isDone=function(){return!1},Ui.prototype.isGeometryChanged=function(){return!1},Ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ui.prototype.interfaces_=function(){return[Zr]},Ui.prototype.getClass=function(){return Ui};var mi=function(e){this._comps=e||null};mi.prototype.filter=function(e){e instanceof it&&this._comps.add(e)},mi.prototype.interfaces_=function(){return[hn]},mi.prototype.getClass=function(){return mi},mi.getPolygons=function(){if(arguments.length===1){var e=arguments[0];return mi.getPolygons(e,new W)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof it?r.add(t):t instanceof Mt&&t.apply(new mi(r)),r}};var wt=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],r=arguments[1];this._lines=t,this._isForcedToLineString=r}};wt.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof Rn){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof Je&&this._lines.add(e)},wt.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},wt.prototype.interfaces_=function(){return[ai]},wt.prototype.getClass=function(){return wt},wt.getGeometry=function(){if(arguments.length===1){var e=arguments[0];return e.getFactory().buildGeometry(wt.getLines(e))}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t.getFactory().buildGeometry(wt.getLines(t,r))}},wt.getLines=function(){if(arguments.length===1){var e=arguments[0];return wt.getLines(e,!1)}else if(arguments.length===2){if(ae(arguments[0],nt)&&ae(arguments[1],nt)){for(var t=arguments[0],r=arguments[1],i=t.iterator();i.hasNext();){var s=i.next();wt.getLines(s,r)}return r}else if(arguments[0]instanceof oe&&typeof arguments[1]=="boolean"){var o=arguments[0],a=arguments[1],l=new W;return o.apply(new wt(l,a)),l}else if(arguments[0]instanceof oe&&ae(arguments[1],nt)){var u=arguments[0],h=arguments[1];return u instanceof Je?h.add(u):u.apply(new wt(h)),h}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ae(arguments[0],nt)&&ae(arguments[1],nt)){for(var f=arguments[0],p=arguments[1],v=arguments[2],w=f.iterator();w.hasNext();){var I=w.next();wt.getLines(I,p,v)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof oe&&ae(arguments[1],nt)){var T=arguments[0],L=arguments[1],m=arguments[2];return T.apply(new wt(L,m)),L}}};var $r=function(){if(this._boundaryRule=Pr.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 Ue("Rule must be non-null");this._boundaryRule=e}}};$r.prototype.locateInternal=function(){var e=this;if(arguments[0]instanceof M&&arguments[1]instanceof it){var t=arguments[0],r=arguments[1];if(r.isEmpty())return R.EXTERIOR;var i=r.getExteriorRing(),s=this.locateInPolygonRing(t,i);if(s===R.EXTERIOR)return R.EXTERIOR;if(s===R.BOUNDARY)return R.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var a=r.getInteriorRingN(o),l=e.locateInPolygonRing(t,a);if(l===R.INTERIOR)return R.EXTERIOR;if(l===R.BOUNDARY)return R.BOUNDARY}return R.INTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof Je){var u=arguments[0],h=arguments[1];if(!h.getEnvelopeInternal().intersects(u))return R.EXTERIOR;var f=h.getCoordinates();return!h.isClosed()&&(u.equals(f[0])||u.equals(f[f.length-1]))?R.BOUNDARY:H.isOnLine(u,f)?R.INTERIOR:R.EXTERIOR}else if(arguments[0]instanceof M&&arguments[1]instanceof jt){var p=arguments[0],v=arguments[1],w=v.getCoordinate();return w.equals2D(p)?R.INTERIOR:R.EXTERIOR}},$r.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?H.locatePointInRing(e,t.getCoordinates()):R.EXTERIOR},$r.prototype.intersects=function(e,t){return this.locate(e,t)!==R.EXTERIOR},$r.prototype.updateLocationInfo=function(e){e===R.INTERIOR&&(this._isIn=!0),e===R.BOUNDARY&&this._numBoundaries++},$r.prototype.computeLocation=function(e,t){var r=this;if(t instanceof jt&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof Je)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof it)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof ps)for(var i=t,s=0;s<i.getNumGeometries();s++){var o=i.getGeometryN(s);r.updateLocationInfo(r.locateInternal(e,o))}else if(t instanceof Fn)for(var a=t,l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);r.updateLocationInfo(r.locateInternal(e,u))}else if(t instanceof Mt)for(var h=new zn(t);h.hasNext();){var f=h.next();f!==t&&r.computeLocation(e,f)}},$r.prototype.locate=function(e,t){return t.isEmpty()?R.EXTERIOR:t instanceof Je?this.locateInternal(e,t):t instanceof it?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?R.BOUNDARY:this._numBoundaries>0||this._isIn?R.INTERIOR:R.EXTERIOR)},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r};var Ft=function n(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],t=arguments[1];n.call(this,e,n.INSIDE_AREA,t)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._component=r,this._segIndex=i,this._pt=s}},Qf={INSIDE_AREA:{configurable:!0}};Ft.prototype.isInsideArea=function(){return this._segIndex===Ft.INSIDE_AREA},Ft.prototype.getCoordinate=function(){return this._pt},Ft.prototype.getGeometryComponent=function(){return this._component},Ft.prototype.getSegmentIndex=function(){return this._segIndex},Ft.prototype.interfaces_=function(){return[]},Ft.prototype.getClass=function(){return Ft},Qf.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Ft,Qf);var Gi=function(e){this._pts=e||null};Gi.prototype.filter=function(e){e instanceof jt&&this._pts.add(e)},Gi.prototype.interfaces_=function(){return[hn]},Gi.prototype.getClass=function(){return Gi},Gi.getPoints=function(){if(arguments.length===1){var e=arguments[0];return e instanceof jt?Qr.singletonList(e):Gi.getPoints(e,new W)}else if(arguments.length===2){var t=arguments[0],r=arguments[1];return t instanceof jt?r.add(t):t instanceof Mt&&t.apply(new Gi(r)),r}};var so=function(){this._locations=null;var e=arguments[0];this._locations=e};so.prototype.filter=function(e){(e instanceof jt||e instanceof Je||e instanceof it)&&this._locations.add(new Ft(e,0,e.getCoordinate()))},so.prototype.interfaces_=function(){return[hn]},so.prototype.getClass=function(){return so},so.getLocations=function(e){var t=new W;return e.apply(new so(t)),t};var Et=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new $r,this._minDistanceLocation=null,this._minDistance=ue.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 r=arguments[0],i=arguments[1],s=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=s}};Et.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 r=arguments[0],i=arguments[1],s=1-r,o=mi.getPolygons(this._geom[r]);if(o.size()>0){var a=so.getLocations(this._geom[s]);if(this.computeContainmentDistance(a,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[s]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ae(arguments[0],Hr)&&ae(arguments[1],Hr)){for(var l=arguments[0],u=arguments[1],h=arguments[2],f=0;f<l.size();f++)for(var p=l.get(f),v=0;v<u.size();v++)if(e.computeContainmentDistance(p,u.get(v),h),e._minDistance<=e._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ft&&arguments[1]instanceof it){var w=arguments[0],I=arguments[1],T=arguments[2],L=w.getCoordinate();if(R.EXTERIOR!==this._ptLocator.locate(L,I))return this._minDistance=0,T[0]=w,T[1]=new Ft(I,L),null}}},Et.prototype.computeMinDistanceLinesPoints=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}},Et.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=wt.getLines(this._geom[0]),r=wt.getLines(this._geom[1]),i=Gi.getPoints(this._geom[0]),s=Gi.getPoints(this._geom[1]);if(this.computeMinDistanceLines(t,r,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(r,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)},Et.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Et.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])},Et.prototype.nearestPoints=function(){this.computeMinDistance();var e=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return e},Et.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 Je&&arguments[1]instanceof jt){var t=arguments[0],r=arguments[1],i=arguments[2];if(t.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var s=t.getCoordinates(),o=r.getCoordinate(),a=0;a<s.length-1;a++){var l=H.distancePointLine(o,s[a],s[a+1]);if(l<e._minDistance){e._minDistance=l;var u=new re(s[a],s[a+1]),h=u.closestPoint(o);i[0]=new Ft(t,a,h),i[1]=new Ft(r,0,o)}if(e._minDistance<=e._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Je&&arguments[1]instanceof Je){var f=arguments[0],p=arguments[1],v=arguments[2];if(f.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var w=f.getCoordinates(),I=p.getCoordinates(),T=0;T<w.length-1;T++)for(var L=0;L<I.length-1;L++){var m=H.distanceLineLine(w[T],w[T+1],I[L],I[L+1]);if(m<e._minDistance){e._minDistance=m;var _=new re(w[T],w[T+1]),g=new re(I[L],I[L+1]),y=_.closestPoints(g);v[0]=new Ft(f,T,y[0]),v[1]=new Ft(p,L,y[1])}if(e._minDistance<=e._terminateDistance)return null}}}},Et.prototype.computeMinDistancePoints=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a),u=o.getCoordinate().distance(l.getCoordinate());if(u<i._minDistance&&(i._minDistance=u,r[0]=new Ft(o,0,o.getCoordinate()),r[1]=new Ft(l,0,l.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},Et.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new Ue("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Et.prototype.computeMinDistanceLines=function(e,t,r){for(var i=this,s=0;s<e.size();s++)for(var o=e.get(s),a=0;a<t.size();a++){var l=t.get(a);if(i.computeMinDistance(o,l,r),i._minDistance<=i._terminateDistance)return null}},Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.distance=function(e,t){var r=new Et(e,t);return r.distance()},Et.isWithinDistance=function(e,t,r){var i=new Et(e,t,r);return i.distance()<=r},Et.nearestPoints=function(e,t){var r=new Et(e,t);return r.nearestPoints()};var bt=function(){this._pt=[new M,new M],this._distance=ue.NaN,this._isNull=!0};bt.prototype.getCoordinates=function(){return this._pt},bt.prototype.getCoordinate=function(e){return this._pt[e]},bt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i<this._distance&&this.initialize(t,r,i)}},bt.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 r=arguments[0],i=arguments[1],s=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=s,this._isNull=!1}},bt.prototype.toString=function(){return Yr.toLineString(this._pt[0],this._pt[1])},bt.prototype.getDistance=function(){return this._distance},bt.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],r=arguments[1];if(this._isNull)return this.initialize(t,r),null;var i=t.distance(r);i>this._distance&&this.initialize(t,r,i)}},bt.prototype.interfaces_=function(){return[]},bt.prototype.getClass=function(){return bt};var wn=function(){};wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.computeDistance=function(){if(arguments[2]instanceof bt&&arguments[0]instanceof Je&&arguments[1]instanceof M)for(var e=arguments[0],t=arguments[1],r=arguments[2],i=new re,s=e.getCoordinates(),o=0;o<s.length-1;o++){i.setCoordinates(s[o],s[o+1]);var a=i.closestPoint(t);r.setMinimum(a,t)}else if(arguments[2]instanceof bt&&arguments[0]instanceof it&&arguments[1]instanceof M){var l=arguments[0],u=arguments[1],h=arguments[2];wn.computeDistance(l.getExteriorRing(),u,h);for(var f=0;f<l.getNumInteriorRing();f++)wn.computeDistance(l.getInteriorRingN(f),u,h)}else if(arguments[2]instanceof bt&&arguments[0]instanceof oe&&arguments[1]instanceof M){var p=arguments[0],v=arguments[1],w=arguments[2];if(p instanceof Je)wn.computeDistance(p,v,w);else if(p instanceof it)wn.computeDistance(p,v,w);else if(p instanceof Mt)for(var I=p,T=0;T<I.getNumGeometries();T++){var L=I.getGeometryN(T);wn.computeDistance(L,v,w)}else w.setMinimum(p.getCoordinate(),v)}else if(arguments[2]instanceof bt&&arguments[0]instanceof re&&arguments[1]instanceof M){var m=arguments[0],_=arguments[1],g=arguments[2],y=m.closestPoint(_);g.setMinimum(y,_)}};var br=function(){this._g0=null,this._g1=null,this._ptDist=new bt,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},Qc={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};br.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},br.prototype.setDensifyFraction=function(e){if(e>1||e<=0)throw new Ue("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},br.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},br.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},br.prototype.computeOrientedDistance=function(e,t,r){var i=new oo(t);if(e.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var s=new Wi(t,this._densifyFrac);e.apply(s),r.setMaximum(s.getMaxPointDistance())}},br.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},br.distance=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new br(e,t);return r.distance()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2],a=new br(i,s);return a.setDensifyFraction(o),a.distance()}},Qc.MaxPointDistanceFilter.get=function(){return oo},Qc.MaxDensifiedByFractionDistanceFilter.get=function(){return Wi},Object.defineProperties(br,Qc);var oo=function(){this._maxPtDist=new bt,this._minPtDist=new bt,this._euclideanDist=new wn,this._geom=null;var e=arguments[0];this._geom=e};oo.prototype.filter=function(e){this._minPtDist.initialize(),wn.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},oo.prototype.getMaxPointDistance=function(){return this._maxPtDist},oo.prototype.interfaces_=function(){return[An]},oo.prototype.getClass=function(){return oo};var Wi=function(){this._maxPtDist=new bt,this._minPtDist=new bt,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};Wi.prototype.filter=function(e,t){var r=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,l=0;l<this._numSubSegs;l++){var u=i.x+l*o,h=i.y+l*a,f=new M(u,h);r._minPtDist.initialize(),wn.computeDistance(r._geom,f,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},Wi.prototype.isDone=function(){return!1},Wi.prototype.isGeometryChanged=function(){return!1},Wi.prototype.getMaxPointDistance=function(){return this._maxPtDist},Wi.prototype.interfaces_=function(){return[Zr]},Wi.prototype.getClass=function(){return Wi};var rr=function(e,t,r){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=r||null},Bc={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};rr.prototype.checkMaximumDistance=function(e,t,r){var i=new br(t,e);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){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 "+Yr.toLineString(s[0],s[1])+")"}},rr.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=rr.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(),rr.VERBOSE&&vt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},rr.prototype.checkNegativeValid=function(){if(!(this._input instanceof it||this._input instanceof Fn||this._input instanceof Mt))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)},rr.prototype.getErrorIndicator=function(){return this._errorIndicator},rr.prototype.checkMinimumDistance=function(e,t,r){var i=new Et(e,t,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){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 "+Yr.toLineString(s[0],s[1])+" )"}},rr.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)},rr.prototype.getErrorLocation=function(){return this._errorLocation},rr.prototype.getPolygonLines=function(e){for(var t=new W,r=new wt(t),i=mi.getPolygons(e),s=i.iterator();s.hasNext();){var o=s.next();o.apply(r)}return e.getFactory().buildGeometry(t)},rr.prototype.getErrorMessage=function(){return this._errMsg},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},Bc.VERBOSE.get=function(){return!1},Bc.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(rr,Bc);var St=function(e,t,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=r||null},$c={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};St.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},St.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*St.MAX_ENV_DIFF_FRAC;e===0&&(e=.001);var t=new te(this._input.getEnvelopeInternal());t.expandBy(this._distance);var r=new te(this._result.getEnvelopeInternal());r.expandBy(e),r.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},St.prototype.checkDistance=function(){var e=new rr(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")},St.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")},St.prototype.checkPolygonal=function(){this._result instanceof it||this._result instanceof Fn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},St.prototype.getErrorIndicator=function(){return this._errorIndicator},St.prototype.getErrorLocation=function(){return this._errorLocation},St.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")},St.prototype.report=function(e){if(!St.VERBOSE)return null;vt.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},St.prototype.getErrorMessage=function(){return this._errorMsg},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.isValidMsg=function(e,t,r){var i=new St(e,t,r);return i.isValid()?null:i.getErrorMessage()},St.isValid=function(e,t,r){var i=new St(e,t,r);return!!i.isValid()},$c.VERBOSE.get=function(){return!1},$c.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(St,$c);var En=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};En.prototype.getCoordinates=function(){return this._pts},En.prototype.size=function(){return this._pts.length},En.prototype.getCoordinate=function(e){return this._pts[e]},En.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},En.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:eo.octant(this.getCoordinate(e),this.getCoordinate(e+1))},En.prototype.setData=function(e){this._data=e},En.prototype.getData=function(){return this._data},En.prototype.toString=function(){return Yr.toLineString(new Qe(this._pts))},En.prototype.interfaces_=function(){return[Vn]},En.prototype.getClass=function(){return En};var ct=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};ct.prototype.getInteriorIntersection=function(){return this._interiorIntersection},ct.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},ct.prototype.getIntersectionSegments=function(){return this._intSegments},ct.prototype.count=function(){return this._intersectionCount},ct.prototype.getIntersections=function(){return this._intersections},ct.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},ct.prototype.setKeepIntersections=function(e){this._keepIntersections=e},ct.prototype.processIntersections=function(e,t,r,i){if(!this._findAllIntersections&&this.hasIntersection()||e===r&&t===i)return null;if(this._isCheckEndSegmentsOnly){var s=this.isEndSegment(e,t)||this.isEndSegment(r,i);if(!s)return null}var o=e.getCoordinates()[t],a=e.getCoordinates()[t+1],l=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(o,a,l,u),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=a,this._intSegments[2]=l,this._intSegments[3]=u,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},ct.prototype.isEndSegment=function(e,t){return t===0||t>=e.size()-2},ct.prototype.hasIntersection=function(){return this._interiorIntersection!==null},ct.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},ct.prototype.interfaces_=function(){return[vs]},ct.prototype.getClass=function(){return ct},ct.createAllIntersectionsFinder=function(e){var t=new ct(e);return t.setFindAllIntersections(!0),t},ct.createAnyIntersectionFinder=function(e){return new ct(e)},ct.createIntersectionCounter=function(e){var t=new ct(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var jr=function(){this._li=new hs,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};jr.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new ct(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Zc;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new fi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Yr.toLineString(e[0],e[1])+" and "+Yr.toLineString(e[2],e[3])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(e){var t=new jr(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var ws=function n(){this._nv=null;var e=arguments[0];this._nv=new jr(n.toSegmentStrings(e))};ws.prototype.checkValid=function(){this._nv.checkValid()},ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws},ws.toSegmentStrings=function(e){for(var t=new W,r=e.iterator();r.hasNext();){var i=r.next();t.add(new En(i.getCoordinates(),i))}return t},ws.checkValid=function(e){var t=new ws(e);t.checkValid()};var ao=function(e){this._mapOp=e};ao.prototype.map=function(e){for(var t=this,r=new W,i=0;i<e.getNumGeometries();i++){var s=t._mapOp.map(e.getGeometryN(i));s.isEmpty()||r.add(s)}return e.getFactory().createGeometryCollection(me.toGeometryArray(r))},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.map=function(e,t){var r=new ao(t);return r.map(e)};var Sn=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],r=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=r};Sn.prototype.collectLines=function(e){for(var t=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();t.collectLineEdge(i,e,t._lineEdgesList),t.collectBoundaryTouchEdge(i,e,t._lineEdgesList)}},Sn.prototype.labelIsolatedLine=function(e,t){var r=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,r)},Sn.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},Sn.prototype.collectLineEdge=function(e,t,r){var i=e.getLabel(),s=e.getEdge();e.isLineEdge()&&!e.isVisited()&&he.isResultOfOp(i,t)&&!s.isCovered()&&(r.add(s),e.setVisitedEdge(!0))},Sn.prototype.findCoveredLineEdges=function(){for(var e=this,t=this._op.getGraph().getNodes().iterator();t.hasNext();){var r=t.next();r.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)}}},Sn.prototype.labelIsolatedLines=function(e){for(var t=this,r=e.iterator();r.hasNext();){var i=r.next(),s=i.getLabel();i.isIsolated()&&(s.isNull(0)?t.labelIsolatedLine(i,0):t.labelIsolatedLine(i,1))}},Sn.prototype.buildLines=function(e){for(var t=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),s=t._geometryFactory.createLineString(i.getCoordinates());t._resultLineList.add(s),i.setInResult(!0)}},Sn.prototype.collectBoundaryTouchEdge=function(e,t,r){var i=e.getLabel();if(e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult())return null;fe.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),he.isResultOfOp(i,t)&&t===he.INTERSECTION&&(r.add(e.getEdge()),e.setVisitedEdge(!0))},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn};var lo=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new W;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};lo.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var r=this._geometryFactory.createPoint(t);this._resultPointList.add(r)}},lo.prototype.extractNonCoveredResultNodes=function(e){for(var t=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||e===he.INTERSECTION)){var s=i.getLabel();he.isResultOfOp(s,e)&&t.filterCoveredNodeToPoint(i)}}},lo.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var Yt=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Yt.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},Yt.prototype.transformPolygon=function(e,t){var r=this,i=!0,s=this.transformLinearRing(e.getExteriorRing(),e);(s===null||!(s instanceof Rn)||s.isEmpty())&&(i=!1);for(var o=new W,a=0;a<e.getNumInteriorRing();a++){var l=r.transformLinearRing(e.getInteriorRingN(a),e);l===null||l.isEmpty()||(l instanceof Rn||(i=!1),o.add(l))}if(i)return this._factory.createPolygon(s,o.toArray([]));var u=new W;return s!==null&&u.add(s),u.addAll(o),this._factory.buildGeometry(u)},Yt.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},Yt.prototype.getInputGeometry=function(){return this._inputGeom},Yt.prototype.transformMultiLineString=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformLineString(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.transformCoordinates=function(e,t){return this.copy(e)},Yt.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},Yt.prototype.transformMultiPoint=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformPoint(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.transformMultiPolygon=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transformPolygon(e.getGeometryN(s),e);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},Yt.prototype.copy=function(e){return e.copy()},Yt.prototype.transformGeometryCollection=function(e,t){for(var r=this,i=new W,s=0;s<e.getNumGeometries();s++){var o=r.transform(e.getGeometryN(s));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(me.toGeometryArray(i)):this._factory.buildGeometry(i)},Yt.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof jt)return this.transformPoint(e,null);if(e instanceof pl)return this.transformMultiPoint(e,null);if(e instanceof Rn)return this.transformLinearRing(e,null);if(e instanceof Je)return this.transformLineString(e,null);if(e instanceof ps)return this.transformMultiLineString(e,null);if(e instanceof it)return this.transformPolygon(e,null);if(e instanceof Fn)return this.transformMultiPolygon(e,null);if(e instanceof Mt)return this.transformGeometryCollection(e,null);throw new Ue("Unknown Geometry subtype: "+e.getClass().getName())},Yt.prototype.transformLinearRing=function(e,t){var r=this.transformCoordinates(e.getCoordinateSequence(),e);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var qn=function n(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new re,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Je&&typeof arguments[1]=="number"){var e=arguments[0],t=arguments[1];n.call(this,e.getCoordinates(),t)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=n.isClosed(r),this._snapTolerance=i}};qn.prototype.snapVertices=function(e,t){for(var r=this,i=this._isClosed?e.size()-1:e.size(),s=0;s<i;s++){var o=e.get(s),a=r.findSnapForVertex(o,t);a!==null&&(e.set(s,new M(a)),s===0&&r._isClosed&&e.set(e.size()-1,new M(a)))}},qn.prototype.findSnapForVertex=function(e,t){for(var r=this,i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<r._snapTolerance)return t[i]}return null},qn.prototype.snapTo=function(e){var t=new Hl(this._srcPts);this.snapVertices(t,e),this.snapSegments(t,e);var r=t.toCoordinateArray();return r},qn.prototype.snapSegments=function(e,t){var r=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=r.findSegmentIndexToSnap(o,e);a>=0&&e.add(a+1,new M(o),!1)}},qn.prototype.findSegmentIndexToSnap=function(e,t){for(var r=this,i=ue.MAX_VALUE,s=-1,o=0;o<t.size()-1;o++){if(r._seg.p0=t.get(o),r._seg.p1=t.get(o+1),r._seg.p0.equals2D(e)||r._seg.p1.equals2D(e)){if(r._allowSnappingToSourceVertices)continue;return-1}var a=r._seg.distance(e);a<r._snapTolerance&&a<i&&(i=a,s=o)}return s},qn.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},qn.isClosed=function(e){return e.length<=1?!1:e[0].equals2D(e[e.length-1])};var $e=function(e){this._srcGeom=e||null},Bf={SNAP_PRECISION_FACTOR:{configurable:!0}};$e.prototype.snapTo=function(e,t){var r=this.extractTargetCoordinates(e),i=new $f(t,r);return i.transform(this._srcGeom)},$e.prototype.snapToSelf=function(e,t){var r=this.extractTargetCoordinates(this._srcGeom),i=new $f(e,r,!0),s=i.transform(this._srcGeom),o=s;return t&&ae(o,Ri)&&(o=s.buffer(0)),o},$e.prototype.computeSnapTolerance=function(e){var t=this.computeMinimumSegmentLength(e),r=t/10;return r},$e.prototype.extractTargetCoordinates=function(e){for(var t=new cn,r=e.getCoordinates(),i=0;i<r.length;i++)t.add(r[i]);return t.toArray(new Array(0).fill(null))},$e.prototype.computeMinimumSegmentLength=function(e){for(var t=ue.MAX_VALUE,r=0;r<e.length-1;r++){var i=e[r].distance(e[r+1]);i<t&&(t=i)}return t},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e},$e.snap=function(e,t,r){var i=new Array(2).fill(null),s=new $e(e);i[0]=s.snapTo(t,r);var o=new $e(t);return i[1]=o.snapTo(i[0],r),i},$e.computeOverlaySnapTolerance=function(){if(arguments.length===1){var e=arguments[0],t=$e.computeSizeBasedSnapTolerance(e),r=e.getPrecisionModel();if(r.getType()===Te.FIXED){var i=1/r.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($e.computeOverlaySnapTolerance(s),$e.computeOverlaySnapTolerance(o))}},$e.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal(),r=Math.min(t.getHeight(),t.getWidth()),i=r*$e.SNAP_PRECISION_FACTOR;return i},$e.snapToSelf=function(e,t,r){var i=new $e(e);return i.snapToSelf(t,r)},Bf.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties($e,Bf);var $f=function(n){function e(t,r,i){n.call(this),this._snapTolerance=t||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(r,i){var s=new qn(r,this._snapTolerance);return s.setAllowSnappingToSourceVertices(this._isSelfSnap),s.snapTo(i)},e.prototype.transformCoordinates=function(r,i){var s=r.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}(Yt),kt=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};kt.prototype.getCommon=function(){return ue.longBitsToDouble(this._commonBits)},kt.prototype.add=function(e){var t=ue.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=kt.signExpBits(this._commonBits),this._isFirst=!1,null;var r=kt.signExpBits(t);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=kt.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=kt.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},kt.prototype.toString=function(){if(arguments.length===1){var e=arguments[0],t=ue.longBitsToDouble(e),r=ue.toBinaryString(e),i="0000000000000000000000000000000000000000000000000000000000000000"+r,s=i.substring(i.length-64),o=s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+t+" ]";return o}},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.getBit=function(e,t){var r=1<<t;return(e&r)!==0?1:0},kt.signExpBits=function(e){return e>>52},kt.zeroLowerBits=function(e,t){var r=(1<<t)-1,i=~r,s=e&i;return s},kt.numCommonMostSigMantissaBits=function(e,t){for(var r=0,i=52;i>=0;i--){if(kt.getBit(e,i)!==kt.getBit(t,i))return r;r++}return 52};var qi=function(){this._commonCoord=null,this._ccFilter=new uo},jc={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};qi.prototype.addCommonBits=function(e){var t=new Xi(this._commonCoord);e.apply(t),e.geometryChanged()},qi.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 r=new Xi(t);return e.apply(r),e.geometryChanged(),e},qi.prototype.getCommonCoordinate=function(){return this._commonCoord},qi.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi},jc.CommonCoordinateFilter.get=function(){return uo},jc.Translater.get=function(){return Xi},Object.defineProperties(qi,jc);var uo=function(){this._commonBitsX=new kt,this._commonBitsY=new kt};uo.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},uo.prototype.getCommonCoordinate=function(){return new M(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},uo.prototype.interfaces_=function(){return[An]},uo.prototype.getClass=function(){return uo};var Xi=function(){this.trans=null;var e=arguments[0];this.trans=e};Xi.prototype.filter=function(e,t){var r=e.getOrdinate(t,0)+this.trans.x,i=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,r),e.setOrdinate(t,1,i)},Xi.prototype.isDone=function(){return!1},Xi.prototype.isGeometryChanged=function(){return!0},Xi.prototype.interfaces_=function(){return[Zr]},Xi.prototype.getClass=function(){return Xi};var ht=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()};ht.prototype.selfSnap=function(e){var t=new $e(e),r=t.snapTo(e,this._snapTolerance);return r},ht.prototype.removeCommonBits=function(e){this._cbr=new qi,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},ht.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},ht.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),r=he.overlayOp(t[0],t[1],e);return this.prepareResult(r)},ht.prototype.checkValid=function(e){e.isValid()||vt.out.println("Snapped geometry is invalid")},ht.prototype.computeSnapTolerance=function(){this._snapTolerance=$e.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ht.prototype.snap=function(e){var t=this.removeCommonBits(e),r=$e.snap(t[0],t[1],this._snapTolerance);return r},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.overlayOp=function(e,t,r){var i=new ht(e,t);return i.getResultGeometry(r)},ht.union=function(e,t){return ht.overlayOp(e,t,he.UNION)},ht.intersection=function(e,t){return ht.overlayOp(e,t,he.INTERSECTION)},ht.symDifference=function(e,t){return ht.overlayOp(e,t,he.SYMDIFFERENCE)},ht.difference=function(e,t){return ht.overlayOp(e,t,he.DIFFERENCE)};var Vt=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};Vt.prototype.getResultGeometry=function(e){var t=null,r=!1,i=null;try{t=he.overlayOp(this._geom[0],this._geom[1],e);var s=!0;s&&(r=!0)}catch(o){if(o instanceof oi)i=o;else throw o}finally{}if(!r)try{t=ht.overlayOp(this._geom[0],this._geom[1],e)}catch(o){throw o instanceof oi?i:o}finally{}return t},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.overlayOp=function(e,t,r){var i=new Vt(e,t);return i.getResultGeometry(r)},Vt.union=function(e,t){return Vt.overlayOp(e,t,he.UNION)},Vt.intersection=function(e,t){return Vt.overlayOp(e,t,he.INTERSECTION)},Vt.symDifference=function(e,t){return Vt.overlayOp(e,t,he.SYMDIFFERENCE)},Vt.difference=function(e,t){return Vt.overlayOp(e,t,he.DIFFERENCE)};var au=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};au.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},au.prototype.interfaces_=function(){return[]},au.prototype.getClass=function(){return au};var nr=function n(){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=n.DELETE,this._xValue=e,this._insertEvent=t}else if(arguments.length===3){var r=arguments[0],i=arguments[1],s=arguments[2];this._eventType=n.INSERT,this._label=r,this._xValue=i,this._obj=s}},eh={INSERT:{configurable:!0},DELETE:{configurable:!0}};nr.prototype.isDelete=function(){return this._eventType===nr.DELETE},nr.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},nr.prototype.getObject=function(){return this._obj},nr.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},nr.prototype.getInsertEvent=function(){return this._insertEvent},nr.prototype.isInsert=function(){return this._eventType===nr.INSERT},nr.prototype.isSameLabel=function(e){return this._label===null?!1:this._label===e._label},nr.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},nr.prototype.interfaces_=function(){return[Sr]},nr.prototype.getClass=function(){return nr},eh.INSERT.get=function(){return 1},eh.DELETE.get=function(){return 2},Object.defineProperties(nr,eh);var Ju=function(){};Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju};var Ct=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],r=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=r};Ct.prototype.isTrivialIntersection=function(e,t,r,i){if(e===r&&this._li.getIntersectionNum()===1){if(Ct.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},Ct.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ct.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},Ct.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ct.prototype.isBoundaryPointInternal=function(e,t){for(var r=t.iterator();r.hasNext();){var i=r.next(),s=i.getCoordinate();if(e.isIntersection(s))return!0}return!1},Ct.prototype.hasProperIntersection=function(){return this._hasProper},Ct.prototype.hasIntersection=function(){return this._hasIntersection},Ct.prototype.isDone=function(){return this._isDone},Ct.prototype.isBoundaryPoint=function(e,t){return t===null?!1:!!(this.isBoundaryPointInternal(e,t[0])||this.isBoundaryPointInternal(e,t[1]))},Ct.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},Ct.prototype.addIntersections=function(e,t,r,i){if(e===r&&t===i)return null;this.numTests++;var s=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(s,o,a,l),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(e.addIntersections(this._li,t,0),r.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))))},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isAdjacentSegments=function(e,t){return Math.abs(e-t)===1};var iv=function(n){function e(){n.call(this),this.events=new W,this.nOverlaps=null}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var r=this;Qr.sort(this.events);for(var i=0;i<this.events.size();i++){var s=r.events.get(i);s.isDelete()&&s.getInsertEvent().setDeleteEventIndex(i)}},e.prototype.computeIntersections=function(){var r=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=r.events.get(s);if(o.isInsert()&&r.processOverlaps(s,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Ct&&ae(arguments[0],Hr)&&ae(arguments[1],Hr)){var a=arguments[0],l=arguments[1],u=arguments[2];this.addEdges(a,a),this.addEdges(l,l),this.computeIntersections(u)}else if(typeof arguments[2]=="boolean"&&ae(arguments[0],Hr)&&arguments[1]instanceof Ct){var h=arguments[0],f=arguments[1],p=arguments[2];p?this.addEdges(h,null):this.addEdges(h),this.computeIntersections(f)}}},e.prototype.addEdge=function(r,i){for(var s=this,o=r.getMonotoneChainEdge(),a=o.getStartIndexes(),l=0;l<a.length-1;l++){var u=new au(o,l),h=new nr(i,o.getMinX(l),u);s.events.add(h),s.events.add(new nr(o.getMaxX(l),h))}},e.prototype.processOverlaps=function(r,i,s,o){for(var a=this,l=s.getObject(),u=r;u<i;u++){var h=a.events.get(u);if(h.isInsert()){var f=h.getObject();s.isSameLabel(h)||(l.computeIntersections(f,o),a.nOverlaps++)}}},e.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],s=i.iterator();s.hasNext();){var o=s.next();r.addEdge(o,o)}else if(arguments.length===2)for(var a=arguments[0],l=arguments[1],u=a.iterator();u.hasNext();){var h=u.next();r.addEdge(h,l)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ju),Xn=function(){this._min=ue.POSITIVE_INFINITY,this._max=ue.NEGATIVE_INFINITY},jf={NodeComparator:{configurable:!0}};Xn.prototype.getMin=function(){return this._min},Xn.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},Xn.prototype.getMax=function(){return this._max},Xn.prototype.toString=function(){return Yr.toLineString(new M(this._min,0),new M(this._max,0))},Xn.prototype.interfaces_=function(){return[]},Xn.prototype.getClass=function(){return Xn},jf.NodeComparator.get=function(){return lu},Object.defineProperties(Xn,jf);var lu=function(){};lu.prototype.compare=function(e,t){var r=e,i=t,s=(r._min+r._max)/2,o=(i._min+i._max)/2;return s<o?-1:s>o?1:0},lu.prototype.interfaces_=function(){return[nl]},lu.prototype.getClass=function(){return lu};var sv=function(n){function e(){n.call(this),this._item=null;var t=arguments[0],r=arguments[1],i=arguments[2];this._min=t,this._max=r,this._item=i}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;s.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xn),ov=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var t=arguments[0],r=arguments[1];this._node1=t,this._node2=r,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},e.prototype.query=function(r,i,s){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,s),this._node2!==null&&this._node2.query(r,i,s)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xn),Yn=function(){this._leaves=new W,this._root=null,this._level=0};Yn.prototype.buildTree=function(){var e=this;Qr.sort(this._leaves,new Xn.NodeComparator);for(var t=this._leaves,r=null,i=new W;;){if(e.buildLevel(t,i),i.size()===1)return i.get(0);r=t,t=i,i=r}},Yn.prototype.insert=function(e,t,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new sv(e,t,r))},Yn.prototype.query=function(e,t,r){this.init(),this._root.query(e,t,r)},Yn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Yn.prototype.printNode=function(e){vt.out.println(Yr.toLineString(new M(e._min,this._level),new M(e._max,this._level)))},Yn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Yn.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var r=0;r<e.size();r+=2){var i=e.get(r),s=r+1<e.size()?e.get(r):null;if(s===null)t.add(i);else{var o=new ov(e.get(r),e.get(r+1));t.add(o)}}},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var El=function(){this._items=new W};El.prototype.visitItem=function(e){this._items.add(e)},El.prototype.getItems=function(){return this._items},El.prototype.interfaces_=function(){return[Fi]},El.prototype.getClass=function(){return El};var Sl=function(){this._index=null;var e=arguments[0];if(!ae(e,Ri))throw new Ue("Argument must be Polygonal");this._index=new Es(e)},th={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Sl.prototype.locate=function(e){var t=new un(e),r=new Cl(t);return this._index.query(e.y,e.y,r),t.getLocation()},Sl.prototype.interfaces_=function(){return[yl]},Sl.prototype.getClass=function(){return Sl},th.SegmentVisitor.get=function(){return Cl},th.IntervalIndexedGeometry.get=function(){return Es},Object.defineProperties(Sl,th);var Cl=function(){this._counter=null;var e=arguments[0];this._counter=e};Cl.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Cl.prototype.interfaces_=function(){return[Fi]},Cl.prototype.getClass=function(){return Cl};var Es=function(){this._index=new Yn;var e=arguments[0];this.init(e)};Es.prototype.init=function(e){for(var t=this,r=wt.getLines(e),i=r.iterator();i.hasNext();){var s=i.next(),o=s.getCoordinates();t.addLine(o)}},Es.prototype.addLine=function(e){for(var t=this,r=1;r<e.length;r++){var i=new re(e[r-1],e[r]),s=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);t._index.insert(s,o,i)}},Es.prototype.query=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new El;return this._index.query(e,t,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];this._index.query(i,s,o)}},Es.prototype.interfaces_=function(){return[]},Es.prototype.getClass=function(){return Es};var uu=function(n){function e(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new Af,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new $r,arguments.length===2){var t=arguments[0],r=arguments[1],i=Pr.OGC_SFS_BOUNDARY_RULE;this._argIndex=t,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}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 n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(r,i){var s=this._nodes.addNode(i),o=s.getLabel(),a=1,l=R.NONE;l=o.getLocation(r,G.ON),l===R.BOUNDARY&&a++;var u=e.determineBoundary(this._boundaryNodeRule,a);o.setLocation(r,u)},e.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var s=arguments[0],o=arguments[1],a=arguments[2],l=new Ct(s,!0,!1);l.setIsDoneIfProperInt(a);var u=this.createEdgeSetIntersector(),h=this._parentGeom instanceof Rn||this._parentGeom instanceof it||this._parentGeom instanceof Fn,f=o||!h;return u.computeIntersections(this._edges,l,f),this.addSelfIntersectionNodes(this._argIndex),l}},e.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var s=i.next();s.eiList.addSplitEdges(r)}},e.prototype.computeEdgeIntersections=function(r,i,s){var o=new Ct(i,s,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,r._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 jt){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,R.INTERIOR)}else if(arguments[0]instanceof M){var s=arguments[0];this.insertPoint(this._argIndex,s,R.INTERIOR)}},e.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),R.EXTERIOR,R.INTERIOR);for(var s=0;s<r.getNumInteriorRing();s++){var o=r.getInteriorRingN(s);i.addPolygonRing(o,R.INTERIOR,R.EXTERIOR)}},e.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],R.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],R.BOUNDARY)},e.prototype.addLineString=function(r){var i=ge.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var s=new Hu(i,new be(this._argIndex,R.INTERIOR));this._lineEdgeMap.put(r,s),this.insertEdge(s),fe.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 r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),s=0,o=r.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(r,i,s){if(this.isBoundaryNode(r,i))return null;s===R.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,s)},e.prototype.addPolygonRing=function(r,i,s){if(r.isEmpty())return null;var o=ge.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var a=i,l=s;H.isCCW(o)&&(a=s,l=i);var u=new Hu(o,new be(this._argIndex,R.BOUNDARY,a,l));this._lineEdgeMap.put(r,u),this.insertEdge(u),this.insertPoint(this._argIndex,o[0],R.BOUNDARY)},e.prototype.insertPoint=function(r,i,s){var o=this._nodes.addNode(i),a=o.getLabel();a===null?o._label=new be(r,s):a.setLocation(r,s)},e.prototype.createEdgeSetIntersector=function(){return new iv},e.prototype.addSelfIntersectionNodes=function(r){for(var i=this,s=this._edges.iterator();s.hasNext();)for(var o=s.next(),a=o.getLabel().getLocation(r),l=o.eiList.iterator();l.hasNext();){var u=l.next();i.addSelfIntersectionNode(r,u.coord,a)}},e.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Fn&&(this._useBoundaryDeterminationRule=!1),r instanceof it)this.addPolygon(r);else if(r instanceof Je)this.addLineString(r);else if(r instanceof jt)this.addPoint(r);else if(r instanceof pl)this.addCollection(r);else if(r instanceof ps)this.addCollection(r);else if(r instanceof Fn)this.addCollection(r);else if(r instanceof Mt)this.addCollection(r);else throw new Error(r.getClass().getName())}else return n.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(r){for(var i=this,s=0;s<r.getNumGeometries();s++){var o=r.getGeometryN(s);i.add(o)}},e.prototype.locate=function(r){return ae(this._parentGeom,Ri)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Sl(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return n.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(r,i){return r.isInBoundary(i)?R.BOUNDARY:R.INTERIOR},e}(He),Pl=function(){if(this._li=new hs,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 uu(0,e)}else if(arguments.length===2){var t=arguments[0],r=arguments[1],i=Pr.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new uu(0,t,i),this._arg[1]=new uu(1,r,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 uu(0,s,a),this._arg[1]=new uu(1,o,a)}};Pl.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Pl.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Pl.prototype.interfaces_=function(){return[]},Pl.prototype.getClass=function(){return Pl};var Ss=function(){};Ss.prototype.interfaces_=function(){return[]},Ss.prototype.getClass=function(){return Ss},Ss.map=function(){if(arguments[0]instanceof oe&&ae(arguments[1],Ss.MapOp)){for(var e=arguments[0],t=arguments[1],r=new W,i=0;i<e.getNumGeometries();i++){var s=t.map(e.getGeometryN(i));s!==null&&r.add(s)}return e.getFactory().buildGeometry(r)}else if(ae(arguments[0],nt)&&ae(arguments[1],Ss.MapOp)){for(var o=arguments[0],a=arguments[1],l=new W,u=o.iterator();u.hasNext();){var h=u.next(),f=a.map(h);f!==null&&l.add(f)}return l}},Ss.MapOp=function(){};var he=function(n){function e(){var t=arguments[0],r=arguments[1];n.call(this,t,r),this._ptLocator=new $r,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Br,this._resultPolyList=new W,this._resultLineList=new W,this._resultPointList=new W,this._graph=new He(new Xf),this._geomFact=t.getFactory()}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var s=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new be(r.getLabel()),o.flip());var a=i.getDepth();a.isNull()&&a.add(s),a.add(o),s.merge(o)}else this._edgeList.add(r)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),s=i.getSym();i.isInResult()&&s.isInResult()&&(i.setInResult(!1),s.setInResult(!1))}},e.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},e.prototype.computeGeometry=function(r,i,s,o){var a=new W;return a.addAll(r),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 r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},e.prototype.isCovered=function(r,i){for(var s=this,o=i.iterator();o.hasNext();){var a=o.next(),l=s._ptLocator.locate(r,a);if(l!==R.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var r=new W,i=this._edgeList.iterator();i.hasNext();){var s=i.next();s.isCollapsed()&&(i.remove(),r.add(s.getCollapsedEdge()))}this._edgeList.addAll(r)},e.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),s=i.getEdges().getLabel();i.getLabel().merge(s)}},e.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},e.prototype.insertUniqueEdges=function(r){for(var i=this,s=r.iterator();s.hasNext();){var o=s.next();i.insertUniqueEdge(o)}},e.prototype.computeOverlay=function(r){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(),ws.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var s=new er(this._geomFact);s.add(this._graph),this._resultPolyList=s.getPolygons();var o=new Sn(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var a=new lo(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},e.prototype.labelIncompleteNode=function(r,i){var s=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,s)},e.prototype.copyPoints=function(r){for(var i=this,s=this._arg[r].getNodeIterator();s.hasNext();){var o=s.next(),a=i._graph.addNode(o.getCoordinate());a.setLabel(r,o.getLabel().getLocation(r))}},e.prototype.findResultAreaEdges=function(r){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,G.RIGHT),o.getLocation(1,G.RIGHT),r)&&s.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.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):(fe.isTrue(!o.isNull(a,G.LEFT),"depth of LEFT side has not been initialized"),s.setLocation(a,G.LEFT,o.getLocation(a,G.LEFT)),fe.isTrue(!o.isNull(a,G.RIGHT),"depth of RIGHT side has not been initialized"),s.setLocation(a,G.RIGHT,o.getLocation(a,G.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next();s.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var s=i.next(),o=s.getLabel();s.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(s,0):r.labelIncompleteNode(s,1)),s.getEdges().updateLabelling(o)}},e.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Pl);he.overlayOp=function(n,e,t){var r=new he(n,e),i=r.getResultGeometry(t);return i},he.intersection=function(n,e){if(n.isEmpty()||e.isEmpty())return he.createEmptyResult(he.INTERSECTION,n,e,n.getFactory());if(n.isGeometryCollection()){var t=e;return ao.map(n,{interfaces_:function(){return[Ss.MapOp]},map:function(r){return r.intersection(t)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.INTERSECTION)},he.symDifference=function(n,e){if(n.isEmpty()||e.isEmpty()){if(n.isEmpty()&&e.isEmpty())return he.createEmptyResult(he.SYMDIFFERENCE,n,e,n.getFactory());if(n.isEmpty())return e.copy();if(e.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.SYMDIFFERENCE)},he.resultDimension=function(n,e,t){var r=e.getDimension(),i=t.getDimension(),s=-1;switch(n){case he.INTERSECTION:s=Math.min(r,i);break;case he.UNION:s=Math.max(r,i);break;case he.DIFFERENCE:s=r;break;case he.SYMDIFFERENCE:s=Math.max(r,i);break}return s},he.createEmptyResult=function(n,e,t,r){var i=null;switch(he.resultDimension(n,e,t)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},he.difference=function(n,e){return n.isEmpty()?he.createEmptyResult(he.DIFFERENCE,n,e,n.getFactory()):e.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(e),Vt.overlayOp(n,e,he.DIFFERENCE))},he.isResultOfOp=function(){if(arguments.length===2){var n=arguments[0],e=arguments[1],t=n.getLocation(0),r=n.getLocation(1);return he.isResultOfOp(t,r,e)}else if(arguments.length===3){var i=arguments[0],s=arguments[1],o=arguments[2];switch(i===R.BOUNDARY&&(i=R.INTERIOR),s===R.BOUNDARY&&(s=R.INTERIOR),o){case he.INTERSECTION:return i===R.INTERIOR&&s===R.INTERIOR;case he.UNION:return i===R.INTERIOR||s===R.INTERIOR;case he.DIFFERENCE:return i===R.INTERIOR&&s!==R.INTERIOR;case he.SYMDIFFERENCE:return i===R.INTERIOR&&s!==R.INTERIOR||i!==R.INTERIOR&&s===R.INTERIOR}return!1}},he.INTERSECTION=1,he.UNION=2,he.DIFFERENCE=3,he.SYMDIFFERENCE=4;var Yi=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new $r,this._seg=new re;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};Yi.prototype.isWithinToleranceOfBoundary=function(e){for(var t=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=t._linework.getGeometryN(r),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},Yi.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?R.BOUNDARY:this._ptLocator.locate(e,this._g)},Yi.prototype.extractLinework=function(e){var t=new Il;e.apply(t);var r=t.getLinework(),i=me.toLineStringArray(r);return e.getFactory().createMultiLineString(i)},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi};var Il=function(){this._linework=null,this._linework=new W};Il.prototype.getLinework=function(){return this._linework},Il.prototype.filter=function(e){var t=this;if(e instanceof it){var r=e;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)t._linework.add(r.getInteriorRingN(i))}},Il.prototype.interfaces_=function(){return[hn]},Il.prototype.getClass=function(){return Il};var Cs=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};Cs.prototype.extractPoints=function(e,t,r){for(var i=this,s=e.getCoordinates(),o=0;o<s.length-1;o++)i.computeOffsetPoints(s[o],s[o+1],t,r)},Cs.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},Cs.prototype.getPoints=function(e){for(var t=this,r=new W,i=wt.getLines(this._g),s=i.iterator();s.hasNext();){var o=s.next();t.extractPoints(o,e,r)}return r},Cs.prototype.computeOffsetPoints=function(e,t,r,i){var s=t.x-e.x,o=t.y-e.y,a=Math.sqrt(s*s+o*o),l=r*s/a,u=r*o/a,h=(t.x+e.x)/2,f=(t.y+e.y)/2;if(this._doLeft){var p=new M(h-u,f+l);i.add(p)}if(this._doRight){var v=new M(h+u,f-l);i.add(v)}},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs};var pr=function n(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=n.TOLERANCE,this._testCoords=new W;var e=arguments[0],t=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(e,t),this._geom=[e,t,r],this._locFinder=[new Yi(this._geom[0],this._boundaryDistanceTolerance),new Yi(this._geom[1],this._boundaryDistanceTolerance),new Yi(this._geom[2],this._boundaryDistanceTolerance)]},ed={TOLERANCE:{configurable:!0}};pr.prototype.reportResult=function(e,t,r){vt.out.println("Overlay result invalid - A:"+R.toLocationSymbol(t[0])+" B:"+R.toLocationSymbol(t[1])+" expected:"+(r?"i":"e")+" actual:"+R.toLocationSymbol(t[2]))},pr.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},pr.prototype.checkValid=function(){var e=this;if(arguments.length===1){for(var t=arguments[0],r=0;r<this._testCoords.size();r++){var i=e._testCoords.get(r);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),pr.hasLocation(this._location,R.BOUNDARY)?!0:this.isValidResult(s,this._location)}},pr.prototype.addTestPts=function(e){var t=new Cs(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},pr.prototype.isValidResult=function(e,t){var r=he.isResultOfOp(t[0],t[1],e),i=t[2]===R.INTERIOR,s=!(r^i);return s||this.reportResult(e,t,r),s},pr.prototype.getInvalidLocation=function(){return this._invalidLocation},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},pr.hasLocation=function(e,t){for(var r=0;r<3;r++)if(e[r]===t)return!0;return!1},pr.computeBoundaryDistanceTolerance=function(e,t){return Math.min($e.computeSizeBasedSnapTolerance(e),$e.computeSizeBasedSnapTolerance(t))},pr.isValid=function(e,t,r,i){var s=new pr(e,t,i);return s.isValid(r)},ed.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(pr,ed);var gr=function n(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=n.extractFactory(e),this._inputGeoms=e};gr.prototype.extractElements=function(e,t){var r=this;if(e===null)return null;for(var i=0;i<e.getNumGeometries();i++){var s=e.getGeometryN(i);r._skipEmpty&&s.isEmpty()||t.add(s)}},gr.prototype.combine=function(){for(var e=this,t=new W,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();e.extractElements(i,t)}return t.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.combine=function(){if(arguments.length===1){var e=arguments[0],t=new gr(e);return t.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],s=new gr(gr.createList(r,i));return s.combine()}else if(arguments.length===3){var o=arguments[0],a=arguments[1],l=arguments[2],u=new gr(gr.createList(o,a,l));return u.combine()}},gr.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},gr.createList=function(){if(arguments.length===2){var e=arguments[0],t=arguments[1],r=new W;return r.add(e),r.add(t),r}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 tt=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,this._inputPolys===null&&(this._inputPolys=new W)},td={STRTREE_NODE_CAPACITY:{configurable:!0}};tt.prototype.reduceToGeometries=function(e){for(var t=this,r=new W,i=e.iterator();i.hasNext();){var s=i.next(),o=null;ae(s,Hr)?o=t.unionTree(s):s instanceof oe&&(o=s),r.add(o)}return r},tt.prototype.extractByEnvelope=function(e,t,r){for(var i=new W,s=0;s<t.getNumGeometries();s++){var o=t.getGeometryN(s);o.getEnvelopeInternal().intersects(e)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},tt.prototype.unionOptimized=function(e,t){var r=e.getEnvelopeInternal(),i=t.getEnvelopeInternal();if(!r.intersects(i)){var s=gr.combine(e,t);return s}if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(e,t,o)},tt.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 Vf(tt.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var r=t.next();e.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=e.itemsTree(),s=this.unionTree(i);return s},tt.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],r=arguments[1],i=arguments[2];if(i-r<=1){var s=tt.getGeometry(t,r);return this.unionSafe(s,null)}else{if(i-r===2)return this.unionSafe(tt.getGeometry(t,r),tt.getGeometry(t,r+1));var o=Math.trunc((i+r)/2),a=this.binaryUnion(t,r,o),l=this.binaryUnion(t,o,i);return this.unionSafe(a,l)}}},tt.prototype.repeatedUnion=function(e){for(var t=null,r=e.iterator();r.hasNext();){var i=r.next();t===null?t=i.copy():t=t.union(i)}return t},tt.prototype.unionSafe=function(e,t){return e===null&&t===null?null:e===null?t.copy():t===null?e.copy():this.unionOptimized(e,t)},tt.prototype.unionActual=function(e,t){return tt.restrictToPolygons(e.union(t))},tt.prototype.unionTree=function(e){var t=this.reduceToGeometries(e),r=this.binaryUnion(t);return r},tt.prototype.unionUsingEnvelopeIntersection=function(e,t,r){var i=new W,s=this.extractByEnvelope(r,e,i),o=this.extractByEnvelope(r,t,i),a=this.unionActual(s,o);i.add(a);var l=gr.combine(i);return l},tt.prototype.bufferUnion=function(){if(arguments.length===1){var e=arguments[0],t=e.get(0).getFactory(),r=t.buildGeometry(e),i=r.buffer(0);return i}else if(arguments.length===2){var s=arguments[0],o=arguments[1],a=s.getFactory(),l=a.createGeometryCollection([s,o]),u=l.buffer(0);return u}},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.restrictToPolygons=function(e){if(ae(e,Ri))return e;var t=mi.getPolygons(e);return t.size()===1?t.get(0):e.getFactory().createMultiPolygon(me.toPolygonArray(t))},tt.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},tt.union=function(e){var t=new tt(e);return t.union()},td.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(tt,td);var Zu=function(){};Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu},Zu.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return he.createEmptyResult(he.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),Vt.overlayOp(e,t,he.UNION)};function Ps(){return new Ku}function Ku(){this.reset()}Ku.prototype={constructor:Ku,reset:function(){this.s=this.t=0},add:function(n){rd(Qu,n,this.t),rd(this,Qu.s,this.s),this.s?this.t+=Qu.t:this.s=Qu.t},valueOf:function(){return this.s}};var Qu=new Ku;function rd(n,e,t){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}var rt=1e-6,Le=Math.PI,vi=Le/2,nd=Le/4,yi=Le*2,Is=180/Le,Cn=Le/180,zt=Math.abs,av=Math.atan,Tl=Math.atan2,ot=Math.cos,at=Math.sin,Nl=Math.sqrt;function id(n){return n>1?0:n<-1?Le:Math.acos(n)}function co(n){return n>1?vi:n<-1?-vi:Math.asin(n)}function cu(){}function Bu(n,e){n&&od.hasOwnProperty(n.type)&&od[n.type](n,e)}var sd={Feature:function(n,e){Bu(n.geometry,e)},FeatureCollection:function(n,e){for(var t=n.features,r=-1,i=t.length;++r<i;)Bu(t[r].geometry,e)}},od={Sphere:function(n,e){e.sphere()},Point:function(n,e){n=n.coordinates,e.point(n[0],n[1],n[2])},MultiPoint:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)n=t[r],e.point(n[0],n[1],n[2])},LineString:function(n,e){rh(n.coordinates,e,0)},MultiLineString:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)rh(t[r],e,0)},Polygon:function(n,e){ad(n.coordinates,e)},MultiPolygon:function(n,e){for(var t=n.coordinates,r=-1,i=t.length;++r<i;)ad(t[r],e)},GeometryCollection:function(n,e){for(var t=n.geometries,r=-1,i=t.length;++r<i;)Bu(t[r],e)}};function rh(n,e,t){var r=-1,i=n.length-t,s;for(e.lineStart();++r<i;)s=n[r],e.point(s[0],s[1],s[2]);e.lineEnd()}function ad(n,e){var t=-1,r=n.length;for(e.polygonStart();++t<r;)rh(n[t],e,1);e.polygonEnd()}function lv(n,e){n&&sd.hasOwnProperty(n.type)?sd[n.type](n,e):Bu(n,e)}Ps(),Ps();function nh(n){return[Tl(n[1],n[0]),co(n[2])]}function Dl(n){var e=n[0],t=n[1],r=ot(t);return[r*ot(e),r*at(e),at(t)]}function $u(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function ju(n,e){return[n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function ih(n,e){n[0]+=e[0],n[1]+=e[1],n[2]+=e[2]}function ec(n,e){return[n[0]*e,n[1]*e,n[2]*e]}function sh(n){var e=Nl(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=e,n[1]/=e,n[2]/=e}Ps();function ld(n,e){function t(r,i){return r=n(r,i),e(r[0],r[1])}return n.invert&&e.invert&&(t.invert=function(r,i){return r=e.invert(r,i),r&&n.invert(r[0],r[1])}),t}function oh(n,e){return[n>Le?n-yi:n<-Le?n+yi:n,e]}oh.invert=oh;function uv(n,e,t){return(n%=yi)?e||t?ld(cd(n),hd(e,t)):cd(n):e||t?hd(e,t):oh}function ud(n){return function(e,t){return e+=n,[e>Le?e-yi:e<-Le?e+yi:e,t]}}function cd(n){var e=ud(n);return e.invert=ud(-n),e}function hd(n,e){var t=ot(n),r=at(n),i=ot(e),s=at(e);function o(a,l){var u=ot(l),h=ot(a)*u,f=at(a)*u,p=at(l),v=p*t+h*r;return[Tl(f*i-v*s,h*t-p*r),co(v*i+f*s)]}return o.invert=function(a,l){var u=ot(l),h=ot(a)*u,f=at(a)*u,p=at(l),v=p*i-f*s;return[Tl(f*i+p*s,h*t+v*r),co(v*t-h*r)]},o}function cv(n,e,t,r,i,s){if(t){var o=ot(e),a=at(e),l=r*t;i==null?(i=e+r*yi,s=e-l/2):(i=fd(o,i),s=fd(o,s),(r>0?i<s:i>s)&&(i+=r*yi));for(var u,h=i;r>0?h>s:h<s;h-=l)u=nh([o,-a*ot(h),-a*at(h)]),n.point(u[0],u[1])}}function fd(n,e){e=Dl(e),e[0]-=n,sh(e);var t=id(-e[1]);return((-e[2]<0?-t:t)+yi-rt)%yi}function dd(){var n=[],e;return{point:function(t,r){e.push([t,r])},lineStart:function(){n.push(e=[])},lineEnd:cu,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var t=n;return n=[],e=null,t}}}function hv(n,e,t,r,i,s){var o=n[0],a=n[1],l=e[0],u=e[1],h=0,f=1,p=l-o,v=u-a,w;if(w=t-o,!(!p&&w>0)){if(w/=p,p<0){if(w<h)return;w<f&&(f=w)}else if(p>0){if(w>f)return;w>h&&(h=w)}if(w=i-o,!(!p&&w<0)){if(w/=p,p<0){if(w>f)return;w>h&&(h=w)}else if(p>0){if(w<h)return;w<f&&(f=w)}if(w=r-a,!(!v&&w>0)){if(w/=v,v<0){if(w<h)return;w<f&&(f=w)}else if(v>0){if(w>f)return;w>h&&(h=w)}if(w=s-a,!(!v&&w<0)){if(w/=v,v<0){if(w>f)return;w>h&&(h=w)}else if(v>0){if(w<h)return;w<f&&(f=w)}return h>0&&(n[0]=o+h*p,n[1]=a+h*v),f<1&&(e[0]=o+f*p,e[1]=a+f*v),!0}}}}}function tc(n,e){return zt(n[0]-e[0])<rt&&zt(n[1]-e[1])<rt}function rc(n,e,t,r){this.x=n,this.z=e,this.o=t,this.e=r,this.v=!1,this.n=this.p=null}function pd(n,e,t,r,i){var s=[],o=[],a,l;if(n.forEach(function(w){if(!((I=w.length-1)<=0)){var I,T=w[0],L=w[I],m;if(tc(T,L)){for(i.lineStart(),a=0;a<I;++a)i.point((T=w[a])[0],T[1]);i.lineEnd();return}s.push(m=new rc(T,w,null,!0)),o.push(m.o=new rc(T,null,m,!1)),s.push(m=new rc(L,w,null,!1)),o.push(m.o=new rc(L,null,m,!0))}}),!!s.length){for(o.sort(e),gd(s),gd(o),a=0,l=o.length;a<l;++a)o[a].e=t=!t;for(var u=s[0],h,f;;){for(var p=u,v=!0;p.v;)if((p=p.n)===u)return;h=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(v)for(a=0,l=h.length;a<l;++a)i.point((f=h[a])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(v)for(h=p.p.z,a=h.length-1;a>=0;--a)i.point((f=h[a])[0],f[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,h=p.z,v=!v}while(!p.v);i.lineEnd()}}}function gd(n){if(e=n.length){for(var e,t=0,r=n[0],i;++t<e;)r.n=i=n[t],i.p=r,r=i;r.n=i=n[0],i.p=r}}function md(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function fv(n){return n.length===1&&(n=dv(n)),{left:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var s=r+i>>>1;n(e[s],t)<0?r=s+1:i=s}return r},right:function(e,t,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r<i;){var s=r+i>>>1;n(e[s],t)>0?i=s:r=s+1}return r}}}function dv(n){return function(e,t){return md(n(e),t)}}fv(md);function vd(n){for(var e=n.length,t,r=-1,i=0,s,o;++r<e;)i+=n[r].length;for(s=new Array(i);--e>=0;)for(o=n[e],t=o.length;--t>=0;)s[--i]=o[t];return s}var nc=1e9,ic=-1e9;function pv(n,e,t,r){function i(u,h){return n<=u&&u<=t&&e<=h&&h<=r}function s(u,h,f,p){var v=0,w=0;if(u==null||(v=o(u,f))!==(w=o(h,f))||l(u,h)<0^f>0)do p.point(v===0||v===3?n:t,v>1?r:e);while((v=(v+f+4)%4)!==w);else p.point(h[0],h[1])}function o(u,h){return zt(u[0]-n)<rt?h>0?0:3:zt(u[0]-t)<rt?h>0?2:1:zt(u[1]-e)<rt?h>0?1:0:h>0?3:2}function a(u,h){return l(u.x,h.x)}function l(u,h){var f=o(u,1),p=o(h,1);return f!==p?f-p:f===0?h[1]-u[1]:f===1?u[0]-h[0]:f===2?u[1]-h[1]:h[0]-u[0]}return function(u){var h=u,f=dd(),p,v,w,I,T,L,m,_,g,y,E,C={point:N,lineStart:O,lineEnd:A,polygonStart:x,polygonEnd:D};function N(B,X){i(B,X)&&h.point(B,X)}function b(){for(var B=0,X=0,ne=v.length;X<ne;++X)for(var ce=v[X],pe=1,K=ce.length,$=ce[0],ee,ye,Oe=$[0],Ce=$[1];pe<K;++pe)ee=Oe,ye=Ce,$=ce[pe],Oe=$[0],Ce=$[1],ye<=r?Ce>r&&(Oe-ee)*(r-ye)>(Ce-ye)*(n-ee)&&++B:Ce<=r&&(Oe-ee)*(r-ye)<(Ce-ye)*(n-ee)&&--B;return B}function x(){h=f,p=[],v=[],E=!0}function D(){var B=b(),X=E&&B,ne=(p=vd(p)).length;(X||ne)&&(u.polygonStart(),X&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),ne&&pd(p,a,B,s,u),u.polygonEnd()),h=u,p=v=w=null}function O(){C.point=k,v&&v.push(w=[]),y=!0,g=!1,m=_=NaN}function A(){p&&(k(I,T),L&&g&&f.rejoin(),p.push(f.result())),C.point=N,g&&h.lineEnd()}function k(B,X){var ne=i(B,X);if(v&&w.push([B,X]),y)I=B,T=X,L=ne,y=!1,ne&&(h.lineStart(),h.point(B,X));else if(ne&&g)h.point(B,X);else{var ce=[m=Math.max(ic,Math.min(nc,m)),_=Math.max(ic,Math.min(nc,_))],pe=[B=Math.max(ic,Math.min(nc,B)),X=Math.max(ic,Math.min(nc,X))];hv(ce,pe,n,e,t,r)?(g||(h.lineStart(),h.point(ce[0],ce[1])),h.point(pe[0],pe[1]),ne||h.lineEnd(),E=!1):ne&&(h.lineStart(),h.point(B,X),E=!1)}m=B,_=X,g=ne}return C}}var ah=Ps();function gv(n,e){var t=e[0],r=e[1],i=[at(t),-ot(t),0],s=0,o=0;ah.reset();for(var a=0,l=n.length;a<l;++a)if(h=(u=n[a]).length)for(var u,h,f=u[h-1],p=f[0],v=f[1]/2+nd,w=at(v),I=ot(v),T=0;T<h;++T,p=m,w=g,I=y,f=L){var L=u[T],m=L[0],_=L[1]/2+nd,g=at(_),y=ot(_),E=m-p,C=E>=0?1:-1,N=C*E,b=N>Le,x=w*g;if(ah.add(Tl(x*C*at(N),I*y+x*ot(N))),s+=b?E+C*yi:E,b^p>=t^m>=t){var D=ju(Dl(f),Dl(L));sh(D);var O=ju(i,D);sh(O);var A=(b^E>=0?-1:1)*co(O[2]);(r>A||r===A&&(D[0]||D[1]))&&(o+=b^E>=0?1:-1)}}return(s<-1e-6||s<rt&&ah<-1e-6)^o&1}Ps();function yd(n){return n}Ps(),Ps();var bl=1/0,sc=bl,hu=-bl,oc=hu,_d={point:mv,lineStart:cu,lineEnd:cu,polygonStart:cu,polygonEnd:cu,result:function(){var n=[[bl,sc],[hu,oc]];return hu=oc=-(sc=bl=1/0),n}};function mv(n,e){n<bl&&(bl=n),n>hu&&(hu=n),e<sc&&(sc=e),e>oc&&(oc=e)}Ps();function wd(n,e,t,r){return function(i,s){var o=e(s),a=i.invert(r[0],r[1]),l=dd(),u=e(l),h=!1,f,p,v,w={point:I,lineStart:L,lineEnd:m,polygonStart:function(){w.point=_,w.lineStart=g,w.lineEnd=y,p=[],f=[]},polygonEnd:function(){w.point=I,w.lineStart=L,w.lineEnd=m,p=vd(p);var E=gv(f,a);p.length?(h||(s.polygonStart(),h=!0),pd(p,yv,E,t,s)):E&&(h||(s.polygonStart(),h=!0),s.lineStart(),t(null,null,1,s),s.lineEnd()),h&&(s.polygonEnd(),h=!1),p=f=null},sphere:function(){s.polygonStart(),s.lineStart(),t(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function I(E,C){var N=i(E,C);n(E=N[0],C=N[1])&&s.point(E,C)}function T(E,C){var N=i(E,C);o.point(N[0],N[1])}function L(){w.point=T,o.lineStart()}function m(){w.point=I,o.lineEnd()}function _(E,C){v.push([E,C]);var N=i(E,C);u.point(N[0],N[1])}function g(){u.lineStart(),v=[]}function y(){_(v[0][0],v[0][1]),u.lineEnd();var E=u.clean(),C=l.result(),N,b=C.length,x,D,O;if(v.pop(),f.push(v),v=null,!!b){if(E&1){if(D=C[0],(x=D.length-1)>0){for(h||(s.polygonStart(),h=!0),s.lineStart(),N=0;N<x;++N)s.point((O=D[N])[0],O[1]);s.lineEnd()}return}b>1&&E&2&&C.push(C.pop().concat(C.shift())),p.push(C.filter(vv))}}return w}}function vv(n){return n.length>1}function yv(n,e){return((n=n.x)[0]<0?n[1]-vi-rt:vi-n[1])-((e=e.x)[0]<0?e[1]-vi-rt:vi-e[1])}const Ed=wd(function(){return!0},_v,Ev,[-Le,-vi]);function _v(n){var e=NaN,t=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(s,o){var a=s>0?Le:-Le,l=zt(s-e);zt(l-Le)<rt?(n.point(e,t=(t+o)/2>0?vi:-vi),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(a,t),n.point(s,t),i=0):r!==a&&l>=Le&&(zt(e-r)<rt&&(e-=r*rt),zt(s-a)<rt&&(s-=a*rt),t=wv(e,t,s,o),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(a,t),i=0),n.point(e=s,t=o),r=a},lineEnd:function(){n.lineEnd(),e=t=NaN},clean:function(){return 2-i}}}function wv(n,e,t,r){var i,s,o=at(n-t);return zt(o)>rt?av((at(e)*(s=ot(r))*at(t)-at(r)*(i=ot(e))*at(n))/(i*s*o)):(e+r)/2}function Ev(n,e,t,r){var i;if(n==null)i=t*vi,r.point(-Le,i),r.point(0,i),r.point(Le,i),r.point(Le,0),r.point(Le,-i),r.point(0,-i),r.point(-Le,-i),r.point(-Le,0),r.point(-Le,i);else if(zt(n[0]-e[0])>rt){var s=n[0]<e[0]?Le:-Le;i=t*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(e[0],e[1])}function Sv(n,e){var t=ot(n),r=t>0,i=zt(t)>rt;function s(h,f,p,v){cv(v,n,e,p,h,f)}function o(h,f){return ot(h)*ot(f)>t}function a(h){var f,p,v,w,I;return{lineStart:function(){w=v=!1,I=1},point:function(T,L){var m=[T,L],_,g=o(T,L),y=r?g?0:u(T,L):g?u(T+(T<0?Le:-Le),L):0;if(!f&&(w=v=g)&&h.lineStart(),g!==v&&(_=l(f,m),(!_||tc(f,_)||tc(m,_))&&(m[0]+=rt,m[1]+=rt,g=o(m[0],m[1]))),g!==v)I=0,g?(h.lineStart(),_=l(m,f),h.point(_[0],_[1])):(_=l(f,m),h.point(_[0],_[1]),h.lineEnd()),f=_;else if(i&&f&&r^g){var E;!(y&p)&&(E=l(m,f,!0))&&(I=0,r?(h.lineStart(),h.point(E[0][0],E[0][1]),h.point(E[1][0],E[1][1]),h.lineEnd()):(h.point(E[1][0],E[1][1]),h.lineEnd(),h.lineStart(),h.point(E[0][0],E[0][1])))}g&&(!f||!tc(f,m))&&h.point(m[0],m[1]),f=m,v=g,p=y},lineEnd:function(){v&&h.lineEnd(),f=null},clean:function(){return I|(w&&v)<<1}}}function l(h,f,p){var v=Dl(h),w=Dl(f),I=[1,0,0],T=ju(v,w),L=$u(T,T),m=T[0],_=L-m*m;if(!_)return!p&&h;var g=t*L/_,y=-t*m/_,E=ju(I,T),C=ec(I,g),N=ec(T,y);ih(C,N);var b=E,x=$u(C,b),D=$u(b,b),O=x*x-D*($u(C,C)-1);if(!(O<0)){var A=Nl(O),k=ec(b,(-x-A)/D);if(ih(k,C),k=nh(k),!p)return k;var B=h[0],X=f[0],ne=h[1],ce=f[1],pe;X<B&&(pe=B,B=X,X=pe);var K=X-B,$=zt(K-Le)<rt,ee=$||K<rt;if(!$&&ce<ne&&(pe=ne,ne=ce,ce=pe),ee?$?ne+ce>0^k[1]<(zt(k[0]-B)<rt?ne:ce):ne<=k[1]&&k[1]<=ce:K>Le^(B<=k[0]&&k[0]<=X)){var ye=ec(b,(-x+A)/D);return ih(ye,C),[k,nh(ye)]}}}function u(h,f){var p=r?n:Le-n,v=0;return h<-p?v|=1:h>p&&(v|=2),f<-p?v|=4:f>p&&(v|=8),v}return wd(o,a,s,r?[0,-n]:[-Le,n-Le])}function Sd(n){return function(e){var t=new lh;for(var r in n)t[r]=n[r];return t.stream=e,t}}function lh(){}lh.prototype={constructor:lh,point:function(n,e){this.stream.point(n,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 Cd(n,e,t){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],s=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),s!=null&&n.clipExtent(null),lv(t,n.stream(_d));var o=_d.result(),a=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+e[0][0]+(r-a*(o[1][0]+o[0][0]))/2,u=+e[0][1]+(i-a*(o[1][1]+o[0][1]))/2;return s!=null&&n.clipExtent(s),n.scale(a*150).translate([l,u])}function Cv(n,e,t){return Cd(n,[[0,0],e],t)}var Pd=16,Pv=ot(30*Cn);function Id(n,e){return+e?Tv(n,e):Iv(n)}function Iv(n){return Sd({point:function(e,t){e=n(e,t),this.stream.point(e[0],e[1])}})}function Tv(n,e){function t(r,i,s,o,a,l,u,h,f,p,v,w,I,T){var L=u-r,m=h-i,_=L*L+m*m;if(_>4*e&&I--){var g=o+p,y=a+v,E=l+w,C=Nl(g*g+y*y+E*E),N=co(E/=C),b=zt(zt(E)-1)<rt||zt(s-f)<rt?(s+f)/2:Tl(y,g),x=n(b,N),D=x[0],O=x[1],A=D-r,k=O-i,B=m*A-L*k;(B*B/_>e||zt((L*A+m*k)/_-.5)>.3||o*p+a*v+l*w<Pv)&&(t(r,i,s,o,a,l,D,O,b,g/=C,y/=C,E,I,T),T.point(D,O),t(D,O,b,g,y,E,u,h,f,p,v,w,I,T))}}return function(r){var i,s,o,a,l,u,h,f,p,v,w,I,T={point:L,lineStart:m,lineEnd:g,polygonStart:function(){r.polygonStart(),T.lineStart=y},polygonEnd:function(){r.polygonEnd(),T.lineStart=m}};function L(N,b){N=n(N,b),r.point(N[0],N[1])}function m(){f=NaN,T.point=_,r.lineStart()}function _(N,b){var x=Dl([N,b]),D=n(N,b);t(f,p,h,v,w,I,f=D[0],p=D[1],h=N,v=x[0],w=x[1],I=x[2],Pd,r),r.point(f,p)}function g(){T.point=L,r.lineEnd()}function y(){m(),T.point=E,T.lineEnd=C}function E(N,b){_(i=N,b),s=f,o=p,a=v,l=w,u=I,T.point=_}function C(){t(f,p,h,v,w,I,s,o,i,a,l,u,Pd,r),T.lineEnd=g,g()}return T}}var Nv=Sd({point:function(n,e){this.stream.point(n*Cn,e*Cn)}});function Dv(n){return bv(function(){return n})()}function bv(n){var e,t=150,r=480,i=250,s,o,a=0,l=0,u=0,h=0,f=0,p,v,w=null,I=Ed,T=null,L,m,_,g=yd,y=.5,E=Id(D,y),C,N;function b(k){return k=v(k[0]*Cn,k[1]*Cn),[k[0]*t+s,o-k[1]*t]}function x(k){return k=v.invert((k[0]-s)/t,(o-k[1])/t),k&&[k[0]*Is,k[1]*Is]}function D(k,B){return k=e(k,B),[k[0]*t+s,o-k[1]*t]}b.stream=function(k){return C&&N===k?C:C=Nv(I(p,E(g(N=k))))},b.clipAngle=function(k){return arguments.length?(I=+k?Sv(w=k*Cn,6*Cn):(w=null,Ed),A()):w*Is},b.clipExtent=function(k){return arguments.length?(g=k==null?(T=L=m=_=null,yd):pv(T=+k[0][0],L=+k[0][1],m=+k[1][0],_=+k[1][1]),A()):T==null?null:[[T,L],[m,_]]},b.scale=function(k){return arguments.length?(t=+k,O()):t},b.translate=function(k){return arguments.length?(r=+k[0],i=+k[1],O()):[r,i]},b.center=function(k){return arguments.length?(a=k[0]%360*Cn,l=k[1]%360*Cn,O()):[a*Is,l*Is]},b.rotate=function(k){return arguments.length?(u=k[0]%360*Cn,h=k[1]%360*Cn,f=k.length>2?k[2]%360*Cn:0,O()):[u*Is,h*Is,f*Is]},b.precision=function(k){return arguments.length?(E=Id(D,y=k*k),A()):Nl(y)},b.fitExtent=function(k,B){return Cd(b,k,B)},b.fitSize=function(k,B){return Cv(b,k,B)};function O(){v=ld(p=uv(u,h,f),e);var k=e(a,l);return s=r-k[0]*t,o=i+k[1]*t,A()}function A(){return C=N=null,b}return function(){return e=n.apply(this,arguments),b.invert=e.invert&&x,O()}}function Td(n){return function(e,t){var r=ot(e),i=ot(t),s=n(r*i);return[s*i*at(e),s*at(t)]}}function Nd(n){return function(e,t){var r=Nl(e*e+t*t),i=n(r),s=at(i),o=ot(i);return[Tl(e*s,r*o),co(r&&t*s/r)]}}var Ov=Td(function(n){return Nl(2/(1+n))});Ov.invert=Nd(function(n){return 2*co(n/2)});var Dd=Td(function(n){return(n=id(n))&&n/at(n)});Dd.invert=Nd(function(n){return n});function Mv(){return Dv(Dd).scale(79.4188).clipAngle(180-.001)}function bd(n,e){return[n,e]}bd.invert=bd;function xv(n,e,t){t=t||{};var r=t.units||"kilometers",i=t.steps||8;if(!n)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(n.type){case"GeometryCollection":return Tu(n,function(o){var a=ac(o,e,r,i);a&&s.push(a)}),el(s);case"FeatureCollection":return Iu(n,function(o){var a=ac(o,e,r,i);a&&Iu(a,function(l){l&&s.push(l)})}),el(s)}return ac(n,e,r,i)}function ac(n,e,t,r){var i=n.properties||{},s=n.type==="Feature"?n.geometry:n;if(s.type==="GeometryCollection"){var o=[];return Tu(n,function(I){var T=ac(I,e,t,r);T&&o.push(T)}),el(o)}var a=Lv(s),l={type:s.type,coordinates:Md(s.coordinates,a)},u=new Hc,h=u.read(l),f=Tc(Nc(e,t),"meters"),p=_t.bufferOp(h,f,r),v=new Ff;if(p=v.write(p),!Od(p.coordinates)){var w={type:p.type,coordinates:xd(p.coordinates,a)};return bn(w,i)}}function Od(n){return Array.isArray(n[0])?Od(n[0]):isNaN(n[0])}function Md(n,e){return typeof n[0]!="object"?e(n):n.map(function(t){return Md(t,e)})}function xd(n,e){return typeof n[0]!="object"?e.invert(n):n.map(function(t){return xd(t,e)})}function Lv(n){var e=qm(n).geometry.coordinates,t=[-e[0],-e[1]];return Mv().rotate(t).scale(Ut)}function Av(n,e,t){t===void 0&&(t={});for(var r=t.steps||64,i=t.properties?t.properties:!Array.isArray(n)&&n.type==="Feature"&&n.properties?n.properties:{},s=[],o=0;o<r;o++)s.push(tl(n,e,o*-360/r,t).geometry.coordinates);return s.push(s[0]),ar([s],i)}/**
7
7
  * splaytree v3.1.2
8
8
  * Fast Splay tree for Node and browser
9
9
  *
@@ -531,10 +531,10 @@ ${Vp}
531
531
  `,zp=Date.now();new Date(zp).toISOString(),new Date(zp+24*60*60*1e3).toISOString();const pt=class pt extends j{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new c.Event));d(this,"_resetClockEvent",this.disposeVar(new c.Event))}get typeName(){return"ESCzml"}get defaultProps(){return pt.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new U("数据","数据",!0,!1,[this,"data"],pt.defaults.data,pt.defaults.dataMd),new U("路径","路径",!1,!1,[this,"uri"],""),new F("启用","启用",!1,!1,[this,"clockEnabled"],!1),new S("倍速","倍速.",!1,!1,[this,"multiplier"],pt.defaults.multiplier),new F("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],!0),new ii("开始时间","开始时间",!0,!1,[this,"startTime"],pt.defaults.startTime),new ii("结束时间","结束时间",!0,!1,[this,"stopTime"],pt.defaults.stopTime),new ii("当前时间","当前时间",!0,!1,[this,"currentTime"],pt.defaults.currentTime),new Y("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"SYSTEM_CLOCK_MULTIPLIER"),new Y("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"UNBOUNDED"),new F("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],!1)],general:[...t.general,new Z("唯一标识","id",!1,!0,[this,"id"]),new Z("名称","name",!0,!1,[this,"name"]),new F("是否显示","show",!1,!1,[this,"show"],!0),new F("开启碰撞","collision",!1,!1,[this,"collision"],!1),new F("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(t){return[...super.getProperties(t),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new F("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new ie("飞入","飞入",["number"],r=>this.flyTo(r),[1e3]),new U("数据","数据",!0,!1,[this,"data"],pt.defaults.data,pt.defaults.dataMd),new U("路径","路径",!1,!1,[this,"uri"]),new F("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new ie("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[]),new ni("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],pt.defaults.defaultLoadFuncStr,pt.defaults.defaultLoadFuncDocStr)]),new z("时钟","时钟",[new F("启用","启用",!1,!1,[this,"clockEnabled"]),new ii("开始时间","开始时间",!0,!1,[this,"startTime"],pt.defaults.startTime),new ii("结束时间","结束时间",!0,!1,[this,"stopTime"],pt.defaults.stopTime),new ii("当前时间","当前时间",!0,!1,[this,"currentTime"],pt.defaults.currentTime),new S("倍速","倍速.",!1,!1,[this,"multiplier"],pt.defaults.multiplier),new Y("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new Y("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new F("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};d(pt,"type",pt.register("ESCzml",pt,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"})),d(pt,"defaults",{...j.defaults,show:!0,allowPicking:!0,data:o0,dataMd:a0,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Vp,defaultLoadFuncDocStr:l0});let _a=pt;(n=>{n.createDefaultProps=()=>({show:!0,uri:"",allowPicking:!1,data:c.reactJsonWithUndefined(void 0),autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...j.createDefaultProps()})})(_a||(_a={})),c.extendClassProps(_a.prototype,_a.createDefaultProps);const Za=class Za extends j{get typeName(){return"ESNavigator"}get defaultProps(){return Za.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new S("尺寸","尺寸",!1,!1,[this,"cssSize"]),new ze("位置","位置(top,right)",!1,!1,[this,"cssPosition"]),new zl("图片地址","图片地址",!1,!1,[this,"imgUrl"])])]}};d(Za,"type",Za.register("ESNavigator",Za,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"})),d(Za,"defaults",{...j.defaults,show:!0,cssPosition:[170,30],cssSize:100,imgUrl:j.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")});let wa=Za;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:n.defaults.imgUrl})})(wa||(wa={})),c.extendClassProps(wa.prototype,wa.createDefaultProps);const jn=class jn extends j{get typeName(){return"ESViewerStatusBar"}get defaultProps(){return jn.createDefaultProps()}constructor(e){super(e)}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],jn.defaults.show),new S("高度","height",!0,!1,[this,"height"],jn.defaults.height),new S("文字大小","fontSize",!0,!1,[this,"fontSize"],jn.defaults.fontSize),new J("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],jn.defaults.bgColor)])]}};d(jn,"type",jn.register("ESViewerStatusBar",jn,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),d(jn,"defaults",{...j.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let Ea=jn;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:c.reactArray([71/255,71/255,71/255,.8])})})(Ea||(Ea={})),c.extendClassProps(Ea.prototype,Ea.createDefaultProps);const ei=class ei extends j{get typeName(){return"ESViewerStatusBarScale"}get defaultProps(){return ei.createDefaultProps()}constructor(e){super(e)}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],ei.defaults.show),new S("高度","height",!0,!1,[this,"height"],ei.defaults.height),new S("文字大小","fontSize",!0,!1,[this,"fontSize"],ei.defaults.fontSize),new J("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],ei.defaults.bgColor)])]}};d(ei,"type",ei.register("ESViewerStatusBarScale",ei,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),d(ei,"defaults",{...j.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let Sa=ei;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:c.reactArray([71/255,71/255,71/255,.8])})})(Sa||(Sa={})),c.extendClassProps(Sa.prototype,Sa.createDefaultProps);const Ka=class Ka extends q{get typeName(){return"ESGaussianSplatting"}get defaultProps(){return Ka.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Z("路径","url",!0,!1,[this,"url"]),new S("进度","progress",!1,!0,[this,"progress"],0)]}}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new Z("路径","url",!0,!1,[this,"url"]),new S("进度","progress",!1,!0,[this,"progress"],0)])]}};d(Ka,"type",Ka.register("ESGaussianSplatting",Ka,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"})),d(Ka,"defaults",{...q.defaults});let Ca=Ka;(n=>{n.createDefaultProps=()=>({...q.createDefaultProps(),url:"",progress:0})})(Ca||(Ca={})),c.extendClassProps(Ca.prototype,Ca.createDefaultProps);const us=class us extends q{get typeName(){return"ESStaticMesh"}get defaultProps(){return us.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()},t=[new Z("mesh地址","mesh地址",!1,!1,[this,"mesh"],us.defaults.mesh)];return e.basic.push(...t),e}getProperties(e){return[...super.getProperties(e),new z("ESStaticMesh","ESStaticMesh",[new Z("mesh地址","mesh地址",!1,!1,[this,"mesh"],us.defaults.mesh)])]}};d(us,"type",us.register("ESStaticMesh",us,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"})),d(us,"defaults",{...q.defaults,mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"});let Pa=us;(n=>{n.createDefaultProps=()=>({...q.createDefaultProps(),mesh:""})})(Pa||(Pa={})),c.extendClassProps(Pa.prototype,Pa.createDefaultProps);const Qa=class Qa extends le{constructor(t){super(t);d(this,"_startEvent",this.dv(new c.Event));d(this,"_clearEvent",this.dv(new c.Event));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Ki),this._eSGeoExtrudedPolygon.parentID=this.id,this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(c.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get typeName(){return"ESSkylineAnalysis"}get defaultProps(){return Qa.createDefaultProps()}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ie("开始分析","开始分析",[],()=>this.start(),[]),new ie("清除分析","清除分析",[],()=>this.clear(),[]),new U("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new U("深度值","depths",!1,!0,[this,"depths"]),new S("半径","半径",!0,!1,[this,"radius"],1e4)]}}getProperties(t){return[...super.getProperties(t),new z("通用","通用",[new ie("开始分析","开始分析",[],()=>this.start(),[]),new ie("清除分析","清除分析",[],()=>this.clear(),[]),new U("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new U("深度值","depths",!1,!0,[this,"depths"]),new S("半径","半径",!0,!1,[this,"radius"],1e4)])]}};d(Qa,"type",Qa.register("ESSkylineAnalysis",Qa,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"})),d(Qa,"defaults",{...le.defaults,windowPositions:[],depths:[],radius:1e4});let Ia=Qa;(n=>{n.createDefaultProps=()=>({...le.createDefaultProps(),windowPositions:Cc(void 0),depths:c.reactArrayWithUndefined(void 0),radius:c.react(void 0)})})(Ia||(Ia={})),c.extendClassProps(Ia.prototype,Ia.createDefaultProps);const sn=class sn extends ve{get typeName(){return"ESHeatMap"}get defaultProps(){return sn.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new U("data","数据",!0,!1,[this,"data"]),new U("gradient","渐变",!0,!1,[this,"gradient"],sn.defaults.gradient),new S("radius","半径",!0,!1,[this,"radius"],sn.defaults.radius),new S("blur","模糊",!0,!1,[this,"blur"],sn.defaults.blur),new F("is3D","3D",!0,!1,[this,"is3D"])]}}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new U("data","数据",!0,!1,[this,"data"]),new U("gradient","渐变",!0,!1,[this,"gradient"],sn.defaults.gradient),new S("radius","半径",!0,!1,[this,"radius"],sn.defaults.radius),new S("blur","模糊",!0,!1,[this,"blur"],sn.defaults.blur),new F("is3D","3D",!0,!1,[this,"is3D"])])]}};d(sn,"type",sn.register("ESHeatMap",sn,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"})),d(sn,"defaults",{...ve.defaults,is3D:!1,data:[],radius:10,gradient:{".5":"green",".7":"yellow",".95":"red"},blur:.85});let Ta=sn;(n=>{n.createDefaultProps=()=>({...ve.createDefaultProps(),is3D:c.react(void 0),data:c.reactPositions(void 0),gradient:c.reactJsonWithUndefined(void 0),radius:c.react(void 0),blur:c.react(void 0)})})(Ta||(Ta={})),c.extendClassProps(Ta.prototype,Ta.createDefaultProps);const Ba=class Ba extends le{constructor(t){super(t);d(this,"editingBindMode","scatter")}get typeName(){return"ESGeoPoints"}get defaultProps(){return Ba.createDefaultProps()}};d(Ba,"type",Ba.register("ESGeoPoints",Ba,{chsName:"地理点集合",tags:["ESObjects","_ES_Impl_Cesium"],description:"地图中的可视化地理点集合"})),d(Ba,"supportEditingModes",[...le.supportEditingModes,se.ScatterAppend,se.ScatterModify]);let Na=Ba;(n=>{n.createDefaultProps=()=>({...le.createDefaultProps(),pointed:!0})})(Na||(Na={})),c.extendClassProps(Na.prototype,Na.createDefaultProps);function Up(n){return typeof n=="string"?document.getElementById(n):n}function Mh(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",n.appendChild(e),e}class Gp extends c.Destroyable{constructor(t,r){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=r;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let l of o){const u=i.get(l);u&&(u.destroy(),i.delete(l))}if(a)for(let l of a){if(i.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const h=this.createSceneObjectListeningFunc(l);h&&i.set(l,h)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class u0 extends c.Destroyable{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class r extends c.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new c.ObjResettingWithEvent(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends c.Destroyable{constructor(u){if(super(),this._esPath=u,!o)throw new Error("!viewer");const h=()=>{const f=t.activeViewer;f&&(this._esPath.path.currentTime=f.simulationTime)};h(),this.d(o.simulationTimeChanged.don(h))}}return new a(this._esPath)}))}}this.dv(new Gp(t.sceneObjectsManager,i=>{if(i instanceof Bi)return new r(i)}))}{const t=this._esObjectsManager;class r extends c.Destroyable{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new Gp(t.sceneObjectsManager,i=>{if(i instanceof Qi)return new r(i)}))}}}class c0 extends c.Destroyable{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(r=>{r&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...r])})})),this.d(t.path.currentRotationChanged.don(r=>{r&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...r])})}))})}}class h0 extends c.Destroyable{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(c.reactArray([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new c.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const r=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=j.getSceneObjById(s.pathId);if(!o||!(o instanceof Bi))continue;const l=s.sceneObjectIds.map(u=>j.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&r.push({path:o,sceneObjects:l})}if(r.length!==0)return new c0(r)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function mc(n){if(n.data){const{type:e,value:t}=n.data;if(e==="UITreeA"&&t instanceof sr){const{sceneObject:r}=t;if(r)return r.id}}}function f0(n,e){const{property:t,customEventName:r,otherParams:i}=e,{dragstartDataMananger:s}=n;if(!(t instanceof Dn)){if(!(t instanceof Uh)){if(t instanceof Z){const[o,a]=c.getReactFuncs(t.reactVar);if(r==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;mc(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(r==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const u=mc(s);u!==void 0&&a(u)}}else if(t instanceof Rh){const[o,a]=c.getReactFuncs(t.reactVar);if(r==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;mc(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(r==="ondrop"){if(!i)throw new Error("!otherParams");const l=i[0].$event,u=i[0].strinsPropDom,h=i[0].index;l.preventDefault();const f=mc(s);if(f!==void 0){u[h].firstChild.value=f;const p=new Event("input",{bubbles:!0,cancelable:!0});u[h].firstChild.dispatchEvent(p)}}}else if(t instanceof Fh){const[o,a]=c.getReactFuncs(t.reactVar)}}}}function Wp(n,e,t,r){if(t)r.currentActiveEditing=[n,e];else if(r.currentActiveEditing){const[i,s]=r.currentActiveEditing;i===n&&s===e&&(t||(r.currentActiveEditing=void 0))}}const d0=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class p0 extends c.Destroyable{constructor(e,t){super(),this._sceneObject=e;const r=this._sceneObject;for(let i of d0){const s=i+"Changed",o=r[s];if(o){{const a=r[i];Wp(r,i,a,t)}this.dispose(o.disposableOn(a=>Wp(r,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class g0 extends c.Destroyable{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(c.reactArrayWithUndefined(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,r)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),r){const[i,s]=r;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),j.context.sceneObjCreatedEvent.don(t=>{t.dv(new p0(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class m0 extends c.Destroyable{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new c.Event));this.d(()=>{const t=c.length(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){if(this._sceneObjects.has(t))return console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t);while(!1);return!0}deleteSceneObject(t){if(!this._sceneObjects.has(t))return console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t);while(!1);return!0}createSceneObject(t,r){const i=j.context.createSceneObject(t,r);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,r){const i=j.context.createSceneObjectFromClass(t,r);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const r=j.context.createSceneObjectFromJson(t);return r&&this.addSceneObject(r),r}}function qp(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}class v0 extends c.Destroyable{constructor(e){super(),this._viewer=e,this.d(c.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class y0 extends c.Destroyable{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const r=Kn.createCommonProps(),i=[];Object.keys(r).forEach(l=>{const u=this._activeViewer[l+"Changed"];i.push(u)});const s=this.dv(c.createNextAnimateFrameEvent(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(r).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(o));const a=this.dv(c.createAnimateFrame());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:h,rotation:f}=l;u&&qp(h,u.position)&&qp(f,u.rotation)||this._viewer.flyIn(h,f,0)}),this.d(()=>a.cancel())}}const _0=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
532
532
  <animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
533
533
  </circle><g></g></g></svg>
534
- `,w0='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',E0='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',$a=class $a extends c.Destroyable{constructor(e){super();const t=()=>{const r=this.dv(new Ls);this.d(c.track([r,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{r.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),r.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(r),this.d(()=>e.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(o,a,l){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const w=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};w(),this.d(a.showChanged.don(w))}let u,h,f,p,v;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=$a.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",f=document.createElement("div"),u.appendChild(f),f.style.pointerEvents="none",f.style.marginLeft="10px",f.style.display="flex",f.style.flexFlow="column",f.style.maxWidth="300px",p=document.createElement("div"),f.appendChild(p),p.style.fontSize="14px",p.style.fontWeight="800",p.style.marginBottom="5px",p.style.textShadow="0 0 2px black",v=document.createElement("div"),f.appendChild(v),v.style.fontWeight="400",v.style.textShadow="0 0 2px black";{const w=()=>{let T="Raw";l.status==="Raw"?T="初始状态":l.status==="Creating"?T="正在创建":l.status==="Created"?T="创建完成":l.status==="Error"?T="创建失败":l.status==="Reconnecting"&&(T="重新连接"),p.innerText=`${T}(${l.status})`,v.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=$a.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=$a.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=$a.defaultsSvg.warnSvg)};w();const I=this.dv(c.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(I.don(w))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d($a,"defaultsSvg",{loadingSvg:_0,successSvg:w0,warnSvg:E0});let xh=$a;class S0 extends c.Destroyable{constructor(e,t,r){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=r;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{i.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{i.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function vc(n){let e=c.getExtProp(n,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",n.appendChild(e),c.setExtProp(n,"_relativeContainer",e)),e}class C0 extends c.Destroyable{constructor(t,r){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=r,this._containerStyleController=this.dv(new S0(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),vc(this._container).appendChild(i),this.d(()=>vc(this._container).removeChild(i)),vc(this._container).appendChild(s),this.d(()=>vc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class P0 extends c.Destroyable{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,r){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,r),t}getViewerConstructor(t){const r=this.registerObjsMap.get(t);if(!r){console.warn(`未找到${t}类!`);return}return r}createViewer(t){const r=t.type;console.log(t);const i=this.getViewerConstructor(r);if(!i)throw new Error(`没有找到类型为${r}的Viewer构造器!`);return new i(t)}}class Xp extends c.Destroyable{constructor(e,t,r=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(c.DomElementEvent.create(t,"pointerdown")),o=this.dv(c.DomElementEvent.create(t,"pointermove")),a=this.dv(c.DomElementEvent.create(t,"pointerup")),l=this.dv(c.DomElementEvent.create(t,"pointerout")),u=this.dv(c.DomElementEvent.create(t,"pointerover")),h=this.dv(new c.PointerClick),f=this.dv(new c.PointerHover),p=()=>{const g=this._viewer.hoverTime*1e3;f.delayTime=g};this.d(this._viewer.hoverTimeChanged.don(()=>{p()})),this.d(s.don(g=>h.pointerDown(g))),this.d(o.don(g=>h.pointerMove(g))),this.d(a.don(g=>h.pointerUp(g))),this.d(l.don(g=>h.pointerOut(g))),this.d(s.don(g=>f.pointerDown(g))),this.d(o.don(g=>f.pointerMove(g))),this.d(a.don(g=>f.pointerUp(g))),this.d(l.don(g=>f.pointerOut(g)));const{x:v,y:w}=t.getBoundingClientRect(),I=i?v:0,T=i?w:0;this.d(f.hoverEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.hoverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.clickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.clickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.dbclickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(s.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(a.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(o.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerMoveEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(u.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(l.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOutEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})}));const L=this.dv(c.DomElementEvent.create(t,"keydown"));this.d(L.don(g=>this._viewer.keyDownEvent.emit(g)));const m=this.dv(c.DomElementEvent.create(t,"keyup"));this.d(m.don(g=>this._viewer.keyUpEvent.emit(g)));const _=this.dv(c.DomElementEvent.create(t,"wheel"));this.d(_.don(g=>this._viewer.wheelEvent.emit(g)))}}class I0 extends c.Destroyable{constructor(t){super();d(this,"viewer");const r=this.viewer=t;this.ad(new c.ObjResettingWithEvent(r.rollerShutterChanged,()=>{const i=r.container;if(!i||!r.rollerShutter)return;const s=new c.Destroyable;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const r=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",r)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",r)}),t}}class T0 extends c.Destroyable{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new I0(t))}}const Oi=class Oi extends c.Destroyable{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new c.Event));d(this,"_container",this.dv(c.react(void 0)));d(this,"_containerSize",this.dv(c.react(void 0)));d(this,"_editingEvent",this.disposeVar(new c.Event));d(this,"_status",this.dv(c.react("Raw")));d(this,"_statusLog",this.dv(c.react("")));d(this,"_statusContainer",this.dv(new xh(this)));d(this,"_useCustomInteraction",this.dv(c.react(!0)));d(this,"_resetInteractionEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new c.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Xp(this,this.container)})));d(this,"_viewerChanged",this.dv(new c.Event));d(this,"_containerResetEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new c.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new C0(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_statusInfo",Oi.defaults.statusInfo);d(this,"_navigationMode",this.dv(c.react("Map")));d(this,"_syncViewer",this.dv(c.react(void 0)));d(this,"_syncEventDon",this.dv(new c.ObjResettingWithEvent(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new y0(this,t)})));d(this,"_timeSyncdon",this.dv(new c.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new v0(this)})));d(this,"_hoverEvent",this.dv(new c.Event));d(this,"_pointerOverEvent",this.dv(new c.Event));d(this,"_pointerMoveEvent",this.dv(new c.Event));d(this,"_pointerDownEvent",this.dv(new c.Event));d(this,"_pointerUpEvent",this.dv(new c.Event));d(this,"_pointerOutEvent",this.dv(new c.Event));d(this,"_clickEvent",this.dv(new c.Event));d(this,"_dblclickEvent",this.dv(new c.Event));d(this,"_keyDownEvent",this.dv(new c.Event));d(this,"_keyUpEvent",this.dv(new c.Event));d(this,"_wheelEvent",this.dv(new c.Event));d(this,"_actived",this.dv(c.react(!1)));this._id=t.id??c.createGuid();const r=Up(t.container);if(r)this._container.value=Mh(r),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{r&&(this.show??!0?r.style.display="block":r.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,l]of i.entries())if(!l&&a){const u=Ys.context.createEngineObject(a,this);u&&i.set(a,u)}},o=()=>{for(let[a,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||c.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new T0(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const r=document.getElementById(t);r&&r instanceof HTMLDivElement?this._container.value=Mh(r):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Mh(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let r of t)if(!this.has(r)){j.context.addSceneObject(r);const i=Ys.context.createEngineObject(r,this);i&&this._sceneObjectsMap.set(r,i),r.viewerAttached.emit(this)}}delete(...t){for(let r of t)if(this.has(r)){const i=this._sceneObjectsMap.get(r);i&&i.destroy(),j.context.deleteSceneObject(r),this._sceneObjectsMap.delete(r),r.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oi.createDefaultProps()}_getJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_setJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(r){console.warn(`时间格式不正确! value: ${t} error: ${r}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(t){return[new z("ESViewer","ESViewer",[new ie("强制刷新","重载",[],()=>this.forceRecreate(),[]),new F("debug","debug",!0,!1,[this,"debug"],Oi.defaults.debug),new F("是否可见","是否可见",!0,!1,[this,"show"]),new Y("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new F("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new Z("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new S("时钟","时钟",!1,!1,[this,"currentTime"]),new F("globeShow","globeShow",!0,!1,[this,"globeShow"]),new F("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new S("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new S("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new z("Globe","Globe",[new U("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}};d(Oi,"context",new P0),d(Oi,"register",Oi.context.register.bind(Oi.context)),d(Oi,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Kn=Oi;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),n.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:c.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:c.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:c.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:c.react(void 0),rollerShutter:!1}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(Kn||(Kn={})),c.extendClassProps(Kn.prototype,Kn.createDefaultProps);function Yp(n,e){const t=n._lastCameraInfo;if(t){const r=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),n._lastCameraInfo=void 0,r()})}}const N0=n=>{const e=Kn.createCommonProps(),t={};try{Object.keys(e).forEach(r=>{t[r]=n[r]})}catch(r){console.warn(r)}return t},Hp=(n,e)=>{const t=Kn.createCommonProps();try{Object.keys(t).forEach(r=>{n[r]=e[r]})}catch(r){console.warn(r)}};class D0 extends c.Destroyable{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new c.Event));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new c.Event));this._sceneObjectsManager=t,this.d(()=>{for(const r of this._viewers)this.destroyViewer(r);this._viewers.clear()}),this.viewers.forEach(r=>{const i=this._sceneObjectsManager.sceneObjects;r.add(...i)}),this.d(()=>{const r=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...r)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((r,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),r.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Ji(o.devTags,s.devTags)),Ji(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((r,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),r.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Ji(o.devTags,l.devTags)),Ji(o.devTags,l.devTags)&&(o.has(l)?console.warn(`${o.typeName}中已存${l.typeName},检查逻辑是否有问题!`):o.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const r=Kn.context.createViewer(t);return this._viewers.add(r),this._viewersChanged.emit([],[r]),r}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class Rs extends c.Destroyable{constructor(...t){super();d(this,"_drgm",this.dv(new np));d(this,"_sobjm",this.dv(new m0));d(this,"_vrm",this.dv(new D0(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new g0));d(this,"_activeViewer",this.dv(c.react(void 0)));d(this,"_syncOtherViewersToActived",this.dv(c.react(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(Ms));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new mu("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new xl(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new c.Event));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"syncEvent",this.dv(c.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));d(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(r=>{t?r.syncOtherViewer(this.activeViewer):r.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(Qi));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new u0(this)));d(this,"_pathAnimationManager",this.dv(new h0(this)))}static get envs(){return j.context.environmentVariables}getSceneObjectById(t){return j.getSceneObjectById(t)}getSceneObject(t){return j.getSceneObject(t)}get $refs(){return j.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var f;const t=this._asset.createdTime||new Date().toISOString(),r=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:r,name:i},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(p=>p.json),h=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(r=>{const i=t.viewers.find(s=>s.id===r.id);i&&(r.json=i)})}catch(r){console.error(`ESObjectsManager解析json数据时发生错误! error: ${r}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return f0(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,r=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new mu(t,this.dragstartDataMananger,r,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const r=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=r);const i=this.d(r.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(r),i())}));return r}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,r=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&r&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?N0(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===t.type);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),r&&Yp(this,a),i&&this._lastActiveViewerJson&&(Hp(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===Up(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(t);return console.log(t),console.log(this),r&&Yp(this,l),i&&this._lastActiveViewerJson&&(Hp(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:r,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:r,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const r={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:l}=r;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,o,a)}}switchToUEViewer(...t){let r,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:f,viewSync:p,attributeSync:v,destroy:w,id:I}=t[0];r={type:"ESUeViewer",container:l,id:I,options:{uri:u,app:h,token:f}},i={viewSync:p??!0,attributeSync:v??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{ws:u,esmsg:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{project:u,baseUrl:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(r={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(r={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(r={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!r)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(r,s,o,a)}createCesiumViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createOpenLayersViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createUeViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?r={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!r)throw new Error("参数错误");return this.createViewer(r)}createSceneObject(t,r){return this._sobjm.createSceneObject(t,r)}createSceneObjectFromClass(t,r){return this._sobjm.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const r=this._sobjm.deleteSceneObject(t);return t.destroy(),r}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let r of t)r!=this._player&&r!=this._cmrvm&&this.destroySceneObject(r)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(Rs,"getSceneObjById",j.context.getSceneObjectById.bind(j.context)),d(Rs,"getEnv",j.context.getEnv.bind(j.context)),d(Rs,"setEnv",j.context.setEnv.bind(j.context)),(n=>{n.createDefaultProps=()=>({})})(Rs||(Rs={})),c.extendClassProps(Rs.prototype,Rs.createDefaultProps);function b0(){const n=navigator.userAgent;let e="Unknown";/Windows/.test(n)?e="Windows":/Macintosh/.test(n)?e="MacOS":/Linux/.test(n)?e="Linux":/Android/.test(n)?e="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?t="x64":/x86|i686|Win32/.test(n)?t="x86":/arm64|aarch64/.test(n)?t="arm64":/arm/.test(n)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const O0=Date.now();function Jp(n){const{os:e,arch:t}=b0(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-O0)/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(r));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))}P.copyright=void 0;try{const n="earthsdk3",e="3.4.0-beta.4",t="2025-08-13T02:44:57.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="1db9138c470e4d98418a0699adcb1700a2168ceb",a=((Date.now()-1755053097e3)/36e5).toFixed(1),l=`%c🌏 ${n}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
534
+ `,w0='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',E0='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',$a=class $a extends c.Destroyable{constructor(e){super();const t=()=>{const r=this.dv(new Ls);this.d(c.track([r,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{r.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),r.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(r),this.d(()=>e.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(o,a,l){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const w=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};w(),this.d(a.showChanged.don(w))}let u,h,f,p,v;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=$a.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",f=document.createElement("div"),u.appendChild(f),f.style.pointerEvents="none",f.style.marginLeft="10px",f.style.display="flex",f.style.flexFlow="column",f.style.maxWidth="300px",p=document.createElement("div"),f.appendChild(p),p.style.fontSize="14px",p.style.fontWeight="800",p.style.marginBottom="5px",p.style.textShadow="0 0 2px black",v=document.createElement("div"),f.appendChild(v),v.style.fontWeight="400",v.style.textShadow="0 0 2px black";{const w=()=>{let T="Raw";l.status==="Raw"?T="初始状态":l.status==="Creating"?T="正在创建":l.status==="Created"?T="创建完成":l.status==="Error"?T="创建失败":l.status==="Reconnecting"&&(T="重新连接"),p.innerText=`${T}(${l.status})`,v.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=$a.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=$a.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=$a.defaultsSvg.warnSvg)};w();const I=this.dv(c.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(I.don(w))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d($a,"defaultsSvg",{loadingSvg:_0,successSvg:w0,warnSvg:E0});let xh=$a;class S0 extends c.Destroyable{constructor(e,t,r){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=r;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{i.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{i.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function vc(n){let e=c.getExtProp(n,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",n.appendChild(e),c.setExtProp(n,"_relativeContainer",e)),e}class C0 extends c.Destroyable{constructor(t,r){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=r,this._containerStyleController=this.dv(new S0(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),vc(this._container).appendChild(i),this.d(()=>vc(this._container).removeChild(i)),vc(this._container).appendChild(s),this.d(()=>vc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class P0 extends c.Destroyable{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,r){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,r),t}getViewerConstructor(t){const r=this.registerObjsMap.get(t);if(!r){console.warn(`未找到${t}类!`);return}return r}createViewer(t){const r=t.type;console.log(t);const i=this.getViewerConstructor(r);if(!i)throw new Error(`没有找到类型为${r}的Viewer构造器!`);return new i(t)}}class Xp extends c.Destroyable{constructor(e,t,r=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(c.DomElementEvent.create(t,"pointerdown")),o=this.dv(c.DomElementEvent.create(t,"pointermove")),a=this.dv(c.DomElementEvent.create(t,"pointerup")),l=this.dv(c.DomElementEvent.create(t,"pointerout")),u=this.dv(c.DomElementEvent.create(t,"pointerover")),h=this.dv(new c.PointerClick),f=this.dv(new c.PointerHover),p=()=>{const g=this._viewer.hoverTime*1e3;f.delayTime=g};this.d(this._viewer.hoverTimeChanged.don(()=>{p()})),this.d(s.don(g=>h.pointerDown(g))),this.d(o.don(g=>h.pointerMove(g))),this.d(a.don(g=>h.pointerUp(g))),this.d(l.don(g=>h.pointerOut(g))),this.d(s.don(g=>f.pointerDown(g))),this.d(o.don(g=>f.pointerMove(g))),this.d(a.don(g=>f.pointerUp(g))),this.d(l.don(g=>f.pointerOut(g)));const{x:v,y:w}=t.getBoundingClientRect(),I=i?v:0,T=i?w:0;this.d(f.hoverEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.hoverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.clickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.clickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.dbclickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(s.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(a.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(o.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerMoveEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(u.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(l.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOutEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})}));const L=this.dv(c.DomElementEvent.create(t,"keydown"));this.d(L.don(g=>this._viewer.keyDownEvent.emit(g)));const m=this.dv(c.DomElementEvent.create(t,"keyup"));this.d(m.don(g=>this._viewer.keyUpEvent.emit(g)));const _=this.dv(c.DomElementEvent.create(t,"wheel"));this.d(_.don(g=>this._viewer.wheelEvent.emit(g)))}}class I0 extends c.Destroyable{constructor(t){super();d(this,"viewer");const r=this.viewer=t;this.ad(new c.ObjResettingWithEvent(r.rollerShutterChanged,()=>{const i=r.container;if(!i||!r.rollerShutter)return;const s=new c.Destroyable;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const r=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",r)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",r)}),t}}class T0 extends c.Destroyable{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new I0(t))}}const Oi=class Oi extends c.Destroyable{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new c.Event));d(this,"_container",this.dv(c.react(void 0)));d(this,"_containerSize",this.dv(c.react(void 0)));d(this,"_editingEvent",this.disposeVar(new c.Event));d(this,"_status",this.dv(c.react("Raw")));d(this,"_statusLog",this.dv(c.react("")));d(this,"_statusContainer",this.dv(new xh(this)));d(this,"_useCustomInteraction",this.dv(c.react(!0)));d(this,"_resetInteractionEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new c.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Xp(this,this.container)})));d(this,"_viewerChanged",this.dv(new c.Event));d(this,"_containerResetEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new c.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new C0(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_statusInfo",Oi.defaults.statusInfo);d(this,"_navigationMode",this.dv(c.react("Map")));d(this,"_syncViewer",this.dv(c.react(void 0)));d(this,"_syncEventDon",this.dv(new c.ObjResettingWithEvent(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new y0(this,t)})));d(this,"_timeSyncdon",this.dv(new c.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new v0(this)})));d(this,"_hoverEvent",this.dv(new c.Event));d(this,"_pointerOverEvent",this.dv(new c.Event));d(this,"_pointerMoveEvent",this.dv(new c.Event));d(this,"_pointerDownEvent",this.dv(new c.Event));d(this,"_pointerUpEvent",this.dv(new c.Event));d(this,"_pointerOutEvent",this.dv(new c.Event));d(this,"_clickEvent",this.dv(new c.Event));d(this,"_dblclickEvent",this.dv(new c.Event));d(this,"_keyDownEvent",this.dv(new c.Event));d(this,"_keyUpEvent",this.dv(new c.Event));d(this,"_wheelEvent",this.dv(new c.Event));d(this,"_actived",this.dv(c.react(!1)));this._id=t.id??c.createGuid();const r=Up(t.container);if(r)this._container.value=Mh(r),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{r&&(this.show??!0?r.style.display="block":r.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,l]of i.entries())if(!l&&a){const u=Ys.context.createEngineObject(a,this);u&&i.set(a,u)}},o=()=>{for(let[a,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||c.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new T0(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const r=document.getElementById(t);r&&r instanceof HTMLDivElement?this._container.value=Mh(r):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Mh(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let r of t)if(!this.has(r)){j.context.addSceneObject(r);const i=Ys.context.createEngineObject(r,this);i&&this._sceneObjectsMap.set(r,i),r.viewerAttached.emit(this)}}delete(...t){for(let r of t)if(this.has(r)){const i=this._sceneObjectsMap.get(r);i&&i.destroy(),j.context.deleteSceneObject(r),this._sceneObjectsMap.delete(r),r.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oi.createDefaultProps()}_getJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_setJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(r){console.warn(`时间格式不正确! value: ${t} error: ${r}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(t){return[new z("ESViewer","ESViewer",[new ie("强制刷新","重载",[],()=>this.forceRecreate(),[]),new F("debug","debug",!0,!1,[this,"debug"],Oi.defaults.debug),new F("是否可见","是否可见",!0,!1,[this,"show"]),new Y("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new F("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new Z("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new S("时钟","时钟",!1,!1,[this,"currentTime"]),new F("globeShow","globeShow",!0,!1,[this,"globeShow"]),new F("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new S("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new S("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new z("Globe","Globe",[new U("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}};d(Oi,"context",new P0),d(Oi,"register",Oi.context.register.bind(Oi.context)),d(Oi,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Kn=Oi;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),n.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:c.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:c.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:c.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:c.react(void 0),rollerShutter:!1}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(Kn||(Kn={})),c.extendClassProps(Kn.prototype,Kn.createDefaultProps);function Yp(n,e){const t=n._lastCameraInfo;if(t){const r=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),n._lastCameraInfo=void 0,r()})}}const N0=n=>{const e=Kn.createCommonProps(),t={};try{Object.keys(e).forEach(r=>{t[r]=n[r]})}catch(r){console.warn(r)}return t},Hp=(n,e)=>{const t=Kn.createCommonProps();try{Object.keys(t).forEach(r=>{n[r]=e[r]})}catch(r){console.warn(r)}};class D0 extends c.Destroyable{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new c.Event));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new c.Event));this._sceneObjectsManager=t,this.d(()=>{for(const r of this._viewers)this.destroyViewer(r);this._viewers.clear()}),this.viewers.forEach(r=>{const i=this._sceneObjectsManager.sceneObjects;r.add(...i)}),this.d(()=>{const r=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...r)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((r,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),r.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Ji(o.devTags,s.devTags)),Ji(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((r,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),r.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Ji(o.devTags,l.devTags)),Ji(o.devTags,l.devTags)&&(o.has(l)?console.warn(`${o.typeName}中已存${l.typeName},检查逻辑是否有问题!`):o.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const r=Kn.context.createViewer(t);return this._viewers.add(r),this._viewersChanged.emit([],[r]),r}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class Rs extends c.Destroyable{constructor(...t){super();d(this,"_drgm",this.dv(new np));d(this,"_sobjm",this.dv(new m0));d(this,"_vrm",this.dv(new D0(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new g0));d(this,"_activeViewer",this.dv(c.react(void 0)));d(this,"_syncOtherViewersToActived",this.dv(c.react(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(Ms));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new mu("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new xl(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new c.Event));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"syncEvent",this.dv(c.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));d(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(r=>{t?r.syncOtherViewer(this.activeViewer):r.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(Qi));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new u0(this)));d(this,"_pathAnimationManager",this.dv(new h0(this)))}static get envs(){return j.context.environmentVariables}getSceneObjectById(t){return j.getSceneObjectById(t)}getSceneObject(t){return j.getSceneObject(t)}get $refs(){return j.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var f;const t=this._asset.createdTime||new Date().toISOString(),r=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:r,name:i},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(p=>p.json),h=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(r=>{const i=t.viewers.find(s=>s.id===r.id);i&&(r.json=i)})}catch(r){console.error(`ESObjectsManager解析json数据时发生错误! error: ${r}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return f0(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,r=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new mu(t,this.dragstartDataMananger,r,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const r=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=r);const i=this.d(r.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(r),i())}));return r}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,r=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&r&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?N0(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===t.type);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),r&&Yp(this,a),i&&this._lastActiveViewerJson&&(Hp(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===Up(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(t);return console.log(t),console.log(this),r&&Yp(this,l),i&&this._lastActiveViewerJson&&(Hp(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:r,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:r,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const r={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:l}=r;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,o,a)}}switchToUEViewer(...t){let r,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:f,viewSync:p,attributeSync:v,destroy:w,id:I}=t[0];r={type:"ESUeViewer",container:l,id:I,options:{uri:u,app:h,token:f}},i={viewSync:p??!0,attributeSync:v??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{ws:u,esmsg:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{project:u,baseUrl:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(r={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(r={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(r={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!r)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(r,s,o,a)}createCesiumViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createOpenLayersViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createUeViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?r={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!r)throw new Error("参数错误");return this.createViewer(r)}createSceneObject(t,r){return this._sobjm.createSceneObject(t,r)}createSceneObjectFromClass(t,r){return this._sobjm.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const r=this._sobjm.deleteSceneObject(t);return t.destroy(),r}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let r of t)r!=this._player&&r!=this._cmrvm&&this.destroySceneObject(r)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(Rs,"getSceneObjById",j.context.getSceneObjectById.bind(j.context)),d(Rs,"getEnv",j.context.getEnv.bind(j.context)),d(Rs,"setEnv",j.context.setEnv.bind(j.context)),(n=>{n.createDefaultProps=()=>({})})(Rs||(Rs={})),c.extendClassProps(Rs.prototype,Rs.createDefaultProps);function b0(){const n=navigator.userAgent;let e="Unknown";/Windows/.test(n)?e="Windows":/Macintosh/.test(n)?e="MacOS":/Linux/.test(n)?e="Linux":/Android/.test(n)?e="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?t="x64":/x86|i686|Win32/.test(n)?t="x86":/arm64|aarch64/.test(n)?t="arm64":/arm/.test(n)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const O0=Date.now();function Jp(n){const{os:e,arch:t}=b0(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-O0)/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(r));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))}P.copyright=void 0;try{const n="earthsdk3",e="3.4.0-beta.6",t="2025-08-13T02:44:57.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="1db9138c470e4d98418a0699adcb1700a2168ceb",a=((Date.now()-1755053097e3)/36e5).toFixed(1),l=`%c🌏 ${n}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
535
535
  %c${i?i+`
536
536
  `:""}当前网站正在使用${n},此软件版权归${r}所有
537
- `;P.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1db9138c470e4d98418a0699adcb1700a2168ceb")},get info(){return l},get date(){return"2025-08-13T02:44:57.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.4"},get name(){return"earthsdk3"},get commitId(){return"1db9138c470e4d98418a0699adcb1700a2168ceb"},print(){console.info(this.info,`
537
+ `;P.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","1db9138c470e4d98418a0699adcb1700a2168ceb")},get info(){return l},get date(){return"2025-08-13T02:44:57.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.6"},get name(){return"earthsdk3"},get commitId(){return"1db9138c470e4d98418a0699adcb1700a2168ceb"},print(){console.info(this.info,`
538
538
  font-size: 18px;
539
539
  font-weight: 1000;
540
540
  line-height: 1;