@maptiler/geocoding-control 0.0.91-git.4d23c0 → 0.0.91-git.535bd0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/leaflet.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Dt,$t){typeof exports=="object"&&typeof module<"u"?$t(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],$t):(Dt=typeof globalThis<"u"?globalThis:Dt||self,$t(Dt.leafletMaptilerGeocoder={},Dt.leaflet))})(this,function(Dt,$t){var Bn,di;"use strict";var nl=(Dt,$t,$e)=>{if(!$t.has(Dt))throw TypeError("Cannot "+$e)};var sr=(Dt,$t,$e)=>(nl(Dt,$t,"read from private field"),$e?$e.call(Dt):$t.get(Dt)),ra=(Dt,$t,$e)=>{if($t.has(Dt))throw TypeError("Cannot add the same private member more than once");$t instanceof WeakSet?$t.add(Dt):$t.set(Dt,$e)},hs=(Dt,$t,$e,tn)=>(nl(Dt,$t,"write to private field"),tn?tn.call(Dt,$e):$t.set(Dt,$e),$e);function $e(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const tn=$e($t);function _t(){}function rl(r,t){for(const e in t)r[e]=t[e];return r}function ia(r){return r()}function oa(){return Object.create(null)}function ar(r){r.forEach(ia)}function sa(r){return typeof r=="function"}function Sr(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}let Lo;function xr(r,t){return Lo||(Lo=document.createElement("a")),Lo.href=t,r===Lo.href}function il(r){return Object.keys(r).length===0}function ol(r,t,e,n){if(r){const i=aa(r,t,e,n);return r[0](i)}}function aa(r,t,e,n){return r[1]&&n?rl(e.ctx.slice(),r[1](n(t))):e.ctx}function sl(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function al(r,t,e,n,i,o){if(i){const s=aa(t,e,n,o);r.p(s,i)}}function ul(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function ua(r){return r??""}function rt(r,t){r.appendChild(t)}function Mt(r,t,e){r.insertBefore(t,e||null)}function Lt(r){r.parentNode&&r.parentNode.removeChild(r)}function ft(r){return document.createElement(r)}function Vn(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function wr(r){return document.createTextNode(r)}function en(){return wr(" ")}function ll(){return wr("")}function Ie(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function cl(r){return function(t){return t.preventDefault(),r.call(this,t)}}function P(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function fl(r){return Array.from(r.childNodes)}function Qi(r,t){t=""+t,r.data!==t&&(r.data=t)}function la(r,t){r.value=t??""}function nn(r,t,e){r.classList[e?"add":"remove"](t)}function hl(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Zi;function Ji(r){Zi=r}function ca(){if(!Zi)throw new Error("Function called outside component initialization");return Zi}function gl(r){ca().$$.on_destroy.push(r)}function pl(){const r=ca();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=hl(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}function fa(r,t){const e=r.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const mi=[],gs=[];let _i=[];const ha=[],dl=Promise.resolve();let ps=!1;function vl(){ps||(ps=!0,dl.then(ga))}function ds(r){_i.push(r)}const vs=new Set;let Ei=0;function ga(){if(Ei!==0)return;const r=Zi;do{try{for(;Ei<mi.length;){const t=mi[Ei];Ei++,Ji(t),yl(t.$$)}}catch(t){throw mi.length=0,Ei=0,t}for(Ji(null),mi.length=0,Ei=0;gs.length;)gs.pop()();for(let t=0;t<_i.length;t+=1){const e=_i[t];vs.has(e)||(vs.add(e),e())}_i.length=0}while(mi.length);for(;ha.length;)ha.pop()();ps=!1,vs.clear(),Ji(r)}function yl(r){if(r.fragment!==null){r.update(),ar(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(ds)}}function ml(r){const t=[],e=[];_i.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),_i=t}const bo=new Set;let Qr;function Po(){Qr={r:0,c:[],p:Qr}}function Ro(){Qr.r||ar(Qr.c),Qr=Qr.p}function Bt(r,t){r&&r.i&&(bo.delete(r),r.i(t))}function ce(r,t,e,n){if(r&&r.o){if(bo.has(r))return;bo.add(r),Qr.c.push(()=>{bo.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function _l(r,t){ce(r,1,1,()=>{t.delete(r.key)})}function El(r,t,e,n,i,o,s,a,u,l,c,f){let h=r.length,g=o.length,p=h;const y={};for(;p--;)y[r[p].key]=p;const d=[],m=new Map,E=new Map,C=[];for(p=g;p--;){const T=f(i,o,p),A=e(T);let w=s.get(A);w?n&&C.push(()=>w.p(T,t)):(w=l(A,T),w.c()),m.set(A,d[p]=w),A in y&&E.set(A,Math.abs(p-y[A]))}const L=new Set,N=new Set;function S(T){Bt(T,1),T.m(a,c),s.set(T.key,T),c=T.first,g--}for(;h&&g;){const T=d[g-1],A=r[h-1],w=T.key,F=A.key;T===A?(c=T.first,h--,g--):m.has(F)?!s.has(w)||L.has(w)?S(T):N.has(F)?h--:E.get(w)>E.get(F)?(N.add(w),S(T)):(L.add(F),h--):(u(A,s),h--)}for(;h--;){const T=r[h];m.has(T.key)||u(T,s)}for(;g;)S(d[g-1]);return ar(C),d}function Lr(r){r&&r.c()}function ur(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||ds(()=>{const s=r.$$.on_mount.map(ia).filter(sa);r.$$.on_destroy?r.$$.on_destroy.push(...s):ar(s),r.$$.on_mount=[]}),o.forEach(ds)}function lr(r,t){const e=r.$$;e.fragment!==null&&(ml(e.after_update),ar(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Il(r,t){r.$$.dirty[0]===-1&&(mi.push(r),vl(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function br(r,t,e,n,i,o,s,a=[-1]){const u=Zi;Ji(r);const l=r.$$={fragment:null,ctx:[],props:o,update:_t,not_equal:i,bound:oa(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:oa(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(r,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&Il(r,f)),h}):[],l.update(),c=!0,ar(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=fl(t.target);l.fragment&&l.fragment.l(f),f.forEach(Lt)}else l.fragment&&l.fragment.c();t.intro&&Bt(r.$$.fragment),ur(r,t.target,t.anchor,t.customElement),ga()}Ji(u)}class Pr{$destroy(){lr(this,1),this.$destroy=_t}$on(t,e){if(!sa(e))return _t;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!il(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Df="";function Cl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),P(t,"viewBox","0 0 14 14"),P(t,"width","13"),P(t,"height","13"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),rt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class pa extends Pr{constructor(t){super(),br(this,t,null,Cl,Sr,{})}}const Mf="";function Nl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),P(t,"viewBox","0 0 30 30"),P(t,"fill","none"),P(t,"xmlns","http://www.w3.org/2000/svg"),P(t,"class","svelte-d2loi5")},m(n,i){Mt(n,t,i),rt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class da extends Pr{constructor(t){super(),br(this,t,null,Nl,Sr,{})}}const Af="";function Sl(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/area.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function xl(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/poi.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function wl(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/postal_code.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Ll(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/street.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function bl(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/road.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Pl(r){let t,e;return{c(){t=ft("img"),xr(t.src,e="/icons/housenumber.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Rl(r){let t,e,n,i;return{c(){t=ft("img"),xr(t.src,e=r[5])||P(t,"src",e),P(t,"alt",r[3]),P(t,"class","svelte-ltkwvy")},m(o,s){Mt(o,t,s),n||(i=Ie(t,"error",r[10]),n=!0)},p(o,s){s&32&&!xr(t.src,e=o[5])&&P(t,"src",e),s&8&&P(t,"alt",o[3])},d(o){o&&Lt(t),n=!1,i()}}}function va(r){let t,e;return{c(){t=ft("span"),e=wr(r[4]),P(t,"class","secondary svelte-ltkwvy")},m(n,i){Mt(n,t,i),rt(t,e)},p(n,i){i&16&&Qi(e,n[4])},d(n){n&&Lt(t)}}}function Ol(r){var T,A;let t,e,n,i,o,s,a,u,l=r[0].place_name.replace(/,.*/,"")+"",c,f,h=r[2]==="always"||r[2]&&!r[0].address&&((T=r[0].properties)==null?void 0:T.kind)!=="road"&&((A=r[0].properties)==null?void 0:A.kind)!=="road_relation"&&!r[0].id.startsWith("address.")&&!r[0].id.startsWith("postal_code.")&&(!r[0].id.startsWith("poi.")||!r[5]),g,p,y=r[0].place_name.replace(/[^,]*,?\s*/,"")+"",d,m,E;function C(w,F){var X,R;return F&1&&(e=null),F&1&&(n=null),F&1&&(i=null),w[5]?Rl:w[0].address?Pl:((X=w[0].properties)==null?void 0:X.kind)==="road"||((R=w[0].properties)==null?void 0:R.kind)==="road_relation"?bl:(e==null&&(e=!!w[0].id.startsWith("address.")),e?Ll:(n==null&&(n=!!w[0].id.startsWith("postal_code.")),n?wl:(i==null&&(i=!!w[0].id.startsWith("poi.")),i?xl:Sl)))}let L=C(r,-1),N=L(r),S=h&&va(r);return{c(){t=ft("li"),N.c(),o=en(),s=ft("span"),a=ft("span"),u=ft("span"),c=wr(l),f=en(),S&&S.c(),g=en(),p=ft("span"),d=wr(y),P(u,"class","primary svelte-ltkwvy"),P(a,"class","svelte-ltkwvy"),P(p,"class","line2 svelte-ltkwvy"),P(s,"class","texts svelte-ltkwvy"),P(t,"tabindex","0"),P(t,"data-selected",r[1]),P(t,"class","svelte-ltkwvy"),nn(t,"selected",r[1])},m(w,F){Mt(w,t,F),N.m(t,null),rt(t,o),rt(t,s),rt(s,a),rt(a,u),rt(u,c),rt(a,f),S&&S.m(a,null),rt(s,g),rt(s,p),rt(p,d),m||(E=[Ie(t,"mouseenter",r[8]),Ie(t,"focus",r[9])],m=!0)},p(w,[F]){var X,R;L===(L=C(w,F))&&N?N.p(w,F):(N.d(1),N=L(w),N&&(N.c(),N.m(t,o))),F&1&&l!==(l=w[0].place_name.replace(/,.*/,"")+"")&&Qi(c,l),F&37&&(h=w[2]==="always"||w[2]&&!w[0].address&&((X=w[0].properties)==null?void 0:X.kind)!=="road"&&((R=w[0].properties)==null?void 0:R.kind)!=="road_relation"&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])),h?S?S.p(w,F):(S=va(w),S.c(),S.m(a,null)):S&&(S.d(1),S=null),F&1&&y!==(y=w[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Qi(d,y),F&2&&P(t,"data-selected",w[1]),F&2&&nn(t,"selected",w[1])},i:_t,o:_t,d(w){w&&Lt(t),N.d(),S&&S.d(),m=!1,ar(E)}}}function Tl(r,t,e){var y;let n,i,o,s,{feature:a}=t,{selected:u=!1}=t,{showPlaceType:l}=t;const c=(y=a.properties)==null?void 0:y.categories;function f(d){n>-1?e(7,n--,n):d.style.visibility="hidden"}function h(d){fa.call(this,r,d)}function g(d){fa.call(this,r,d)}const p=d=>f(d.currentTarget);return r.$$set=d=>{"feature"in d&&e(0,a=d.feature),"selected"in d&&e(1,u=d.selected),"showPlaceType"in d&&e(2,l=d.showPlaceType)},r.$$.update=()=>{var d,m,E,C;r.$$.dirty&128&&e(3,i=c==null?void 0:c[n]),r.$$.dirty&8&&e(5,o=i?`/icons/${i.replace(/ /g,"_")}.svg`:void 0),r.$$.dirty&1&&e(4,s=a.id.startsWith("poi.")?(m=(d=a.properties)==null?void 0:d.categories)==null?void 0:m.join(" ,"):((C=(E=a.properties)==null?void 0:E.place_type_name)==null?void 0:C[0])??a.place_type[0])},e(7,n=((c==null?void 0:c.length)??0)-1),[a,u,l,i,s,o,f,n,h,g,p]}class Dl extends Pr{constructor(t){super(),br(this,t,Tl,Ol,Sr,{feature:0,selected:1,showPlaceType:2})}}const Ff="";function Ml(r){let t;return{c(){t=ft("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',P(t,"class","svelte-7cmwmc")},m(e,n){Mt(e,t,n)},p:_t,i:_t,o:_t,d(e){e&&Lt(t)}}}class Al extends Pr{constructor(t){super(),br(this,t,null,Ml,Sr,{})}}const kf="";function Fl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),P(t,"viewBox","0 0 60.006 21.412"),P(t,"width","14"),P(t,"height","20"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),rt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class kl extends Pr{constructor(t){super(),br(this,t,null,Fl,Sr,{})}}const Bf="";function Bl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"),P(t,"width","14"),P(t,"height","14"),P(t,"viewBox","0 0 15 15"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),rt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class Gl extends Pr{constructor(t){super(),br(this,t,null,Bl,Sr,{})}}const Gf="";function ya(r,t,e){const n=r.slice();return n[71]=t[e],n[73]=e,n}function ma(r){let t,e;return t=new Al({}),{c(){Lr(t.$$.fragment)},m(n,i){ur(t,n,i),e=!0},i(n){e||(Bt(t.$$.fragment,n),e=!0)},o(n){ce(t.$$.fragment,n),e=!1},d(n){lr(t,n)}}}function _a(r){let t,e,n,i,o;return e=new kl({}),{c(){t=ft("button"),Lr(e.$$.fragment),P(t,"type","button"),P(t,"title",r[9]),P(t,"class","svelte-1r7dvt7"),nn(t,"active",r[0])},m(s,a){Mt(s,t,a),ur(e,t,null),n=!0,i||(o=Ie(t,"click",r[57]),i=!0)},p(s,a){(!n||a[0]&512)&&P(t,"title",s[9]),(!n||a[0]&1)&&nn(t,"active",s[0])},i(s){n||(Bt(e.$$.fragment,s),n=!0)},o(s){ce(e.$$.fragment,s),n=!1},d(s){s&&Lt(t),lr(e),i=!1,o()}}}function zl(r){let t,e=[],n=new Map,i,o,s,a=r[12];const u=l=>l[71].id;for(let l=0;l<a.length;l+=1){let c=ya(r,a,l),f=u(c);n.set(f,e[l]=Ea(f,c))}return{c(){t=ft("ul");for(let l=0;l<e.length;l+=1)e[l].c();P(t,"class","svelte-1r7dvt7")},m(l,c){Mt(l,t,c);for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(t,null);i=!0,o||(s=[Ie(t,"mouseleave",r[61]),Ie(t,"blur",r[62])],o=!0)},p(l,c){c[0]&2110464&&(a=l[12],Po(),e=El(e,c,u,1,l,a,n,t,_l,Ea,null,ya),Ro())},i(l){if(!i){for(let c=0;c<a.length;c+=1)Bt(e[c]);i=!0}},o(l){for(let c=0;c<e.length;c+=1)ce(e[c]);i=!1},d(l){l&&Lt(t);for(let c=0;c<e.length;c+=1)e[c].d();o=!1,ar(s)}}}function Vl(r){let t,e,n,i,o,s;return e=new da({}),{c(){t=ft("div"),Lr(e.$$.fragment),n=en(),i=ft("div"),o=wr(r[7]),P(i,"class","svelte-1r7dvt7"),P(t,"class","no-results svelte-1r7dvt7")},m(a,u){Mt(a,t,u),ur(e,t,null),rt(t,n),rt(t,i),rt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Qi(o,a[7])},i(a){s||(Bt(e.$$.fragment,a),s=!0)},o(a){ce(e.$$.fragment,a),s=!1},d(a){a&&Lt(t),lr(e)}}}function Ul(r){let t="",e;return{c(){e=wr(t)},m(n,i){Mt(n,e,i)},p:_t,i:_t,o:_t,d(n){n&&Lt(e)}}}function ql(r){let t,e,n,i,o,s,a,u,l,c,f;return e=new da({}),u=new pa({}),{c(){t=ft("div"),Lr(e.$$.fragment),n=en(),i=ft("div"),o=wr(r[6]),s=en(),a=ft("button"),Lr(u.$$.fragment),P(i,"class","svelte-1r7dvt7"),P(a,"class","svelte-1r7dvt7"),P(t,"class","error svelte-1r7dvt7")},m(h,g){Mt(h,t,g),ur(e,t,null),rt(t,n),rt(t,i),rt(i,o),rt(t,s),rt(t,a),ur(u,a,null),l=!0,c||(f=Ie(a,"click",r[58]),c=!0)},p(h,g){(!l||g[0]&64)&&Qi(o,h[6])},i(h){l||(Bt(e.$$.fragment,h),Bt(u.$$.fragment,h),l=!0)},o(h){ce(e.$$.fragment,h),ce(u.$$.fragment,h),l=!1},d(h){h&&Lt(t),lr(e),lr(u),c=!1,f()}}}function Ea(r,t){let e,n,i;function o(){return t[59](t[73])}function s(){return t[60](t[71])}return n=new Dl({props:{feature:t[71],showPlaceType:t[10],selected:t[13]===t[73]}}),n.$on("mouseenter",o),n.$on("focus",s),{key:r,first:null,c(){e=ll(),Lr(n.$$.fragment),this.first=e},m(a,u){Mt(a,e,u),ur(n,a,u),i=!0},p(a,u){t=a;const l={};u[0]&4096&&(l.feature=t[71]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&12288&&(l.selected=t[13]===t[73]),n.$set(l)},i(a){i||(Bt(n.$$.fragment,a),i=!0)},o(a){ce(n.$$.fragment,a),i=!1},d(a){a&&Lt(e),lr(n,a)}}}function Xl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,y,d,m,E,C,L;i=new Gl({}),c=new pa({});let N=r[17]&&ma(),S=r[5]===!0&&_a(r);const T=r[49].default,A=ol(T,r,r[48],null),w=[ql,Ul,Vl,zl],F=[];function X(R,Y){var D,W;return R[16]?0:R[14]?((D=R[12])==null?void 0:D.length)===0?2:R[14]&&((W=R[12])!=null&&W.length)?3:-1:1}return~(y=X(r))&&(d=F[y]=w[y](r)),{c(){t=ft("form"),e=ft("div"),n=ft("button"),Lr(i.$$.fragment),o=en(),s=ft("input"),a=en(),u=ft("div"),l=ft("button"),Lr(c.$$.fragment),f=en(),N&&N.c(),h=en(),S&&S.c(),g=en(),A&&A.c(),p=en(),d&&d.c(),P(n,"class","search-button svelte-1r7dvt7"),P(n,"type","button"),P(s,"placeholder",r[8]),P(s,"aria-label",r[8]),P(s,"class","svelte-1r7dvt7"),P(l,"type","button"),P(l,"title",r[3]),P(l,"class","svelte-1r7dvt7"),P(u,"class","clear-button-container svelte-1r7dvt7"),nn(u,"displayable",r[1]!==""),P(e,"class","input-group svelte-1r7dvt7"),P(t,"tabindex","0"),P(t,"class",m=ua(r[2])+" svelte-1r7dvt7"),nn(t,"can-collapse",r[4]&&r[1]==="")},m(R,Y){Mt(R,t,Y),rt(t,e),rt(e,n),ur(i,n,null),rt(e,o),rt(e,s),r[51](s),la(s,r[1]),rt(e,a),rt(e,u),rt(u,l),ur(c,l,null),rt(u,f),N&&N.m(u,null),rt(e,h),S&&S.m(e,null),rt(e,g),A&&A.m(e,null),rt(t,p),~y&&F[y].m(t,null),E=!0,C||(L=[Ie(n,"click",r[50]),Ie(s,"input",r[52]),Ie(s,"focus",r[53]),Ie(s,"blur",r[54]),Ie(s,"keydown",r[19]),Ie(s,"input",r[55]),Ie(l,"click",r[56]),Ie(t,"submit",cl(r[18]))],C=!0)},p(R,Y){(!E||Y[0]&256)&&P(s,"placeholder",R[8]),(!E||Y[0]&256)&&P(s,"aria-label",R[8]),Y[0]&2&&s.value!==R[1]&&la(s,R[1]),(!E||Y[0]&8)&&P(l,"title",R[3]),R[17]?N?Y[0]&131072&&Bt(N,1):(N=ma(),N.c(),Bt(N,1),N.m(u,null)):N&&(Po(),ce(N,1,1,()=>{N=null}),Ro()),(!E||Y[0]&2)&&nn(u,"displayable",R[1]!==""),R[5]===!0?S?(S.p(R,Y),Y[0]&32&&Bt(S,1)):(S=_a(R),S.c(),Bt(S,1),S.m(e,g)):S&&(Po(),ce(S,1,1,()=>{S=null}),Ro()),A&&A.p&&(!E||Y[1]&131072)&&al(A,T,R,R[48],E?sl(T,R[48],Y,null):ul(R[48]),null);let D=y;y=X(R),y===D?~y&&F[y].p(R,Y):(d&&(Po(),ce(F[D],1,1,()=>{F[D]=null}),Ro()),~y?(d=F[y],d?d.p(R,Y):(d=F[y]=w[y](R),d.c()),Bt(d,1),d.m(t,null)):d=null),(!E||Y[0]&4&&m!==(m=ua(R[2])+" svelte-1r7dvt7"))&&P(t,"class",m),(!E||Y[0]&22)&&nn(t,"can-collapse",R[4]&&R[1]==="")},i(R){E||(Bt(i.$$.fragment,R),Bt(c.$$.fragment,R),Bt(N),Bt(S),Bt(A,R),Bt(d),E=!0)},o(R){ce(i.$$.fragment,R),ce(c.$$.fragment,R),ce(N),ce(S),ce(A,R),ce(d),E=!1},d(R){R&&Lt(t),lr(i),r[51](null),lr(c),N&&N.d(),S&&S.d(),A&&A.d(R),~y&&F[y].d(),C=!1,ar(L)}}}function Yl(r,t,e){const n=t[1],i=t[0],o=n-i;return r===n&&e?r:((r-i)%o+o)%o+i}function Ia(r){let t=[...r];return t[2]<t[0]&&(t[2]+=360),t}function Wl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:y="Something went wrong…"}=t,{filter:d=()=>!0}=t,{flyTo:m=!0}=t,{fuzzyMatch:E=!0}=t,{language:C=void 0}=t,{limit:L=void 0}=t,{mapController:N=void 0}=t,{minLength:S=2}=t,{noResultsMessage:T="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:A="Search"}=t,{proximity:w=void 0}=t,{reverseActive:F=p==="always"}=t,{reverseButtonTitle:X="toggle reverse geocoding"}=t,{searchValue:R=""}=t,{showFullGeometry:Y=!0}=t,{showPlaceType:D="ifNeeded"}=t,{showResultsWhileTyping:W=!0}=t,{trackProximity:ut=!0}=t,{types:mt=void 0}=t,{zoom:Jt=16}=t,{maxZoom:le=18}=t,{fetchParameters:Cr={}}=t;function Gn(){rr.focus()}function Nr(){rr.blur()}function Nn(x,Ht=!0){e(1,R=x),Ht?(e(13,Wt=-1),tl()):($s(),setTimeout(()=>{rr.focus(),rr.select()}))}let zn=!1,nt,Oe,pt,$u="",rr,Wt=-1,ir,cs=[],vi,ji,fs;const jr=pl();gl(()=>{N&&(N.setEventHandler(void 0),N.indicateReverse(!1),N.setSelectedMarker(-1),N.setMarkers(void 0,void 0))});function tl(x){if(ji&&(clearTimeout(ji),ji=void 0),Wt>-1&&nt)e(46,pt=nt[Wt]),e(1,R=pt.place_name.replace(/,.*/,"")),e(16,ir=void 0),e(45,Oe=void 0),e(13,Wt=-1);else if(R){const Ht=x||!el();Js(R,{exact:!0}).then(()=>{e(45,Oe=nt),e(46,pt=void 0),Ht&&yf()}).catch(or=>e(16,ir=or))}}function el(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(R)}async function Js(x,{byId:Ht=!1,exact:or=!1}={}){e(16,ir=void 0);const Ki=el(),Je=new URLSearchParams;C!=null&&Je.set("language",Array.isArray(C)?C.join(","):C),mt&&Je.set("types",mt.join(",")),Ki||(u&&Je.set("bbox",u.map(Kr=>Kr.toFixed(6)).join(",")),h&&Je.set("country",Array.isArray(h)?h.join(","):h)),Ht||(w&&Je.set("proximity",w.map(Kr=>Kr.toFixed(6)).join(",")),(or||!W)&&Je.set("autocomplete","false"),Je.set("fuzzyMatch",String(E))),L!==void 0&&(!Ki||(mt==null?void 0:mt.length)===1)&&Je.set("limit",String(L)),Je.set("key",a);const yi="https://api.maptiler.com/geocoding/"+encodeURIComponent(x)+".json?"+Je.toString();if(yi===$u){Ht?(e(12,nt=void 0),e(46,pt=cs[0])):e(12,nt=cs);return}$u=yi,vi==null||vi.abort();const Te=new AbortController;e(17,vi=Te);let ea;try{ea=await fetch(yi,{signal:Te.signal,...Cr}).finally(()=>{Te===vi&&e(17,vi=void 0)})}catch(Kr){if(Kr&&typeof Kr=="object"&&"name"in Kr&&Kr.name==="AbortError")return;throw new Error}if(!ea.ok)throw new Error;const na=await ea.json();jr("response",{url:yi,featureCollection:na}),Ht?(e(12,nt=void 0),e(46,pt=na.features[0]),cs=[pt]):(e(12,nt=na.features.filter(d)),cs=nt,Ki&&rr.focus())}function yf(){var or,Ki,Je,yi;if(!(Oe!=null&&Oe.length)||!m)return;const x=[180,90,-180,-90],Ht=!Oe.some(Te=>!Te.matching_text);for(const Te of Oe)(Ht||!Te.matching_text)&&(x[0]=Math.min(x[0],((or=Te.bbox)==null?void 0:or[0])??Te.center[0]),x[1]=Math.min(x[1],((Ki=Te.bbox)==null?void 0:Ki[1])??Te.center[1]),x[2]=Math.max(x[2],((Je=Te.bbox)==null?void 0:Je[2])??Te.center[0]),x[3]=Math.max(x[3],((yi=Te.bbox)==null?void 0:yi[3])??Te.center[1]));N&&Oe.length>0&&(pt&&x[0]===x[2]&&x[1]===x[3]?N.flyTo(pt.center,Jt):N.fitBounds(Ia(x),50,le))}function mf(x){e(0,F=p==="always"),Nn(Yl(x[0],[-180,180],!0).toFixed(6)+","+x[1].toFixed(6))}function _f(x){if(!nt)return;let Ht=x.key==="ArrowDown"?1:x.key==="ArrowUp"?-1:0;Ht?(Wt===-1&&Ht===-1&&e(13,Wt=nt.length),e(13,Wt+=Ht),Wt>=nt.length&&e(13,Wt=-1),x.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(x.key)&&e(13,Wt=-1)}function $s(x=!0){if(e(16,ir=void 0),W){if(ji&&clearTimeout(ji),R.length<S)return;const Ht=R;ji=window.setTimeout(()=>{Js(Ht).catch(or=>e(16,ir=or))},x?g:0)}else e(12,nt=void 0),e(16,ir=void 0)}function ta(x){e(46,pt=x),e(1,R=x.place_name),e(13,Wt=-1)}const Ef=()=>rr.focus();function If(x){gs[x?"unshift":"push"](()=>{rr=x,e(15,rr)})}function Cf(){R=this.value,e(1,R),e(11,zn),e(25,c)}const Nf=()=>e(11,zn=!0),Sf=()=>e(11,zn=!1),xf=()=>$s(),wf=()=>{e(1,R=""),rr.focus()},Lf=()=>e(0,F=!F),bf=()=>e(16,ir=void 0),Pf=x=>e(13,Wt=x),Rf=x=>ta(x),Of=()=>e(13,Wt=-1),Tf=()=>{};return r.$$set=x=>{"class"in x&&e(2,s=x.class),"apiKey"in x&&e(23,a=x.apiKey),"bbox"in x&&e(24,u=x.bbox),"clearButtonTitle"in x&&e(3,l=x.clearButtonTitle),"clearOnBlur"in x&&e(25,c=x.clearOnBlur),"collapsed"in x&&e(4,f=x.collapsed),"country"in x&&e(26,h=x.country),"debounceSearch"in x&&e(27,g=x.debounceSearch),"enableReverse"in x&&e(5,p=x.enableReverse),"errorMessage"in x&&e(6,y=x.errorMessage),"filter"in x&&e(28,d=x.filter),"flyTo"in x&&e(29,m=x.flyTo),"fuzzyMatch"in x&&e(30,E=x.fuzzyMatch),"language"in x&&e(31,C=x.language),"limit"in x&&e(32,L=x.limit),"mapController"in x&&e(33,N=x.mapController),"minLength"in x&&e(34,S=x.minLength),"noResultsMessage"in x&&e(7,T=x.noResultsMessage),"placeholder"in x&&e(8,A=x.placeholder),"proximity"in x&&e(22,w=x.proximity),"reverseActive"in x&&e(0,F=x.reverseActive),"reverseButtonTitle"in x&&e(9,X=x.reverseButtonTitle),"searchValue"in x&&e(1,R=x.searchValue),"showFullGeometry"in x&&e(35,Y=x.showFullGeometry),"showPlaceType"in x&&e(10,D=x.showPlaceType),"showResultsWhileTyping"in x&&e(36,W=x.showResultsWhileTyping),"trackProximity"in x&&e(37,ut=x.trackProximity),"types"in x&&e(38,mt=x.types),"zoom"in x&&e(39,Jt=x.zoom),"maxZoom"in x&&e(40,le=x.maxZoom),"fetchParameters"in x&&e(41,Cr=x.fetchParameters),"$$scope"in x&&e(48,o=x.$$scope)},r.$$.update=()=>{if(r.$$.dirty[1]&64&&(ut||e(22,w=void 0)),r.$$.dirty[0]&33556480&&setTimeout(()=>{e(14,fs=zn),c&&!zn&&e(1,R="")}),r.$$.dirty[0]&4098|r.$$.dirty[1]&8&&R.length<S&&(e(46,pt=void 0),e(12,nt=void 0),e(16,ir=void 0),e(45,Oe=nt)),r.$$.dirty[1]&32784&&Y&&pt&&!pt.address&&pt.geometry.type==="Point"&&Js(pt.id,{byId:!0}).catch(x=>e(16,ir=x)),r.$$.dirty[0]&536870912|r.$$.dirty[1]&33540&&N&&pt&&m&&(!pt.bbox||pt.bbox[0]===pt.bbox[2]&&pt.bbox[1]===pt.bbox[3]?N.flyTo(pt.center,pt.id.startsWith("poi.")||pt.id.startsWith("address.")?le:Jt):N.fitBounds(Ia(pt.bbox),50,le),e(12,nt=void 0),e(45,Oe=void 0),e(13,Wt=-1)),r.$$.dirty[0]&4096|r.$$.dirty[1]&16384&&Oe!==nt&&e(45,Oe=void 0),r.$$.dirty[1]&49156&&N&&N.setMarkers(Oe,pt),r.$$.dirty[0]&2&&e(13,Wt=-1),r.$$.dirty[0]&20481|r.$$.dirty[1]&68&&N&&N.setEventHandler(x=>{switch(x.type){case"mapClick":F&&mf(x.coordinates);break;case"proximityChange":e(22,w=ut?x.proximity:void 0);break;case"markerClick":{const Ht=nt==null?void 0:nt.find(or=>or.id===x.id);Ht&&ta(Ht)}break;case"markerMouseEnter":e(13,Wt=fs?(nt==null?void 0:nt.findIndex(Ht=>Ht.id===x.id))??-1:-1);break;case"markerMouseLeave":e(13,Wt=-1);break}}),r.$$.dirty[0]&8192|r.$$.dirty[1]&4&&(N==null||N.setSelectedMarker(Wt)),r.$$.dirty[0]&12288&&e(47,n=nt==null?void 0:nt[Wt]),r.$$.dirty[0]&2|r.$$.dirty[1]&4){const x=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(R);N==null||N.setReverseMarker(x?[Number(x[1]),Number(x[2])]:void 0)}r.$$.dirty[1]&65536&&jr("select",n),r.$$.dirty[1]&32768&&jr("pick",pt),r.$$.dirty[0]&20480&&jr("optionsVisibilityChange",fs&&!!nt),r.$$.dirty[0]&4096&&jr("featuresListed",nt),r.$$.dirty[1]&16384&&jr("featuresMarked",Oe),r.$$.dirty[0]&1&&jr("reverseToggle",F),r.$$.dirty[0]&2&&jr("queryChange",R),r.$$.dirty[0]&1|r.$$.dirty[1]&4&&N&&N.indicateReverse(F)},[F,R,s,l,f,p,y,T,A,X,D,zn,nt,Wt,fs,rr,ir,vi,tl,_f,$s,ta,w,a,u,c,h,g,d,m,E,C,L,N,S,Y,W,ut,mt,Jt,le,Cr,Gn,Nr,Nn,Oe,pt,n,o,i,Ef,If,Cf,Nf,Sf,xf,wf,Lf,bf,Pf,Rf,Of,Tf]}let Hl=class extends Pr{constructor(t){super(),br(this,t,Wl,Xl,Sr,{class:2,apiKey:23,bbox:24,clearButtonTitle:3,clearOnBlur:25,collapsed:4,country:26,debounceSearch:27,enableReverse:5,errorMessage:6,filter:28,flyTo:29,fuzzyMatch:30,language:31,limit:32,mapController:33,minLength:34,noResultsMessage:7,placeholder:8,proximity:22,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:35,showPlaceType:10,showResultsWhileTyping:36,trackProximity:37,types:38,zoom:39,maxZoom:40,fetchParameters:41,focus:42,blur:43,setQuery:44},null,[-1,-1,-1])}get focus(){return this.$$.ctx[42]}get blur(){return this.$$.ctx[43]}get setQuery(){return this.$$.ctx[44]}};/**
1
+ (function(Dt,$t){typeof exports=="object"&&typeof module<"u"?$t(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],$t):(Dt=typeof globalThis<"u"?globalThis:Dt||self,$t(Dt.leafletMaptilerGeocoder={},Dt.leaflet))})(this,function(Dt,$t){var Gn,di;"use strict";var il=(Dt,$t,en)=>{if(!$t.has(Dt))throw TypeError("Cannot "+en)};var sr=(Dt,$t,en)=>(il(Dt,$t,"read from private field"),en?en.call(Dt):$t.get(Dt)),oa=(Dt,$t,en)=>{if($t.has(Dt))throw TypeError("Cannot add the same private member more than once");$t instanceof WeakSet?$t.add(Dt):$t.set(Dt,en)},gs=(Dt,$t,en,nn)=>(il(Dt,$t,"write to private field"),nn?nn.call(Dt,en):$t.set(Dt,en),en);function en(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const nn=en($t);function _t(){}function ol(r,t){for(const e in t)r[e]=t[e];return r}function sa(r){return r()}function aa(){return Object.create(null)}function ar(r){r.forEach(sa)}function ua(r){return typeof r=="function"}function Sr(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}let bo;function xr(r,t){return bo||(bo=document.createElement("a")),bo.href=t,r===bo.href}function sl(r){return Object.keys(r).length===0}function al(r,t,e,n){if(r){const i=la(r,t,e,n);return r[0](i)}}function la(r,t,e,n){return r[1]&&n?ol(e.ctx.slice(),r[1](n(t))):e.ctx}function ul(r,t,e,n){if(r[2]&&n){const i=r[2](n(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(t.dirty.length,i.length);for(let a=0;a<s;a+=1)o[a]=t.dirty[a]|i[a];return o}return t.dirty|i}return t.dirty}function ll(r,t,e,n,i,o){if(i){const s=la(t,e,n,o);r.p(s,i)}}function cl(r){if(r.ctx.length>32){const t=[],e=r.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function ca(r){return r??""}function nt(r,t){r.appendChild(t)}function Mt(r,t,e){r.insertBefore(t,e||null)}function Lt(r){r.parentNode&&r.parentNode.removeChild(r)}function ht(r){return document.createElement(r)}function Vn(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function wr(r){return document.createTextNode(r)}function rn(){return wr(" ")}function fl(){return wr("")}function Ie(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function hl(r){return function(t){return t.preventDefault(),r.call(this,t)}}function P(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function gl(r){return Array.from(r.childNodes)}function Zi(r,t){t=""+t,r.data!==t&&(r.data=t)}function fa(r,t){r.value=t??""}function on(r,t,e){r.classList[e?"add":"remove"](t)}function pl(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Ji;function $i(r){Ji=r}function ha(){if(!Ji)throw new Error("Function called outside component initialization");return Ji}function dl(r){ha().$$.on_destroy.push(r)}function vl(){const r=ha();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=pl(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}function ga(r,t){const e=r.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const _i=[],ps=[];let Ei=[];const pa=[],yl=Promise.resolve();let ds=!1;function ml(){ds||(ds=!0,yl.then(da))}function vs(r){Ei.push(r)}const ys=new Set;let Ii=0;function da(){if(Ii!==0)return;const r=Ji;do{try{for(;Ii<_i.length;){const t=_i[Ii];Ii++,$i(t),_l(t.$$)}}catch(t){throw _i.length=0,Ii=0,t}for($i(null),_i.length=0,Ii=0;ps.length;)ps.pop()();for(let t=0;t<Ei.length;t+=1){const e=Ei[t];ys.has(e)||(ys.add(e),e())}Ei.length=0}while(_i.length);for(;pa.length;)pa.pop()();ds=!1,ys.clear(),$i(r)}function _l(r){if(r.fragment!==null){r.update(),ar(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(vs)}}function El(r){const t=[],e=[];Ei.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Ei=t}const Po=new Set;let Qr;function Ro(){Qr={r:0,c:[],p:Qr}}function Oo(){Qr.r||ar(Qr.c),Qr=Qr.p}function Bt(r,t){r&&r.i&&(Po.delete(r),r.i(t))}function ce(r,t,e,n){if(r&&r.o){if(Po.has(r))return;Po.add(r),Qr.c.push(()=>{Po.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function Il(r,t){ce(r,1,1,()=>{t.delete(r.key)})}function Cl(r,t,e,n,i,o,s,a,u,l,c,f){let h=r.length,g=o.length,p=h;const y={};for(;p--;)y[r[p].key]=p;const d=[],m=new Map,E=new Map,C=[];for(p=g;p--;){const T=f(i,o,p),A=e(T);let w=s.get(A);w?n&&C.push(()=>w.p(T,t)):(w=l(A,T),w.c()),m.set(A,d[p]=w),A in y&&E.set(A,Math.abs(p-y[A]))}const L=new Set,N=new Set;function x(T){Bt(T,1),T.m(a,c),s.set(T.key,T),c=T.first,g--}for(;h&&g;){const T=d[g-1],A=r[h-1],w=T.key,F=A.key;T===A?(c=T.first,h--,g--):m.has(F)?!s.has(w)||L.has(w)?x(T):N.has(F)?h--:E.get(w)>E.get(F)?(N.add(w),x(T)):(L.add(F),h--):(u(A,s),h--)}for(;h--;){const T=r[h];m.has(T.key)||u(T,s)}for(;g;)x(d[g-1]);return ar(C),d}function Lr(r){r&&r.c()}function ur(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||vs(()=>{const s=r.$$.on_mount.map(sa).filter(ua);r.$$.on_destroy?r.$$.on_destroy.push(...s):ar(s),r.$$.on_mount=[]}),o.forEach(vs)}function lr(r,t){const e=r.$$;e.fragment!==null&&(El(e.after_update),ar(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Nl(r,t){r.$$.dirty[0]===-1&&(_i.push(r),ml(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function br(r,t,e,n,i,o,s,a=[-1]){const u=Ji;$i(r);const l=r.$$={fragment:null,ctx:[],props:o,update:_t,not_equal:i,bound:aa(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:aa(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};s&&s(l.root);let c=!1;if(l.ctx=e?e(r,t.props||{},(f,h,...g)=>{const p=g.length?g[0]:h;return l.ctx&&i(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&Nl(r,f)),h}):[],l.update(),c=!0,ar(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=gl(t.target);l.fragment&&l.fragment.l(f),f.forEach(Lt)}else l.fragment&&l.fragment.c();t.intro&&Bt(r.$$.fragment),ur(r,t.target,t.anchor,t.customElement),da()}$i(u)}class Pr{$destroy(){lr(this,1),this.$destroy=_t}$on(t,e){if(!ua(e))return _t;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!sl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Af="";function Sl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),P(t,"viewBox","0 0 14 14"),P(t,"width","13"),P(t,"height","13"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),nt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class va extends Pr{constructor(t){super(),br(this,t,null,Sl,Sr,{})}}const Ff="";function xl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),P(t,"viewBox","0 0 30 30"),P(t,"fill","none"),P(t,"xmlns","http://www.w3.org/2000/svg"),P(t,"class","svelte-d2loi5")},m(n,i){Mt(n,t,i),nt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class ya extends Pr{constructor(t){super(),br(this,t,null,xl,Sr,{})}}const kf="";function wl(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/area.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Ll(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/poi.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function bl(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/postal_code.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Pl(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/street.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Rl(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/road.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Ol(r){let t,e;return{c(){t=ht("img"),xr(t.src,e="/icons/housenumber.svg")||P(t,"src",e),P(t,"alt",r[4]),P(t,"class","svelte-ltkwvy")},m(n,i){Mt(n,t,i)},p(n,i){i&16&&P(t,"alt",n[4])},d(n){n&&Lt(t)}}}function Tl(r){let t,e,n,i;return{c(){t=ht("img"),xr(t.src,e=r[5])||P(t,"src",e),P(t,"alt",r[3]),P(t,"class","svelte-ltkwvy")},m(o,s){Mt(o,t,s),n||(i=Ie(t,"error",r[10]),n=!0)},p(o,s){s&32&&!xr(t.src,e=o[5])&&P(t,"src",e),s&8&&P(t,"alt",o[3])},d(o){o&&Lt(t),n=!1,i()}}}function ma(r){let t,e;return{c(){t=ht("span"),e=wr(r[4]),P(t,"class","secondary svelte-ltkwvy")},m(n,i){Mt(n,t,i),nt(t,e)},p(n,i){i&16&&Zi(e,n[4])},d(n){n&&Lt(t)}}}function Dl(r){var T,A;let t,e,n,i,o,s,a,u,l=r[0].place_name.replace(/,.*/,"")+"",c,f,h=r[2]==="always"||r[2]&&!r[0].address&&((T=r[0].properties)==null?void 0:T.kind)!=="road"&&((A=r[0].properties)==null?void 0:A.kind)!=="road_relation"&&!r[0].id.startsWith("address.")&&!r[0].id.startsWith("postal_code.")&&(!r[0].id.startsWith("poi.")||!r[5]),g,p,y=r[0].place_name.replace(/[^,]*,?\s*/,"")+"",d,m,E;function C(w,F){var X,R;return F&1&&(e=null),F&1&&(n=null),F&1&&(i=null),w[5]?Tl:w[0].address?Ol:((X=w[0].properties)==null?void 0:X.kind)==="road"||((R=w[0].properties)==null?void 0:R.kind)==="road_relation"?Rl:(e==null&&(e=!!w[0].id.startsWith("address.")),e?Pl:(n==null&&(n=!!w[0].id.startsWith("postal_code.")),n?bl:(i==null&&(i=!!w[0].id.startsWith("poi.")),i?Ll:wl)))}let L=C(r,-1),N=L(r),x=h&&ma(r);return{c(){t=ht("li"),N.c(),o=rn(),s=ht("span"),a=ht("span"),u=ht("span"),c=wr(l),f=rn(),x&&x.c(),g=rn(),p=ht("span"),d=wr(y),P(u,"class","primary svelte-ltkwvy"),P(a,"class","svelte-ltkwvy"),P(p,"class","line2 svelte-ltkwvy"),P(s,"class","texts svelte-ltkwvy"),P(t,"tabindex","0"),P(t,"data-selected",r[1]),P(t,"class","svelte-ltkwvy"),on(t,"selected",r[1])},m(w,F){Mt(w,t,F),N.m(t,null),nt(t,o),nt(t,s),nt(s,a),nt(a,u),nt(u,c),nt(a,f),x&&x.m(a,null),nt(s,g),nt(s,p),nt(p,d),m||(E=[Ie(t,"mouseenter",r[8]),Ie(t,"focus",r[9])],m=!0)},p(w,[F]){var X,R;L===(L=C(w,F))&&N?N.p(w,F):(N.d(1),N=L(w),N&&(N.c(),N.m(t,o))),F&1&&l!==(l=w[0].place_name.replace(/,.*/,"")+"")&&Zi(c,l),F&37&&(h=w[2]==="always"||w[2]&&!w[0].address&&((X=w[0].properties)==null?void 0:X.kind)!=="road"&&((R=w[0].properties)==null?void 0:R.kind)!=="road_relation"&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])),h?x?x.p(w,F):(x=ma(w),x.c(),x.m(a,null)):x&&(x.d(1),x=null),F&1&&y!==(y=w[0].place_name.replace(/[^,]*,?\s*/,"")+"")&&Zi(d,y),F&2&&P(t,"data-selected",w[1]),F&2&&on(t,"selected",w[1])},i:_t,o:_t,d(w){w&&Lt(t),N.d(),x&&x.d(),m=!1,ar(E)}}}function Ml(r,t,e){var y;let n,i,o,s,{feature:a}=t,{selected:u=!1}=t,{showPlaceType:l}=t;const c=(y=a.properties)==null?void 0:y.categories;function f(d){n>-1?e(7,n--,n):d.style.visibility="hidden"}function h(d){ga.call(this,r,d)}function g(d){ga.call(this,r,d)}const p=d=>f(d.currentTarget);return r.$$set=d=>{"feature"in d&&e(0,a=d.feature),"selected"in d&&e(1,u=d.selected),"showPlaceType"in d&&e(2,l=d.showPlaceType)},r.$$.update=()=>{var d,m,E,C;r.$$.dirty&128&&e(3,i=c==null?void 0:c[n]),r.$$.dirty&8&&e(5,o=i?`/icons/${i.replace(/ /g,"_")}.svg`:void 0),r.$$.dirty&1&&e(4,s=a.id.startsWith("poi.")?(m=(d=a.properties)==null?void 0:d.categories)==null?void 0:m.join(", "):((C=(E=a.properties)==null?void 0:E.place_type_name)==null?void 0:C[0])??a.place_type[0])},e(7,n=((c==null?void 0:c.length)??0)-1),[a,u,l,i,s,o,f,n,h,g,p]}class Al extends Pr{constructor(t){super(),br(this,t,Ml,Dl,Sr,{feature:0,selected:1,showPlaceType:2})}}const Bf="";function Fl(r){let t;return{c(){t=ht("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',P(t,"class","svelte-7cmwmc")},m(e,n){Mt(e,t,n)},p:_t,i:_t,o:_t,d(e){e&&Lt(t)}}}class kl extends Pr{constructor(t){super(),br(this,t,null,Fl,Sr,{})}}const Gf="";function Bl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),P(t,"viewBox","0 0 60.006 21.412"),P(t,"width","14"),P(t,"height","20"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),nt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class Gl extends Pr{constructor(t){super(),br(this,t,null,Bl,Sr,{})}}const zf="";function zl(r){let t,e;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"d","M13.101 14.261 8.74 9.899a4.797 4.797 0 0 1-1.425.748 5.165 5.165 0 0 1-1.603.248c-1.446 0-2.677-.5-3.693-1.503S.495 7.164.495 5.717c0-1.446.508-2.678 1.524-3.693C3.035 1.008 4.266.5 5.712.5c1.448 0 2.672.508 3.675 1.524 1.002 1.015 1.503 2.247 1.503 3.693 0 .558-.08 1.092-.239 1.603-.159.512-.411.98-.757 1.405l4.382 4.4a.74.74 0 0 1 .229.568.81.81 0 0 1-.249.568.787.787 0 0 1-.577.239.787.787 0 0 1-.578-.239ZM5.712 9.223c.97 0 1.796-.342 2.48-1.026a3.378 3.378 0 0 0 1.026-2.48c0-.982-.34-1.818-1.016-2.509-.677-.69-1.507-1.035-2.49-1.035a3.42 3.42 0 0 0-2.509 1.035 3.42 3.42 0 0 0-1.035 2.51c0 .982.345 1.812 1.035 2.488.691.678 1.527 1.017 2.51 1.017Z"),P(t,"width","14"),P(t,"height","14"),P(t,"viewBox","0 0 15 15"),P(t,"class","svelte-en2qvf")},m(n,i){Mt(n,t,i),nt(t,e)},p:_t,i:_t,o:_t,d(n){n&&Lt(t)}}}class Vl extends Pr{constructor(t){super(),br(this,t,null,zl,Sr,{})}}const Vf="";function _a(r,t,e){const n=r.slice();return n[73]=t[e],n[75]=e,n}function Ea(r){let t,e;return t=new kl({}),{c(){Lr(t.$$.fragment)},m(n,i){ur(t,n,i),e=!0},i(n){e||(Bt(t.$$.fragment,n),e=!0)},o(n){ce(t.$$.fragment,n),e=!1},d(n){lr(t,n)}}}function Ia(r){let t,e,n,i,o;return e=new Gl({}),{c(){t=ht("button"),Lr(e.$$.fragment),P(t,"type","button"),P(t,"title",r[9]),P(t,"class","svelte-1r7dvt7"),on(t,"active",r[0])},m(s,a){Mt(s,t,a),ur(e,t,null),n=!0,i||(o=Ie(t,"click",r[59]),i=!0)},p(s,a){(!n||a[0]&512)&&P(t,"title",s[9]),(!n||a[0]&1)&&on(t,"active",s[0])},i(s){n||(Bt(e.$$.fragment,s),n=!0)},o(s){ce(e.$$.fragment,s),n=!1},d(s){s&&Lt(t),lr(e),i=!1,o()}}}function Ul(r){let t,e=[],n=new Map,i,o,s,a=r[12];const u=l=>l[73].id;for(let l=0;l<a.length;l+=1){let c=_a(r,a,l),f=u(c);n.set(f,e[l]=Ca(f,c))}return{c(){t=ht("ul");for(let l=0;l<e.length;l+=1)e[l].c();P(t,"class","svelte-1r7dvt7")},m(l,c){Mt(l,t,c);for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(t,null);i=!0,o||(s=[Ie(t,"mouseleave",r[63]),Ie(t,"blur",r[64])],o=!0)},p(l,c){c[0]&2110464&&(a=l[12],Ro(),e=Cl(e,c,u,1,l,a,n,t,Il,Ca,null,_a),Oo())},i(l){if(!i){for(let c=0;c<a.length;c+=1)Bt(e[c]);i=!0}},o(l){for(let c=0;c<e.length;c+=1)ce(e[c]);i=!1},d(l){l&&Lt(t);for(let c=0;c<e.length;c+=1)e[c].d();o=!1,ar(s)}}}function ql(r){let t,e,n,i,o,s;return e=new ya({}),{c(){t=ht("div"),Lr(e.$$.fragment),n=rn(),i=ht("div"),o=wr(r[7]),P(i,"class","svelte-1r7dvt7"),P(t,"class","no-results svelte-1r7dvt7")},m(a,u){Mt(a,t,u),ur(e,t,null),nt(t,n),nt(t,i),nt(i,o),s=!0},p(a,u){(!s||u[0]&128)&&Zi(o,a[7])},i(a){s||(Bt(e.$$.fragment,a),s=!0)},o(a){ce(e.$$.fragment,a),s=!1},d(a){a&&Lt(t),lr(e)}}}function Xl(r){let t="",e;return{c(){e=wr(t)},m(n,i){Mt(n,e,i)},p:_t,i:_t,o:_t,d(n){n&&Lt(e)}}}function Yl(r){let t,e,n,i,o,s,a,u,l,c,f;return e=new ya({}),u=new va({}),{c(){t=ht("div"),Lr(e.$$.fragment),n=rn(),i=ht("div"),o=wr(r[6]),s=rn(),a=ht("button"),Lr(u.$$.fragment),P(i,"class","svelte-1r7dvt7"),P(a,"class","svelte-1r7dvt7"),P(t,"class","error svelte-1r7dvt7")},m(h,g){Mt(h,t,g),ur(e,t,null),nt(t,n),nt(t,i),nt(i,o),nt(t,s),nt(t,a),ur(u,a,null),l=!0,c||(f=Ie(a,"click",r[60]),c=!0)},p(h,g){(!l||g[0]&64)&&Zi(o,h[6])},i(h){l||(Bt(e.$$.fragment,h),Bt(u.$$.fragment,h),l=!0)},o(h){ce(e.$$.fragment,h),ce(u.$$.fragment,h),l=!1},d(h){h&&Lt(t),lr(e),lr(u),c=!1,f()}}}function Ca(r,t){let e,n,i;function o(){return t[61](t[75])}function s(){return t[62](t[73])}return n=new Al({props:{feature:t[73],showPlaceType:t[10],selected:t[13]===t[75]}}),n.$on("mouseenter",o),n.$on("focus",s),{key:r,first:null,c(){e=fl(),Lr(n.$$.fragment),this.first=e},m(a,u){Mt(a,e,u),ur(n,a,u),i=!0},p(a,u){t=a;const l={};u[0]&4096&&(l.feature=t[73]),u[0]&1024&&(l.showPlaceType=t[10]),u[0]&12288&&(l.selected=t[13]===t[75]),n.$set(l)},i(a){i||(Bt(n.$$.fragment,a),i=!0)},o(a){ce(n.$$.fragment,a),i=!1},d(a){a&&Lt(e),lr(n,a)}}}function Wl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,y,d,m,E,C,L;i=new Vl({}),c=new va({});let N=r[17]&&Ea(),x=r[5]===!0&&Ia(r);const T=r[51].default,A=al(T,r,r[50],null),w=[Yl,Xl,ql,Ul],F=[];function X(R,Y){var D,W;return R[16]?0:R[14]?((D=R[12])==null?void 0:D.length)===0?2:R[14]&&((W=R[12])!=null&&W.length)?3:-1:1}return~(y=X(r))&&(d=F[y]=w[y](r)),{c(){t=ht("form"),e=ht("div"),n=ht("button"),Lr(i.$$.fragment),o=rn(),s=ht("input"),a=rn(),u=ht("div"),l=ht("button"),Lr(c.$$.fragment),f=rn(),N&&N.c(),h=rn(),x&&x.c(),g=rn(),A&&A.c(),p=rn(),d&&d.c(),P(n,"class","search-button svelte-1r7dvt7"),P(n,"type","button"),P(s,"placeholder",r[8]),P(s,"aria-label",r[8]),P(s,"class","svelte-1r7dvt7"),P(l,"type","button"),P(l,"title",r[3]),P(l,"class","svelte-1r7dvt7"),P(u,"class","clear-button-container svelte-1r7dvt7"),on(u,"displayable",r[1]!==""),P(e,"class","input-group svelte-1r7dvt7"),P(t,"tabindex","0"),P(t,"class",m=ca(r[2])+" svelte-1r7dvt7"),on(t,"can-collapse",r[4]&&r[1]==="")},m(R,Y){Mt(R,t,Y),nt(t,e),nt(e,n),ur(i,n,null),nt(e,o),nt(e,s),r[53](s),fa(s,r[1]),nt(e,a),nt(e,u),nt(u,l),ur(c,l,null),nt(u,f),N&&N.m(u,null),nt(e,h),x&&x.m(e,null),nt(e,g),A&&A.m(e,null),nt(t,p),~y&&F[y].m(t,null),E=!0,C||(L=[Ie(n,"click",r[52]),Ie(s,"input",r[54]),Ie(s,"focus",r[55]),Ie(s,"blur",r[56]),Ie(s,"keydown",r[19]),Ie(s,"input",r[57]),Ie(l,"click",r[58]),Ie(t,"submit",hl(r[18]))],C=!0)},p(R,Y){(!E||Y[0]&256)&&P(s,"placeholder",R[8]),(!E||Y[0]&256)&&P(s,"aria-label",R[8]),Y[0]&2&&s.value!==R[1]&&fa(s,R[1]),(!E||Y[0]&8)&&P(l,"title",R[3]),R[17]?N?Y[0]&131072&&Bt(N,1):(N=Ea(),N.c(),Bt(N,1),N.m(u,null)):N&&(Ro(),ce(N,1,1,()=>{N=null}),Oo()),(!E||Y[0]&2)&&on(u,"displayable",R[1]!==""),R[5]===!0?x?(x.p(R,Y),Y[0]&32&&Bt(x,1)):(x=Ia(R),x.c(),Bt(x,1),x.m(e,g)):x&&(Ro(),ce(x,1,1,()=>{x=null}),Oo()),A&&A.p&&(!E||Y[1]&524288)&&ll(A,T,R,R[50],E?ul(T,R[50],Y,null):cl(R[50]),null);let D=y;y=X(R),y===D?~y&&F[y].p(R,Y):(d&&(Ro(),ce(F[D],1,1,()=>{F[D]=null}),Oo()),~y?(d=F[y],d?d.p(R,Y):(d=F[y]=w[y](R),d.c()),Bt(d,1),d.m(t,null)):d=null),(!E||Y[0]&4&&m!==(m=ca(R[2])+" svelte-1r7dvt7"))&&P(t,"class",m),(!E||Y[0]&22)&&on(t,"can-collapse",R[4]&&R[1]==="")},i(R){E||(Bt(i.$$.fragment,R),Bt(c.$$.fragment,R),Bt(N),Bt(x),Bt(A,R),Bt(d),E=!0)},o(R){ce(i.$$.fragment,R),ce(c.$$.fragment,R),ce(N),ce(x),ce(A,R),ce(d),E=!1},d(R){R&&Lt(t),lr(i),r[53](null),lr(c),N&&N.d(),x&&x.d(),A&&A.d(R),~y&&F[y].d(),C=!1,ar(L)}}}function Hl(r,t,e){const n=t[1],i=t[0],o=n-i;return r===n&&e?r:((r-i)%o+o)%o+i}function Na(r){let t=[...r];return t[2]<t[0]&&(t[2]+=360),t}function jl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{apiKey:a}=t,{bbox:u=void 0}=t,{clearButtonTitle:l="clear"}=t,{clearOnBlur:c=!1}=t,{collapsed:f=!1}=t,{country:h=void 0}=t,{debounceSearch:g=200}=t,{enableReverse:p=!1}=t,{errorMessage:y="Something went wrong…"}=t,{filter:d=()=>!0}=t,{flyTo:m=!0}=t,{fuzzyMatch:E=!0}=t,{language:C=void 0}=t,{limit:L=void 0}=t,{mapController:N=void 0}=t,{minLength:x=2}=t,{noResultsMessage:T="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=t,{placeholder:A="Search"}=t,{proximity:w=void 0}=t,{reverseActive:F=p==="always"}=t,{reverseButtonTitle:X="toggle reverse geocoding"}=t,{searchValue:R=""}=t,{showFullGeometry:Y=!0}=t,{showPlaceType:D="ifNeeded"}=t,{showResultsWhileTyping:W=!0}=t,{trackProximity:ut=!0}=t,{types:mt=void 0}=t,{zoom:Jt=16}=t,{maxZoom:le=18}=t,{apiUrl:Cr="https://api.maptiler.com/geocoding"}=t,{fetchParameters:Je={}}=t;function Nr(){rr.focus()}function zn(){rr.blur()}function vi(S,Ht=!0){e(1,R=S),Ht?(e(13,Wt=-1),nl()):(ea(),setTimeout(()=>{rr.focus(),rr.select()}))}let $e=!1,ft,Oe,at,el="",rr,Wt=-1,ir,fs=[],yi,Ki,hs,$s;const jr=vl();dl(()=>{N&&(N.setEventHandler(void 0),N.indicateReverse(!1),N.setSelectedMarker(-1),N.setMarkers(void 0,void 0))});function nl(S){if(Ki&&(clearTimeout(Ki),Ki=void 0),Wt>-1&&ft)e(47,at=ft[Wt]),e(1,R=at.place_name.replace(/,.*/,"")),e(16,ir=void 0),e(46,Oe=void 0),e(13,Wt=-1);else if(R){const Ht=S||!rl();ta(R,{exact:!0}).then(()=>{e(46,Oe=ft),e(47,at=void 0),Ht&&_f()}).catch(or=>e(16,ir=or))}}function rl(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(R)}async function ta(S,{byId:Ht=!1,exact:or=!1}={}){e(16,ir=void 0);const Qi=rl(),tn=new URLSearchParams;C!=null&&tn.set("language",Array.isArray(C)?C.join(","):C),mt&&tn.set("types",mt.join(",")),Qi||(u&&tn.set("bbox",u.map(Kr=>Kr.toFixed(6)).join(",")),h&&tn.set("country",Array.isArray(h)?h.join(","):h)),Ht||(w&&tn.set("proximity",w.map(Kr=>Kr.toFixed(6)).join(",")),(or||!W)&&tn.set("autocomplete","false"),tn.set("fuzzyMatch",String(E))),L!==void 0&&(!Qi||(mt==null?void 0:mt.length)===1)&&tn.set("limit",String(L)),tn.set("key",a);const mi=Cr+"/"+encodeURIComponent(S)+".json?"+tn.toString();if(mi===el){Ht?(e(12,ft=void 0),e(47,at=fs[0])):e(12,ft=fs);return}el=mi,yi==null||yi.abort();const Te=new AbortController;e(17,yi=Te);let ra;try{ra=await fetch(mi,{signal:Te.signal,...Je}).finally(()=>{Te===yi&&e(17,yi=void 0)})}catch(Kr){if(Kr&&typeof Kr=="object"&&"name"in Kr&&Kr.name==="AbortError")return;throw new Error}if(!ra.ok)throw new Error;const ia=await ra.json();jr("response",{url:mi,featureCollection:ia}),Ht?(e(12,ft=void 0),e(47,at=ia.features[0]),fs=[at]):(e(12,ft=ia.features.filter(d)),fs=ft,Qi&&rr.focus())}function _f(){var or,Qi,tn,mi;if(!(Oe!=null&&Oe.length)||!m)return;const S=[180,90,-180,-90],Ht=!Oe.some(Te=>!Te.matching_text);for(const Te of Oe)(Ht||!Te.matching_text)&&(S[0]=Math.min(S[0],((or=Te.bbox)==null?void 0:or[0])??Te.center[0]),S[1]=Math.min(S[1],((Qi=Te.bbox)==null?void 0:Qi[1])??Te.center[1]),S[2]=Math.max(S[2],((tn=Te.bbox)==null?void 0:tn[2])??Te.center[0]),S[3]=Math.max(S[3],((mi=Te.bbox)==null?void 0:mi[3])??Te.center[1]));N&&Oe.length>0&&(at&&S[0]===S[2]&&S[1]===S[3]?N.flyTo(at.center,Jt):N.fitBounds(Na(S),50,le))}function Ef(S){e(0,F=p==="always"),vi(Hl(S[0],[-180,180],!0).toFixed(6)+","+S[1].toFixed(6))}function If(S){if(!ft)return;let Ht=S.key==="ArrowDown"?1:S.key==="ArrowUp"?-1:0;Ht?(Wt===-1&&Ht===-1&&e(13,Wt=ft.length),e(13,Wt+=Ht),Wt>=ft.length&&e(13,Wt=-1),S.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(S.key)&&e(13,Wt=-1)}function ea(S=!0){if(e(16,ir=void 0),W){if(Ki&&clearTimeout(Ki),R.length<x)return;const Ht=R;Ki=window.setTimeout(()=>{ta(Ht).catch(or=>e(16,ir=or))},S?g:0)}else e(12,ft=void 0),e(16,ir=void 0)}function na(S){e(47,at=S),e(1,R=S.place_name),e(13,Wt=-1)}const Cf=()=>rr.focus();function Nf(S){ps[S?"unshift":"push"](()=>{rr=S,e(15,rr)})}function Sf(){R=this.value,e(1,R),e(11,$e),e(25,c)}const xf=()=>e(11,$e=!0),wf=()=>e(11,$e=!1),Lf=()=>ea(),bf=()=>{e(1,R=""),rr.focus()},Pf=()=>e(0,F=!F),Rf=()=>e(16,ir=void 0),Of=S=>e(13,Wt=S),Tf=S=>na(S),Df=()=>e(13,Wt=-1),Mf=()=>{};return r.$$set=S=>{"class"in S&&e(2,s=S.class),"apiKey"in S&&e(23,a=S.apiKey),"bbox"in S&&e(24,u=S.bbox),"clearButtonTitle"in S&&e(3,l=S.clearButtonTitle),"clearOnBlur"in S&&e(25,c=S.clearOnBlur),"collapsed"in S&&e(4,f=S.collapsed),"country"in S&&e(26,h=S.country),"debounceSearch"in S&&e(27,g=S.debounceSearch),"enableReverse"in S&&e(5,p=S.enableReverse),"errorMessage"in S&&e(6,y=S.errorMessage),"filter"in S&&e(28,d=S.filter),"flyTo"in S&&e(29,m=S.flyTo),"fuzzyMatch"in S&&e(30,E=S.fuzzyMatch),"language"in S&&e(31,C=S.language),"limit"in S&&e(32,L=S.limit),"mapController"in S&&e(33,N=S.mapController),"minLength"in S&&e(34,x=S.minLength),"noResultsMessage"in S&&e(7,T=S.noResultsMessage),"placeholder"in S&&e(8,A=S.placeholder),"proximity"in S&&e(22,w=S.proximity),"reverseActive"in S&&e(0,F=S.reverseActive),"reverseButtonTitle"in S&&e(9,X=S.reverseButtonTitle),"searchValue"in S&&e(1,R=S.searchValue),"showFullGeometry"in S&&e(35,Y=S.showFullGeometry),"showPlaceType"in S&&e(10,D=S.showPlaceType),"showResultsWhileTyping"in S&&e(36,W=S.showResultsWhileTyping),"trackProximity"in S&&e(37,ut=S.trackProximity),"types"in S&&e(38,mt=S.types),"zoom"in S&&e(39,Jt=S.zoom),"maxZoom"in S&&e(40,le=S.maxZoom),"apiUrl"in S&&e(41,Cr=S.apiUrl),"fetchParameters"in S&&e(42,Je=S.fetchParameters),"$$scope"in S&&e(50,o=S.$$scope)},r.$$.update=()=>{if(r.$$.dirty[1]&64&&(ut||e(22,w=void 0)),r.$$.dirty[0]&33556480&&setTimeout(()=>{e(14,hs=$e),c&&!$e&&e(1,R="")}),r.$$.dirty[0]&4098|r.$$.dirty[1]&8&&R.length<x&&(e(47,at=void 0),e(12,ft=void 0),e(16,ir=void 0),e(46,Oe=ft)),r.$$.dirty[1]&65552&&Y&&at&&!at.address&&at.geometry.type==="Point"&&ta(at.id,{byId:!0}).catch(S=>e(16,ir=S)),r.$$.dirty[0]&536870912|r.$$.dirty[1]&197380&&(N&&at&&at.id!==$s&&m&&(!at.bbox||at.bbox[0]===at.bbox[2]&&at.bbox[1]===at.bbox[3]?N.flyTo(at.center,at.id.startsWith("poi.")||at.id.startsWith("address.")?le:Jt):N.fitBounds(Na(at.bbox),50,le),e(12,ft=void 0),e(46,Oe=void 0),e(13,Wt=-1)),e(48,$s=at==null?void 0:at.id)),r.$$.dirty[0]&4096|r.$$.dirty[1]&32768&&Oe!==ft&&e(46,Oe=void 0),r.$$.dirty[1]&98308&&N&&N.setMarkers(Oe,at),r.$$.dirty[0]&2&&e(13,Wt=-1),r.$$.dirty[0]&20481|r.$$.dirty[1]&68&&N&&N.setEventHandler(S=>{switch(S.type){case"mapClick":F&&Ef(S.coordinates);break;case"proximityChange":e(22,w=ut?S.proximity:void 0);break;case"markerClick":{const Ht=ft==null?void 0:ft.find(or=>or.id===S.id);Ht&&na(Ht)}break;case"markerMouseEnter":e(13,Wt=hs?(ft==null?void 0:ft.findIndex(Ht=>Ht.id===S.id))??-1:-1);break;case"markerMouseLeave":e(13,Wt=-1);break}}),r.$$.dirty[0]&8192|r.$$.dirty[1]&4&&(N==null||N.setSelectedMarker(Wt)),r.$$.dirty[0]&12288&&e(49,n=ft==null?void 0:ft[Wt]),r.$$.dirty[0]&2|r.$$.dirty[1]&4){const S=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(R);N==null||N.setReverseMarker(S?[Number(S[1]),Number(S[2])]:void 0)}r.$$.dirty[1]&262144&&jr("select",n),r.$$.dirty[1]&65536&&jr("pick",at),r.$$.dirty[0]&20480&&jr("optionsVisibilityChange",hs&&!!ft),r.$$.dirty[0]&4096&&jr("featuresListed",ft),r.$$.dirty[1]&32768&&jr("featuresMarked",Oe),r.$$.dirty[0]&1&&jr("reverseToggle",F),r.$$.dirty[0]&2&&jr("queryChange",R),r.$$.dirty[0]&1|r.$$.dirty[1]&4&&N&&N.indicateReverse(F)},[F,R,s,l,f,p,y,T,A,X,D,$e,ft,Wt,hs,rr,ir,yi,nl,If,ea,na,w,a,u,c,h,g,d,m,E,C,L,N,x,Y,W,ut,mt,Jt,le,Cr,Je,Nr,zn,vi,Oe,at,$s,n,o,i,Cf,Nf,Sf,xf,wf,Lf,bf,Pf,Rf,Of,Tf,Df,Mf]}let Kl=class extends Pr{constructor(t){super(),br(this,t,jl,Wl,Sr,{class:2,apiKey:23,bbox:24,clearButtonTitle:3,clearOnBlur:25,collapsed:4,country:26,debounceSearch:27,enableReverse:5,errorMessage:6,filter:28,flyTo:29,fuzzyMatch:30,language:31,limit:32,mapController:33,minLength:34,noResultsMessage:7,placeholder:8,proximity:22,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:35,showPlaceType:10,showResultsWhileTyping:36,trackProximity:37,types:38,zoom:39,maxZoom:40,apiUrl:41,fetchParameters:42,focus:43,blur:44,setQuery:45},null,[-1,-1,-1])}get focus(){return this.$$.ctx[43]}get blur(){return this.$$.ctx[44]}get setQuery(){return this.$$.ctx[45]}};/**
2
2
  * splaytree v3.1.1
3
3
  * Fast Splay tree for Node and browser
4
4
  *
@@ -18,9 +18,9 @@
18
18
 
19
19
  See the Apache Version 2.0 License for specific language governing permissions
20
20
  and limitations under the License.
21
- ***************************************************************************** */function jl(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){e.label=l[1];break}if(l[0]===6&&e.label<o[1]){e.label=o[1],o=l;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(l);break}o[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Rr=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function Kl(r,t){return r>t?1:r<t?-1:0}function Or(r,t,e){for(var n=new Rr(null,null),i=n,o=n;;){var s=e(r,t.key);if(s<0){if(t.left===null)break;if(e(r,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}o.left=t,o=t,t=t.left}else if(s>0){if(t.right===null)break;if(e(r,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function ys(r,t,e,n){var i=new Rr(r,t);if(e===null)return i.left=i.right=null,i;e=Or(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function Ca(r,t,e){var n=null,i=null;if(t){t=Or(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function Ql(r,t,e){return t===null?r:(r===null||(t=Or(r.key,t,e),t.left=r),t)}function ms(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
22
- `);var o=t+(e?" ":"│ ");r.left&&ms(r.left,o,!1,n,i),r.right&&ms(r.right,o,!0,n,i)}}var _s=function(){function r(t){t===void 0&&(t=Kl),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ys(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new Rr(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=Or(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=Or(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=Or(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Or(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=Or(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return Jl(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&Cs(t,e,0,i-1,o),this._root===null)this._root=Es(t,e,0,i),this._size=i;else{var s=$l(this.toList(),Zl(t,e),o);i=this._size+i,this._root=Is({head:s},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return ms(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=Ca(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=ys(e,n,a,i):s=ys(e,n,s,i),this._root=Ql(s,a,i)},r.prototype.split=function(t){return Ca(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t;return jl(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},r}();function Es(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),s=r[o],a=t[o],u=new Rr(s,a);return u.left=Es(r,t,e,o),u.right=Es(r,t,o+1,n),u}return null}function Zl(r,t){for(var e=new Rr(null,null),n=e,i=0;i<r.length;i++)n=n.next=new Rr(r[i],t[i]);return n.next=null,e.next}function Jl(r){for(var t=r,e=[],n=!1,i=new Rr(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function Is(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=Is(r,t,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=Is(r,i+1,e),s}return null}function $l(r,t,e){for(var n=new Rr(null,null),i=n,o=r,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function Cs(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],s=e-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var u=r[s];r[s]=r[a],r[a]=u,u=t[s],t[s]=t[a],t[a]=u}Cs(r,t,e,a,i),Cs(r,t,a+1,n,i)}}function rn(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function Na(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Ce(r,t,e){return t&&Na(r.prototype,t),e&&Na(r,e),r}var $i=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Ns=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:n,y:o},ur:{x:i,y:s}}},Tr=Number.EPSILON;Tr===void 0&&(Tr=Math.pow(2,-52));var tc=Tr*Tr,Ss=function(t,e){if(-Tr<t&&t<Tr&&-Tr<e&&e<Tr)return 0;var n=t-e;return n*n<tc*t*e?0:t<e?-1:1},ec=function(){function r(){rn(this,r),this.reset()}return Ce(r,[{key:"reset",value:function(){this.xRounder=new Sa,this.yRounder=new Sa}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),r}(),Sa=function(){function r(){rn(this,r),this.tree=new _s,this.round(0)}return Ce(r,[{key:"round",value:function(e){var n=this.tree.add(e),i=this.tree.prev(n);if(i!==null&&Ss(n.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(n);return o!==null&&Ss(n.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),r}(),to=new ec,eo=function(t,e){return t.x*e.y-t.y*e.x},xa=function(t,e){return t.x*e.x+t.y*e.y},wa=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y},s=eo(i,o);return Ss(s,0)},Oo=function(t){return Math.sqrt(xa(t,t))},nc=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return eo(o,i)/Oo(o)/Oo(i)},rc=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return xa(o,i)/Oo(o)/Oo(i)},La=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},ba=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},ic=function(t,e,n,i){if(e.x===0)return ba(n,i,t.x);if(i.x===0)return ba(t,e,n.x);if(e.y===0)return La(n,i,t.y);if(i.y===0)return La(t,e,n.y);var o=eo(e,i);if(o==0)return null;var s={x:n.x-t.x,y:n.y-t.y},a=eo(s,e)/o,u=eo(s,i)/o,l=t.x+u*e.x,c=n.x+a*i.x,f=t.y+u*e.y,h=n.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Un=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=r.comparePoints(e.point,n.point);return i!==0?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:To.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}}]);function r(t,e){rn(this,r),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Ce(r,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,i=0,o=n.length;i<o;i++){var s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,n=0;n<e;n++){var i=this.point.events[n];if(i.segment.consumedBy===void 0)for(var o=n+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],n=0,i=this.point.events.length;n<i;n++){var o=this.point.events[n];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var n=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:nc(n.point,e.point,u.point),cosine:rc(n.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),r}(),oc=0,To=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,o=n.leftSE.point.x,s=e.rightSE.point.x,a=n.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=n.leftSE.point.y,c=e.rightSE.point.y,f=n.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=n.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=n.comparePoint(e.leftSE.point);if(p!==0)return p;var y=e.comparePoint(n.rightSE.point);return y<0?1:y>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=n.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var m=e.comparePoint(n.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(s!==a){var E=c-u,C=s-i,L=f-l,N=a-o;if(E>C&&L<N)return 1;if(E<C&&L>N)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<n.id?-1:e.id>n.id?1:0}}]);function r(t,e,n,i){rn(this,r),this.id=++oc,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}return Ce(r,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<n?e:n},ur:{x:this.rightSE.point.x,y:e>n?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return e.x===n.x?0:e.x<n.x?1:-1;var s=(e.y-n.y)/o.y,a=n.x+s*o.x;if(e.x===a)return 0;var u=(e.x-n.x)/o.x,l=n.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var n=this.bbox(),i=e.bbox(),o=Ns(n,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=$i(n,u)&&this.comparePoint(u)===0,f=$i(i,s)&&e.comparePoint(s)===0,h=$i(n,l)&&this.comparePoint(l)===0,g=$i(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=ic(s,this.vector(),u,e.vector());return p===null||!$i(o,p)?null:to.round(p.x,p.y)}},{key:"split",value:function(e){var n=[],i=e.events!==void 0,o=new Un(e,!0),s=new Un(e,!1),a=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(o);var u=new r(o,a,this.rings.slice(),this.windings.slice());return Un.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Un.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}},{key:"consume",value:function(e){for(var n=this,i=e;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=r.compare(n,i);if(o!==0){if(o>0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=n.rings.indexOf(c);h===-1?(n.rings.push(c),n.windings.push(f)):n.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var n=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=n.indexOf(u);c===-1?(n.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=n.length;g<p;g++)if(i[g]!==0){var y=n[g],d=y.poly;if(h.indexOf(d)===-1)if(y.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var m=f.indexOf(y.poly);m!==-1&&f.splice(m,1)}}for(var E=0,C=f.length;E<C;E++){var L=f[E].multiPoly;o.indexOf(L)===-1&&o.push(L)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(Sn.type){case"union":{var i=e.length===0,o=n.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<n.length?(s=e.length,a=n.length):(s=n.length,a=e.length),this._isInResult=a===Sn.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-n.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(n);break}default:throw new Error("Unrecognized operation type found ".concat(Sn.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,i){var o,s,a,u=Un.comparePoints(e,n);if(u<0)o=e,s=n,a=1;else if(u>0)o=n,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Un(o,!0),c=new Un(s,!1);return new r(l,c,[i],[a])}}]),r}(),Pa=function(){function r(t,e,n){if(rn(this,r),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=to.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=to.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(To.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(To.fromRing(o,i,this))}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.segments.length;n<i;n++){var o=this.segments[n];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),r}(),sc=function(){function r(t,e){if(rn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pa(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,i=t.length;n<i;n++){var o=new Pa(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;n<i;n++)for(var o=this.interiorRings[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),Ra=function(){function r(t,e){if(rn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,i=t.length;n<i;n++){var o=new sc(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++)for(var o=this.polys[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),ac=function(){Ce(r,null,[{key:"factory",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,y=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(y.x,", ").concat(y.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,m=0,E=h.length;m<E;m++)if(h[m].point===u.point){d=m;break}if(d!==null){var C=h.splice(d)[0],L=c.splice(C.index);L.unshift(L[0].otherSE),n.push(new r(L.reverse()));continue}h.push({index:c.length,point:u.point});var N=u.getLeftmostComparator(a);l=g.sort(N)[0].otherSE;break}n.push(new r(c))}}return n}}]);function r(t){rn(this,r),this.events=t;for(var e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}return Ce(r,[{key:"getGeom",value:function(){for(var e=this.events[0].point,n=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;wa(s,e,a)!==0&&(n.push(s),e=s)}if(n.length===1)return null;var u=n[0],l=n[1];wa(u,e,l)===0&&n.shift(),n.push(n[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:n.length-1,h=this.isExteriorRing()?n.length:-1,g=[],p=f;p!=h;p+=c)g.push([n[p].x,n[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],n=1,i=this.events.length;n<i;n++){var o=this.events[n];Un.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),Oa=function(){function r(t){rn(this,r),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Ce(r,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,i=this.interiorRings.length;n<i;n++){var o=this.interiorRings[n].getGeom();o!==null&&e.push(o)}return e}}]),r}(),uc=function(){function r(t){rn(this,r),this.rings=t,this.polys=this._composePolys(t)}return Ce(r,[{key:"getGeom",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++){var o=this.polys[n].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())n.push(new Oa(s));else{var a=s.enclosingRing();a.poly||n.push(new Oa(a)),a.poly.addInterior(s)}}return n}}]),r}(),lc=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:To.compare;rn(this,r),this.queue=t,this.tree=new _s(e),this.segments=[]}return Ce(r,[{key:"process",value:function(e){var n=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),i;var o=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(n);if(f!==null&&(n.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var y=null;if(l){var d=l.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(y=d),!l.isAnEndpoint(d)))for(var m=this._splitSafely(l,d),E=0,C=m.length;E<C;E++)i.push(m[E])}if(c!==null||y!==null){var L=null;if(c===null)L=y;else if(y===null)L=c;else{var N=Un.comparePoints(c,y);L=N<=0?c:y}this.queue.remove(n.rightSE),i.push(n.rightSE);for(var S=n.split(L),T=0,A=S.length;T<A;T++)i.push(S[T])}i.length>0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&l){var w=u.getIntersection(l);if(w!==null){if(!u.isAnEndpoint(w))for(var F=this._splitSafely(u,w),X=0,R=F.length;X<R;X++)i.push(F[X]);if(!l.isAnEndpoint(w))for(var Y=this._splitSafely(l,w),D=0,W=Y.length;D<W;D++)i.push(Y[D])}}this.tree.remove(n)}return i}},{key:"_splitSafely",value:function(e,n){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(n);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),r}(),Ta=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,cc=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,fc=function(){function r(){rn(this,r)}return Ce(r,[{key:"run",value:function(e,n,i){Sn.type=e,to.reset();for(var o=[new Ra(n,!0)],s=0,a=i.length;s<a;s++)o.push(new Ra(i[s],!1));if(Sn.numMultiPolys=o.length,Sn.type==="difference")for(var u=o[0],l=1;l<o.length;)Ns(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(Sn.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(Ns(h.bbox,o[g].bbox)===null)return[]}for(var y=new _s(Un.compare),d=0,m=o.length;d<m;d++)for(var E=o[d].getSweepEvents(),C=0,L=E.length;C<L;C++)if(y.insert(E[C]),y.size>Ta)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var N=new lc(y),S=y.size,T=y.pop();T;){var A=T.key;if(y.size===S){var w=A.segment;throw new Error("Unable to pop() ".concat(A.isLeft?"left":"right"," SweepEvent ")+"[".concat(A.point.x,", ").concat(A.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(y.size>Ta)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(N.segments.length>cc)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var F=N.process(A),X=0,R=F.length;X<R;X++){var Y=F[X];Y.consumedBy===void 0&&y.insert(Y)}S=y.size,T=y.pop()}to.reset();var D=ac.factory(N.segments),W=new uc(D);return W.getGeom()}}]),r}(),Sn=new fc,hc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Sn.run("union",t,n)},gc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Sn.run("intersection",t,n)},pc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Sn.run("xor",t,n)},dc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Sn.run("difference",t,n)},Da={union:hc,intersection:gc,xor:pc,difference:dc},Ne=63710088e-1,Ma={centimeters:Ne*100,centimetres:Ne*100,degrees:Ne/111325,feet:Ne*3.28084,inches:Ne*39.37,kilometers:Ne/1e3,kilometres:Ne/1e3,meters:Ne,metres:Ne,miles:Ne/1609.344,millimeters:Ne*1e3,millimetres:Ne*1e3,nauticalmiles:Ne/1852,radians:1,yards:Ne*1.0936};function Do(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function vc(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ka(r[0])||!ka(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Do(n,t,e)}function Aa(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return Do(a,t,e)}function xs(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Fa(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return Do(n,t,e)}function yc(r,t){t===void 0&&(t="kilometers");var e=Ma[t];if(!e)throw new Error(t+" units is invalid");return r*e}function mc(r,t){t===void 0&&(t="kilometers");var e=Ma[t];if(!e)throw new Error(t+" units is invalid");return r/e}function ka(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Mo(r){return r.type==="Feature"?r.geometry:r}function _c(r,t,e){e===void 0&&(e={});var n=Mo(r),i=Mo(t),o=Da.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?Aa(o[0],e.properties):Fa(o,e.properties)}const zf="";function Ec(r){let t,e,n;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"stroke-width","4"),P(e,"fill-rule","evenodd"),P(e,"clip-rule","evenodd"),P(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),P(e,"class","svelte-gzo3ar"),P(t,"width",n=r[0]!=="list"?void 0:"20"),P(t,"viewBox","0 0 70 85"),P(t,"fill","none"),P(t,"class","svelte-gzo3ar"),nn(t,"in-map",r[0]!=="list"),nn(t,"list-icon",r[0]==="list")},m(i,o){Mt(i,t,o),rt(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&P(t,"width",n),o&1&&nn(t,"in-map",i[0]!=="list"),o&1&&nn(t,"list-icon",i[0]==="list")},i:_t,o:_t,d(i){i&&Lt(t)}}}function Ic(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class Cc extends Pr{constructor(t){super(),br(this,t,Ic,Ec,Sr,{displayIn:0})}}function Ba(r,t,e){if(r!==null)for(var n,i,o,s,a,u,l,c=0,f=0,h,g=r.type,p=g==="FeatureCollection",y=g==="Feature",d=p?r.features.length:1,m=0;m<d;m++){l=p?r.features[m].geometry:y?r.geometry:r,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var E=0;E<a;E++){var C=0,L=0;if(s=h?l.geometries[E]:l,s!==null){u=s.coordinates;var N=s.type;switch(c=e&&(N==="Polygon"||N==="MultiPolygon")?1:0,N){case null:break;case"Point":if(t(u,f,m,C,L)===!1)return!1;f++,C++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,m,C,L)===!1)return!1;f++,N==="MultiPoint"&&C++}N==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(t(u[n][i],f,m,C,L)===!1)return!1;f++}N==="MultiLineString"&&C++,N==="Polygon"&&L++}N==="Polygon"&&C++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(L=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-c;o++){if(t(u[n][i][o],f,m,C,L)===!1)return!1;f++}L++}C++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Ba(s.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ga(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function za(r,t){var e,n,i,o,s,a,u,l,c,f,h=0,g=r.type==="FeatureCollection",p=r.type==="Feature",y=g?r.features.length:1;for(e=0;e<y;e++){for(a=g?r.features[e].geometry:p?r.geometry:r,l=g?r.features[e].properties:p?r.properties:{},c=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function ws(r){var t=[1/0,1/0,-1/0,-1/0];return Ba(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}ws.default=ws;function Nc(r,t){t===void 0&&(t={});var e=ws(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return vc([n,i],t.properties,t)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(o=o<0?Math.max(n+arguments[2],0):Math.min(o,n);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var Zr=function(){};Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ct=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),V=function(){},Va={MAX_VALUE:{configurable:!0}};V.isNaN=function(t){return Number.isNaN(t)},V.doubleToLongBits=function(t){return t},V.longBitsToDouble=function(t){return t},V.isInfinite=function(t){return!Number.isFinite(t)},Va.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(V,Va);var De=function(){},Ao=function(){},Ii=function(){};function Me(){}var v=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Jr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};v.prototype.setOrdinate=function(t,e){switch(t){case v.X:this.x=e;break;case v.Y:this.y=e;break;case v.Z:this.z=e;break;default:throw new ct("Invalid ordinate index: "+t)}},v.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!Zr.equalsWithTolerance(this.x,e.x,n)||!Zr.equalsWithTolerance(this.y,e.y,n))}},v.prototype.getOrdinate=function(t){switch(t){case v.X:return this.x;case v.Y:return this.y;case v.Z:return this.z}throw new ct("Invalid ordinate index: "+t)},v.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||V.isNaN(this.z))&&V.isNaN(t.z)},v.prototype.equals=function(t){return t instanceof v?this.equals2D(t):!1},v.prototype.equalInZ=function(t,e){return Zr.equalsWithTolerance(this.z,t.z,e)},v.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},v.prototype.clone=function(){},v.prototype.copy=function(){return new v(this)},v.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},v.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},v.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},v.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this.x),t=37*t+v.hashCode(this.y),t},v.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},v.prototype.interfaces_=function(){return[De,Ao,Me]},v.prototype.getClass=function(){return v},v.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=V.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Jr.DimensionalComparator.get=function(){return cr},Jr.serialVersionUID.get=function(){return 6683108902428367e3},Jr.NULL_ORDINATE.get=function(){return V.NaN},Jr.X.get=function(){return 0},Jr.Y.get=function(){return 1},Jr.Z.get=function(){return 2},Object.defineProperties(v,Jr);var cr=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ct("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};cr.prototype.compare=function(t,e){var n=t,i=e,o=cr.compare(n.x,i.x);if(o!==0)return o;var s=cr.compare(n.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=cr.compare(n.z,i.z);return a},cr.prototype.interfaces_=function(){return[Ii]},cr.prototype.getClass=function(){return cr},cr.compare=function(t,e){return t<e?-1:t>e?1:V.isNaN(t)?V.isNaN(e)?0:-1:V.isNaN(e)?1:0};var Ci=function(){};Ci.prototype.create=function(){},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var _=function(){},no={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.toLocationSymbol=function(t){switch(t){case _.EXTERIOR:return"e";case _.BOUNDARY:return"b";case _.INTERIOR:return"i";case _.NONE:return"-"}throw new ct("Unknown location value: "+t)},no.INTERIOR.get=function(){return 0},no.BOUNDARY.get=function(){return 1},no.EXTERIOR.get=function(){return 2},no.NONE.get=function(){return-1},Object.defineProperties(_,no);var z=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},Se=function(){},Ua={LOG_10:{configurable:!0}};Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.log10=function(t){var e=Math.log(t);return V.isInfinite(e)||V.isNaN(e)?e:e/Se.LOG_10},Se.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},Se.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},Se.wrap=function(t,e){return t<0?e- -t%e:t%e},Se.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},Se.average=function(t,e){return(t+e)/2},Ua.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Se,Ua);var on=function(t){this.str=t};on.prototype.append=function(t){this.str+=t},on.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},on.prototype.toString=function(t){return this.str};var sn=function(t){this.value=t};sn.prototype.intValue=function(){return this.value},sn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},sn.isNaN=function(t){return Number.isNaN(t)};var ro=function(){};ro.isWhitespace=function(t){return t<=32&&t>=0||t===127},ro.toUpperCase=function(t){return t.toUpperCase()};var I=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},Ve={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}};I.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},I.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=I.magnitude(n._hi),o=I.TEN.pow(i);n=n.divide(o),n.gt(I.TEN)?(n=n.divide(I.TEN),i+=1):n.lt(I.ONE)&&(n=n.multiply(I.TEN),i-=1);for(var s=i+1,a=new on,u=I.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),n=n.subtract(I.valueOf(c)).multiply(I.TEN),f&&n.selfAdd(I.TEN);var g=!0,p=I.magnitude(n._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},I.prototype.sqr=function(){return this.multiply(this)},I.prototype.doubleValue=function(){return this._hi+this._lo},I.prototype.subtract=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},I.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},I.prototype.isZero=function(){return this._hi===0&&this._lo===0},I.prototype.selfSubtract=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},I.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},I.prototype.min=function(t){return this.le(t)?this:t},I.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/n,c=I.SPLIT*l,o=c-l,h=I.SPLIT*n,o=c-o,s=l-o,a=h-n,f=l*n,a=h-a,u=n-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/n,h=l+c,this._hi=h,this._lo=l-h+c,this}},I.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},I.prototype.divide=function(){if(arguments[0]instanceof I){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=I.SPLIT*s,e=a-s,l=I.SPLIT*t._hi,e=a-e,n=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+n*i+n*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new I(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return V.isNaN(h)?I.createNaN():I.copy(this).selfDivide(h,0)}},I.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},I.prototype.pow=function(t){if(t===0)return I.valueOf(1);var e=new I(this),n=I.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},I.prototype.ceil=function(){if(this.isNaN())return I.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new I(t,e)},I.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},I.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},I.prototype.setValue=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},I.prototype.max=function(t){return this.ge(t)?this:t},I.prototype.sqrt=function(){if(this.isZero())return I.valueOf(0);if(this.isNegative())return I.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=I.valueOf(e),i=this.subtract(n.sqr()),o=i._hi*(t*.5);return n.add(o)},I.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,n=o+u,i=u+(o-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,y=null,d=null,m=null,E=null;y=this._hi+l,g=this._lo+c,m=y-this._hi,E=g-this._lo,d=y-m,p=g-E,d=l-m+(this._hi-d),p=c-E+(this._lo-p),m=d+g,f=y+m,h=m+(y-f),m=p+h;var C=f+m,L=m+(f-C);return this._hi=C,this._lo=L,this}},I.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=I.SPLIT*this._hi,o=l-this._hi,c=I.SPLIT*n,o=l-o,s=this._hi-o,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*n);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},I.prototype.selfSqr=function(){return this.selfMultiply(this)},I.prototype.floor=function(){if(this.isNaN())return I.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new I(t,e)},I.prototype.negate=function(){return this.isNaN()?this:new I(-this._hi,-this._lo)},I.prototype.clone=function(){},I.prototype.multiply=function(){if(arguments[0]instanceof I){var t=arguments[0];return t.isNaN()?I.createNaN():I.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return V.isNaN(e)?I.createNaN():I.copy(this).selfMultiply(e,0)}},I.prototype.isNaN=function(){return V.isNaN(this._hi)},I.prototype.intValue=function(){return Math.trunc(this._hi)},I.prototype.toString=function(){var t=I.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},I.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(i<0)o="0."+I.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var s=i-n.length,a=I.stringOfChar("0",s);o=n+a+".0"}return this.isNegative()?"-"+o:o},I.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=I.SPLIT*o,t=s-o,u=I.SPLIT*this._hi,t=s-t,e=o-t,n=u-this._hi,a=o*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new I(l,c)},I.prototype.toSciNotation=function(){if(this.isZero())return I.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=I.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var s=n.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},I.prototype.abs=function(){return this.isNaN()?I.NaN:this.isNegative()?this.negate():new I(this)},I.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},I.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},I.prototype.add=function(){if(arguments[0]instanceof I){var t=arguments[0];return I.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return I.copy(this).selfAdd(e)}},I.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof I){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},I.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},I.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},I.prototype.trunc=function(){return this.isNaN()?I.NaN:this.isPositive()?this.floor():this.ceil()},I.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},I.prototype.interfaces_=function(){return[Me,De,Ao]},I.prototype.getClass=function(){return I},I.sqr=function(t){return I.valueOf(t).selfMultiply(t)},I.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return I.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new I(e)}},I.sqrt=function(t){return I.valueOf(t).sqrt()},I.parse=function(t){for(var e=0,n=t.length;ro.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new I,a=0,u=0,l=0;!(e>=n);){var c=t.charAt(e);if(e++,ro.isDigit(c)){var f=c-"0";s.selfMultiply(I.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=sn.parseInt(h)}catch(m){throw m instanceof Error?new Error("Invalid exponent "+h+" in string "+t):m}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var y=I.TEN.pow(p);g=s.divide(y)}else if(p<0){var d=I.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},I.createNaN=function(){return new I(V.NaN,V.NaN)},I.copy=function(t){return new I(t)},I.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},I.stringOfChar=function(t,e){for(var n=new on,i=0;i<e;i++)n.append(t);return n.toString()},Ve.PI.get=function(){return new I(3.141592653589793,12246467991473532e-32)},Ve.TWO_PI.get=function(){return new I(6.283185307179586,24492935982947064e-32)},Ve.PI_2.get=function(){return new I(1.5707963267948966,6123233995736766e-32)},Ve.E.get=function(){return new I(2.718281828459045,14456468917292502e-32)},Ve.NaN.get=function(){return new I(V.NaN,V.NaN)},Ve.EPS.get=function(){return 123259516440783e-46},Ve.SPLIT.get=function(){return 134217729},Ve.MAX_PRINT_DIGITS.get=function(){return 32},Ve.TEN.get=function(){return I.valueOf(10)},Ve.ONE.get=function(){return I.valueOf(1)},Ve.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ve.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(I,Ve);var fe=function(){},qa={DP_SAFE_EPSILON:{configurable:!0}};fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.orientationIndex=function(t,e,n){var i=fe.orientationIndexFilter(t,e,n);if(i<=1)return i;var o=I.valueOf(e.x).selfAdd(-t.x),s=I.valueOf(e.y).selfAdd(-t.y),a=I.valueOf(n.x).selfAdd(-e.x),u=I.valueOf(n.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},fe.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},fe.intersection=function(t,e,n,i){var o=I.valueOf(i.y).selfSubtract(n.y).selfMultiply(I.valueOf(e.x).selfSubtract(t.x)),s=I.valueOf(i.x).selfSubtract(n.x).selfMultiply(I.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=I.valueOf(i.x).selfSubtract(n.x).selfMultiply(I.valueOf(t.y).selfSubtract(n.y)),l=I.valueOf(i.y).selfSubtract(n.y).selfMultiply(I.valueOf(t.x).selfSubtract(n.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=I.valueOf(t.x).selfAdd(I.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=I.valueOf(e.x).selfSubtract(t.x).selfMultiply(I.valueOf(t.y).selfSubtract(n.y)),p=I.valueOf(e.y).selfSubtract(t.y).selfMultiply(I.valueOf(t.x).selfSubtract(n.x)),y=g.subtract(p),d=y.selfDivide(a).doubleValue(),m=I.valueOf(n.y).selfAdd(I.valueOf(i.y).selfSubtract(n.y).selfMultiply(d)).doubleValue();return new v(h,m)},fe.orientationIndexFilter=function(t,e,n){var i=null,o=(t.x-n.x)*(e.y-n.y),s=(t.y-n.y)*(e.x-n.x),a=o-s;if(o>0){if(s<=0)return fe.signum(a);i=o+s}else if(o<0){if(s>=0)return fe.signum(a);i=-o-s}else return fe.signum(a);var u=fe.DP_SAFE_EPSILON*i;return a>=u||-a>=u?fe.signum(a):2},fe.signum=function(t){return t>0?1:t<0?-1:0},qa.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(fe,qa);var Q=function(){},io={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};io.X.get=function(){return 0},io.Y.get=function(){return 1},io.Z.get=function(){return 2},io.M.get=function(){return 3},Q.prototype.setOrdinate=function(t,e,n){},Q.prototype.size=function(){},Q.prototype.getOrdinate=function(t,e){},Q.prototype.getCoordinate=function(){},Q.prototype.getCoordinateCopy=function(t){},Q.prototype.getDimension=function(){},Q.prototype.getX=function(t){},Q.prototype.clone=function(){},Q.prototype.expandEnvelope=function(t){},Q.prototype.copy=function(){},Q.prototype.getY=function(t){},Q.prototype.toCoordinateArray=function(){},Q.prototype.interfaces_=function(){return[Ao]},Q.prototype.getClass=function(){return Q},Object.defineProperties(Q,io);var Xa=function(){},Ni=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Xa),Gt=function(){};Gt.arraycopy=function(t,e,n,i,o){for(var s=0,a=e;a<e+o;a++)n[i+s]=t[a],s++},Gt.getProperty=function(t){return{"line.separator":`
23
- `}[t]};var Ue=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],y=f.y-h.y,d=h.x-f.x,m=f.x*h.y-h.x*f.y,E=g.y-p.y,C=p.x-g.x,L=g.x*p.y-p.x*g.y;this.x=d*L-C*m,this.y=E*m-y*L,this.w=y*C-E*d}};Ue.prototype.getY=function(){var t=this.y/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new Ni;return t},Ue.prototype.getX=function(){var t=this.x/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new Ni;return t},Ue.prototype.getCoordinate=function(){var t=new v;return t.x=this.getX(),t.y=this.getY(),t},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.intersection=function(t,e,n,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,y=h/g;if(V.isNaN(p)||V.isInfinite(p)||V.isNaN(y)||V.isInfinite(y))throw new Ni;return new v(p,y)};var k=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Ya={serialVersionUID:{configurable:!0}};k.prototype.getArea=function(){return this.getWidth()*this.getHeight()},k.prototype.equals=function(t){if(!(t instanceof k))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},k.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new k;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new k(e,i,n,o)},k.prototype.isNull=function(){return this._maxx<this._minx},k.prototype.getMaxX=function(){return this._maxx},k.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},k.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof k){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof v){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},k.prototype.getMinY=function(){return this._miny},k.prototype.getMinX=function(){return this._minx},k.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},k.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},k.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},k.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},k.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},k.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},k.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},k.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},k.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},k.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},k.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof k){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},k.prototype.centre=function(){return this.isNull()?null:new v((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},k.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},k.prototype.getMaxY=function(){return this._maxy},k.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},k.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this._minx),t=37*t+v.hashCode(this._maxx),t=37*t+v.hashCode(this._miny),t=37*t+v.hashCode(this._maxy),t},k.prototype.interfaces_=function(){return[De,Me]},k.prototype.getClass=function(){return k},k.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},Ya.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(k,Ya);var an={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*$/},Fo=function(t){this.geometryFactory=t||new j};Fo.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=an.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=an.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],Si[n]&&(e=Si[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Fo.prototype.write=function(t){return this.extractGeometry(t)},Fo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!qn[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+qn[e].apply(this,[t])+")",i};var qn={coordinate:function(t){return t.x+" "+t.y},point:function(t){return qn.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(qn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(qn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+qn.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+qn.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},Si={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(an.spaces);return this.geometryFactory.createPoint(new v(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Si.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(an.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(an.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(an.parenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Si.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,o,s=t.trim().split(an.parenComma),a,u=[],l=0,c=s.length;l<c;++l)n=s[l].replace(an.trimParens,"$1"),i=Si.linestring.apply(e,[n]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(an.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(an.trimParens,"$1"),o.push(Si.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],o=0,s=n.length;o<s;++o)i.push(e.read(n[o]));return this.geometryFactory.createGeometryCollection(i)}},qe=function(t){this.parser=new Fo(t)};qe.prototype.write=function(t){return this.parser.write(t)},qe.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Xn=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),ko=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Xn),q=function(){};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.shouldNeverReachHere=function(){if(arguments.length===0)q.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new ko("Should never reach here"+(t!==null?": "+t:""))}},q.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],q.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new ko:new ko(e)},q.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],q.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new ko("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var ht=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 v,this._intPt[1]=new v,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},$r={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ht.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ht.prototype.getTopologySummary=function(){var t=new on;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ht.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},ht.prototype.getIntersectionNum=function(){return this._result},ht.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 t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ht.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ht.prototype.setPrecisionModel=function(t){this._precisionModel=t},ht.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},ht.prototype.getIntersection=function(t){return this._intPt[t]},ht.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ht.prototype.hasIntersection=function(){return this._result!==ht.NO_INTERSECTION},ht.prototype.getEdgeDistance=function(t,e){var n=ht.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},ht.prototype.isCollinear=function(){return this._result===ht.COLLINEAR_INTERSECTION},ht.prototype.toString=function(){return qe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+qe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ht.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ht.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},ht.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ht.prototype.interfaces_=function(){return[]},ht.prototype.getClass=function(){return ht},ht.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),o=Math.abs(n.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(n))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return q.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},ht.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return q.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},$r.DONT_INTERSECT.get=function(){return 0},$r.DO_INTERSECT.get=function(){return 1},$r.COLLINEAR.get=function(){return 2},$r.NO_INTERSECTION.get=function(){return 0},$r.POINT_INTERSECTION.get=function(){return 1},$r.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ht,$r);var Dr=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new k(this._inputLines[0][0],this._inputLines[0][1]),o=new k(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,k.intersects(i,o,n)&&M.orientationIndex(i,o,n)===0&&M.orientationIndex(o,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(o))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,o,s,a){a.x=this.smallestInAbsValue(n.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(n.y,i.y,o.y,s.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,o,s){var a=null;try{a=Ue.intersection(n,i,o,s)}catch(u){if(u instanceof Ni)a=t.nearestEndpoint(n,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(n,i,o,s){var a=this.intersectionWithNormalization(n,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new v(t.nearestEndpoint(n,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,o,s){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(n,i,o,s,a){var u=fe.intersection(n,i,o,s),l=this.isInSegmentEnvelopes(u);Gt.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Gt.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,s){var a=new v(n),u=new v(i),l=new v(o),c=new v(s),f=new v;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(n,i,o,s){var a=k.intersects(n,i,o),u=k.intersects(n,i,s),l=k.intersects(o,s,n),c=k.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,o,s,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,y=o.y>s.y?o.y:s.y,d=u>h?u:h,m=c<p?c:p,E=l>g?l:g,C=f<y?f:y,L=(d+m)/2,N=(E+C)/2;a.x=L,a.y=N,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(n,i,o,s){if(this._isProper=!1,!k.intersects(n,i,o,s))return r.NO_INTERSECTION;var a=M.orientationIndex(n,i,o),u=M.orientationIndex(n,i,s);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=M.orientationIndex(o,s,n),c=M.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(n,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(s)?this._intPt[0]=n:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new v(o):u===0?this._intPt[0]=new v(s):l===0?this._intPt[0]=new v(n):c===0&&(this._intPt[0]=new v(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,o,s)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,o,s){var a=n,u=M.distancePointLine(n,o,s),l=M.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=M.distancePointLine(o,n,i),l<u&&(u=l,a=o),l=M.distancePointLine(s,n,i),l<u&&(u=l,a=s),a},t}(ht),ti=function(){};ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.orientationIndex=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=n.x-e.x,a=n.y-e.y;return ti.signOfDet2x2(i,o,s,a)},ti.signOfDet2x2=function(t,e,n,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-o:o:n>0?o:-o;if(e===0||n===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=n,n=s,s=e,e=i,i=s):e<=-i?(o=-o,n=-n,i=-i):(s=t,t=-n,n=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=n,n=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,n=-n,i=-i):(o=-o,s=-t,t=-n,n=s,s=-e,e=-i,i=s),t>0)if(n>0){if(!(t<=n))return o}else return o;else{if(n>0)return-o;if(t>=n)o=-o,t=-t,n=-n;else return-o}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>n+n){if(e<i+i)return o}else{if(e>i+i)return-o;n=t-n,i=e-i,o=-o}if(i===0)return n===0?0:-o;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return o;if(e>i)return-o;if(n>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=n-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var un=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};un.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=ti.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},un.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR},un.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.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 v&&z(arguments[1],Q)){for(var t=arguments[0],e=arguments[1],n=new un(t),i=new v,o=new v,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),n.countSegment(i,o),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof v&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new un(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var M=function(){},ei={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.orientationIndex=function(t,e,n){return fe.orientationIndex(t,e,n)},M.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-n,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(z(arguments[0],Q)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new v,f=new v,h=new v;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,y=1;y<l-1;y++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(y+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},M.distanceLineLine=function(t,e,n,i){if(t.equals(e))return M.distancePointLine(t,n,i);if(n.equals(i))return M.distancePointLine(i,t,e);var o=!1;if(!k.intersects(t,e,n,i))o=!0;else{var s=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(s===0)o=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?Se.min(M.distancePointLine(t,n,i),M.distancePointLine(e,n,i),M.distancePointLine(n,t,e),M.distancePointLine(i,t,e)):0},M.isPointInRing=function(t,e){return M.locatePointInRing(t,e)!==_.EXTERIOR},M.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new v;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;n+=Math.sqrt(c*c+f*f),o=u,s=l}return n},M.isCCW=function(t){var e=t.length-1;if(e<3)throw new ct("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var f=M.computeOrientation(l,n,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},M.locatePointInRing=function(t,e){return un.locatePointInRing(t,e)},M.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},M.computeOrientation=function(t,e,n){return M.orientationIndex(t,e,n)},M.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ct("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=M.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},M.isOnLine=function(t,e){for(var n=new Dr,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(n.computeIntersection(t,o,s),n.hasIntersection())return!0}return!1},ei.CLOCKWISE.get=function(){return-1},ei.RIGHT.get=function(){return M.CLOCKWISE},ei.COUNTERCLOCKWISE.get=function(){return 1},ei.LEFT.get=function(){return M.COUNTERCLOCKWISE},ei.COLLINEAR.get=function(){return 0},ei.STRAIGHT.get=function(){return M.COLLINEAR},Object.defineProperties(M,ei);var Yn=function(){};Yn.prototype.filter=function(t){},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var G=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},xn={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}};G.prototype.isGeometryCollection=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},G.prototype.getFactory=function(){return this._factory},G.prototype.getGeometryN=function(t){return this},G.prototype.getArea=function(){return 0},G.prototype.isRectangle=function(){return!1},G.prototype.equals=function(){if(arguments[0]instanceof G){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof G))return!1;var n=e;return this.equalsExact(n)}},G.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},G.prototype.geometryChanged=function(){this.apply(G.geometryChangedFilter)},G.prototype.geometryChangedAction=function(){this._envelope=null},G.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},G.prototype.getLength=function(){return 0},G.prototype.getNumGeometries=function(){return 1},G.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},G.prototype.getUserData=function(){return this._userData},G.prototype.getSRID=function(){return this._SRID},G.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},G.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new ct("This method does not support GeometryCollection arguments")},G.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},G.prototype.norm=function(){var t=this.copy();return t.normalize(),t},G.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},G.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new k(this._envelope)},G.prototype.setSRID=function(t){this._SRID=t},G.prototype.setUserData=function(t){this._userData=t},G.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var o=n.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},G.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},G.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},G.prototype.interfaces_=function(){return[Ao,De,Me]},G.prototype.getClass=function(){return G},G.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},G.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},xn.serialVersionUID.get=function(){return 8763622679187377e3},xn.SORTINDEX_POINT.get=function(){return 0},xn.SORTINDEX_MULTIPOINT.get=function(){return 1},xn.SORTINDEX_LINESTRING.get=function(){return 2},xn.SORTINDEX_LINEARRING.get=function(){return 3},xn.SORTINDEX_MULTILINESTRING.get=function(){return 4},xn.SORTINDEX_POLYGON.get=function(){return 5},xn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},xn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},xn.geometryChangedFilter.get=function(){return Ls},Object.defineProperties(G,xn);var Ls=function(){};Ls.interfaces_=function(){return[Yn]},Ls.filter=function(t){t.geometryChangedAction()};var wn=function(){};wn.prototype.filter=function(t){},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var Ae=function(){},Wn={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}};Ae.prototype.isInBoundary=function(t){},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Wn.Mod2BoundaryNodeRule.get=function(){return xi},Wn.EndPointBoundaryNodeRule.get=function(){return wi},Wn.MultiValentEndPointBoundaryNodeRule.get=function(){return Li},Wn.MonoValentEndPointBoundaryNodeRule.get=function(){return bi},Wn.MOD2_BOUNDARY_RULE.get=function(){return new xi},Wn.ENDPOINT_BOUNDARY_RULE.get=function(){return new wi},Wn.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Li},Wn.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bi},Wn.OGC_SFS_BOUNDARY_RULE.get=function(){return Ae.MOD2_BOUNDARY_RULE},Object.defineProperties(Ae,Wn);var xi=function(){};xi.prototype.isInBoundary=function(t){return t%2===1},xi.prototype.interfaces_=function(){return[Ae]},xi.prototype.getClass=function(){return xi};var wi=function(){};wi.prototype.isInBoundary=function(t){return t>0},wi.prototype.interfaces_=function(){return[Ae]},wi.prototype.getClass=function(){return wi};var Li=function(){};Li.prototype.isInBoundary=function(t){return t>1},Li.prototype.interfaces_=function(){return[Ae]},Li.prototype.getClass=function(){return Li};var bi=function(){};bi.prototype.isInBoundary=function(t){return t===1},bi.prototype.interfaces_=function(){return[Ae]},bi.prototype.getClass=function(){return bi};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){};function bs(r){this.message=r||""}bs.prototype=new Error,bs.prototype.name="IndexOutOfBoundsException";var Pi=function(){};Pi.prototype.hasNext=function(){},Pi.prototype.next=function(){},Pi.prototype.remove=function(){};var Xe=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(bt);function Ri(r){this.message=r||""}Ri.prototype=new Error,Ri.prototype.name="NoSuchElementException";var O=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,bt]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(n,i){var o=this.array_[n];return this.array_[n]=i,o},t.prototype.iterator=function(){return new Sc(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new bs;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.remove=function(n){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===n){i.array_.splice(s,1),o=!0;break}return o},t}(Xe),Sc=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Ri;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Pi),oo=function(r){function t(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=r.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];r.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof v&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],y=arguments[2];if(y)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var m=g.length-1;m>=0;m--)i.add(g[m],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2];if(!L){var N=this.size();if(N>0){if(E>0){var S=this.get(E-1);if(S.equals2D(C))return null}if(E<N){var T=this.get(E);if(T.equals2D(C))return null}}}r.prototype.add.call(this,E,C)}}else if(arguments.length===4){var A=arguments[0],w=arguments[1],F=arguments[2],X=arguments[3],R=1;F>X&&(R=-1);for(var Y=F;Y!==X;Y+=R)i.add(A[Y],w);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new v(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(O),H=function(){},Bo={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Bo.ForwardComparator.get=function(){return so},Bo.BidirectionalComparator.get=function(){return Oi},Bo.coordArrayType.get=function(){return new Array(0).fill(null)},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},H.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(H.indexOf(i,e)<0)return i}return null},H.scroll=function(t,e){var n=H.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);Gt.arraycopy(t,n,i,0,t.length-n),Gt.arraycopy(t,0,i,t.length-n,n),Gt.arraycopy(i,0,t,0,t.length)},H.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},H.intersection=function(t,e){for(var n=new oo,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},H.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},H.removeRepeatedPoints=function(t){if(!H.hasRepeatedPoints(t))return t;var e=new oo(t,!1);return e.toCoordinateArray()},H.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},H.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},H.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new v(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new v(i[o+l])},H.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[t.length-n-1];if(i.compareTo(o)!==0)return!1}return!0},H.envelope=function(t){for(var e=new k,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},H.toCoordinateArray=function(t){return t.toArray(H.coordArrayType)},H.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},H.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},H.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},H.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},H.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},H.extract=function(t,e,n){e=Se.clamp(e,0,t.length),n=Se.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=n;a++)o[s++]=t[a];return o},Object.defineProperties(H,Bo);var so=function(){};so.prototype.compare=function(t,e){var n=t,i=e;return H.compare(n,i)},so.prototype.interfaces_=function(){return[Ii]},so.prototype.getClass=function(){return so};var Oi=function(){};Oi.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var o=H.compare(n,i),s=H.isEqualReversed(n,i);return s?0:o},Oi.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var o=H.increasingDirection(n),s=H.increasingDirection(i),a=o>0?0:n.length-1,u=s>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},Oi.prototype.interfaces_=function(){return[Ii]},Oi.prototype.getClass=function(){return Oi};var ni=function(){};ni.prototype.get=function(){},ni.prototype.put=function(){},ni.prototype.size=function(){},ni.prototype.values=function(){},ni.prototype.entrySet=function(){};var xc=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(ni);function ao(r){this.message=r||""}ao.prototype=new Error,ao.prototype.name="OperationNotSupported";function Go(){}Go.prototype=new bt,Go.prototype.contains=function(){};var Ps=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.iterator=function(){return new wc(this)},t}(Go),wc=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Ri;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new ao},t}(Pi),Hn=0,Mr=1;function Wa(r){return r===null?Hn:r.color}function st(r){return r===null?null:r.parent}function jn(r,t){r!==null&&(r.color=t)}function Rs(r){return r===null?null:r.left}function Ha(r){return r===null?null:r.right}function jt(){this.root_=null,this.size_=0}jt.prototype=new xc,jt.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},jt.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:r,left:null,right:null,value:t,parent:n,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},jt.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Mr;r!=null&&r!==this.root_&&r.parent.color===Mr;)if(st(r)===Rs(st(st(r)))){var e=Ha(st(st(r)));Wa(e)===Mr?(jn(st(r),Hn),jn(e,Hn),jn(st(st(r)),Mr),r=st(st(r))):(r===Ha(st(r))&&(r=st(r),t.rotateLeft(r)),jn(st(r),Hn),jn(st(st(r)),Mr),t.rotateRight(st(st(r))))}else{var n=Rs(st(st(r)));Wa(n)===Mr?(jn(st(r),Hn),jn(n,Hn),jn(st(st(r)),Mr),r=st(st(r))):(r===Rs(st(r))&&(r=st(r),t.rotateRight(r)),jn(st(r),Hn),jn(st(st(r)),Mr),t.rotateLeft(st(st(r))))}this.root_.color=Hn},jt.prototype.values=function(){var r=new O,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=jt.successor(t))!==null;)r.add(t.value);return r},jt.prototype.entrySet=function(){var r=new Ps,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=jt.successor(t))!==null;)r.add(t);return r},jt.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},jt.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},jt.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},jt.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},jt.prototype.size=function(){return this.size_};var uo=function(){};uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo};function ja(){}ja.prototype=new Go;function ln(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}ln.prototype=new ja,ln.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},ln.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},ln.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},ln.prototype.remove=function(r){throw new ao},ln.prototype.size=function(){return this.array_.length},ln.prototype.isEmpty=function(){return this.array_.length===0},ln.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},ln.prototype.iterator=function(){return new zo(this)};var zo=function(r){this.treeSet_=r,this.position_=0};zo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Ri;return this.treeSet_.array_[this.position_++]},zo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},zo.prototype.remove=function(){throw new ao};var Ar=function(){};Ar.sort=function(){var t=arguments[0],e,n,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},n.sort(o),s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},Ar.asList=function(t){for(var e=new O,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var Z=function(){},Ye={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}};Ye.P.get=function(){return 0},Ye.L.get=function(){return 1},Ye.A.get=function(){return 2},Ye.FALSE.get=function(){return-1},Ye.TRUE.get=function(){return-2},Ye.DONTCARE.get=function(){return-3},Ye.SYM_FALSE.get=function(){return"F"},Ye.SYM_TRUE.get=function(){return"T"},Ye.SYM_DONTCARE.get=function(){return"*"},Ye.SYM_P.get=function(){return"0"},Ye.SYM_L.get=function(){return"1"},Ye.SYM_A.get=function(){return"2"},Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toDimensionSymbol=function(t){switch(t){case Z.FALSE:return Z.SYM_FALSE;case Z.TRUE:return Z.SYM_TRUE;case Z.DONTCARE:return Z.SYM_DONTCARE;case Z.P:return Z.SYM_P;case Z.L:return Z.SYM_L;case Z.A:return Z.SYM_A}throw new ct("Unknown dimension value: "+t)},Z.toDimensionValue=function(t){switch(ro.toUpperCase(t)){case Z.SYM_FALSE:return Z.FALSE;case Z.SYM_TRUE:return Z.TRUE;case Z.SYM_DONTCARE:return Z.DONTCARE;case Z.SYM_P:return Z.P;case Z.SYM_L:return Z.L;case Z.SYM_A:return Z.A}throw new ct("Unknown dimension symbol: "+t)},Object.defineProperties(Z,Ye);var cn=function(){};cn.prototype.filter=function(t){},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var We=function(){};We.prototype.filter=function(t,e){},We.prototype.isDone=function(){},We.prototype.isGeometryChanged=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var te=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new ct("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new k,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();Ar.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new ln(Ar.asList(this._geometries)),a=new ln(Ar.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),y=c.getGeometryN(g),d=p.compareToSameClass(y,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(z(arguments[0],wn))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(z(arguments[0],We)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],cn)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(z(arguments[0],Yn)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),q.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(G),Fr=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Fe(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[uo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(te),Fe=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Ae.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Fe.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Fe.prototype.getBoundary=function(){return this._geom instanceof dt?this.boundaryLineString(this._geom):this._geom instanceof Fr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Fe.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Fe.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Fe.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new O;this._endpointMap=new jt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return H.toCoordinateArray(n)},Fe.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Vo,this._endpointMap.put(t,e)),e.count++},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Fe(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Fe(n,i);return o.getBoundary()}};var Vo=function(){this.count=null};Vo.prototype.interfaces_=function(){return[]},Vo.prototype.getClass=function(){return Vo};function Lc(){}function bc(){}var Pc=function(){};function Rc(){}function Oc(){}function Tc(){}var ke=function(){},Os={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},ke.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Rc,n=new Lc;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new bc(ke.getStackTrace(i));for(var a=new Tc,u=0;u<o;u++)try{s+=a.readLine()+ke.NEWLINE}catch(l){if(l instanceof Oc)q.shouldNeverReachHere();else throw l}finally{}return s}},ke.split=function(t,e){for(var n=e.length,i=new O,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+n),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},ke.toString=function(){if(arguments.length===1){var t=arguments[0];return ke.SIMPLE_ORDINATE_FORMAT.format(t)}},ke.spaces=function(t){return ke.chars(" ",t)},Os.NEWLINE.get=function(){return Gt.getProperty("line.separator")},Os.SIMPLE_ORDINATE_FORMAT.get=function(){return new Pc},Object.defineProperties(ke,Os);var Et=function(){};Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.copyCoord=function(t,e,n,i){for(var o=Math.min(t.getDimension(),n.getDimension()),s=0;s<o;s++)n.setOrdinate(i,s,t.getOrdinate(e,s))},Et.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Q.X)===t.getOrdinate(e-1,Q.X)&&t.getOrdinate(0,Q.Y)===t.getOrdinate(e-1,Q.Y)},Et.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<n;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(V.isNaN(u)&&V.isNaN(l)))return!1}return!0},Et.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(Et.copy(e,0,i,0,o),o>0)for(var s=o;s<n;s++)Et.copy(e,o-1,i,s,1);return i},Et.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)Et.swap(t,i,e-i)},Et.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,o)}},Et.copy=function(t,e,n,i,o){for(var s=0;s<o;s++)Et.copyCoord(t,e+s,n,i+s)},Et.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new on;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<n;s++)s>0&&i.append(","),i.append(ke.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Et.createClosedRing(t,e,4);var i=e.getOrdinate(0,Q.X)===e.getOrdinate(n-1,Q.X)&&e.getOrdinate(0,Q.Y)===e.getOrdinate(n-1,Q.Y);return i?e:Et.createClosedRing(t,e,n+1)},Et.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();Et.copy(e,0,i,0,o);for(var s=o;s<n;s++)Et.copy(e,0,i,s,1);return i};var dt=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new k:this._points.expandEnvelope(new k)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&Et.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return M.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(z(arguments[0],wn))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(z(arguments[0],We)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],cn)){var l=arguments[0];l.filter(this)}else if(z(arguments[0],Yn)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Fe(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new ct("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[uo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(G),lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var ve=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new k;var i=new k;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(z(arguments[0],wn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(z(arguments[0],We)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],cn)){var s=arguments[0];s.filter(this)}else if(z(arguments[0],Yn)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),q.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(G),fr=function(){};fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var Pt=function(r){function t(n,i,o){if(r.call(this,o),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new ct("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new ct("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(M.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(M.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,y=g!==c;if(p===y)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);Ar.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);Gt.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=H.minCoordinate(s.getCoordinates());H.scroll(u,l),Gt.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],M.isCCW(s.getCoordinates())===a&&H.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),y=c.getNumInteriorRing(),d=0;d<p&&d<y;){var m=i.getInteriorRingN(d),E=c.getInteriorRingN(d),C=m.compareToSameClass(E,l);if(C!==0)return C;d++}return d<p?1:d<y?-1:0}},t.prototype.apply=function(i){var o=this;if(z(i,wn)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(z(i,We)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(z(i,cn))i.filter(this);else if(z(i,Yn)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[fr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(G),Ti=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(te),Ln=function(r){function t(n,i){n instanceof v&&i instanceof j&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new ct("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ct("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(dt),bn=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new O,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[fr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(te),Be=function(t){this._factory=t||null,this._isUserDataCopied=!1},Uo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Be.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Be.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Be.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof te?this.editGeometryCollection(t,e):t instanceof Pt?this.editPolygon(t,e):t instanceof ve?e.edit(t,this._factory):t instanceof dt?e.edit(t,this._factory):(q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Be.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new O,s=0;s<i.getNumGeometries();s++){var a=n.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Ti?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Fr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===bn?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Be.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new O,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.GeometryEditorOperation=function(){},Uo.NoOpGeometryOperation.get=function(){return co},Uo.CoordinateOperation.get=function(){return fo},Uo.CoordinateSequenceOperation.get=function(){return ho},Object.defineProperties(Be,Uo);var co=function(){};co.prototype.edit=function(t,e){return t},co.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},co.prototype.getClass=function(){return co};var fo=function(){};fo.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Ln?e.createLinearRing(n):t instanceof dt?e.createLineString(n):t instanceof ve?n.length>0?e.createPoint(n[0]):e.createPoint():t},fo.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},fo.prototype.getClass=function(){return fo};var ho=function(){};ho.prototype.edit=function(t,e){return t instanceof Ln?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof dt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ho.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},ho.prototype.getClass=function(){return ho};var It=function(){var t=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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new v}else if(z(arguments[0],Q)){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 o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new v}}},Ka={serialVersionUID:{configurable:!0}};It.prototype.setOrdinate=function(t,e,n){switch(e){case Q.X:this._coordinates[t].x=n;break;case Q.Y:this._coordinates[t].y=n;break;case Q.Z:this._coordinates[t].z=n;break;default:throw new ct("invalid ordinateIndex")}},It.prototype.size=function(){return this._coordinates.length},It.prototype.getOrdinate=function(t,e){switch(e){case Q.X:return this._coordinates[t].x;case Q.Y:return this._coordinates[t].y;case Q.Z:return this._coordinates[t].z}return V.NaN},It.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},It.prototype.getCoordinateCopy=function(t){return new v(this._coordinates[t])},It.prototype.getDimension=function(){return this._dimension},It.prototype.getX=function(t){return this._coordinates[t].x},It.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new It(e,this._dimension)},It.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},It.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new It(e,this._dimension)},It.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new on(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},It.prototype.getY=function(t){return this._coordinates[t].y},It.prototype.toCoordinateArray=function(){return this._coordinates},It.prototype.interfaces_=function(){return[Q,Me]},It.prototype.getClass=function(){return It},Ka.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(It,Ka);var Pn=function(){},Ts={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Pn.prototype.readResolve=function(){return Pn.instance()},Pn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new It(t)}else if(z(arguments[0],Q)){var e=arguments[0];return new It(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new It(n):new It(n,i)}},Pn.prototype.interfaces_=function(){return[Ci,Me]},Pn.prototype.getClass=function(){return Pn},Pn.instance=function(){return Pn.instanceObject},Ts.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ts.instanceObject.get=function(){return new Pn},Object.defineProperties(Pn,Ts);var Qa=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new O,i=this.map_.values(),o=i.next();!o.done;)n.add(o.value),o=i.next();return n},t.prototype.entrySet=function(){var n=new Ps;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(ni),J=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof fn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Ds={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},J.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new sn(n).compareTo(new sn(i))},J.prototype.getScale=function(){return this._scale},J.prototype.isFloating=function(){return this._modelType===J.FLOATING||this._modelType===J.FLOATING_SINGLE},J.prototype.getType=function(){return this._modelType},J.prototype.toString=function(){var t="UNKNOWN";return this._modelType===J.FLOATING?t="Floating":this._modelType===J.FLOATING_SINGLE?t="Floating-Single":this._modelType===J.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},J.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(V.isNaN(t))return t;if(this._modelType===J.FLOATING_SINGLE){var e=t;return e}return this._modelType===J.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof v){var n=arguments[0];if(this._modelType===J.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},J.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===J.FLOATING?t=16:this._modelType===J.FLOATING_SINGLE?t=6:this._modelType===J.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},J.prototype.setScale=function(t){this._scale=Math.abs(t)},J.prototype.interfaces_=function(){return[Me,De]},J.prototype.getClass=function(){return J},J.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Ds.serialVersionUID.get=function(){return 7777263578777804e3},Ds.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(J,Ds);var fn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Ms={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[Me]},fn.prototype.getClass=function(){return fn},Ms.serialVersionUID.get=function(){return-552860263173159e4},Ms.nameToTypeMap.get=function(){return new Qa},Object.defineProperties(fn,Ms),J.Type=fn,J.FIXED=new fn("FIXED"),J.FLOATING=new fn("FLOATING"),J.FLOATING_SINGLE=new fn("FLOATING SINGLE");var j=function r(){this._precisionModel=new J,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?z(arguments[0],Ci)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof J&&(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]))},Za={serialVersionUID:{configurable:!0}};j.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new v(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new v(t.getMinX(),t.getMinY()),new v(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new v(t.getMinX(),t.getMinY()),new v(t.getMinX(),t.getMaxY()),new v(t.getMaxX(),t.getMaxY()),new v(t.getMaxX(),t.getMinY()),new v(t.getMinX(),t.getMinY())]),null)},j.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new dt(this.getCoordinateSequenceFactory().create(t),this);if(z(t,Q))return new dt(t,this)}else return new dt(this.getCoordinateSequenceFactory().create([]),this)},j.prototype.createMultiLineString=function(){if(arguments.length===0)return new Fr(null,this);if(arguments.length===1){var t=arguments[0];return new Fr(t,this)}},j.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(n=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(j.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Pt)return this.createMultiPolygon(j.toPolygonArray(t));if(u instanceof dt)return this.createMultiLineString(j.toLineStringArray(t));if(u instanceof ve)return this.createMultiPoint(j.toPointArray(t));q.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},j.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},j.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(z(arguments[0],Q)){var e=arguments[0];return new ve(e,this)}}},j.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},j.prototype.createPolygon=function(){if(arguments.length===0)return new Pt(null,null,this);if(arguments.length===1){if(z(arguments[0],Q)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ln){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Pt(i,o,this)}},j.prototype.getSRID=function(){return this._SRID},j.prototype.createGeometryCollection=function(){if(arguments.length===0)return new te(null,this);if(arguments.length===1){var t=arguments[0];return new te(t,this)}},j.prototype.createGeometry=function(t){var e=new Be(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},j.prototype.getPrecisionModel=function(){return this._precisionModel},j.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(z(arguments[0],Q)){var e=arguments[0];return new Ln(e,this)}}},j.prototype.createMultiPolygon=function(){if(arguments.length===0)return new bn(null,this);if(arguments.length===1){var t=arguments[0];return new bn(t,this)}},j.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Ti(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Ti(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(z(arguments[0],Q)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());Et.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},j.prototype.interfaces_=function(){return[Me]},j.prototype.getClass=function(){return j},j.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},j.getDefaultCoordinateSequenceFactory=function(){return Pn.instance()},j.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Za.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(j,Za);var Dc=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],qo=function(t){this.geometryFactory=t||new j};qo.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!hn[n])throw new Error("Unknown GeoJSON type: "+e.type);return Dc.indexOf(n)!==-1?hn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?hn[n].apply(this,[e.geometries]):hn[n].apply(this,[e])},qo.prototype.write=function(t){var e=t.getGeometryType();if(!Kn[e])throw new Error("Geometry is not supported");return Kn[e].apply(this,[t])};var hn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!hn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=hn.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new v(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new v(r[0],r[1]),new v(r[2],r[1]),new v(r[2],r[3]),new v(r[0],r[3]),new v(r[0],r[1])])},Point:function(r){var t=new v(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(hn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=hn.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(hn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=hn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var s=r[o],a=hn.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(hn.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Kn={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Kn.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var o=n[i];e.push(Kn.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Kn.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],s=Kn.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=i.getGeometryType();e.push(Kn[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},As=function(t){this.geometryFactory=t||new j,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new qo(this.geometryFactory)};As.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===J.FIXED&&this.reducePrecision(e),e},As.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var Ja=function(){this.parser=new qo(this.geometryFactory)};Ja.prototype.write=function(t){return this.parser.write(t)};var b=function(){},Xo={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};b.prototype.interfaces_=function(){return[]},b.prototype.getClass=function(){return b},b.opposite=function(t){return t===b.LEFT?b.RIGHT:t===b.RIGHT?b.LEFT:t},Xo.ON.get=function(){return 0},Xo.LEFT.get=function(){return 1},Xo.RIGHT.get=function(){return 2},Object.defineProperties(b,Xo);function Yo(r){this.message=r||""}Yo.prototype=new Error,Yo.prototype.name="EmptyStackException";function gn(){this.array_=[]}gn.prototype=new Xe,gn.prototype.add=function(r){return this.array_.push(r),!0},gn.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},gn.prototype.push=function(r){return this.array_.push(r),r},gn.prototype.pop=function(r){if(this.array_.length===0)throw new Yo;return this.array_.pop()},gn.prototype.peek=function(){if(this.array_.length===0)throw new Yo;return this.array_[this.array_.length-1]},gn.prototype.empty=function(){return this.array_.length===0},gn.prototype.isEmpty=function(){return this.empty()},gn.prototype.search=function(r){return this.array_.indexOf(r)},gn.prototype.size=function(){return this.array_.length},gn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var pn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};pn.prototype.getCoordinate=function(){return this._minCoord},pn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},pn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();q.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=M.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===M.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===M.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},pn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=b.LEFT;return i[e].y<i[e+1].y&&(o=b.RIGHT),o},pn.prototype.getEdge=function(){return this._orientedDe},pn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},pn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},pn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}q.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 o=this.getRightmostSide(this._minDe,this._minIndex);o===b.LEFT&&(this._orientedDe=this._minDe.getSym())},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var Qn=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new v(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(Xn),Wo=function(){this.array_=[]};Wo.prototype.addLast=function(t){this.array_.push(t)},Wo.prototype.removeFirst=function(){return this.array_.shift()},Wo.prototype.isEmpty=function(){return this.array_.length===0};var ee=function(){this._finder=null,this._dirEdgeList=new O,this._nodes=new O,this._rightMostCoord=null,this._env=null,this._finder=new pn};ee.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},ee.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ee.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new Qn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},ee.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(b.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ee.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ee.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(b.RIGHT)>=1&&e.getDepth(b.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ee.prototype.computeDepths=function(t){var e=this,n=new Ps,i=new Wo,o=t.getNode();for(i.addLast(o),n.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();n.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},ee.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ee.prototype.getEnvelope=function(){if(this._env===null){for(var t=new k,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},ee.prototype.addReachable=function(t){var e=this,n=new gn;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},ee.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(b.LEFT,t.getDepth(b.RIGHT)),e.setDepth(b.RIGHT,t.getDepth(b.LEFT))},ee.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();n._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},ee.prototype.getNodes=function(){return this._nodes},ee.prototype.getDirectedEdges=function(){return this._dirEdgeList},ee.prototype.interfaces_=function(){return[De]},ee.prototype.getClass=function(){return ee};var at=function r(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[b.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[b.ON]=s,this.location[b.LEFT]=a,this.location[b.RIGHT]=u}};at.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},at.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0},at.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===_.NONE&&(e.location[n]=t)},at.prototype.isLine=function(){return this.location.length===1},at.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[b.ON]=this.location[b.ON],n[b.LEFT]=_.NONE,n[b.RIGHT]=_.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===_.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},at.prototype.getLocations=function(){return this.location},at.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[b.LEFT];this.location[b.LEFT]=this.location[b.RIGHT],this.location[b.RIGHT]=t},at.prototype.toString=function(){var t=new on;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[b.LEFT])),t.append(_.toLocationSymbol(this.location[b.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[b.RIGHT])),t.toString()},at.prototype.setLocations=function(t,e,n){this.location[b.ON]=t,this.location[b.LEFT]=e,this.location[b.RIGHT]=n},at.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE},at.prototype.isArea=function(){return this.location.length>1},at.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1},at.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(b.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},at.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)},at.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},at.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at};var et=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new at(t),this.elt[1]=new at(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new at(e.elt[0]),this.elt[1]=new at(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new at(_.NONE),this.elt[1]=new at(_.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new at(o,s,a),this.elt[1]=new at(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new at(_.NONE,_.NONE,_.NONE),this.elt[1]=new at(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,f)}};et.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},et.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},et.prototype.isNull=function(t){return this.elt[t].isNull()},et.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},et.prototype.isLine=function(t){return this.elt[t].isLine()},et.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new at(t.elt[n]):e.elt[n].merge(t.elt[n])},et.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},et.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(b.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},et.prototype.toString=function(){var t=new on;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},et.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},et.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},et.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(b.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},et.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},et.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},et.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new at(this.elt[t].location[0]))},et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.toLineLabel=function(t){for(var e=new et(_.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var St=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new O,this._pts=new O,this._label=new et(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new O,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};St.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=M.isCCW(this._ring.getCoordinates())},St.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},St.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Qn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Qn("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var o=n.getLabel();q.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},St.prototype.getLinearRing=function(){return this._ring},St.prototype.getCoordinate=function(t){return this._pts.get(t)},St.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},St.prototype.addPoints=function(t,e,n){var i=this,o=t.getCoordinates();if(e){var s=1;n&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;n&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},St.prototype.isHole=function(){return this._isHole},St.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},St.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!M.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},St.prototype.addHole=function(t){this._holes.add(t)},St.prototype.isShell=function(){return this._shell===null},St.prototype.getLabel=function(){return this._label},St.prototype.getEdges=function(){return this._edges},St.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},St.prototype.getShell=function(){return this._shell},St.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,b.RIGHT);if(i===_.NONE)return null;if(this._label.getLocation(n)===_.NONE)return this._label.setLocation(n,i),null}},St.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},St.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),n);return o},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St};var Mc=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(St),Ac=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new O,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new Mc(o,n._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(St),xe=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 t=arguments[0];this._label=t}}};xe.prototype.setVisited=function(t){this._isVisited=t},xe.prototype.setInResult=function(t){this._isInResult=t},xe.prototype.isCovered=function(){return this._isCovered},xe.prototype.isCoveredSet=function(){return this._isCoveredSet},xe.prototype.setLabel=function(t){this._label=t},xe.prototype.getLabel=function(){return this._label},xe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},xe.prototype.updateIM=function(t){q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},xe.prototype.isInResult=function(){return this._isInResult},xe.prototype.isVisited=function(){return this._isVisited},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe};var Ho=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new et(0,_.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var o=_.NONE;if(o=this._label.getLocation(i),!n.isNull(i)){var s=n.getLocation(i);o!==_.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new et(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof et)for(var o=arguments[0],s=0;s<2;s++){var a=n.computeMergedLocation(o,s),u=n._label.getLocation(s);u===_.NONE&&n._label.setLocation(s,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=_.NONE;this._label!==null&&(i=this._label.getLocation(n));var o=null;switch(i){case _.BOUNDARY:o=_.INTERIOR;break;case _.INTERIOR:o=_.BOUNDARY;break;default:o=_.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xe),dn=function(){this.nodeMap=new jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};dn.prototype.find=function(t){return this.nodeMap.get(t)},dn.prototype.addNode=function(){if(arguments[0]instanceof v){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof Ho){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},dn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},dn.prototype.iterator=function(){return this.nodeMap.values().iterator()},dn.prototype.values=function(){return this.nodeMap.values()},dn.prototype.getBoundaryNodes=function(t){for(var e=new O,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===_.BOUNDARY&&e.add(i)}return e},dn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},dn.prototype.interfaces_=function(){return[]},dn.prototype.getClass=function(){return dn};var it=function(){},go={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};it.prototype.interfaces_=function(){return[]},it.prototype.getClass=function(){return it},it.isNorthern=function(t){return t===it.NE||t===it.NW},it.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},it.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},it.isInHalfPlane=function(t,e){return e===it.SE?t===it.SE||t===it.SW:t===e||t===e+1},it.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ct("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?it.NE:it.SE:e>=0?it.NW:it.SW}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new ct("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?it.NE:it.SE:i.y>=n.y?it.NW:it.SW}},go.NE.get=function(){return 0},go.NW.get=function(){return 1},go.SW.get=function(){return 2},go.SE.get=function(){return 3},Object.defineProperties(it,go);var Kt=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 t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(n,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};Kt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:M.computeOrientation(t._p0,t._p1,this._p1)},Kt.prototype.getDy=function(){return this._dy},Kt.prototype.getCoordinate=function(){return this._p0},Kt.prototype.setNode=function(t){this._node=t},Kt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),o=n.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Kt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Kt.prototype.getDirectedCoordinate=function(){return this._p1},Kt.prototype.getDx=function(){return this._dx},Kt.prototype.getLabel=function(){return this._label},Kt.prototype.getEdge=function(){return this._edge},Kt.prototype.getQuadrant=function(){return this._quadrant},Kt.prototype.getNode=function(){return this._node},Kt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Kt.prototype.computeLabel=function(t){},Kt.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=it.quadrant(this._dx,this._dy),q.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Kt.prototype.interfaces_=function(){return[De]},Kt.prototype.getClass=function(){return Kt};var Fs=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new et(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Qn("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,o=0;o<2;o++)n._label.isArea(o)&&n._label.getLocation(o,b.LEFT)===_.INTERIOR&&n._label.getLocation(o,b.RIGHT)===_.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[b.LEFT]+"/"+this._depth[b.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,_.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,_.EXTERIOR);return n&&i&&o},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;n===b.LEFT&&(s=-1);var a=b.opposite(n),u=o*s,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===_.EXTERIOR&&i===_.INTERIOR?1:n===_.INTERIOR&&i===_.EXTERIOR?-1:0},t}(Kt),Di=function(){};Di.prototype.createNode=function(t){return new Ho(t,null)},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var gt=function(){if(this._edges=new O,this._nodes=null,this._edgeEndList=new O,arguments.length===0)this._nodes=new dn(new Di);else if(arguments.length===1){var t=arguments[0];this._nodes=new dn(t)}};gt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},gt.prototype.find=function(t){return this._nodes.find(t)},gt.prototype.addNode=function(){if(arguments[0]instanceof Ho){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this._nodes.addNode(e)}},gt.prototype.getNodeIterator=function(){return this._nodes.iterator()},gt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},gt.prototype.debugPrintln=function(t){Gt.out.println(t)},gt.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===_.BOUNDARY},gt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},gt.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?M.computeOrientation(t,e,i)===M.COLLINEAR&&it.quadrant(t,e)===it.quadrant(n,i):!1},gt.prototype.getEdgeEnds=function(){return this._edgeEndList},gt.prototype.debugPrint=function(t){Gt.out.print(t)},gt.prototype.getEdgeIterator=function(){return this._edges.iterator()},gt.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(n.matchInSameDirection(t,e,s[0],s[1])||n.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},gt.prototype.insertEdge=function(t){this._edges.add(t)},gt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},gt.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var o=new Fs(i,!0),s=new Fs(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},gt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},gt.prototype.getNodes=function(){return this._nodes.values()},gt.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var ye=function(){this._geometryFactory=null,this._shellList=new O;var t=arguments[0];this._geometryFactory=t};ye.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?n.add(o):e.add(o)}},ye.prototype.computePolygons=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);n.add(s)}return n},ye.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=n.findEdgeRingContaining(o,t);if(s===null)throw new Qn("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new O,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else o.add(a)}return o},ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},ye.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new Ac(o,e._geometryFactory);n.add(s),s.setInResult()}}return n},ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},ye.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),o=n.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&M.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},ye.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(n=o,e++)}return q.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},ye.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];gt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),o=new O,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye};var Mi=function(){};Mi.prototype.getBounds=function(){},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Mi,Me]},He.prototype.getClass=function(){return He};var Zn=function(){this._size=null,this._items=null,this._size=0,this._items=new O,this._items.add(null)};Zn.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Zn.prototype.size=function(){return this._size},Zn.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},Zn.prototype.clear=function(){this._size=0,this._items.clear()},Zn.prototype.isEmpty=function(){return this._size===0},Zn.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var hr=function(){};hr.prototype.visitItem=function(t){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var ri=function(){};ri.prototype.insert=function(t,e){},ri.prototype.remove=function(t,e){},ri.prototype.query=function(){},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri};var Rt=function(){if(this._childBoundables=new O,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},$a={serialVersionUID:{configurable:!0}};Rt.prototype.getLevel=function(){return this._level},Rt.prototype.size=function(){return this._childBoundables.size()},Rt.prototype.getChildBoundables=function(){return this._childBoundables},Rt.prototype.addChildBoundable=function(t){q.isTrue(this._bounds===null),this._childBoundables.add(t)},Rt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Rt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Rt.prototype.interfaces_=function(){return[Mi,Me]},Rt.prototype.getClass=function(){return Rt},$a.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Rt,$a);var je=function(){};je.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},je.min=function(t){return je.sort(t),t.get(0)},je.sort=function(t,e){var n=t.toArray();e?Ar.sort(n,e):Ar.sort(n);for(var i=t.iterator(),o=0,s=n.length;o<s;o++)i.next(),i.set(n[o])},je.singletonList=function(t){var e=new O;return e.add(t),e};var xt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};xt.prototype.expandToQueue=function(t,e){var n=xt.isComposite(this._boundable1),i=xt.isComposite(this._boundable2);if(n&&i)return xt.area(this._boundable1)>xt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ct("neither boundable is composite")},xt.prototype.isLeaves=function(){return!(xt.isComposite(this._boundable1)||xt.isComposite(this._boundable2))},xt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},xt.prototype.expand=function(t,e,n,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new xt(u,e,o._itemDistance);l.getDistance()<i&&n.add(l)}},xt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},xt.prototype.getDistance=function(){return this._distance},xt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},xt.prototype.interfaces_=function(){return[De]},xt.prototype.getClass=function(){return xt},xt.area=function(t){return t.getBounds().getArea()},xt.isComposite=function(t){return t instanceof Rt};var At=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new O,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];q.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},jo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};At.prototype.getNodeCapacity=function(){return this._nodeCapacity},At.prototype.lastNode=function(t){return t.get(t.size()-1)},At.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Rt?n+=t.size(o):o instanceof He&&(n+=1)}return n}},At.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof He&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},At.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new O:e}else if(arguments.length===1){for(var n=arguments[0],i=new O,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof Rt){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof He?i.add(s.getItem()):q.shouldNeverReachHere()}return i.size()<=0?null:i}},At.prototype.insert=function(t,e){q.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},At.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new O;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(q.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Rt?t.boundablesAtLevel(i,u,s):(q.isTrue(u instanceof He),i===-1&&s.add(u))}return null}},At.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new O;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(z(arguments[2],hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof Rt?t.query(s,f,u):f instanceof He?u.visitItem(f.getItem()):q.shouldNeverReachHere())}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt)for(var h=arguments[0],g=arguments[1],p=arguments[2],y=g.getChildBoundables(),d=0;d<y.size();d++){var m=y.get(d);t.getIntersectsOp().intersects(m.getBounds(),h)&&(m instanceof Rt?t.query(h,m,p):m instanceof He?p.add(m.getItem()):q.shouldNeverReachHere())}}},At.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},At.prototype.getRoot=function(){return this.build(),this._root},At.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof Rt&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},At.prototype.createHigherLevels=function(t,e){q.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},At.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof Rt){var s=t.depth(o);s>n&&(n=s)}}return n+1}},At.prototype.createParentBoundables=function(t,e){var n=this;q.isTrue(!t.isEmpty());var i=new O;i.add(this.createNode(e));var o=new O(t);je.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},At.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},At.prototype.interfaces_=function(){return[Me]},At.prototype.getClass=function(){return At},At.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},jo.IntersectsOp.get=function(){return Fc},jo.serialVersionUID.get=function(){return-3886435814360241e3},jo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(At,jo);var Fc=function(){},Ai=function(){};Ai.prototype.distance=function(t,e){},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var tu=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;q.isTrue(i.length>0);for(var a=new O,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new eu(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,o)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new O;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];r.prototype.query.call(this,o,s)}else if(arguments.length===3){if(z(arguments[2],hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt){var c=arguments[0],f=arguments[1],h=arguments[2];r.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return r.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return r.prototype.remove.call(this,i,o)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){q.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new O(i);je.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(z(arguments[0],Ai)){var i=arguments[0],o=new xt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof xt){var s=arguments[0];return this.nearestNeighbour(s,V.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&z(arguments[1],Ai)){var a=arguments[0],u=arguments[1],l=new xt(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof xt&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new Zn;for(p.add(c);!p.isEmpty()&&h>0;){var y=p.poll(),d=y.getDistance();if(d>=h)break;y.isLeaves()?(h=d,g=y):y.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var m=arguments[0],E=arguments[1],C=arguments[2],L=new He(m,E),N=new xt(this.getRoot(),L,C);return this.nearestNeighbour(N)[0]}},t.prototype.interfaces_=function(){return[ri,Me]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return eu},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Ii]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Ii]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(At),eu=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();n===null?n=new k(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rt),he=function(){};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.relativeSign=function(t,e){return t<e?-1:t>e?1:0},he.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=he.relativeSign(e.x,n.x),o=he.relativeSign(e.y,n.y);switch(t){case 0:return he.compareValue(i,o);case 1:return he.compareValue(o,i);case 2:return he.compareValue(o,-i);case 3:return he.compareValue(-i,o);case 4:return he.compareValue(-i,-o);case 5:return he.compareValue(-o,-i);case 6:return he.compareValue(-o,i);case 7:return he.compareValue(i,-o)}return q.shouldNeverReachHere("invalid octant value"),0},he.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var gr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new v(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};gr.prototype.getCoordinate=function(){return this.coord},gr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},gr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:he.compare(this._segmentOctant,this.coord,e.coord)},gr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},gr.prototype.isInterior=function(){return this._isInterior},gr.prototype.interfaces_=function(){return[De]},gr.prototype.getClass=function(){return gr};var ne=function(){this._nodeMap=new jt,this._edge=null;var t=arguments[0];this._edge=t};ne.prototype.getSplitCoordinates=function(){var t=this,e=new oo;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},ne.prototype.addCollapsedNodes=function(){var t=this,e=new O;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},ne.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},ne.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),o=e._edge.getCoordinate(n+2);i.equals2D(o)&&t.add(new sn(n+1))}},ne.prototype.addEdgeCoordinates=function(t,e,n){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);n.add(new v(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));s&&n.add(new v(e.coord))},ne.prototype.iterator=function(){return this._nodeMap.values().iterator()},ne.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},ne.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},ne.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,n);a&&t.add(new sn(n[0])),o=s}},ne.prototype.getEdge=function(){return this._edge},ne.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ne.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return s&&(a[u]=new v(e.coord)),new Ct(a,this._edge.getData())},ne.prototype.add=function(t,e){var n=new gr(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(q.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},ne.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new Xn("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new Xn("bad split edge end point at "+a)},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne};var ii=function(){};ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ct("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new ct("Cannot compute the octant for two identical points "+o);return ii.octant(a,u)}};var Rn=function(){};Rn.prototype.getCoordinates=function(){},Rn.prototype.size=function(){},Rn.prototype.getCoordinate=function(t){},Rn.prototype.isClosed=function(){},Rn.prototype.setData=function(t){},Rn.prototype.getData=function(){},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn};var po=function(){};po.prototype.addIntersection=function(t,e){},po.prototype.interfaces_=function(){return[Rn]},po.prototype.getClass=function(){return po};var Ct=function(){this._nodeList=new ne(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ct.prototype.getCoordinates=function(){return this._pts},Ct.prototype.size=function(){return this._pts.length},Ct.prototype.getCoordinate=function(t){return this._pts[t]},Ct.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ct.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Ct.prototype.setData=function(t){this._data=t},Ct.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ii.octant(t,e)},Ct.prototype.getData=function(){return this._data},Ct.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[3],s=new v(n.getIntersection(o));this.addIntersection(s,i)}},Ct.prototype.toString=function(){return qe.toLineString(new It(this._pts))},Ct.prototype.getNodeList=function(){return this._nodeList},Ct.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(n=i)}var s=this._nodeList.add(t,n);return s},Ct.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},Ct.prototype.interfaces_=function(){return[po]},Ct.prototype.getClass=function(){return Ct},Ct.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new O;return Ct.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],o=n.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var B=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new v,this.p1=new v;else if(arguments.length===1){var t=arguments[0];this.p0=new v(t.p0),this.p1=new v(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],o=arguments[3];this.p0=new v(e,n),this.p1=new v(i,o)}},nu={serialVersionUID:{configurable:!0}};B.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},B.prototype.orientationIndex=function(){if(arguments[0]instanceof B){var t=arguments[0],e=M.orientationIndex(this.p0,this.p1,t.p0),n=M.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof v){var i=arguments[0];return M.orientationIndex(this.p0,this.p1,i)}},B.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},B.prototype.isVertical=function(){return this.p0.x===this.p1.x},B.prototype.equals=function(t){if(!(t instanceof B))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},B.prototype.intersection=function(t){var e=new Dr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},B.prototype.project=function(){if(arguments[0]instanceof v){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new v(t);var e=this.projectionFactor(t),n=new v;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof B){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new B(a,u)}},B.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},B.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},B.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},B.prototype.distancePerpendicular=function(t){return M.distancePointLinePerpendicular(t,this.p0,this.p1)},B.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},B.prototype.midPoint=function(){return B.midPoint(this.p0,this.p1)},B.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return V.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return o},B.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=V.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=l),n},B.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},B.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},B.prototype.getLength=function(){return this.p0.distance(this.p1)},B.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},B.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},B.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},B.prototype.lineIntersection=function(t){try{var e=Ue.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof Ni))throw n}finally{}return null},B.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},B.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=n-l,f=i+u,h=new v(c,f);return h},B.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},B.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||V.isNaN(e))&&(e=1),e},B.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},B.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},B.prototype.distance=function(){if(arguments[0]instanceof B){var t=arguments[0];return M.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof v){var e=arguments[0];return M.distancePointLine(e,this.p0,this.p1)}},B.prototype.pointAlong=function(t){var e=new v;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},B.prototype.hashCode=function(){var t=V.doubleToLongBits(this.p0.x);t^=V.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=V.doubleToLongBits(this.p1.x);n^=V.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},B.prototype.interfaces_=function(){return[De,Me]},B.prototype.getClass=function(){return B},B.midPoint=function(t,e){return new v((t.x+e.x)/2,(t.y+e.y)/2)},nu.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(B,nu);var vo=function(){this.tempEnv1=new k,this.tempEnv2=new k,this._overlapSeg1=new B,this._overlapSeg2=new B};vo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},vo.prototype.interfaces_=function(){return[]},vo.prototype.getClass=function(){return vo};var me=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};me.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},me.prototype.computeSelect=function(t,e,n,i){var o=this._pts[e],s=this._pts[n];if(i.tempEnv1.init(o,s),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},me.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},me.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},me.prototype.setId=function(t){this._id=t},me.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},me.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new k(t,e)}return this._env},me.prototype.getEndIndex=function(){return this._end},me.prototype.getStartIndex=function(){return this._start},me.prototype.getContext=function(){return this._context},me.prototype.getId=function(){return this._id},me.prototype.computeOverlapsInternal=function(t,e,n,i,o,s){var a=this._pts[t],u=this._pts[e],l=n._pts[i],c=n._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,n,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,n,i,h,s),h<o&&this.computeOverlapsInternal(t,f,n,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,n,i,h,s),h<o&&this.computeOverlapsInternal(f,e,n,h,o,s))},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new O;n.add(new sn(e));do{var i=vn.findChainEnd(t,e);n.add(new sn(i)),e=i}while(e<t.length-1);var o=vn.toIntArray(n);return o},vn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=it.quadrant(t[n],t[n+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=it.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},vn.getChains=function(){if(arguments.length===1){var t=arguments[0];return vn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new O,o=vn.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new me(e,o[s],o[s+1],n);i.add(a)}return i}},vn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var kr=function(){};kr.prototype.computeNodes=function(t){},kr.prototype.getNodedSubstrings=function(){},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr};var yo=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};yo.prototype.setSegmentIntersector=function(t){this._segInt=t},yo.prototype.interfaces_=function(){return[kr]},yo.prototype.getClass=function(){return yo};var ks=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new O,this._index=new tu,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return Ct.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=vn.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new ru(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return ru},Object.defineProperties(t,e),t}(yo),ru=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=n.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vo),$=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},Jn={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}};$.prototype.getEndCapStyle=function(){return this._endCapStyle},$.prototype.isSingleSided=function(){return this._isSingleSided},$.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=$.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=$.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==$.JOIN_ROUND&&(this._quadrantSegments=$.DEFAULT_QUADRANT_SEGMENTS)},$.prototype.getJoinStyle=function(){return this._joinStyle},$.prototype.setJoinStyle=function(t){this._joinStyle=t},$.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},$.prototype.getSimplifyFactor=function(){return this._simplifyFactor},$.prototype.getQuadrantSegments=function(){return this._quadrantSegments},$.prototype.setEndCapStyle=function(t){this._endCapStyle=t},$.prototype.getMitreLimit=function(){return this._mitreLimit},$.prototype.setMitreLimit=function(t){this._mitreLimit=t},$.prototype.setSingleSided=function(t){this._isSingleSided=t},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Jn.CAP_ROUND.get=function(){return 1},Jn.CAP_FLAT.get=function(){return 2},Jn.CAP_SQUARE.get=function(){return 3},Jn.JOIN_ROUND.get=function(){return 1},Jn.JOIN_MITRE.get=function(){return 2},Jn.JOIN_BEVEL.get=function(){return 3},Jn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Jn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Jn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties($,Jn);var vt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=M.COUNTERCLOCKWISE,this._inputLine=t||null},mo={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};vt.prototype.isDeletable=function(t,e,n,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,n,i)},vt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=vt.DELETE,s=!0,o=!0),s?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return o},vt.prototype.isShallowConcavity=function(t,e,n,i){var o=M.computeOrientation(t,e,n),s=o===this._angleOrientation;if(!s)return!1;var a=M.distancePointLine(e,t,n);return a<i},vt.prototype.isShallowSampled=function(t,e,n,i,o){var s=this,a=Math.trunc((i-n)/vt.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},vt.prototype.isConcave=function(t,e,n){var i=M.computeOrientation(t,e,n),o=i===this._angleOrientation;return o},vt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=M.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},vt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===vt.DELETE;)e++;return e},vt.prototype.isShallow=function(t,e,n,i){var o=M.distancePointLine(e,t,n);return o<i},vt.prototype.collapseLine=function(){for(var t=this,e=new oo,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==vt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.simplify=function(t,e){var n=new vt(t);return n.simplify(e)},mo.INIT.get=function(){return 0},mo.DELETE.get=function(){return 1},mo.KEEP.get=function(){return 1},mo.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(vt,mo);var we=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new O},iu={COORDINATE_ARRAY_TYPE:{configurable:!0}};we.prototype.getCoordinates=function(){var t=this._ptList.toArray(we.COORDINATE_ARRAY_TYPE);return t},we.prototype.setPrecisionModel=function(t){this._precisionModel=t},we.prototype.addPt=function(t){var e=new v(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},we.prototype.revere=function(){},we.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)n.addPt(t[o])},we.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},we.prototype.toString=function(){var t=new j,e=t.createLineString(this.getCoordinates());return e.toString()},we.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new v(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},we.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},iu.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(we,iu);var K=function(){},oi={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.toDegrees=function(t){return t*180/Math.PI},K.normalize=function(t){for(;t>Math.PI;)t-=K.PI_TIMES_2;for(;t<=-Math.PI;)t+=K.PI_TIMES_2;return t},K.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,o=n.y-e.y;return Math.atan2(o,i)}},K.isAcute=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u>0},K.isObtuse=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u<0},K.interiorAngle=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return Math.abs(o-i)},K.normalizePositive=function(t){if(t<0){for(;t<0;)t+=K.PI_TIMES_2;t>=K.PI_TIMES_2&&(t=0)}else{for(;t>=K.PI_TIMES_2;)t-=K.PI_TIMES_2;t<0&&(t=0)}return t},K.angleBetween=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return K.diff(i,o)},K.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},K.toRadians=function(t){return t*Math.PI/180},K.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?K.COUNTERCLOCKWISE:n<0?K.CLOCKWISE:K.NONE},K.angleBetweenOriented=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n),s=o-i;return s<=-Math.PI?s+K.PI_TIMES_2:s>Math.PI?s-K.PI_TIMES_2:s},oi.PI_TIMES_2.get=function(){return 2*Math.PI},oi.PI_OVER_2.get=function(){return Math.PI/2},oi.PI_OVER_4.get=function(){return Math.PI/4},oi.COUNTERCLOCKWISE.get=function(){return M.COUNTERCLOCKWISE},oi.CLOCKWISE.get=function(){return M.CLOCKWISE},oi.NONE.get=function(){return M.COLLINEAR},Object.defineProperties(K,oi);var lt=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new B,this._seg1=new B,this._offset0=new B,this._offset1=new B,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Dr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===$.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},_o={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}};lt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=M.computeOrientation(this._s0,this._s1,this._s2),i=n===M.CLOCKWISE&&this._side===b.LEFT||n===M.COUNTERCLOCKWISE&&this._side===b.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},lt.prototype.addLineEndCap=function(t,e){var n=new B(t,e),i=new B;this.computeOffsetSegment(n,b.LEFT,this._distance,i);var o=new B;this.computeOffsetSegment(n,b.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,M.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case $.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case $.CAP_SQUARE:var l=new v;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new v(i.p1.x+l.x,i.p1.y+l.y),f=new v(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},lt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},lt.prototype.addMitreJoin=function(t,e,n,i){var o=!0,s=null;try{s=Ue.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Ni)s=new v(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},lt.prototype.addFilletCorner=function(t,e,n,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=n.x-t.x,c=n.y-t.y,f=Math.atan2(c,l);i===M.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(n)},lt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*lt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===$.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===$.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},lt.prototype.createSquare=function(t){this._segList.addPt(new v(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new v(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},lt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},lt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},lt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},lt.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},lt.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,s=K.angle(o,this._seg0.p0),a=K.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=K.normalize(s+u),c=K.normalize(l+Math.PI),f=i*n,h=f*Math.abs(Math.sin(u)),g=n-h,p=o.x+f*Math.cos(c),y=o.y+f*Math.sin(c),d=new v(p,y),m=new B(o,d),E=m.pointAlongOffset(1,g),C=m.pointAlongOffset(1,-g);this._side===b.LEFT?(this._segList.addPt(E),this._segList.addPt(C)):(this._segList.addPt(C),this._segList.addPt(E))},lt.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===b.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*n*s/u,c=o*n*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},lt.prototype.addFilletArc=function(t,e,n,i,o){var s=this,a=i===M.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new v;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},lt.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*lt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new v((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new v((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)}},lt.prototype.createCircle=function(t){var e=new v(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},lt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},lt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new we,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*lt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},lt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===$.JOIN_BEVEL||this._bufParams.getJoinStyle()===$.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,M.CLOCKWISE,this._distance))},lt.prototype.closeRing=function(){this._segList.closeRing()},lt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},_o.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},_o.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},_o.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},_o.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(lt,_o);var ge=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ge.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,n,o);var s=o.getCoordinates();return n&&H.reverse(s),s},ge.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var o=vt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],b.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{n.addSegments(t,!1);var u=vt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],b.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},ge.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===b.RIGHT&&(i=-i);var o=vt.simplify(t,i),s=o.length-1;n.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;n.addNextSegment(o[a],u)}n.closeRing()},ge.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=vt.simplify(t,n),o=i.length-1;e.initSideSegments(i[0],i[1],b.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=vt.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],b.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},ge.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:e.createCircle(t);break;case $.CAP_SQUARE:e.createSquare(t);break}},ge.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},ge.prototype.getBufferParameters=function(){return this._bufParams},ge.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ge.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return ge.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},ge.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var o=vt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],b.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{var u=vt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],b.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},ge.prototype.getSegGen=function(t){return new lt(this._precisionModel,this._bufParams,t)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new v(t[n]);return e};var si=function(){this._subgraphs=null,this._seg=new B,this._cga=new M;var t=arguments[0];this._subgraphs=t},ou={DepthSegment:{configurable:!0}};si.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new O,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(z(arguments[2],Xe)&&arguments[0]instanceof v&&arguments[1]instanceof Fs)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&M.computeOrientation(t._seg.p0,t._seg.p1,a)!==M.RIGHT){var g=u.getDepth(b.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(b.RIGHT));var p=new Br(t._seg,g);l.add(p)}}else if(z(arguments[2],Xe)&&arguments[0]instanceof v&&z(arguments[1],Xe))for(var y=arguments[0],d=arguments[1],m=arguments[2],E=d.iterator();E.hasNext();){var C=E.next();C.isForward()&&t.findStabbedSegments(y,C,m)}}},si.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=je.min(e);return n._leftDepth},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},ou.DepthSegment.get=function(){return Br},Object.defineProperties(si,ou);var Br=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new B(t),this._leftDepth=e};Br.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Br.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Br.prototype.toString=function(){return this._upwardSeg.toString()},Br.prototype.interfaces_=function(){return[De]},Br.prototype.getClass=function(){return Br};var tt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)},tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)},tt.prototype.interpolateZ=function(t){if(t===null)throw new ct("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)},tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)},tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)},tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)},tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)},tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)},tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},tt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},tt.det=function(t,e,n,i){return t*i-e*n},tt.interpolateZ=function(t,e,n,i){var o=e.x,s=e.y,a=n.x-o,u=i.x-o,l=n.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,y=(-l*h+a*g)/f,d=e.z+p*(n.z-e.z)+y*(i.z-e.z);return d},tt.longestSideLength=function(t,e,n){var i=t.distance(e),o=e.distance(n),s=n.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},tt.isAcute=function(t,e,n){return!(!K.isAcute(t,e,n)||!K.isAcute(e,n,t)||!K.isAcute(n,t,e))},tt.circumcentre=function(t,e,n){var i=n.x,o=n.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*tt.det(s,a,u,l),f=tt.det(a,s*s+a*a,l,u*u+l*l),h=tt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new v(g,p)},tt.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,o=new Ue(t.x+n/2,t.y+i/2,1),s=new Ue(t.x-i+n/2,t.y+n+i/2,1);return new Ue(o,s)},tt.angleBisector=function(t,e,n){var i=e.distance(t),o=e.distance(n),s=i/(i+o),a=n.x-t.x,u=n.y-t.y,l=new v(t.x+s*a,t.y+s*u);return l},tt.area3D=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},tt.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new v(i,o)},tt.inCentre=function(t,e,n){var i=e.distance(n),o=t.distance(n),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*n.x)/a,l=(i*t.y+o*e.y+s*n.y)/a;return new v(u,l)};var Ge=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Ge.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)},Ge.prototype.addPolygon=function(t){var e=this,n=this._distance,i=b.LEFT;this._distance<0&&(n=-this._distance,i=b.RIGHT);var o=t.getExteriorRing(),s=H.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,n,i,_.EXTERIOR,_.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=H.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,b.opposite(i),_.INTERIOR,_.EXTERIOR)}},Ge.prototype.isTriangleErodedCompletely=function(t,e){var n=new tt(t[0],t[1],t[2]),i=n.inCentre(),o=M.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},Ge.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=H.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)},Ge.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new Ct(t,new et(0,_.BOUNDARY,e,n));this._curveList.add(i)},Ge.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ge.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<Ln.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Ln.MINIMUM_VALID_SIZE&&M.isCCW(t)&&(s=o,a=i,n=b.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,s,a)},Ge.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Pt?this.addPolygon(t):t instanceof dt?this.addLineString(t):t instanceof ve?this.addPoint(t):t instanceof Ti?this.addCollection(t):t instanceof Fr?this.addCollection(t):t instanceof bn?this.addCollection(t):t instanceof te&&this.addCollection(t)},Ge.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Ge.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge};var Fi=function(){};Fi.prototype.locate=function(t){},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi};var On=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};On.prototype.next=function(){if(this._atStart)return this._atStart=!1,On.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 Ri;var t=this._parent.getGeometryN(this._index++);return t instanceof te?(this._subcollectionIterator=new On(t),this._subcollectionIterator.next()):t},On.prototype.remove=function(){throw new Error(this.getClass().getName())},On.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)},On.prototype.interfaces_=function(){return[Pi]},On.prototype.getClass=function(){return On},On.isAtomic=function(t){return!(t instanceof te)};var Le=function(){this._geom=null;var t=arguments[0];this._geom=t};Le.prototype.locate=function(t){return Le.locate(t,this._geom)},Le.prototype.interfaces_=function(){return[Fi]},Le.prototype.getClass=function(){return Le},Le.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.isPointInRing(t,e.getCoordinates()):!1},Le.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Le.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Le.isPointInRing(t,o))return!1}return!0},Le.containsPoint=function(t,e){if(e instanceof Pt)return Le.containsPointInPolygon(t,e);if(e instanceof te)for(var n=new On(e);n.hasNext();){var i=n.next();if(i!==e&&Le.containsPoint(t,i))return!0}return!1},Le.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Le.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var Qt=function(){this._edgeMap=new jt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};Qt.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Qt.prototype.propagateSideLabels=function(t){for(var e=_.NONE,n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,b.LEFT)!==_.NONE&&(e=o.getLocation(t,b.LEFT))}if(e===_.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,b.ON)===_.NONE&&l.setLocation(t,b.ON,s),l.isArea(t)){var c=l.getLocation(t,b.LEFT),f=l.getLocation(t,b.RIGHT);if(f!==_.NONE){if(f!==s)throw new Qn("side location conflict",u.getCoordinate());c===_.NONE&&q.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else q.isTrue(l.getLocation(t,b.LEFT)===_.NONE,"found single null side"),l.setLocation(t,b.RIGHT,s),l.setLocation(t,b.LEFT,s)}}},Qt.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Qt.prototype.print=function(t){Gt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Qt.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Qt.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),o=i.getLocation(t,b.LEFT);q.isTrue(o!==_.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();q.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,b.LEFT),f=l.getLocation(t,b.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},Qt.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},Qt.prototype.iterator=function(){return this.getEdges().iterator()},Qt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new O(this._edgeMap.values())),this._edgeList},Qt.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Le.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Qt.prototype.toString=function(){var t=new on;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
21
+ ***************************************************************************** */function Ql(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){e.label=l[1];break}if(l[0]===6&&e.label<o[1]){e.label=o[1],o=l;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(l);break}o[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Rr=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function Zl(r,t){return r>t?1:r<t?-1:0}function Or(r,t,e){for(var n=new Rr(null,null),i=n,o=n;;){var s=e(r,t.key);if(s<0){if(t.left===null)break;if(e(r,t.left.key)<0){var a=t.left;if(t.left=a.right,a.right=t,t=a,t.left===null)break}o.left=t,o=t,t=t.left}else if(s>0){if(t.right===null)break;if(e(r,t.right.key)>0){var a=t.right;if(t.right=a.left,a.left=t,t=a,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function ms(r,t,e,n){var i=new Rr(r,t);if(e===null)return i.left=i.right=null,i;e=Or(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function Sa(r,t,e){var n=null,i=null;if(t){t=Or(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function Jl(r,t,e){return t===null?r:(r===null||(t=Or(r.key,t,e),t.left=r),t)}function _s(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
22
+ `);var o=t+(e?" ":"│ ");r.left&&_s(r.left,o,!1,n,i),r.right&&_s(r.right,o,!0,n,i)}}var Es=function(){function r(t){t===void 0&&(t=Zl),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ms(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new Rr(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=Or(t,this._root,i),s=i(t,o.key);return s===0?this._root=o:(s<0?(n.left=o.left,n.right=o,o.left=null):s>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=Or(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=Or(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Or(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=Or(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],s=this._comparator,a=this._root,u;o.length!==0||a;)if(a)o.push(a),a=a.left;else{if(a=o.pop(),u=s(a.key,e),u>0)break;if(s(a.key,t)>=0&&n.call(i,a))return this;a=a.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return tc(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&Ns(t,e,0,i-1,o),this._root===null)this._root=Is(t,e,0,i),this._size=i;else{var s=ec(this.toList(),$l(t,e),o);i=this._size+i,this._root=Cs({head:s},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return _s(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=Sa(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=ms(e,n,a,i):s=ms(e,n,s,i),this._root=Jl(s,a,i)},r.prototype.split=function(t){return Sa(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t;return Ql(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},r}();function Is(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),s=r[o],a=t[o],u=new Rr(s,a);return u.left=Is(r,t,e,o),u.right=Is(r,t,o+1,n),u}return null}function $l(r,t){for(var e=new Rr(null,null),n=e,i=0;i<r.length;i++)n=n.next=new Rr(r[i],t[i]);return n.next=null,e.next}function tc(r){for(var t=r,e=[],n=!1,i=new Rr(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function Cs(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=Cs(r,t,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=Cs(r,i+1,e),s}return null}function ec(r,t,e){for(var n=new Rr(null,null),i=n,o=r,s=t;o!==null&&s!==null;)e(o.key,s.key)<0?(i.next=o,o=o.next):(i.next=s,s=s.next),i=i.next;return o!==null?i.next=o:s!==null&&(i.next=s),n.next}function Ns(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],s=e-1,a=n+1;;){do s++;while(i(r[s],o)<0);do a--;while(i(r[a],o)>0);if(s>=a)break;var u=r[s];r[s]=r[a],r[a]=u,u=t[s],t[s]=t[a],t[a]=u}Ns(r,t,e,a,i),Ns(r,t,a+1,n,i)}}function sn(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function xa(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Ce(r,t,e){return t&&xa(r.prototype,t),e&&xa(r,e),r}var to=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Ss=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,s=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:n,y:o},ur:{x:i,y:s}}},Tr=Number.EPSILON;Tr===void 0&&(Tr=Math.pow(2,-52));var nc=Tr*Tr,xs=function(t,e){if(-Tr<t&&t<Tr&&-Tr<e&&e<Tr)return 0;var n=t-e;return n*n<nc*t*e?0:t<e?-1:1},rc=function(){function r(){sn(this,r),this.reset()}return Ce(r,[{key:"reset",value:function(){this.xRounder=new wa,this.yRounder=new wa}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),r}(),wa=function(){function r(){sn(this,r),this.tree=new Es,this.round(0)}return Ce(r,[{key:"round",value:function(e){var n=this.tree.add(e),i=this.tree.prev(n);if(i!==null&&xs(n.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(n);return o!==null&&xs(n.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),r}(),eo=new rc,no=function(t,e){return t.x*e.y-t.y*e.x},La=function(t,e){return t.x*e.x+t.y*e.y},ba=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y},s=no(i,o);return xs(s,0)},To=function(t){return Math.sqrt(La(t,t))},ic=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return no(o,i)/To(o)/To(i)},oc=function(t,e,n){var i={x:e.x-t.x,y:e.y-t.y},o={x:n.x-t.x,y:n.y-t.y};return La(o,i)/To(o)/To(i)},Pa=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},Ra=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},sc=function(t,e,n,i){if(e.x===0)return Ra(n,i,t.x);if(i.x===0)return Ra(t,e,n.x);if(e.y===0)return Pa(n,i,t.y);if(i.y===0)return Pa(t,e,n.y);var o=no(e,i);if(o==0)return null;var s={x:n.x-t.x,y:n.y-t.y},a=no(s,e)/o,u=no(s,i)/o,l=t.x+u*e.x,c=n.x+a*i.x,f=t.y+u*e.y,h=n.y+a*i.y,g=(l+c)/2,p=(f+h)/2;return{x:g,y:p}},Un=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=r.comparePoints(e.point,n.point);return i!==0?i:(e.point!==n.point&&e.link(n),e.isLeft!==n.isLeft?e.isLeft?1:-1:Do.compare(e.segment,n.segment))}},{key:"comparePoints",value:function(e,n){return e.x<n.x?-1:e.x>n.x?1:e.y<n.y?-1:e.y>n.y?1:0}}]);function r(t,e){sn(this,r),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return Ce(r,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,i=0,o=n.length;i<o;i++){var s=n[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,n=0;n<e;n++){var i=this.point.events[n];if(i.segment.consumedBy===void 0)for(var o=n+1;o<e;o++){var s=this.point.events[o];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],n=0,i=this.point.events.length;n<i;n++){var o=this.point.events[n];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var n=this,i=new Map,o=function(a){var u=a.otherSE;i.set(a,{sine:ic(n.point,e.point,u.point),cosine:oc(n.point,e.point,u.point)})};return function(s,a){i.has(s)||o(s),i.has(a)||o(a);var u=i.get(s),l=u.sine,c=u.cosine,f=i.get(a),h=f.sine,g=f.cosine;return l>=0&&h>=0?c<g?1:c>g?-1:0:l<0&&h<0?c<g?-1:c>g?1:0:h<l?-1:h>l?1:0}}}]),r}(),ac=0,Do=function(){Ce(r,null,[{key:"compare",value:function(e,n){var i=e.leftSE.point.x,o=n.leftSE.point.x,s=e.rightSE.point.x,a=n.rightSE.point.x;if(a<i)return 1;if(s<o)return-1;var u=e.leftSE.point.y,l=n.leftSE.point.y,c=e.rightSE.point.y,f=n.rightSE.point.y;if(i<o){if(l<u&&l<c)return 1;if(l>u&&l>c)return-1;var h=e.comparePoint(n.leftSE.point);if(h<0)return 1;if(h>0)return-1;var g=n.comparePoint(e.rightSE.point);return g!==0?g:-1}if(i>o){if(u<l&&u<f)return-1;if(u>l&&u>f)return 1;var p=n.comparePoint(e.leftSE.point);if(p!==0)return p;var y=e.comparePoint(n.rightSE.point);return y<0?1:y>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var d=n.comparePoint(e.rightSE.point);if(d!==0)return d}if(s>a){var m=e.comparePoint(n.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(s!==a){var E=c-u,C=s-i,L=f-l,N=a-o;if(E>C&&L<N)return 1;if(E<C&&L>N)return-1}return s>a?1:s<a||c<f?-1:c>f?1:e.id<n.id?-1:e.id>n.id?1:0}}]);function r(t,e,n,i){sn(this,r),this.id=++ac,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}return Ce(r,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<n?e:n},ur:{x:this.rightSE.point.x,y:e>n?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(n.x===i.x)return e.x===n.x?0:e.x<n.x?1:-1;var s=(e.y-n.y)/o.y,a=n.x+s*o.x;if(e.x===a)return 0;var u=(e.x-n.x)/o.x,l=n.y+u*o.y;return e.y===l?0:e.y<l?-1:1}},{key:"getIntersection",value:function(e){var n=this.bbox(),i=e.bbox(),o=Ss(n,i);if(o===null)return null;var s=this.leftSE.point,a=this.rightSE.point,u=e.leftSE.point,l=e.rightSE.point,c=to(n,u)&&this.comparePoint(u)===0,f=to(i,s)&&e.comparePoint(s)===0,h=to(n,l)&&this.comparePoint(l)===0,g=to(i,a)&&e.comparePoint(a)===0;if(f&&c)return g&&!h?a:!g&&h?l:null;if(f)return h&&s.x===l.x&&s.y===l.y?null:s;if(c)return g&&a.x===u.x&&a.y===u.y?null:u;if(g&&h)return null;if(g)return a;if(h)return l;var p=sc(s,this.vector(),u,e.vector());return p===null||!to(o,p)?null:eo.round(p.x,p.y)}},{key:"split",value:function(e){var n=[],i=e.events!==void 0,o=new Un(e,!0),s=new Un(e,!1),a=this.rightSE;this.replaceRightSE(s),n.push(s),n.push(o);var u=new r(o,a,this.rings.slice(),this.windings.slice());return Un.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Un.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),s.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,i=this.windings.length;n<i;n++)this.windings[n]*=-1}},{key:"consume",value:function(e){for(var n=this,i=e;n.consumedBy;)n=n.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=r.compare(n,i);if(o!==0){if(o>0){var s=n;n=i,i=s}if(n.prev===i){var a=n;n=i,i=a}for(var u=0,l=i.rings.length;u<l;u++){var c=i.rings[u],f=i.windings[u],h=n.rings.indexOf(c);h===-1?(n.rings.push(c),n.windings.push(f)):n.windings[h]+=f}i.rings=null,i.windings=null,i.consumedBy=n,i.leftSE.consumedBy=n.leftSE,i.rightSE.consumedBy=n.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var n=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,s=0,a=this.rings.length;s<a;s++){var u=this.rings[s],l=this.windings[s],c=n.indexOf(u);c===-1?(n.push(u),i.push(l)):i[c]+=l}for(var f=[],h=[],g=0,p=n.length;g<p;g++)if(i[g]!==0){var y=n[g],d=y.poly;if(h.indexOf(d)===-1)if(y.isExterior)f.push(d);else{h.indexOf(d)===-1&&h.push(d);var m=f.indexOf(y.poly);m!==-1&&f.splice(m,1)}}for(var E=0,C=f.length;E<C;E++){var L=f[E].multiPoly;o.indexOf(L)===-1&&o.push(L)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,n=this.afterState().multiPolys;switch(xn.type){case"union":{var i=e.length===0,o=n.length===0;this._isInResult=i!==o;break}case"intersection":{var s,a;e.length<n.length?(s=e.length,a=n.length):(s=n.length,a=e.length),this._isInResult=a===xn.numMultiPolys&&s<a;break}case"xor":{var u=Math.abs(e.length-n.length);this._isInResult=u%2===1;break}case"difference":{var l=function(f){return f.length===1&&f[0].isSubject};this._isInResult=l(e)!==l(n);break}default:throw new Error("Unrecognized operation type found ".concat(xn.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,i){var o,s,a,u=Un.comparePoints(e,n);if(u<0)o=e,s=n,a=1;else if(u>0)o=n,s=e,a=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new Un(o,!0),c=new Un(s,!1);return new r(l,c,[i],[a])}}]),r}(),Oa=function(){function r(t,e,n){if(sn(this,r),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=eo.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=eo.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Do.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Do.fromRing(o,i,this))}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.segments.length;n<i;n++){var o=this.segments[n];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),r}(),uc=function(){function r(t,e){if(sn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Oa(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,i=t.length;n<i;n++){var o=new Oa(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,i=this.interiorRings.length;n<i;n++)for(var o=this.interiorRings[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),Ta=function(){function r(t,e){if(sn(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,i=t.length;n<i;n++){var o=new uc(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return Ce(r,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++)for(var o=this.polys[n].getSweepEvents(),s=0,a=o.length;s<a;s++)e.push(o[s]);return e}}]),r}(),lc=function(){Ce(r,null,[{key:"factory",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!(!s.isInResult()||s.ringOut)){for(var a=null,u=s.leftSE,l=s.rightSE,c=[u],f=u.point,h=[];a=u,u=l,c.push(u),u.point!==f;)for(;;){var g=u.getAvailableLinkedEvents();if(g.length===0){var p=c[0].point,y=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(y.x,", ").concat(y.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var d=null,m=0,E=h.length;m<E;m++)if(h[m].point===u.point){d=m;break}if(d!==null){var C=h.splice(d)[0],L=c.splice(C.index);L.unshift(L[0].otherSE),n.push(new r(L.reverse()));continue}h.push({index:c.length,point:u.point});var N=u.getLeftmostComparator(a);l=g.sort(N)[0].otherSE;break}n.push(new r(c))}}return n}}]);function r(t){sn(this,r),this.events=t;for(var e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}return Ce(r,[{key:"getGeom",value:function(){for(var e=this.events[0].point,n=[e],i=1,o=this.events.length-1;i<o;i++){var s=this.events[i].point,a=this.events[i+1].point;ba(s,e,a)!==0&&(n.push(s),e=s)}if(n.length===1)return null;var u=n[0],l=n[1];ba(u,e,l)===0&&n.shift(),n.push(n[0]);for(var c=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:n.length-1,h=this.isExteriorRing()?n.length:-1,g=[],p=f;p!=h;p+=c)g.push([n[p].x,n[p].y]);return g}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],n=1,i=this.events.length;n<i;n++){var o=this.events[n];Un.compare(e,o)>0&&(e=o)}for(var s=e.segment.prevInResult(),a=s?s.prevInResult():null;;){if(!s)return null;if(!a)return s.ringOut;if(a.ringOut!==s.ringOut)return a.ringOut.enclosingRing()!==s.ringOut?s.ringOut:s.ringOut.enclosingRing();s=a.prevInResult(),a=s?s.prevInResult():null}}}]),r}(),Da=function(){function r(t){sn(this,r),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return Ce(r,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,i=this.interiorRings.length;n<i;n++){var o=this.interiorRings[n].getGeom();o!==null&&e.push(o)}return e}}]),r}(),cc=function(){function r(t){sn(this,r),this.rings=t,this.polys=this._composePolys(t)}return Ce(r,[{key:"getGeom",value:function(){for(var e=[],n=0,i=this.polys.length;n<i;n++){var o=this.polys[n].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var n=[],i=0,o=e.length;i<o;i++){var s=e[i];if(!s.poly)if(s.isExteriorRing())n.push(new Da(s));else{var a=s.enclosingRing();a.poly||n.push(new Da(a)),a.poly.addInterior(s)}}return n}}]),r}(),fc=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Do.compare;sn(this,r),this.queue=t,this.tree=new Es(e),this.segments=[]}return Ce(r,[{key:"process",value:function(e){var n=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),i;var o=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!o)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var s=o,a=o,u=void 0,l=void 0;u===void 0;)s=this.tree.prev(s),s===null?u=null:s.key.consumedBy===void 0&&(u=s.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){var c=null;if(u){var f=u.getIntersection(n);if(f!==null&&(n.isAnEndpoint(f)||(c=f),!u.isAnEndpoint(f)))for(var h=this._splitSafely(u,f),g=0,p=h.length;g<p;g++)i.push(h[g])}var y=null;if(l){var d=l.getIntersection(n);if(d!==null&&(n.isAnEndpoint(d)||(y=d),!l.isAnEndpoint(d)))for(var m=this._splitSafely(l,d),E=0,C=m.length;E<C;E++)i.push(m[E])}if(c!==null||y!==null){var L=null;if(c===null)L=y;else if(y===null)L=c;else{var N=Un.comparePoints(c,y);L=N<=0?c:y}this.queue.remove(n.rightSE),i.push(n.rightSE);for(var x=n.split(L),T=0,A=x.length;T<A;T++)i.push(x[T])}i.length>0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&l){var w=u.getIntersection(l);if(w!==null){if(!u.isAnEndpoint(w))for(var F=this._splitSafely(u,w),X=0,R=F.length;X<R;X++)i.push(F[X]);if(!l.isAnEndpoint(w))for(var Y=this._splitSafely(l,w),D=0,W=Y.length;D<W;D++)i.push(Y[D])}}this.tree.remove(n)}return i}},{key:"_splitSafely",value:function(e,n){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(n);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),r}(),Ma=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,hc=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,gc=function(){function r(){sn(this,r)}return Ce(r,[{key:"run",value:function(e,n,i){xn.type=e,eo.reset();for(var o=[new Ta(n,!0)],s=0,a=i.length;s<a;s++)o.push(new Ta(i[s],!1));if(xn.numMultiPolys=o.length,xn.type==="difference")for(var u=o[0],l=1;l<o.length;)Ss(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(xn.type==="intersection"){for(var c=0,f=o.length;c<f;c++)for(var h=o[c],g=c+1,p=o.length;g<p;g++)if(Ss(h.bbox,o[g].bbox)===null)return[]}for(var y=new Es(Un.compare),d=0,m=o.length;d<m;d++)for(var E=o[d].getSweepEvents(),C=0,L=E.length;C<L;C++)if(y.insert(E[C]),y.size>Ma)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var N=new fc(y),x=y.size,T=y.pop();T;){var A=T.key;if(y.size===x){var w=A.segment;throw new Error("Unable to pop() ".concat(A.isLeft?"left":"right"," SweepEvent ")+"[".concat(A.point.x,", ").concat(A.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(y.size>Ma)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(N.segments.length>hc)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var F=N.process(A),X=0,R=F.length;X<R;X++){var Y=F[X];Y.consumedBy===void 0&&y.insert(Y)}x=y.size,T=y.pop()}eo.reset();var D=lc.factory(N.segments),W=new cc(D);return W.getGeom()}}]),r}(),xn=new gc,pc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("union",t,n)},dc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("intersection",t,n)},vc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("xor",t,n)},yc=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return xn.run("difference",t,n)},Aa={union:pc,intersection:dc,xor:vc,difference:yc},Ne=63710088e-1,Fa={centimeters:Ne*100,centimetres:Ne*100,degrees:Ne/111325,feet:Ne*3.28084,inches:Ne*39.37,kilometers:Ne/1e3,kilometres:Ne/1e3,meters:Ne,metres:Ne,miles:Ne/1609.344,millimeters:Ne*1e3,millimetres:Ne*1e3,nauticalmiles:Ne/1852,radians:1,yards:Ne*1.0936};function Mo(r,t,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=r,n}function mc(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ga(r[0])||!Ga(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Mo(n,t,e)}function ka(r,t,e){e===void 0&&(e={});for(var n=0,i=r;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:r};return Mo(a,t,e)}function ws(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}function Ba(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return Mo(n,t,e)}function _c(r,t){t===void 0&&(t="kilometers");var e=Fa[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Ec(r,t){t===void 0&&(t="kilometers");var e=Fa[t];if(!e)throw new Error(t+" units is invalid");return r/e}function Ga(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Ao(r){return r.type==="Feature"?r.geometry:r}function Ic(r,t,e){e===void 0&&(e={});var n=Ao(r),i=Ao(t),o=Aa.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?ka(o[0],e.properties):Ba(o,e.properties)}const Uf="";function Cc(r){let t,e,n;return{c(){t=Vn("svg"),e=Vn("path"),P(e,"stroke-width","4"),P(e,"fill-rule","evenodd"),P(e,"clip-rule","evenodd"),P(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),P(e,"class","svelte-gzo3ar"),P(t,"width",n=r[0]!=="list"?void 0:"20"),P(t,"viewBox","0 0 70 85"),P(t,"fill","none"),P(t,"class","svelte-gzo3ar"),on(t,"in-map",r[0]!=="list"),on(t,"list-icon",r[0]==="list")},m(i,o){Mt(i,t,o),nt(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&P(t,"width",n),o&1&&on(t,"in-map",i[0]!=="list"),o&1&&on(t,"list-icon",i[0]==="list")},i:_t,o:_t,d(i){i&&Lt(t)}}}function Nc(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class Sc extends Pr{constructor(t){super(),br(this,t,Nc,Cc,Sr,{displayIn:0})}}function za(r,t,e){if(r!==null)for(var n,i,o,s,a,u,l,c=0,f=0,h,g=r.type,p=g==="FeatureCollection",y=g==="Feature",d=p?r.features.length:1,m=0;m<d;m++){l=p?r.features[m].geometry:y?r.geometry:r,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var E=0;E<a;E++){var C=0,L=0;if(s=h?l.geometries[E]:l,s!==null){u=s.coordinates;var N=s.type;switch(c=e&&(N==="Polygon"||N==="MultiPolygon")?1:0,N){case null:break;case"Point":if(t(u,f,m,C,L)===!1)return!1;f++,C++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,m,C,L)===!1)return!1;f++,N==="MultiPoint"&&C++}N==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-c;i++){if(t(u[n][i],f,m,C,L)===!1)return!1;f++}N==="MultiLineString"&&C++,N==="Polygon"&&L++}N==="Polygon"&&C++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(L=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-c;o++){if(t(u[n][i][o],f,m,C,L)===!1)return!1;f++}L++}C++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(za(s.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Va(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function Ua(r,t){var e,n,i,o,s,a,u,l,c,f,h=0,g=r.type==="FeatureCollection",p=r.type==="Feature",y=g?r.features.length:1;for(e=0;e<y;e++){for(a=g?r.features[e].geometry:p?r.geometry:r,l=g?r.features[e].properties:p?r.properties:{},c=g?r.features[e].bbox:p?r.bbox:void 0,f=g?r.features[e].id:p?r.id:void 0,u=a?a.type==="GeometryCollection":!1,s=u?a.geometries.length:1,i=0;i<s;i++){if(o=u?a.geometries[i]:a,o===null){if(t(null,h,l,c,f)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,h,l,c,f)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],h,l,c,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}function Ls(r){var t=[1/0,1/0,-1/0,-1/0];return za(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Ls.default=Ls;function xc(r,t){t===void 0&&(t={});var e=Ls(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return mc([n,i],t.properties,t)}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var o=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:n;for(o=o<0?Math.max(n+arguments[2],0):Math.min(o,n);i<o;)e[i]=t,++i;return e},writable:!0}),Number.isFinite=Number.isFinite||function(r){return typeof r=="number"&&isFinite(r)},Number.isInteger=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(r){return r!==r},Math.trunc=Math.trunc||function(r){return r<0?Math.ceil(r):Math.floor(r)};var Zr=function(){};Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ct=function(r){function t(e){r.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),V=function(){},qa={MAX_VALUE:{configurable:!0}};V.isNaN=function(t){return Number.isNaN(t)},V.doubleToLongBits=function(t){return t},V.longBitsToDouble=function(t){return t},V.isInfinite=function(t){return!Number.isFinite(t)},qa.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(V,qa);var De=function(){},Fo=function(){},Ci=function(){};function Me(){}var v=function r(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=r.NULL_ORDINATE;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=r.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Jr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};v.prototype.setOrdinate=function(t,e){switch(t){case v.X:this.x=e;break;case v.Y:this.y=e;break;case v.Z:this.z=e;break;default:throw new ct("Invalid ordinate index: "+t)}},v.prototype.equals2D=function(){if(arguments.length===1){var t=arguments[0];return!(this.x!==t.x||this.y!==t.y)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return!(!Zr.equalsWithTolerance(this.x,e.x,n)||!Zr.equalsWithTolerance(this.y,e.y,n))}},v.prototype.getOrdinate=function(t){switch(t){case v.X:return this.x;case v.Y:return this.y;case v.Z:return this.z}throw new ct("Invalid ordinate index: "+t)},v.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||V.isNaN(this.z))&&V.isNaN(t.z)},v.prototype.equals=function(t){return t instanceof v?this.equals2D(t):!1},v.prototype.equalInZ=function(t,e){return Zr.equalsWithTolerance(this.z,t.z,e)},v.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},v.prototype.clone=function(){},v.prototype.copy=function(){return new v(this)},v.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},v.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},v.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},v.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this.x),t=37*t+v.hashCode(this.y),t},v.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},v.prototype.interfaces_=function(){return[De,Fo,Me]},v.prototype.getClass=function(){return v},v.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=V.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Jr.DimensionalComparator.get=function(){return cr},Jr.serialVersionUID.get=function(){return 6683108902428367e3},Jr.NULL_ORDINATE.get=function(){return V.NaN},Jr.X.get=function(){return 0},Jr.Y.get=function(){return 1},Jr.Z.get=function(){return 2},Object.defineProperties(v,Jr);var cr=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ct("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};cr.prototype.compare=function(t,e){var n=t,i=e,o=cr.compare(n.x,i.x);if(o!==0)return o;var s=cr.compare(n.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=cr.compare(n.z,i.z);return a},cr.prototype.interfaces_=function(){return[Ci]},cr.prototype.getClass=function(){return cr},cr.compare=function(t,e){return t<e?-1:t>e?1:V.isNaN(t)?V.isNaN(e)?0:-1:V.isNaN(e)?1:0};var Ni=function(){};Ni.prototype.create=function(){},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni};var _=function(){},ro={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.toLocationSymbol=function(t){switch(t){case _.EXTERIOR:return"e";case _.BOUNDARY:return"b";case _.INTERIOR:return"i";case _.NONE:return"-"}throw new ct("Unknown location value: "+t)},ro.INTERIOR.get=function(){return 0},ro.BOUNDARY.get=function(){return 1},ro.EXTERIOR.get=function(){return 2},ro.NONE.get=function(){return-1},Object.defineProperties(_,ro);var z=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},Se=function(){},Xa={LOG_10:{configurable:!0}};Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},Se.log10=function(t){var e=Math.log(t);return V.isInfinite(e)||V.isNaN(e)?e:e/Se.LOG_10},Se.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},Se.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1],s=arguments[2];return i<o?o:i>s?s:i}},Se.wrap=function(t,e){return t<0?e- -t%e:t%e},Se.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=o;return s>l&&(l=s),a>l&&(l=a),u>l&&(l=u),l}},Se.average=function(t,e){return(t+e)/2},Xa.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Se,Xa);var an=function(t){this.str=t};an.prototype.append=function(t){this.str+=t},an.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},an.prototype.toString=function(t){return this.str};var un=function(t){this.value=t};un.prototype.intValue=function(){return this.value},un.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},un.isNaN=function(t){return Number.isNaN(t)};var io=function(){};io.isWhitespace=function(t){return t<=32&&t>=0||t===127},io.toUpperCase=function(t){return t.toUpperCase()};var I=function r(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}else if(typeof arguments[0]=="string"){var n=arguments[0];r.call(this,r.parse(n))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},Ve={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}};I.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},I.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),i=I.magnitude(n._hi),o=I.TEN.pow(i);n=n.divide(o),n.gt(I.TEN)?(n=n.divide(I.TEN),i+=1):n.lt(I.ONE)&&(n=n.multiply(I.TEN),i-=1);for(var s=i+1,a=new an,u=I.MAX_PRINT_DIGITS-1,l=0;l<=u;l++){t&&l===s&&a.append(".");var c=Math.trunc(n._hi);if(c<0)break;var f=!1,h=0;c>9?(f=!0,h="9"):h="0"+c,a.append(h),n=n.subtract(I.valueOf(c)).multiply(I.TEN),f&&n.selfAdd(I.TEN);var g=!0,p=I.magnitude(n._hi);if(p<0&&Math.abs(p)>=u-l&&(g=!1),!g)break}return e[0]=i,a.toString()},I.prototype.sqr=function(){return this.multiply(this)},I.prototype.doubleValue=function(){return this._hi+this._lo},I.prototype.subtract=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}},I.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},I.prototype.isZero=function(){return this._hi===0&&this._lo===0},I.prototype.selfSubtract=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},I.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},I.prototype.min=function(t){return this.le(t)?this:t},I.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null,f=null,h=null;return l=this._hi/n,c=I.SPLIT*l,o=c-l,h=I.SPLIT*n,o=c-o,s=l-o,a=h-n,f=l*n,a=h-a,u=n-a,h=o*a-f+o*u+s*a+s*u,c=(this._hi-f-h+this._lo-l*i)/n,h=l+c,this._hi=h,this._lo=l-h+c,this}},I.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},I.prototype.divide=function(){if(arguments[0]instanceof I){var t=arguments[0],e=null,n=null,i=null,o=null,s=null,a=null,u=null,l=null;s=this._hi/t._hi,a=I.SPLIT*s,e=a-s,l=I.SPLIT*t._hi,e=a-e,n=s-e,i=l-t._hi,u=s*t._hi,i=l-i,o=t._hi-i,l=e*i-u+e*o+n*i+n*o,a=(this._hi-u-l+this._lo-s*t._lo)/t._hi,l=s+a;var c=l,f=s-l+a;return new I(c,f)}else if(typeof arguments[0]=="number"){var h=arguments[0];return V.isNaN(h)?I.createNaN():I.copy(this).selfDivide(h,0)}},I.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},I.prototype.pow=function(t){if(t===0)return I.valueOf(1);var e=new I(this),n=I.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},I.prototype.ceil=function(){if(this.isNaN())return I.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new I(t,e)},I.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},I.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},I.prototype.setValue=function(){if(arguments[0]instanceof I){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}},I.prototype.max=function(t){return this.ge(t)?this:t},I.prototype.sqrt=function(){if(this.isZero())return I.valueOf(0);if(this.isNegative())return I.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=I.valueOf(e),i=this.subtract(n.sqr()),o=i._hi*(t*.5);return n.add(o)},I.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,i=null,o=null,s=null,a=null,u=null;return o=this._hi+e,a=o-this._hi,s=o-a,s=e-a+(this._hi-s),u=s+this._lo,n=o+u,i=u+(o-n),this._hi=n+i,this._lo=i+(n-this._hi),this}}else if(arguments.length===2){var l=arguments[0],c=arguments[1],f=null,h=null,g=null,p=null,y=null,d=null,m=null,E=null;y=this._hi+l,g=this._lo+c,m=y-this._hi,E=g-this._lo,d=y-m,p=g-E,d=l-m+(this._hi-d),p=c-E+(this._lo-p),m=d+g,f=y+m,h=m+(y-f),m=p+h;var C=f+m,L=m+(f-C);return this._hi=C,this._lo=L,this}},I.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof I){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=null,s=null,a=null,u=null,l=null,c=null;l=I.SPLIT*this._hi,o=l-this._hi,c=I.SPLIT*n,o=l-o,s=this._hi-o,a=c-n,l=this._hi*n,a=c-a,u=n-a,c=o*a-l+o*u+s*a+s*u+(this._hi*i+this._lo*n);var f=l+c;o=l-f;var h=c+o;return this._hi=f,this._lo=h,this}},I.prototype.selfSqr=function(){return this.selfMultiply(this)},I.prototype.floor=function(){if(this.isNaN())return I.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new I(t,e)},I.prototype.negate=function(){return this.isNaN()?this:new I(-this._hi,-this._lo)},I.prototype.clone=function(){},I.prototype.multiply=function(){if(arguments[0]instanceof I){var t=arguments[0];return t.isNaN()?I.createNaN():I.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return V.isNaN(e)?I.createNaN():I.copy(this).selfMultiply(e,0)}},I.prototype.isNaN=function(){return V.isNaN(this._hi)},I.prototype.intValue=function(){return Math.trunc(this._hi)},I.prototype.toString=function(){var t=I.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},I.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,o=n;if(n.charAt(0)===".")o="0"+n;else if(i<0)o="0."+I.stringOfChar("0",-i)+n;else if(n.indexOf(".")===-1){var s=i-n.length,a=I.stringOfChar("0",s);o=n+a+".0"}return this.isNegative()?"-"+o:o},I.prototype.reciprocal=function(){var t=null,e=null,n=null,i=null,o=null,s=null,a=null,u=null;o=1/this._hi,s=I.SPLIT*o,t=s-o,u=I.SPLIT*this._hi,t=s-t,e=o-t,n=u-this._hi,a=o*this._hi,n=u-n,i=this._hi-n,u=t*n-a+t*i+e*n+e*i,s=(1-a-u-o*this._lo)/this._hi;var l=o+s,c=o-l+s;return new I(l,c)},I.prototype.toSciNotation=function(){if(this.isZero())return I.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=I.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var o="";n.length>1&&(o=n.substring(1));var s=n.charAt(0)+"."+o;return this.isNegative()?"-"+s+i:s+i},I.prototype.abs=function(){return this.isNaN()?I.NaN:this.isNegative()?this.negate():new I(this)},I.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},I.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},I.prototype.add=function(){if(arguments[0]instanceof I){var t=arguments[0];return I.copy(this).selfAdd(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return I.copy(this).selfAdd(e)}},I.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof I){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._hi=n,this._lo=i}},I.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},I.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},I.prototype.trunc=function(){return this.isNaN()?I.NaN:this.isPositive()?this.floor():this.ceil()},I.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},I.prototype.interfaces_=function(){return[Me,De,Fo]},I.prototype.getClass=function(){return I},I.sqr=function(t){return I.valueOf(t).selfMultiply(t)},I.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return I.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new I(e)}},I.sqrt=function(t){return I.valueOf(t).sqrt()},I.parse=function(t){for(var e=0,n=t.length;io.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var o=t.charAt(e);(o==="-"||o==="+")&&(e++,o==="-"&&(i=!0))}for(var s=new I,a=0,u=0,l=0;!(e>=n);){var c=t.charAt(e);if(e++,io.isDigit(c)){var f=c-"0";s.selfMultiply(I.TEN),s.selfAdd(f),a++;continue}if(c==="."){u=a;continue}if(c==="e"||c==="E"){var h=t.substring(e);try{l=un.parseInt(h)}catch(m){throw m instanceof Error?new Error("Invalid exponent "+h+" in string "+t):m}finally{}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}var g=s,p=a-u-l;if(p===0)g=s;else if(p>0){var y=I.TEN.pow(p);g=s.divide(y)}else if(p<0){var d=I.TEN.pow(-p);g=s.multiply(d)}return i?g.negate():g},I.createNaN=function(){return new I(V.NaN,V.NaN)},I.copy=function(t){return new I(t)},I.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),o=Math.pow(10,i);return o*10<=e&&(i+=1),i},I.stringOfChar=function(t,e){for(var n=new an,i=0;i<e;i++)n.append(t);return n.toString()},Ve.PI.get=function(){return new I(3.141592653589793,12246467991473532e-32)},Ve.TWO_PI.get=function(){return new I(6.283185307179586,24492935982947064e-32)},Ve.PI_2.get=function(){return new I(1.5707963267948966,6123233995736766e-32)},Ve.E.get=function(){return new I(2.718281828459045,14456468917292502e-32)},Ve.NaN.get=function(){return new I(V.NaN,V.NaN)},Ve.EPS.get=function(){return 123259516440783e-46},Ve.SPLIT.get=function(){return 134217729},Ve.MAX_PRINT_DIGITS.get=function(){return 32},Ve.TEN.get=function(){return I.valueOf(10)},Ve.ONE.get=function(){return I.valueOf(1)},Ve.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Ve.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(I,Ve);var fe=function(){},Ya={DP_SAFE_EPSILON:{configurable:!0}};fe.prototype.interfaces_=function(){return[]},fe.prototype.getClass=function(){return fe},fe.orientationIndex=function(t,e,n){var i=fe.orientationIndexFilter(t,e,n);if(i<=1)return i;var o=I.valueOf(e.x).selfAdd(-t.x),s=I.valueOf(e.y).selfAdd(-t.y),a=I.valueOf(n.x).selfAdd(-e.x),u=I.valueOf(n.y).selfAdd(-e.y);return o.selfMultiply(u).selfSubtract(s.selfMultiply(a)).signum()},fe.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},fe.intersection=function(t,e,n,i){var o=I.valueOf(i.y).selfSubtract(n.y).selfMultiply(I.valueOf(e.x).selfSubtract(t.x)),s=I.valueOf(i.x).selfSubtract(n.x).selfMultiply(I.valueOf(e.y).selfSubtract(t.y)),a=o.subtract(s),u=I.valueOf(i.x).selfSubtract(n.x).selfMultiply(I.valueOf(t.y).selfSubtract(n.y)),l=I.valueOf(i.y).selfSubtract(n.y).selfMultiply(I.valueOf(t.x).selfSubtract(n.x)),c=u.subtract(l),f=c.selfDivide(a).doubleValue(),h=I.valueOf(t.x).selfAdd(I.valueOf(e.x).selfSubtract(t.x).selfMultiply(f)).doubleValue(),g=I.valueOf(e.x).selfSubtract(t.x).selfMultiply(I.valueOf(t.y).selfSubtract(n.y)),p=I.valueOf(e.y).selfSubtract(t.y).selfMultiply(I.valueOf(t.x).selfSubtract(n.x)),y=g.subtract(p),d=y.selfDivide(a).doubleValue(),m=I.valueOf(n.y).selfAdd(I.valueOf(i.y).selfSubtract(n.y).selfMultiply(d)).doubleValue();return new v(h,m)},fe.orientationIndexFilter=function(t,e,n){var i=null,o=(t.x-n.x)*(e.y-n.y),s=(t.y-n.y)*(e.x-n.x),a=o-s;if(o>0){if(s<=0)return fe.signum(a);i=o+s}else if(o<0){if(s>=0)return fe.signum(a);i=-o-s}else return fe.signum(a);var u=fe.DP_SAFE_EPSILON*i;return a>=u||-a>=u?fe.signum(a):2},fe.signum=function(t){return t>0?1:t<0?-1:0},Ya.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(fe,Ya);var Q=function(){},oo={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};oo.X.get=function(){return 0},oo.Y.get=function(){return 1},oo.Z.get=function(){return 2},oo.M.get=function(){return 3},Q.prototype.setOrdinate=function(t,e,n){},Q.prototype.size=function(){},Q.prototype.getOrdinate=function(t,e){},Q.prototype.getCoordinate=function(){},Q.prototype.getCoordinateCopy=function(t){},Q.prototype.getDimension=function(){},Q.prototype.getX=function(t){},Q.prototype.clone=function(){},Q.prototype.expandEnvelope=function(t){},Q.prototype.copy=function(){},Q.prototype.getY=function(t){},Q.prototype.toCoordinateArray=function(){},Q.prototype.interfaces_=function(){return[Fo]},Q.prototype.getClass=function(){return Q},Object.defineProperties(Q,oo);var Wa=function(){},Si=function(r){function t(){r.call(this,"Projective point not representable on the Cartesian plane.")}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Wa),Gt=function(){};Gt.arraycopy=function(t,e,n,i,o){for(var s=0,a=e;a<e+o;a++)n[i+s]=t[a],s++},Gt.getProperty=function(t){return{"line.separator":`
23
+ `}[t]};var Ue=function r(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof r&&arguments[1]instanceof r){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(arguments.length===3){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(arguments.length===4){var f=arguments[0],h=arguments[1],g=arguments[2],p=arguments[3],y=f.y-h.y,d=h.x-f.x,m=f.x*h.y-h.x*f.y,E=g.y-p.y,C=p.x-g.x,L=g.x*p.y-p.x*g.y;this.x=d*L-C*m,this.y=E*m-y*L,this.w=y*C-E*d}};Ue.prototype.getY=function(){var t=this.y/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new Si;return t},Ue.prototype.getX=function(){var t=this.x/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new Si;return t},Ue.prototype.getCoordinate=function(){var t=new v;return t.x=this.getX(),t.y=this.getY(),t},Ue.prototype.interfaces_=function(){return[]},Ue.prototype.getClass=function(){return Ue},Ue.intersection=function(t,e,n,i){var o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,u=n.y-i.y,l=i.x-n.x,c=n.x*i.y-i.x*n.y,f=s*c-l*a,h=u*a-o*c,g=o*l-u*s,p=f/g,y=h/g;if(V.isNaN(p)||V.isInfinite(p)||V.isNaN(y)||V.isInfinite(y))throw new Si;return new v(p,y)};var k=function r(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof r){var e=arguments[0];this.init(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Ha={serialVersionUID:{configurable:!0}};k.prototype.getArea=function(){return this.getWidth()*this.getHeight()},k.prototype.equals=function(t){if(!(t instanceof k))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},k.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new k;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,i=this._maxx<t._maxx?this._maxx:t._maxx,o=this._maxy<t._maxy?this._maxy:t._maxy;return new k(e,i,n,o)},k.prototype.isNull=function(){return this._maxx<this._minx},k.prototype.getMaxX=function(){return this._maxx},k.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=this._maxy}},k.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof k){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}else if(arguments[0]instanceof v){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this._maxx||n<this._minx||i>this._maxy||i<this._miny)}},k.prototype.getMinY=function(){return this._miny},k.prototype.getMinX=function(){return this._minx},k.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},k.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},k.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},k.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},k.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},k.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},k.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},k.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},k.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},k.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},k.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof k){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},k.prototype.centre=function(){return this.isNull()?null:new v((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},k.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof k){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(arguments.length===4){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];o<s?(this._minx=o,this._maxx=s):(this._minx=s,this._maxx=o),a<u?(this._miny=a,this._maxy=u):(this._miny=u,this._maxy=a)}},k.prototype.getMaxY=function(){return this._maxy},k.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)},k.prototype.hashCode=function(){var t=17;return t=37*t+v.hashCode(this._minx),t=37*t+v.hashCode(this._maxx),t=37*t+v.hashCode(this._miny),t=37*t+v.hashCode(this._maxy),t},k.prototype.interfaces_=function(){return[De,Me]},k.prototype.getClass=function(){return k},k.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=Math.min(s.x,a.x),l=Math.max(s.x,a.x),c=Math.min(i.x,o.x),f=Math.max(i.x,o.x);return!(c>l||f<u||(u=Math.min(s.y,a.y),l=Math.max(s.y,a.y),c=Math.min(i.y,o.y),f=Math.max(i.y,o.y),c>l)||f<u)}},Ha.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(k,Ha);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*$/},ko=function(t){this.geometryFactory=t||new j};ko.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=ln.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=ln.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],xi[n]&&(e=xi[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},ko.prototype.write=function(t){return this.extractGeometry(t)},ko.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!qn[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+qn[e].apply(this,[t])+")",i};var qn={coordinate:function(t){return t.x+" "+t.y},point:function(t){return qn.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.point.apply(e,[t._geometries[i]])+")");return n.join(",")},linestring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(qn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},linearring:function(t){for(var e=this,n=[],i=0,o=t._points._coordinates.length;i<o;++i)n.push(qn.coordinate.apply(e,[t._points._coordinates[i]]));return n.join(",")},multilinestring:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+qn.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+qn.linestring.apply(e,[t._holes[i]])+")");return n.join(",")},multipolygon:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push("("+qn.polygon.apply(e,[t._geometries[i]])+")");return n.join(",")},geometrycollection:function(t){for(var e=this,n=[],i=0,o=t._geometries.length;i<o;++i)n.push(e.extractGeometry(t._geometries[i]));return n.join(",")}},xi={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(ln.spaces);return this.geometryFactory.createPoint(new v(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPoint();for(var n,i=t.trim().split(","),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(ln.trimParens,"$1"),o.push(xi.point.apply(e,[n]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(t===void 0)return this.geometryFactory.createLineString();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(ln.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(t===void 0)return this.geometryFactory.createLinearRing();for(var e=t.trim().split(","),n=[],i,o=0,s=e.length;o<s;++o)i=e[o].trim().split(ln.spaces),n.push(new v(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiLineString();for(var n,i=t.trim().split(ln.parenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(ln.trimParens,"$1"),o.push(xi.linestring.apply(e,[n]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createPolygon();for(var n,i,o,s=t.trim().split(ln.parenComma),a,u=[],l=0,c=s.length;l<c;++l)n=s[l].replace(ln.trimParens,"$1"),i=xi.linestring.apply(e,[n]),o=e.geometryFactory.createLinearRing(i._points),l===0?a=o:u.push(o);return this.geometryFactory.createPolygon(a,u)},multipolygon:function(t){var e=this;if(t===void 0)return this.geometryFactory.createMultiPolygon();for(var n,i=t.trim().split(ln.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(ln.trimParens,"$1"),o.push(xi.polygon.apply(e,[n]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){var e=this;if(t===void 0)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var n=t.trim().split("|"),i=[],o=0,s=n.length;o<s;++o)i.push(e.read(n[o]));return this.geometryFactory.createGeometryCollection(i)}},qe=function(t){this.parser=new ko(t)};qe.prototype.write=function(t){return this.parser.write(t)},qe.toLineString=function(t,e){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Xn=function(r){function t(e){r.call(this,e),this.name="RuntimeException",this.message=e,this.stack=new r().stack}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error),Bo=function(r){function t(){if(r.call(this),arguments.length===0)r.call(this);else if(arguments.length===1){var e=arguments[0];r.call(this,e)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Xn),q=function(){};q.prototype.interfaces_=function(){return[]},q.prototype.getClass=function(){return q},q.shouldNeverReachHere=function(){if(arguments.length===0)q.shouldNeverReachHere(null);else if(arguments.length===1){var t=arguments[0];throw new Bo("Should never reach here"+(t!==null?": "+t:""))}},q.isTrue=function(){var t,e;if(arguments.length===1)t=arguments[0],q.isTrue(t,null);else if(arguments.length===2&&(t=arguments[0],e=arguments[1],!t))throw e===null?new Bo:new Bo(e)},q.equals=function(){var t,e,n;if(arguments.length===2)t=arguments[0],e=arguments[1],q.equals(t,e,null);else if(arguments.length===3&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Bo("Expected "+t+" but encountered "+e+(n!==null?": "+n:""))};var gt=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 v,this._intPt[1]=new v,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},$r={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};gt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},gt.prototype.getTopologySummary=function(){var t=new an;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},gt.prototype.computeIntersection=function(t,e,n,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},gt.prototype.getIntersectionNum=function(){return this._result},gt.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 t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},gt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},gt.prototype.setPrecisionModel=function(t){this._precisionModel=t},gt.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;n<this._result;n++)if(!(t._intPt[n].equals2D(t._inputLines[e][0])||t._intPt[n].equals2D(t._inputLines[e][1])))return!0;return!1}},gt.prototype.getIntersection=function(t){return this._intPt[t]},gt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},gt.prototype.hasIntersection=function(){return this._result!==gt.NO_INTERSECTION},gt.prototype.getEdgeDistance=function(t,e){var n=gt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1]);return n},gt.prototype.isCollinear=function(){return this._result===gt.COLLINEAR_INTERSECTION},gt.prototype.toString=function(){return qe.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+qe.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},gt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},gt.prototype.isIntersection=function(t){for(var e=this,n=0;n<this._result;n++)if(e._intPt[n].equals2D(t))return!0;return!1},gt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},gt.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),o=Math.abs(n.y-e.y),s=-1;if(t.equals(e))s=0;else if(t.equals(n))i>o?s=i:s=o;else{var a=Math.abs(t.x-e.x),u=Math.abs(t.y-e.y);i>o?s=a:s=u,s===0&&!t.equals(e)&&(s=Math.max(a,u))}return q.isTrue(!(s===0&&!t.equals(e)),"Bad distance calculation"),s},gt.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o);return q.isTrue(!(s===0&&!t.equals(e)),"Invalid distance calculation"),s},$r.DONT_INTERSECT.get=function(){return 0},$r.DO_INTERSECT.get=function(){return 1},$r.COLLINEAR.get=function(){return 2},$r.NO_INTERSECTION.get=function(){return 0},$r.POINT_INTERSECTION.get=function(){return 1},$r.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(gt,$r);var Dr=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var i=new k(this._inputLines[0][0],this._inputLines[0][1]),o=new k(this._inputLines[1][0],this._inputLines[1][1]);return i.contains(n)&&o.contains(n)},t.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];if(this._isProper=!1,k.intersects(i,o,n)&&M.orientationIndex(i,o,n)===0&&M.orientationIndex(o,i,n)===0)return this._isProper=!0,(n.equals(i)||n.equals(o))&&(this._isProper=!1),this._result=r.POINT_INTERSECTION,null;this._result=r.NO_INTERSECTION}else return r.prototype.computeIntersection.apply(this,arguments)},t.prototype.normalizeToMinimum=function(n,i,o,s,a){a.x=this.smallestInAbsValue(n.x,i.x,o.x,s.x),a.y=this.smallestInAbsValue(n.y,i.y,o.y,s.y),n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.safeHCoordinateIntersection=function(n,i,o,s){var a=null;try{a=Ue.intersection(n,i,o,s)}catch(u){if(u instanceof Si)a=t.nearestEndpoint(n,i,o,s);else throw u}finally{}return a},t.prototype.intersection=function(n,i,o,s){var a=this.intersectionWithNormalization(n,i,o,s);return this.isInSegmentEnvelopes(a)||(a=new v(t.nearestEndpoint(n,i,o,s))),this._precisionModel!==null&&this._precisionModel.makePrecise(a),a},t.prototype.smallestInAbsValue=function(n,i,o,s){var a=n,u=Math.abs(a);return Math.abs(i)<u&&(a=i,u=Math.abs(i)),Math.abs(o)<u&&(a=o,u=Math.abs(o)),Math.abs(s)<u&&(a=s),a},t.prototype.checkDD=function(n,i,o,s,a){var u=fe.intersection(n,i,o,s),l=this.isInSegmentEnvelopes(u);Gt.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&Gt.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,s){var a=new v(n),u=new v(i),l=new v(o),c=new v(s),f=new v;this.normalizeToEnvCentre(a,u,l,c,f);var h=this.safeHCoordinateIntersection(a,u,l,c);return h.x+=f.x,h.y+=f.y,h},t.prototype.computeCollinearIntersection=function(n,i,o,s){var a=k.intersects(n,i,o),u=k.intersects(n,i,s),l=k.intersects(o,s,n),c=k.intersects(o,s,i);return a&&u?(this._intPt[0]=o,this._intPt[1]=s,r.COLLINEAR_INTERSECTION):l&&c?(this._intPt[0]=n,this._intPt[1]=i,r.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!u&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):a&&c?(this._intPt[0]=o,this._intPt[1]=i,o.equals(i)&&!u&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&l?(this._intPt[0]=s,this._intPt[1]=n,s.equals(n)&&!a&&!c?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):u&&c?(this._intPt[0]=s,this._intPt[1]=i,s.equals(i)&&!a&&!l?r.POINT_INTERSECTION:r.COLLINEAR_INTERSECTION):r.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,i,o,s,a){var u=n.x<i.x?n.x:i.x,l=n.y<i.y?n.y:i.y,c=n.x>i.x?n.x:i.x,f=n.y>i.y?n.y:i.y,h=o.x<s.x?o.x:s.x,g=o.y<s.y?o.y:s.y,p=o.x>s.x?o.x:s.x,y=o.y>s.y?o.y:s.y,d=u>h?u:h,m=c<p?c:p,E=l>g?l:g,C=f<y?f:y,L=(d+m)/2,N=(E+C)/2;a.x=L,a.y=N,n.x-=a.x,n.y-=a.y,i.x-=a.x,i.y-=a.y,o.x-=a.x,o.y-=a.y,s.x-=a.x,s.y-=a.y},t.prototype.computeIntersect=function(n,i,o,s){if(this._isProper=!1,!k.intersects(n,i,o,s))return r.NO_INTERSECTION;var a=M.orientationIndex(n,i,o),u=M.orientationIndex(n,i,s);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=M.orientationIndex(o,s,n),c=M.orientationIndex(o,s,i);if(l>0&&c>0||l<0&&c<0)return r.NO_INTERSECTION;var f=a===0&&u===0&&l===0&&c===0;return f?this.computeCollinearIntersection(n,i,o,s):(a===0||u===0||l===0||c===0?(this._isProper=!1,n.equals2D(o)||n.equals2D(s)?this._intPt[0]=n:i.equals2D(o)||i.equals2D(s)?this._intPt[0]=i:a===0?this._intPt[0]=new v(o):u===0?this._intPt[0]=new v(s):l===0?this._intPt[0]=new v(n):c===0&&(this._intPt[0]=new v(i))):(this._isProper=!0,this._intPt[0]=this.intersection(n,i,o,s)),r.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,i,o,s){var a=n,u=M.distancePointLine(n,o,s),l=M.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=M.distancePointLine(o,n,i),l<u&&(u=l,a=o),l=M.distancePointLine(s,n,i),l<u&&(u=l,a=s),a},t}(gt),ti=function(){};ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.orientationIndex=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=n.x-e.x,a=n.y-e.y;return ti.signOfDet2x2(i,o,s,a)},ti.signOfDet2x2=function(t,e,n,i){var o=null,s=null,a=null;if(o=1,t===0||i===0)return e===0||n===0?0:e>0?n>0?-o:o:n>0?o:-o;if(e===0||n===0)return i>0?t>0?o:-o:t>0?-o:o;if(e>0?i>0?e<=i||(o=-o,s=t,t=n,n=s,s=e,e=i,i=s):e<=-i?(o=-o,n=-n,i=-i):(s=t,t=-n,n=s,s=e,e=-i,i=s):i>0?-e<=i?(o=-o,t=-t,e=-e):(s=-t,t=n,n=s,s=-e,e=i,i=s):e>=i?(t=-t,e=-e,n=-n,i=-i):(o=-o,s=-t,t=-n,n=s,s=-e,e=-i,i=s),t>0)if(n>0){if(!(t<=n))return o}else return o;else{if(n>0)return-o;if(t>=n)o=-o,t=-t,n=-n;else return-o}for(;;){if(a=Math.floor(n/t),n=n-a*t,i=i-a*e,i<0)return-o;if(i>e)return o;if(t>n+n){if(e<i+i)return o}else{if(e>i+i)return-o;n=t-n,i=e-i,o=-o}if(i===0)return n===0?0:-o;if(n===0||(a=Math.floor(t/n),t=t-a*n,e=e-a*i,e<0))return o;if(e>i)return-o;if(n>t+t){if(i<e+e)return-o}else{if(i>e+e)return o;t=n-t,e=i-e,o=-o}if(e===0)return t===0?0:o;if(t===0)return-o}};var cn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};cn.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var o=t.x-this._p.x,s=t.y-this._p.y,a=e.x-this._p.x,u=e.y-this._p.y,l=ti.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},cn.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR},cn.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.EXTERIOR},cn.prototype.isOnSegment=function(){return this._isPointOnSegment},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},cn.locatePointInRing=function(){if(arguments[0]instanceof v&&z(arguments[1],Q)){for(var t=arguments[0],e=arguments[1],n=new cn(t),i=new v,o=new v,s=1;s<e.size();s++)if(e.getCoordinate(s,i),e.getCoordinate(s-1,o),n.countSegment(i,o),n.isOnSegment())return n.getLocation();return n.getLocation()}else if(arguments[0]instanceof v&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new cn(a),c=1;c<u.length;c++){var f=u[c],h=u[c-1];if(l.countSegment(f,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var M=function(){},ei={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.orientationIndex=function(t,e,n){return fe.orientationIndex(t,e,n)},M.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var o=t[i].x-n,s=t[i+1].y,a=t[i-1].y;e+=o*(a-s)}return e/2}else if(z(arguments[0],Q)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new v,f=new v,h=new v;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,y=1;y<l-1;y++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(y+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},M.distanceLineLine=function(t,e,n,i){if(t.equals(e))return M.distancePointLine(t,n,i);if(n.equals(i))return M.distancePointLine(i,t,e);var o=!1;if(!k.intersects(t,e,n,i))o=!0;else{var s=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(s===0)o=!0;else{var a=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),u=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=u/s,c=a/s;(c<0||c>1||l<0||l>1)&&(o=!0)}}return o?Se.min(M.distancePointLine(t,n,i),M.distancePointLine(e,n,i),M.distancePointLine(n,t,e),M.distancePointLine(i,t,e)):0},M.isPointInRing=function(t,e){return M.locatePointInRing(t,e)!==_.EXTERIOR},M.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new v;t.getCoordinate(0,i);for(var o=i.x,s=i.y,a=1;a<e;a++){t.getCoordinate(a,i);var u=i.x,l=i.y,c=u-o,f=l-s;n+=Math.sqrt(c*c+f*f),o=u,s=l}return n},M.isCCW=function(t){var e=t.length-1;if(e<3)throw new ct("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,o=1;o<=e;o++){var s=t[o];s.y>n.y&&(n=s,i=o)}var a=i;do a=a-1,a<0&&(a=e);while(t[a].equals2D(n)&&a!==i);var u=i;do u=(u+1)%e;while(t[u].equals2D(n)&&u!==i);var l=t[a],c=t[u];if(l.equals2D(n)||c.equals2D(n)||l.equals2D(c))return!1;var f=M.computeOrientation(l,n,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},M.locatePointInRing=function(t,e){return cn.locatePointInRing(t,e)},M.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(o)*Math.sqrt(i)},M.computeOrientation=function(t,e,n){return M.orientationIndex(t,e,n)},M.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ct("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=M.distancePointLine(t,e[i],e[i+1]);o<n&&(n=o)}return n}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];if(a.x===u.x&&a.y===u.y)return s.distance(a);var l=(u.x-a.x)*(u.x-a.x)+(u.y-a.y)*(u.y-a.y),c=((s.x-a.x)*(u.x-a.x)+(s.y-a.y)*(u.y-a.y))/l;if(c<=0)return s.distance(a);if(c>=1)return s.distance(u);var f=((a.y-s.y)*(u.x-a.x)-(a.x-s.x)*(u.y-a.y))/l;return Math.abs(f)*Math.sqrt(l)}},M.isOnLine=function(t,e){for(var n=new Dr,i=1;i<e.length;i++){var o=e[i-1],s=e[i];if(n.computeIntersection(t,o,s),n.hasIntersection())return!0}return!1},ei.CLOCKWISE.get=function(){return-1},ei.RIGHT.get=function(){return M.CLOCKWISE},ei.COUNTERCLOCKWISE.get=function(){return 1},ei.LEFT.get=function(){return M.COUNTERCLOCKWISE},ei.COLLINEAR.get=function(){return 0},ei.STRAIGHT.get=function(){return M.COLLINEAR},Object.defineProperties(M,ei);var Yn=function(){};Yn.prototype.filter=function(t){},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var G=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},wn={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}};G.prototype.isGeometryCollection=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION},G.prototype.getFactory=function(){return this._factory},G.prototype.getGeometryN=function(t){return this},G.prototype.getArea=function(){return 0},G.prototype.isRectangle=function(){return!1},G.prototype.equals=function(){if(arguments[0]instanceof G){var t=arguments[0];return t===null?!1:this.equalsTopo(t)}else if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof G))return!1;var n=e;return this.equalsExact(n)}},G.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},G.prototype.geometryChanged=function(){this.apply(G.geometryChangedFilter)},G.prototype.geometryChangedAction=function(){this._envelope=null},G.prototype.equalsNorm=function(t){return t===null?!1:this.norm().equalsExact(t.norm())},G.prototype.getLength=function(){return 0},G.prototype.getNumGeometries=function(){return 1},G.prototype.compareTo=function(){if(arguments.length===1){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,i)}},G.prototype.getUserData=function(){return this._userData},G.prototype.getSRID=function(){return this._SRID},G.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},G.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION)throw new ct("This method does not support GeometryCollection arguments")},G.prototype.equal=function(t,e,n){return n===0?t.equals(e):t.distance(e)<=n},G.prototype.norm=function(){var t=this.copy();return t.normalize(),t},G.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},G.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new k(this._envelope)},G.prototype.setSRID=function(t){this._SRID=t},G.prototype.setUserData=function(t){this._userData=t},G.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var o=n.next(),s=i.next(),a=o.compareTo(s);if(a!==0)return a}return n.hasNext()?1:i.hasNext()?-1:0},G.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},G.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===G.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===G.SORTINDEX_MULTIPOINT||this.getSortIndex()===G.SORTINDEX_MULTILINESTRING||this.getSortIndex()===G.SORTINDEX_MULTIPOLYGON},G.prototype.interfaces_=function(){return[Fo,De,Me]},G.prototype.getClass=function(){return G},G.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},G.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(t[e]===null)return!0;return!1},wn.serialVersionUID.get=function(){return 8763622679187377e3},wn.SORTINDEX_POINT.get=function(){return 0},wn.SORTINDEX_MULTIPOINT.get=function(){return 1},wn.SORTINDEX_LINESTRING.get=function(){return 2},wn.SORTINDEX_LINEARRING.get=function(){return 3},wn.SORTINDEX_MULTILINESTRING.get=function(){return 4},wn.SORTINDEX_POLYGON.get=function(){return 5},wn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},wn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},wn.geometryChangedFilter.get=function(){return bs},Object.defineProperties(G,wn);var bs=function(){};bs.interfaces_=function(){return[Yn]},bs.filter=function(t){t.geometryChangedAction()};var Ln=function(){};Ln.prototype.filter=function(t){},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln};var Ae=function(){},Wn={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}};Ae.prototype.isInBoundary=function(t){},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Wn.Mod2BoundaryNodeRule.get=function(){return wi},Wn.EndPointBoundaryNodeRule.get=function(){return Li},Wn.MultiValentEndPointBoundaryNodeRule.get=function(){return bi},Wn.MonoValentEndPointBoundaryNodeRule.get=function(){return Pi},Wn.MOD2_BOUNDARY_RULE.get=function(){return new wi},Wn.ENDPOINT_BOUNDARY_RULE.get=function(){return new Li},Wn.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new bi},Wn.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Pi},Wn.OGC_SFS_BOUNDARY_RULE.get=function(){return Ae.MOD2_BOUNDARY_RULE},Object.defineProperties(Ae,Wn);var wi=function(){};wi.prototype.isInBoundary=function(t){return t%2===1},wi.prototype.interfaces_=function(){return[Ae]},wi.prototype.getClass=function(){return wi};var Li=function(){};Li.prototype.isInBoundary=function(t){return t>0},Li.prototype.interfaces_=function(){return[Ae]},Li.prototype.getClass=function(){return Li};var bi=function(){};bi.prototype.isInBoundary=function(t){return t>1},bi.prototype.interfaces_=function(){return[Ae]},bi.prototype.getClass=function(){return bi};var Pi=function(){};Pi.prototype.isInBoundary=function(t){return t===1},Pi.prototype.interfaces_=function(){return[Ae]},Pi.prototype.getClass=function(){return Pi};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){};function Ps(r){this.message=r||""}Ps.prototype=new Error,Ps.prototype.name="IndexOutOfBoundsException";var Ri=function(){};Ri.prototype.hasNext=function(){},Ri.prototype.next=function(){},Ri.prototype.remove=function(){};var Xe=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(bt);function Oi(r){this.message=r||""}Oi.prototype=new Error,Oi.prototype.name="NoSuchElementException";var O=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[r,bt]},t.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.set=function(n,i){var o=this.array_[n];return this.array_[n]=i,o},t.prototype.iterator=function(){return new wc(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Ps;return this.array_[n]},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.remove=function(n){for(var i=this,o=!1,s=0,a=this.array_.length;s<a;s++)if(i.array_[s]===n){i.array_.splice(s,1),o=!0;break}return o},t}(Xe),wc=function(r){function t(e){r.call(this),this.arrayList_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Oi;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(Ri),so=function(r){function t(){if(r.call(this),arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.ensureCapacity(n.length),this.add(n,!0)}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.ensureCapacity(i.length),this.add(i,o)}}}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={coordArrayType:{configurable:!0}};return e.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(i){return this.get(i)},t.prototype.addAll=function(){var i=this;if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=!1,u=o.iterator();u.hasNext();)i.add(u.next(),s),a=!0;return a}else return r.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=this,o=r.prototype.clone.call(this),s=0;s<this.size();s++)o.add(s,i.get(s).copy());return o},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var i=this;if(arguments.length===1){var o=arguments[0];r.prototype.add.call(this,o)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1];return this.add(s,a,!0),!0}else if(arguments[0]instanceof v&&typeof arguments[1]=="boolean"){var u=arguments[0],l=arguments[1];if(!l&&this.size()>=1){var c=this.get(this.size()-1);if(c.equals2D(u))return null}r.prototype.add.call(this,u)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var f=arguments[0],h=arguments[1];return this.add(f,h),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var g=arguments[0],p=arguments[1],y=arguments[2];if(y)for(var d=0;d<g.length;d++)i.add(g[d],p);else for(var m=g.length-1;m>=0;m--)i.add(g[m],p);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2];if(!L){var N=this.size();if(N>0){if(E>0){var x=this.get(E-1);if(x.equals2D(C))return null}if(E<N){var T=this.get(E);if(T.equals2D(C))return null}}}r.prototype.add.call(this,E,C)}}else if(arguments.length===4){var A=arguments[0],w=arguments[1],F=arguments[2],X=arguments[3],R=1;F>X&&(R=-1);for(var Y=F;Y!==X;Y+=R)i.add(A[Y],w);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new v(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(O),H=function(){},Go={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Go.ForwardComparator.get=function(){return ao},Go.BidirectionalComparator.get=function(){return Ti},Go.coordArrayType.get=function(){return new Array(0).fill(null)},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},H.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(H.indexOf(i,e)<0)return i}return null},H.scroll=function(t,e){var n=H.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);Gt.arraycopy(t,n,i,0,t.length-n),Gt.arraycopy(t,0,i,t.length-n,n),Gt.arraycopy(i,0,t,0,t.length)},H.equals=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(i===o)return!0;if(i===null||o===null||i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(s.compare(i[a],o[a])!==0)return!1;return!0}},H.intersection=function(t,e){for(var n=new so,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},H.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},H.removeRepeatedPoints=function(t){if(!H.hasRepeatedPoints(t))return t;var e=new so(t,!1);return e.toCoordinateArray()},H.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var o=t[i];t[i]=t[e-i],t[e-i]=o}},H.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)t[n]!==null&&e++;var i=new Array(e).fill(null);if(e===0)return i;for(var o=0,s=0;s<t.length;s++)t[s]!==null&&(i[o++]=t[s]);return i},H.copyDeep=function(){if(arguments.length===1){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new v(t[n]);return e}else if(arguments.length===5)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=0;l<u;l++)s[a+l]=new v(i[o+l])},H.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=e[t.length-n-1];if(i.compareTo(o)!==0)return!1}return!0},H.envelope=function(t){for(var e=new k,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},H.toCoordinateArray=function(t){return t.toArray(H.coordArrayType)},H.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},H.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},H.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(i!==0)return i}return 1},H.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(i!==0)return i;n++}return n<e.length?-1:n<t.length?1:0},H.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(e===null||e.compareTo(t[n])>0)&&(e=t[n]);return e},H.extract=function(t,e,n){e=Se.clamp(e,0,t.length),n=Se.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var o=new Array(i).fill(null);if(i===0)return o;for(var s=0,a=e;a<=n;a++)o[s++]=t[a];return o},Object.defineProperties(H,Go);var ao=function(){};ao.prototype.compare=function(t,e){var n=t,i=e;return H.compare(n,i)},ao.prototype.interfaces_=function(){return[Ci]},ao.prototype.getClass=function(){return ao};var Ti=function(){};Ti.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;var o=H.compare(n,i),s=H.isEqualReversed(n,i);return s?0:o},Ti.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(n.length===0)return 0;for(var o=H.increasingDirection(n),s=H.increasingDirection(i),a=o>0?0:n.length-1,u=s>0?0:n.length-1,l=0;l<n.length;l++){var c=n[a].compareTo(i[u]);if(c!==0)return c;a+=o,u+=s}return 0},Ti.prototype.interfaces_=function(){return[Ci]},Ti.prototype.getClass=function(){return Ti};var ni=function(){};ni.prototype.get=function(){},ni.prototype.put=function(){},ni.prototype.size=function(){},ni.prototype.values=function(){},ni.prototype.entrySet=function(){};var Lc=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(ni);function uo(r){this.message=r||""}uo.prototype=new Error,uo.prototype.name="OperationNotSupported";function zo(){}zo.prototype=new bt,zo.prototype.contains=function(){};var Rs=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var i=this,o=0,s=this.array_.length;o<s;o++){var a=i.array_[o];if(a===n)return!0}return!1},t.prototype.add=function(n){return this.contains(n)?!1:(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var i=this,o=n.iterator();o.hasNext();)i.add(o.next());return!0},t.prototype.remove=function(n){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return this.array_.length===0},t.prototype.toArray=function(){for(var n=this,i=[],o=0,s=this.array_.length;o<s;o++)i.push(n.array_[o]);return i},t.prototype.iterator=function(){return new bc(this)},t}(zo),bc=function(r){function t(e){r.call(this),this.hashSet_=e,this.position_=0}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Oi;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new uo},t}(Ri),Hn=0,Mr=1;function ja(r){return r===null?Hn:r.color}function ot(r){return r===null?null:r.parent}function jn(r,t){r!==null&&(r.color=t)}function Os(r){return r===null?null:r.left}function Ka(r){return r===null?null:r.right}function jt(){this.root_=null,this.size_=0}jt.prototype=new Lc,jt.prototype.get=function(r){for(var t=this.root_;t!==null;){var e=r.compareTo(t.key);if(e<0)t=t.left;else if(e>0)t=t.right;else return t.value}return null},jt.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var e=this.root_,n,i;do if(n=e,i=r.compareTo(e.key),i<0)e=e.left;else if(i>0)e=e.right;else{var o=e.value;return e.value=t,o}while(e!==null);var s={key:r,left:null,right:null,value:t,parent:n,color:Hn,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},jt.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Mr;r!=null&&r!==this.root_&&r.parent.color===Mr;)if(ot(r)===Os(ot(ot(r)))){var e=Ka(ot(ot(r)));ja(e)===Mr?(jn(ot(r),Hn),jn(e,Hn),jn(ot(ot(r)),Mr),r=ot(ot(r))):(r===Ka(ot(r))&&(r=ot(r),t.rotateLeft(r)),jn(ot(r),Hn),jn(ot(ot(r)),Mr),t.rotateRight(ot(ot(r))))}else{var n=Os(ot(ot(r)));ja(n)===Mr?(jn(ot(r),Hn),jn(n,Hn),jn(ot(ot(r)),Mr),r=ot(ot(r))):(r===Os(ot(r))&&(r=ot(r),t.rotateRight(r)),jn(ot(r),Hn),jn(ot(ot(r)),Mr),t.rotateLeft(ot(ot(r))))}this.root_.color=Hn},jt.prototype.values=function(){var r=new O,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=jt.successor(t))!==null;)r.add(t.value);return r},jt.prototype.entrySet=function(){var r=new Rs,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=jt.successor(t))!==null;)r.add(t);return r},jt.prototype.rotateLeft=function(r){if(r!=null){var t=r.right;r.right=t.left,t.left!=null&&(t.left.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.left===r?r.parent.left=t:r.parent.right=t,t.left=r,r.parent=t}},jt.prototype.rotateRight=function(r){if(r!=null){var t=r.left;r.left=t.right,t.right!=null&&(t.right.parent=r),t.parent=r.parent,r.parent===null?this.root_=t:r.parent.right===r?r.parent.right=t:r.parent.left=t,t.right=r,r.parent=t}},jt.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},jt.successor=function(r){if(r===null)return null;if(r.right!==null){for(var t=r.right;t.left!==null;)t=t.left;return t}else{for(var e=r.parent,n=r;e!==null&&n===e.right;)n=e,e=e.parent;return e}},jt.prototype.size=function(){return this.size_};var lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};function Qa(){}Qa.prototype=new zo;function fn(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}fn.prototype=new Qa,fn.prototype.contains=function(r){for(var t=this,e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===0)return!0}return!1},fn.prototype.add=function(r){var t=this;if(this.contains(r))return!1;for(var e=0,n=this.array_.length;e<n;e++){var i=t.array_[e];if(i.compareTo(r)===1)return t.array_.splice(e,0,r),!0}return this.array_.push(r),!0},fn.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},fn.prototype.remove=function(r){throw new uo},fn.prototype.size=function(){return this.array_.length},fn.prototype.isEmpty=function(){return this.array_.length===0},fn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},fn.prototype.iterator=function(){return new Vo(this)};var Vo=function(r){this.treeSet_=r,this.position_=0};Vo.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Oi;return this.treeSet_.array_[this.position_++]},Vo.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Vo.prototype.remove=function(){throw new uo};var Ar=function(){};Ar.sort=function(){var t=arguments[0],e,n,i,o;if(arguments.length===1)o=function(a,u){return a.compareTo(u)},t.sort(o);else if(arguments.length===2)i=arguments[1],o=function(a,u){return i.compare(a,u)},t.sort(o);else if(arguments.length===3){n=t.slice(arguments[1],arguments[2]),n.sort();var s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length));for(t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])}else if(arguments.length===4)for(n=t.slice(arguments[1],arguments[2]),i=arguments[3],o=function(a,u){return i.compare(a,u)},n.sort(o),s=t.slice(0,arguments[1]).concat(n,t.slice(arguments[2],t.length)),t.splice(0,t.length),e=0;e<s.length;e++)t.push(s[e])},Ar.asList=function(t){for(var e=new O,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var Z=function(){},Ye={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}};Ye.P.get=function(){return 0},Ye.L.get=function(){return 1},Ye.A.get=function(){return 2},Ye.FALSE.get=function(){return-1},Ye.TRUE.get=function(){return-2},Ye.DONTCARE.get=function(){return-3},Ye.SYM_FALSE.get=function(){return"F"},Ye.SYM_TRUE.get=function(){return"T"},Ye.SYM_DONTCARE.get=function(){return"*"},Ye.SYM_P.get=function(){return"0"},Ye.SYM_L.get=function(){return"1"},Ye.SYM_A.get=function(){return"2"},Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toDimensionSymbol=function(t){switch(t){case Z.FALSE:return Z.SYM_FALSE;case Z.TRUE:return Z.SYM_TRUE;case Z.DONTCARE:return Z.SYM_DONTCARE;case Z.P:return Z.SYM_P;case Z.L:return Z.SYM_L;case Z.A:return Z.SYM_A}throw new ct("Unknown dimension value: "+t)},Z.toDimensionValue=function(t){switch(io.toUpperCase(t)){case Z.SYM_FALSE:return Z.FALSE;case Z.SYM_TRUE:return Z.TRUE;case Z.SYM_DONTCARE:return Z.DONTCARE;case Z.SYM_P:return Z.P;case Z.SYM_L:return Z.L;case Z.SYM_A:return Z.A}throw new ct("Unknown dimension symbol: "+t)},Object.defineProperties(Z,Ye);var hn=function(){};hn.prototype.filter=function(t){},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var We=function(){};We.prototype.filter=function(t,e){},We.prototype.isDone=function(){},We.prototype.isGeometryChanged=function(){},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var te=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new ct("geometries must not contain null elements")}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var i=this,o=new k,s=0;s<this._geometries.length;s++)o.expandToInclude(i._geometries[s].getEnvelopeInternal());return o},t.prototype.getGeometryN=function(i){return this._geometries[i]},t.prototype.getSortIndex=function(){return r.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i=this,o=new Array(this.getNumPoints()).fill(null),s=-1,a=0;a<this._geometries.length;a++)for(var u=i._geometries[a].getCoordinates(),l=0;l<u.length;l++)s++,o[s]=u[l];return o},t.prototype.getArea=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getArea();return o},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._geometries.length!==a._geometries.length)return!1;for(var u=0;u<this._geometries.length;u++)if(!i._geometries[u].equalsExact(a._geometries[u],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<this._geometries.length;o++)i._geometries[o].normalize();Ar.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getBoundaryDimension());return o},t.prototype.getDimension=function(){for(var i=this,o=Z.FALSE,s=0;s<this._geometries.length;s++)o=Math.max(o,i._geometries[s].getDimension());return o},t.prototype.getLength=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=0,s=0;s<this._geometries.length;s++)o+=i._geometries[s].getNumPoints();return o},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createGeometryCollection(s)},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=new fn(Ar.asList(this._geometries)),a=new fn(Ar.asList(o._geometries));return this.compare(s,a)}else if(arguments.length===2){for(var u=arguments[0],l=arguments[1],c=u,f=this.getNumGeometries(),h=c.getNumGeometries(),g=0;g<f&&g<h;){var p=i.getGeometryN(g),y=c.getGeometryN(g),d=p.compareToSameClass(y,l);if(d!==0)return d;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(z(arguments[0],Ln))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(z(arguments[0],We)){var a=arguments[0];if(this._geometries.length===0)return null;for(var u=0;u<this._geometries.length&&(i._geometries[u].apply(a),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],hn)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(z(arguments[0],Yn)){var f=arguments[0];f.filter(this);for(var h=0;h<this._geometries.length;h++)i._geometries[h].apply(f)}},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),q.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._geometries=new Array(this._geometries.length).fill(null);for(var s=0;s<this._geometries.length;s++)o._geometries[s]=i._geometries[s].clone();return o},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.isEmpty=function(){for(var i=this,o=0;o<this._geometries.length;o++)if(!i._geometries[o].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(t,e),t}(G),Fr=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){var i=this;if(this.isEmpty())return!1;for(var o=0;o<this._geometries.length;o++)if(!i._geometries[o].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[o-1-a]=i._geometries[a].reverse();return this.getFactory().createMultiLineString(s)},t.prototype.getBoundary=function(){return new Fe(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(te),Fe=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Ae.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}};Fe.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return e.length===1?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Fe.prototype.getBoundary=function(){return this._geom instanceof dt?this.boundaryLineString(this._geom):this._geom instanceof Fr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Fe.prototype.boundaryLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this._bnRule.isInBoundary(2);return e?t.getStartPoint():this._geomFact.createMultiPoint()}return this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Fe.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Fe.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new O;this._endpointMap=new jt;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);o.getNumPoints()!==0&&(e.addEndpoint(o.getCoordinateN(0)),e.addEndpoint(o.getCoordinateN(o.getNumPoints()-1)))}for(var s=this._endpointMap.entrySet().iterator();s.hasNext();){var a=s.next(),u=a.getValue(),l=u.count;e._bnRule.isInBoundary(l)&&n.add(a.getKey())}return H.toCoordinateArray(n)},Fe.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Uo,this._endpointMap.put(t,e)),e.count++},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new Fe(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Fe(n,i);return o.getBoundary()}};var Uo=function(){this.count=null};Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo};function Pc(){}function Rc(){}var Oc=function(){};function Tc(){}function Dc(){}function Mc(){}var ke=function(){},Ts={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke},ke.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},ke.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new Tc,n=new Pc;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new Rc(ke.getStackTrace(i));for(var a=new Mc,u=0;u<o;u++)try{s+=a.readLine()+ke.NEWLINE}catch(l){if(l instanceof Dc)q.shouldNeverReachHere();else throw l}finally{}return s}},ke.split=function(t,e){for(var n=e.length,i=new O,o=""+t,s=o.indexOf(e);s>=0;){var a=o.substring(0,s);i.add(a),o=o.substring(s+n),s=o.indexOf(e)}o.length>0&&i.add(o);for(var u=new Array(i.size()).fill(null),l=0;l<u.length;l++)u[l]=i.get(l);return u},ke.toString=function(){if(arguments.length===1){var t=arguments[0];return ke.SIMPLE_ORDINATE_FORMAT.format(t)}},ke.spaces=function(t){return ke.chars(" ",t)},Ts.NEWLINE.get=function(){return Gt.getProperty("line.separator")},Ts.SIMPLE_ORDINATE_FORMAT.get=function(){return new Oc},Object.defineProperties(ke,Ts);var Et=function(){};Et.prototype.interfaces_=function(){return[]},Et.prototype.getClass=function(){return Et},Et.copyCoord=function(t,e,n,i){for(var o=Math.min(t.getDimension(),n.getDimension()),s=0;s<o;s++)n.setOrdinate(i,s,t.getOrdinate(e,s))},Et.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,Q.X)===t.getOrdinate(e-1,Q.X)&&t.getOrdinate(0,Q.Y)===t.getOrdinate(e-1,Q.Y)},Et.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var o=Math.min(t.getDimension(),e.getDimension()),s=0;s<n;s++)for(var a=0;a<o;a++){var u=t.getOrdinate(s,a),l=e.getOrdinate(s,a);if(t.getOrdinate(s,a)!==e.getOrdinate(s,a)&&!(V.isNaN(u)&&V.isNaN(l)))return!1}return!0},Et.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(Et.copy(e,0,i,0,o),o>0)for(var s=o;s<n;s++)Et.copy(e,o-1,i,s,1);return i},Et.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)Et.swap(t,i,e-i)},Et.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var o=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,o)}},Et.copy=function(t,e,n,i,o){for(var s=0;s<o;s++)Et.copyCoord(t,e+s,n,i+s)},Et.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new an;i.append("(");for(var o=0;o<e;o++){o>0&&i.append(" ");for(var s=0;s<n;s++)s>0&&i.append(","),i.append(ke.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return Et.createClosedRing(t,e,4);var i=e.getOrdinate(0,Q.X)===e.getOrdinate(n-1,Q.X)&&e.getOrdinate(0,Q.Y)===e.getOrdinate(n-1,Q.Y);return i?e:Et.createClosedRing(t,e,n+1)},Et.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();Et.copy(e,0,i,0,o);for(var s=o;s<n;s++)Et.copy(e,0,i,s,1);return i};var dt=function(r){function t(n,i){r.call(this,i),this._points=null,this.init(n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new k:this._points.expandEnvelope(new k)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return r.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o;if(this._points.size()!==a._points.size())return!1;for(var u=0;u<this._points.size();u++)if(!i.equal(i._points.getCoordinate(u),a._points.getCoordinate(u),s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var i=this,o=0;o<Math.trunc(this._points.size()/2);o++){var s=i._points.size()-1-o;if(!i._points.getCoordinate(o).equals(i._points.getCoordinate(s)))return i._points.getCoordinate(o).compareTo(i._points.getCoordinate(s))>0&&Et.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Z.FALSE:0},t.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return M.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var o=this.getFactory().createLineString(i);return o},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){for(var o=arguments[0],s=o,a=0,u=0;a<this._points.size()&&u<s._points.size();){var l=i._points.getCoordinate(a).compareTo(s._points.getCoordinate(u));if(l!==0)return l;a++,u++}return a<this._points.size()?1:u<s._points.size()?-1:0}else if(arguments.length===2){var c=arguments[0],f=arguments[1],h=c;return f.compare(this._points,h._points)}},t.prototype.apply=function(){var i=this;if(z(arguments[0],Ln))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(z(arguments[0],We)){var a=arguments[0];if(this._points.size()===0)return null;for(var u=0;u<this._points.size()&&(a.filter(i._points,u),!a.isDone());u++);a.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],hn)){var l=arguments[0];l.filter(this)}else if(z(arguments[0],Yn)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new Fe(this).getBoundary()},t.prototype.isEquivalentClass=function(i){return i instanceof t},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._points=this._points.clone(),i},t.prototype.getCoordinateN=function(i){return this._points.getCoordinate(i)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return this._points.size()===0},t.prototype.init=function(i){if(i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),i.size()===1)throw new ct("Invalid number of points in LineString (found "+i.size()+" - must be 0 or >= 2)");this._points=i},t.prototype.isCoordinate=function(i){for(var o=this,s=0;s<this._points.size();s++)if(o._points.getCoordinate(s).equals(i))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(i){return this.getFactory().createPoint(this._points.getCoordinate(i))},t.prototype.interfaces_=function(){return[lo]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(G),co=function(){};co.prototype.interfaces_=function(){return[]},co.prototype.getClass=function(){return co};var ve=function(r){function t(n,i){r.call(this,i),this._coordinates=n||null,this.init(this._coordinates)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new k;var i=new k;return i.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),i},t.prototype.getSortIndex=function(){return r.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?this.isEmpty()&&i.isEmpty()?!0:this.isEmpty()!==i.isEmpty()?!1:this.equal(i.getCoordinate(),this.getCoordinate(),o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){if(arguments.length===1){var i=arguments[0],o=i;return this.getCoordinate().compareTo(o.getCoordinate())}else if(arguments.length===2){var s=arguments[0],a=arguments[1],u=s;return a.compare(this._coordinates,u._coordinates)}},t.prototype.apply=function(){if(z(arguments[0],Ln)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(z(arguments[0],We)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(z(arguments[0],hn)){var s=arguments[0];s.filter(this)}else if(z(arguments[0],Yn)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var i=r.prototype.clone.call(this);return i._coordinates=this._coordinates.clone(),i},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return this._coordinates.size()===0},t.prototype.init=function(i){i===null&&(i=this.getFactory().getCoordinateSequenceFactory().create([])),q.isTrue(i.size()<=1),this._coordinates=i},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(G),fr=function(){};fr.prototype.interfaces_=function(){return[]},fr.prototype.getClass=function(){return fr};var Pt=function(r){function t(n,i,o){if(r.call(this,o),this._shell=null,this._holes=null,n===null&&(n=this.getFactory().createLinearRing()),i===null&&(i=[]),r.hasNullElements(i))throw new ct("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new ct("shell is empty but holes are not");this._shell=n,this._holes=i}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return r.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var i=this;if(this.isEmpty())return[];for(var o=new Array(this.getNumPoints()).fill(null),s=-1,a=this._shell.getCoordinates(),u=0;u<a.length;u++)s++,o[s]=a[u];for(var l=0;l<this._holes.length;l++)for(var c=i._holes[l].getCoordinates(),f=0;f<c.length;f++)s++,o[s]=c[f];return o},t.prototype.getArea=function(){var i=this,o=0;o+=Math.abs(M.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(M.signedArea(i._holes[s].getCoordinateSequence()));return o},t.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var i=this._shell.getCoordinateSequence(),o=this.getEnvelopeInternal(),s=0;s<5;s++){var a=i.getX(s);if(!(a===o.getMinX()||a===o.getMaxX()))return!1;var u=i.getY(s);if(!(u===o.getMinY()||u===o.getMaxY()))return!1}for(var l=i.getX(0),c=i.getY(0),f=1;f<=4;f++){var h=i.getX(f),g=i.getY(f),p=h!==l,y=g!==c;if(p===y)return!1;l=h,c=g}return!0},t.prototype.equalsExact=function(){var i=this;if(arguments.length===2){var o=arguments[0],s=arguments[1];if(!this.isEquivalentClass(o))return!1;var a=o,u=this._shell,l=a._shell;if(!u.equalsExact(l,s)||this._holes.length!==a._holes.length)return!1;for(var c=0;c<this._holes.length;c++)if(!i._holes[c].equalsExact(a._holes[c],s))return!1;return!0}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i=this;if(arguments.length===0){this.normalize(this._shell,!0);for(var o=0;o<this._holes.length;o++)i.normalize(i._holes[o],!1);Ar.sort(this._holes)}else if(arguments.length===2){var s=arguments[0],a=arguments[1];if(s.isEmpty())return null;var u=new Array(s.getCoordinates().length-1).fill(null);Gt.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=H.minCoordinate(s.getCoordinates());H.scroll(u,l),Gt.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],M.isCCW(s.getCoordinates())===a&&H.reverse(s.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var i=this,o=0;o+=this._shell.getLength();for(var s=0;s<this._holes.length;s++)o+=i._holes[s].getLength();return o},t.prototype.getNumPoints=function(){for(var i=this,o=this._shell.getNumPoints(),s=0;s<this._holes.length;s++)o+=i._holes[s].getNumPoints();return o},t.prototype.reverse=function(){var i=this,o=this.copy();o._shell=this._shell.copy().reverse(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].copy().reverse();return o},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){var i=this;if(arguments.length===1){var o=arguments[0],s=this._shell,a=o._shell;return s.compareToSameClass(a)}else if(arguments.length===2){var u=arguments[0],l=arguments[1],c=u,f=this._shell,h=c._shell,g=f.compareToSameClass(h,l);if(g!==0)return g;for(var p=this.getNumInteriorRing(),y=c.getNumInteriorRing(),d=0;d<p&&d<y;){var m=i.getInteriorRingN(d),E=c.getInteriorRingN(d),C=m.compareToSameClass(E,l);if(C!==0)return C;d++}return d<p?1:d<y?-1:0}},t.prototype.apply=function(i){var o=this;if(z(i,Ln)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(z(i,We)){if(this._shell.apply(i),!i.isDone())for(var a=0;a<this._holes.length&&(o._holes[a].apply(i),!i.isDone());a++);i.isGeometryChanged()&&this.geometryChanged()}else if(z(i,hn))i.filter(this);else if(z(i,Yn)){i.filter(this),this._shell.apply(i);for(var u=0;u<this._holes.length;u++)o._holes[u].apply(i)}},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();var o=new Array(this._holes.length+1).fill(null);o[0]=this._shell;for(var s=0;s<this._holes.length;s++)o[s+1]=i._holes[s];return o.length<=1?this.getFactory().createLinearRing(o[0].getCoordinateSequence()):this.getFactory().createMultiLineString(o)},t.prototype.clone=function(){var i=this,o=r.prototype.clone.call(this);o._shell=this._shell.clone(),o._holes=new Array(this._holes.length).fill(null);for(var s=0;s<this._holes.length;s++)o._holes[s]=i._holes[s].clone();return o},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var i=this,o=this._shell.copy(),s=new Array(this._holes.length).fill(null),a=0;a<s.length;a++)s[a]=i._holes[a].copy();return new t(o,s,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(i){return this._holes[i]},t.prototype.interfaces_=function(){return[fr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(G),Di=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(arguments.length===1){var i=arguments[0];return this._geometries[i].getCoordinate()}else return r.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[co]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(te),bn=function(r){function t(n,i){n instanceof v&&i instanceof j&&(n=i.getCoordinateSequenceFactory().create(n)),r.call(this,n,i),this.validateConstruction()}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return Z.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();Et.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new ct("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ct("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(dt),Pn=function(r){function t(){r.apply(this,arguments)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return G.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return this.isEquivalentClass(i)?r.prototype.equalsExact.call(this,i,o):!1}else return r.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this,o=this._geometries.length,s=new Array(o).fill(null),a=0;a<this._geometries.length;a++)s[a]=i._geometries[a].reverse();return this.getFactory().createMultiPolygon(s)},t.prototype.getBoundary=function(){var i=this;if(this.isEmpty())return this.getFactory().createMultiLineString();for(var o=new O,s=0;s<this._geometries.length;s++)for(var a=i._geometries[s],u=a.getBoundary(),l=0;l<u.getNumGeometries();l++)o.add(u.getGeometryN(l));var c=new Array(o.size()).fill(null);return this.getFactory().createMultiLineString(o.toArray(c))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=this,o=new Array(this._geometries.length).fill(null),s=0;s<o.length;s++)o[s]=i._geometries[s].copy();return new t(o,this._factory)},t.prototype.interfaces_=function(){return[fr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(te),Be=function(t){this._factory=t||null,this._isUserDataCopied=!1},qo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Be.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Be.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Be.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof te?this.editGeometryCollection(t,e):t instanceof Pt?this.editPolygon(t,e):t instanceof ve?e.edit(t,this._factory):t instanceof dt?e.edit(t,this._factory):(q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Be.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new O,s=0;s<i.getNumGeometries();s++){var a=n.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Di?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Fr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===Pn?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Be.prototype.editPolygon=function(t,e){var n=this,i=e.edit(t,this._factory);if(i===null&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var o=this.edit(i.getExteriorRing(),e);if(o===null||o.isEmpty())return this._factory.createPolygon();for(var s=new O,a=0;a<i.getNumInteriorRing();a++){var u=n.edit(i.getInteriorRingN(a),e);u===null||u.isEmpty()||s.add(u)}return this._factory.createPolygon(o,s.toArray([]))},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.GeometryEditorOperation=function(){},qo.NoOpGeometryOperation.get=function(){return fo},qo.CoordinateOperation.get=function(){return ho},qo.CoordinateSequenceOperation.get=function(){return go},Object.defineProperties(Be,qo);var fo=function(){};fo.prototype.edit=function(t,e){return t},fo.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},fo.prototype.getClass=function(){return fo};var ho=function(){};ho.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof bn?e.createLinearRing(n):t instanceof dt?e.createLineString(n):t instanceof ve?n.length>0?e.createPoint(n[0]):e.createPoint():t},ho.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},ho.prototype.getClass=function(){return ho};var go=function(){};go.prototype.edit=function(t,e){return t instanceof bn?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof dt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ve?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},go.prototype.interfaces_=function(){return[Be.GeometryEditorOperation]},go.prototype.getClass=function(){return go};var It=function(){var t=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 e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n<e;n++)t._coordinates[n]=new v}else if(z(arguments[0],Q)){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 o=0;o<this._coordinates.length;o++)t._coordinates[o]=i.getCoordinateCopy(o)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=s,this._dimension=a,s===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var u=arguments[0],l=arguments[1];this._coordinates=new Array(u).fill(null),this._dimension=l;for(var c=0;c<u;c++)t._coordinates[c]=new v}}},Za={serialVersionUID:{configurable:!0}};It.prototype.setOrdinate=function(t,e,n){switch(e){case Q.X:this._coordinates[t].x=n;break;case Q.Y:this._coordinates[t].y=n;break;case Q.Z:this._coordinates[t].z=n;break;default:throw new ct("invalid ordinateIndex")}},It.prototype.size=function(){return this._coordinates.length},It.prototype.getOrdinate=function(t,e){switch(e){case Q.X:return this._coordinates[t].x;case Q.Y:return this._coordinates[t].y;case Q.Z:return this._coordinates[t].z}return V.NaN},It.prototype.getCoordinate=function(){if(arguments.length===1){var t=arguments[0];return this._coordinates[t]}else if(arguments.length===2){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},It.prototype.getCoordinateCopy=function(t){return new v(this._coordinates[t])},It.prototype.getDimension=function(){return this._dimension},It.prototype.getX=function(t){return this._coordinates[t].x},It.prototype.clone=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].clone();return new It(e,this._dimension)},It.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},It.prototype.copy=function(){for(var t=this,e=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)e[n]=t._coordinates[n].copy();return new It(e,this._dimension)},It.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new an(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n<this._coordinates.length;n++)e.append(", "),e.append(t._coordinates[n]);return e.append(")"),e.toString()}else return"()"},It.prototype.getY=function(t){return this._coordinates[t].y},It.prototype.toCoordinateArray=function(){return this._coordinates},It.prototype.interfaces_=function(){return[Q,Me]},It.prototype.getClass=function(){return It},Za.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(It,Za);var Rn=function(){},Ds={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Rn.prototype.readResolve=function(){return Rn.instance()},Rn.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new It(t)}else if(z(arguments[0],Q)){var e=arguments[0];return new It(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new It(n):new It(n,i)}},Rn.prototype.interfaces_=function(){return[Ni,Me]},Rn.prototype.getClass=function(){return Rn},Rn.instance=function(){return Rn.instanceObject},Ds.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ds.instanceObject.get=function(){return new Rn},Object.defineProperties(Rn,Ds);var Ja=function(r){function t(){r.call(this),this.map_=new Map}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,i){return this.map_.set(n,i),i},t.prototype.values=function(){for(var n=new O,i=this.map_.values(),o=i.next();!o.done;)n.add(o.value),o=i.next();return n},t.prototype.entrySet=function(){var n=new Rs;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(ni),J=function r(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=r.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof gn){var t=arguments[0];this._modelType=t,t===r.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var e=arguments[0];this._modelType=r.FIXED,this.setScale(e)}else if(arguments[0]instanceof r){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}}},Ms={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};J.prototype.equals=function(t){if(!(t instanceof J))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},J.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new un(n).compareTo(new un(i))},J.prototype.getScale=function(){return this._scale},J.prototype.isFloating=function(){return this._modelType===J.FLOATING||this._modelType===J.FLOATING_SINGLE},J.prototype.getType=function(){return this._modelType},J.prototype.toString=function(){var t="UNKNOWN";return this._modelType===J.FLOATING?t="Floating":this._modelType===J.FLOATING_SINGLE?t="Floating-Single":this._modelType===J.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},J.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(V.isNaN(t))return t;if(this._modelType===J.FLOATING_SINGLE){var e=t;return e}return this._modelType===J.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof v){var n=arguments[0];if(this._modelType===J.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},J.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===J.FLOATING?t=16:this._modelType===J.FLOATING_SINGLE?t=6:this._modelType===J.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},J.prototype.setScale=function(t){this._scale=Math.abs(t)},J.prototype.interfaces_=function(){return[Me,De]},J.prototype.getClass=function(){return J},J.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Ms.serialVersionUID.get=function(){return 7777263578777804e3},Ms.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(J,Ms);var gn=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},As={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};gn.prototype.readResolve=function(){return gn.nameToTypeMap.get(this._name)},gn.prototype.toString=function(){return this._name},gn.prototype.interfaces_=function(){return[Me]},gn.prototype.getClass=function(){return gn},As.serialVersionUID.get=function(){return-552860263173159e4},As.nameToTypeMap.get=function(){return new Ja},Object.defineProperties(gn,As),J.Type=gn,J.FIXED=new gn("FIXED"),J.FLOATING=new gn("FLOATING"),J.FLOATING_SINGLE=new gn("FLOATING SINGLE");var j=function r(){this._precisionModel=new J,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?z(arguments[0],Ni)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof J&&(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]))},$a={serialVersionUID:{configurable:!0}};j.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new v(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new v(t.getMinX(),t.getMinY()),new v(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new v(t.getMinX(),t.getMinY()),new v(t.getMinX(),t.getMaxY()),new v(t.getMaxX(),t.getMaxY()),new v(t.getMaxX(),t.getMinY()),new v(t.getMinX(),t.getMinY())]),null)},j.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new dt(this.getCoordinateSequenceFactory().create(t),this);if(z(t,Q))return new dt(t,this)}else return new dt(this.getCoordinateSequenceFactory().create([]),this)},j.prototype.createMultiLineString=function(){if(arguments.length===0)return new Fr(null,this);if(arguments.length===1){var t=arguments[0];return new Fr(t,this)}},j.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,o=t.iterator();o.hasNext();){var s=o.next(),a=s.getClass();e===null&&(e=a),a!==e&&(n=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(e===null)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(j.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Pt)return this.createMultiPolygon(j.toPolygonArray(t));if(u instanceof dt)return this.createMultiLineString(j.toLineStringArray(t));if(u instanceof ve)return this.createMultiPoint(j.toPointArray(t));q.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},j.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},j.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof v){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(z(arguments[0],Q)){var e=arguments[0];return new ve(e,this)}}},j.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},j.prototype.createPolygon=function(){if(arguments.length===0)return new Pt(null,null,this);if(arguments.length===1){if(z(arguments[0],Q)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof bn){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Pt(i,o,this)}},j.prototype.getSRID=function(){return this._SRID},j.prototype.createGeometryCollection=function(){if(arguments.length===0)return new te(null,this);if(arguments.length===1){var t=arguments[0];return new te(t,this)}},j.prototype.createGeometry=function(t){var e=new Be(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},j.prototype.getPrecisionModel=function(){return this._precisionModel},j.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(z(arguments[0],Q)){var e=arguments[0];return new bn(e,this)}}},j.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Pn(null,this);if(arguments.length===1){var t=arguments[0];return new Pn(t,this)}},j.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Di(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Di(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(z(arguments[0],Q)){var i=arguments[0];if(i===null)return this.createMultiPoint(new Array(0).fill(null));for(var o=new Array(i.size()).fill(null),s=0;s<i.size();s++){var a=t.getCoordinateSequenceFactory().create(1,i.getDimension());Et.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},j.prototype.interfaces_=function(){return[Me]},j.prototype.getClass=function(){return j},j.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},j.getDefaultCoordinateSequenceFactory=function(){return Rn.instance()},j.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},j.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},$a.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(j,$a);var Ac=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Xo=function(t){this.geometryFactory=t||new j};Xo.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!pn[n])throw new Error("Unknown GeoJSON type: "+e.type);return Ac.indexOf(n)!==-1?pn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?pn[n].apply(this,[e.geometries]):pn[n].apply(this,[e])},Xo.prototype.write=function(t){var e=t.getGeometryType();if(!Kn[e])throw new Error("Geometry is not supported");return Kn[e].apply(this,[t])};var pn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!pn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=pn.bbox.apply(this,[r.bbox])),t},FeatureCollection:function(r){var t=this,e={};if(r.features){e.features=[];for(var n=0;n<r.features.length;++n)e.features.push(t.read(r.features[n]))}return r.bbox&&(e.bbox=this.parse.bbox.apply(this,[r.bbox])),e},coordinates:function(r){for(var t=[],e=0;e<r.length;++e){var n=r[e];t.push(new v(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new v(r[0],r[1]),new v(r[2],r[1]),new v(r[2],r[3]),new v(r[0],r[3]),new v(r[0],r[1])])},Point:function(r){var t=new v(r[0],r[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(pn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=pn.coordinates.apply(this,[r]);return this.geometryFactory.createLineString(t)},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r.length;++n)e.push(pn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=pn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var s=r[o],a=pn.coordinates.apply(t,[s]),u=t.geometryFactory.createLinearRing(a);i.push(u)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(pn.Polygon.apply(t,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r.length;++n){var i=r[n];e.push(t.read(i))}return this.geometryFactory.createGeometryCollection(e)}},Kn={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Kn.coordinate.apply(this,[r.getCoordinate()]);return{type:"Point",coordinates:t}},MultiPoint:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.Point.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(r){for(var t=this,e=[],n=r.getCoordinates(),i=0;i<n.length;++i){var o=n[i];e.push(Kn.coordinate.apply(t,[o]))}return{type:"LineString",coordinates:e}},MultiLineString:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Kn.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],s=Kn.LineString.apply(t,[o]);e.push(s.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=Kn.Polygon.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(r){for(var t=this,e=[],n=0;n<r._geometries.length;++n){var i=r._geometries[n],o=i.getGeometryType();e.push(Kn[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Fs=function(t){this.geometryFactory=t||new j,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Xo(this.geometryFactory)};Fs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===J.FIXED&&this.reducePrecision(e),e},Fs.prototype.reducePrecision=function(t){var e=this,n,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(n=0,i=t.points.length;n<i;n++)e.precisionModel.makePrecise(t.points[n]);else if(t.geometries)for(n=0,i=t.geometries.length;n<i;n++)e.reducePrecision(t.geometries[n])};var tu=function(){this.parser=new Xo(this.geometryFactory)};tu.prototype.write=function(t){return this.parser.write(t)};var b=function(){},Yo={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};b.prototype.interfaces_=function(){return[]},b.prototype.getClass=function(){return b},b.opposite=function(t){return t===b.LEFT?b.RIGHT:t===b.RIGHT?b.LEFT:t},Yo.ON.get=function(){return 0},Yo.LEFT.get=function(){return 1},Yo.RIGHT.get=function(){return 2},Object.defineProperties(b,Yo);function Wo(r){this.message=r||""}Wo.prototype=new Error,Wo.prototype.name="EmptyStackException";function dn(){this.array_=[]}dn.prototype=new Xe,dn.prototype.add=function(r){return this.array_.push(r),!0},dn.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},dn.prototype.push=function(r){return this.array_.push(r),r},dn.prototype.pop=function(r){if(this.array_.length===0)throw new Wo;return this.array_.pop()},dn.prototype.peek=function(){if(this.array_.length===0)throw new Wo;return this.array_[this.array_.length-1]},dn.prototype.empty=function(){return this.array_.length===0},dn.prototype.isEmpty=function(){return this.empty()},dn.prototype.search=function(r){return this.array_.indexOf(r)},dn.prototype.size=function(){return this.array_.length},dn.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t};var vn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};vn.prototype.getCoordinate=function(){return this._minCoord},vn.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},vn.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();q.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],i=M.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===M.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===M.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},vn.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length||i[e].y===i[e+1].y)return-1;var o=b.LEFT;return i[e].y<i[e+1].y&&(o=b.RIGHT),o},vn.prototype.getEdge=function(){return this._orientedDe},vn.prototype.checkForRightmostCoordinate=function(t){for(var e=this,n=t.getEdge().getCoordinates(),i=0;i<n.length-1;i++)(e._minCoord===null||n[i].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=i,e._minCoord=n[i])},vn.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},vn.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();i.isForward()&&e.checkForRightmostCoordinate(i)}q.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 o=this.getRightmostSide(this._minDe,this._minIndex);o===b.LEFT&&(this._orientedDe=this._minDe.getSym())},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var Qn=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new v(n):null,this.name="TopologyException"}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,i){return i?n:n+" [ "+i+" ]"},t}(Xn),Ho=function(){this.array_=[]};Ho.prototype.addLast=function(t){this.array_.push(t)},Ho.prototype.removeFirst=function(){return this.array_.shift()},Ho.prototype.isEmpty=function(){return this.array_.length===0};var ee=function(){this._finder=null,this._dirEdgeList=new O,this._nodes=new O,this._rightMostCoord=null,this._env=null,this._finder=new vn};ee.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},ee.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},ee.prototype.computeNodeDepth=function(t){for(var e=this,n=null,i=t.getEdges().iterator();i.hasNext();){var o=i.next();if(o.isVisited()||o.getSym().isVisited()){n=o;break}}if(n===null)throw new Qn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var s=t.getEdges().iterator();s.hasNext();){var a=s.next();a.setVisited(!0),e.copySymDepths(a)}},ee.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(b.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},ee.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},ee.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(b.RIGHT)>=1&&e.getDepth(b.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},ee.prototype.computeDepths=function(t){var e=this,n=new Rs,i=new Ho,o=t.getNode();for(i.addLast(o),n.add(o),t.setVisited(!0);!i.isEmpty();){var s=i.removeFirst();n.add(s),e.computeNodeDepth(s);for(var a=s.getEdges().iterator();a.hasNext();){var u=a.next(),l=u.getSym();if(!l.isVisited()){var c=l.getNode();n.contains(c)||(i.addLast(c),n.add(c))}}}},ee.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},ee.prototype.getEnvelope=function(){if(this._env===null){for(var t=new k,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),o=0;o<i.length-1;o++)t.expandToInclude(i[o]);this._env=t}return this._env},ee.prototype.addReachable=function(t){var e=this,n=new dn;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},ee.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(b.LEFT,t.getDepth(b.RIGHT)),e.setDepth(b.RIGHT,t.getDepth(b.LEFT))},ee.prototype.add=function(t,e){var n=this;t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();n._dirEdgeList.add(o);var s=o.getSym(),a=s.getNode();a.isVisited()||e.push(a)}},ee.prototype.getNodes=function(){return this._nodes},ee.prototype.getDirectedEdges=function(){return this._dirEdgeList},ee.prototype.interfaces_=function(){return[De]},ee.prototype.getClass=function(){return ee};var st=function r(){var t=this;if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[b.ON]=n}else if(arguments[0]instanceof r){var i=arguments[0];if(this.init(i.location.length),i!==null)for(var o=0;o<this.location.length;o++)t.location[o]=i.location[o]}}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];this.init(3),this.location[b.ON]=s,this.location[b.LEFT]=a,this.location[b.RIGHT]=u}};st.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},st.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0},st.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===_.NONE&&(e.location[n]=t)},st.prototype.isLine=function(){return this.location.length===1},st.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[b.ON]=this.location[b.ON],n[b.LEFT]=_.NONE,n[b.RIGHT]=_.NONE,this.location=n}for(var i=0;i<this.location.length;i++)e.location[i]===_.NONE&&i<t.location.length&&(e.location[i]=t.location[i])},st.prototype.getLocations=function(){return this.location},st.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[b.LEFT];this.location[b.LEFT]=this.location[b.RIGHT],this.location[b.RIGHT]=t},st.prototype.toString=function(){var t=new an;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[b.LEFT])),t.append(_.toLocationSymbol(this.location[b.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[b.RIGHT])),t.toString()},st.prototype.setLocations=function(t,e,n){this.location[b.ON]=t,this.location[b.LEFT]=e,this.location[b.RIGHT]=n},st.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE},st.prototype.isArea=function(){return this.location.length>1},st.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1},st.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(b.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},st.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)},st.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},st.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st};var et=function r(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new st(t),this.elt[1]=new st(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new st(e.elt[0]),this.elt[1]=new st(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new st(_.NONE),this.elt[1]=new st(_.NONE),this.elt[n].setLocation(i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new st(o,s,a),this.elt[1]=new st(o,s,a)}else if(arguments.length===4){var u=arguments[0],l=arguments[1],c=arguments[2],f=arguments[3];this.elt[0]=new st(_.NONE,_.NONE,_.NONE),this.elt[1]=new st(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,f)}};et.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},et.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},et.prototype.isNull=function(t){return this.elt[t].isNull()},et.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},et.prototype.isLine=function(t){return this.elt[t].isLine()},et.prototype.merge=function(t){for(var e=this,n=0;n<2;n++)e.elt[n]===null&&t.elt[n]!==null?e.elt[n]=new st(t.elt[n]):e.elt[n].merge(t.elt[n])},et.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},et.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(b.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},et.prototype.toString=function(){var t=new an;return this.elt[0]!==null&&(t.append("A:"),t.append(this.elt[0].toString())),this.elt[1]!==null&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},et.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var t=arguments[0];return this.elt[t].isArea()}},et.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},et.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(b.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},et.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},et.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},et.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new st(this.elt[t].location[0]))},et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.toLineLabel=function(t){for(var e=new et(_.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var St=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new O,this._pts=new O,this._label=new et(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new O,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};St.prototype.computeRing=function(){var t=this;if(this._ring!==null)return null;for(var e=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)e[n]=t._pts.get(n);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=M.isCCW(this._ring.getCoordinates())},St.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},St.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Qn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Qn("Directed Edge visited twice during ring-building at "+n.getCoordinate());e._edges.add(n);var o=n.getLabel();q.isTrue(o.isArea()),e.mergeLabel(o),e.addPoints(n.getEdge(),n.isForward(),i),i=!1,e.setEdgeRing(n,e),n=e.getNext(n)}while(n!==this._startDe)},St.prototype.getLinearRing=function(){return this._ring},St.prototype.getCoordinate=function(t){return this._pts.get(t)},St.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var n=e.getNode(),i=n.getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},St.prototype.addPoints=function(t,e,n){var i=this,o=t.getCoordinates();if(e){var s=1;n&&(s=0);for(var a=s;a<o.length;a++)i._pts.add(o[a])}else{var u=o.length-2;n&&(u=o.length-1);for(var l=u;l>=0;l--)i._pts.add(o[l])}},St.prototype.isHole=function(){return this._isHole},St.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},St.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!M.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){var o=i.next();if(o.containsPoint(t))return!1}return!0},St.prototype.addHole=function(t){this._holes.add(t)},St.prototype.isShell=function(){return this._shell===null},St.prototype.getLabel=function(){return this._label},St.prototype.getEdges=function(){return this._edges},St.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},St.prototype.getShell=function(){return this._shell},St.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=e.getLocation(n,b.RIGHT);if(i===_.NONE)return null;if(this._label.getLocation(n)===_.NONE)return this._label.setLocation(n,i),null}},St.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},St.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)n[i]=e._holes.get(i).getLinearRing();var o=t.createPolygon(this.getLinearRing(),n);return o},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St};var Fc=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,i){n.setMinEdgeRing(i)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(St),kc=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var n=this,i=new O,o=this._startDe;do{if(o.getMinEdgeRing()===null){var s=new Fc(o,n._geometryFactory);i.add(s)}o=o.getNext()}while(o!==this._startDe);return i},t.prototype.setEdgeRing=function(n,i){n.setEdgeRing(i)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this,i=this._startDe;do{var o=i.getNode();o.getEdges().linkMinimalDirectedEdges(n),i=i.getNext()}while(i!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(St),xe=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 t=arguments[0];this._label=t}}};xe.prototype.setVisited=function(t){this._isVisited=t},xe.prototype.setInResult=function(t){this._isInResult=t},xe.prototype.isCovered=function(){return this._isCovered},xe.prototype.isCoveredSet=function(){return this._isCoveredSet},xe.prototype.setLabel=function(t){this._label=t},xe.prototype.getLabel=function(){return this._label},xe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},xe.prototype.updateIM=function(t){q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},xe.prototype.isInResult=function(){return this._isInResult},xe.prototype.isVisited=function(){return this._isVisited},xe.prototype.interfaces_=function(){return[]},xe.prototype.getClass=function(){return xe};var jo=function(r){function t(){r.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new et(0,_.NONE)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdge().isInResult())return!0}return!1},t.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(n){},t.prototype.computeMergedLocation=function(n,i){var o=_.NONE;if(o=this._label.getLocation(i),!n.isNull(i)){var s=n.getLocation(i);o!==_.BOUNDARY&&(o=s)}return o},t.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this._label===null?this._label=new et(n,i):this._label.setLocation(n,i)}else return r.prototype.setLabel.apply(this,arguments)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof t){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof et)for(var o=arguments[0],s=0;s<2;s++){var a=n.computeMergedLocation(o,s),u=n._label.getLocation(s);u===_.NONE&&n._label.setLocation(s,a)}},t.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},t.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var i=_.NONE;this._label!==null&&(i=this._label.getLocation(n));var o=null;switch(i){case _.BOUNDARY:o=_.INTERIOR;break;case _.INTERIOR:o=_.BOUNDARY;break;default:o=_.BOUNDARY;break}this._label.setLocation(n,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(xe),yn=function(){this.nodeMap=new jt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};yn.prototype.find=function(t){return this.nodeMap.get(t)},yn.prototype.addNode=function(){if(arguments[0]instanceof v){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof jo){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},yn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},yn.prototype.iterator=function(){return this.nodeMap.values().iterator()},yn.prototype.values=function(){return this.nodeMap.values()},yn.prototype.getBoundaryNodes=function(t){for(var e=new O,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===_.BOUNDARY&&e.add(i)}return e},yn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var rt=function(){},po={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.isNorthern=function(t){return t===rt.NE||t===rt.NW},rt.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2},rt.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var i=t<e?t:e,o=t>e?t:e;return i===0&&o===3?3:i},rt.isInHalfPlane=function(t,e){return e===rt.SE?t===rt.SE||t===rt.SW:t===e||t===e+1},rt.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ct("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?rt.NE:rt.SE:e>=0?rt.NW:rt.SW}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new ct("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?rt.NE:rt.SE:i.y>=n.y?rt.NW:rt.SW}},po.NE.get=function(){return 0},po.NW.get=function(){return 1},po.SW.get=function(){return 2},po.SE.get=function(){return 3},Object.defineProperties(rt,po);var Kt=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 t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=null;this._edge=e,this.init(n,i),this._label=o}else if(arguments.length===4){var s=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this._edge=s,this.init(a,u),this._label=l}};Kt.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:M.computeOrientation(t._p0,t._p1,this._p1)},Kt.prototype.getDy=function(){return this._dy},Kt.prototype.getCoordinate=function(){return this._p0},Kt.prototype.setNode=function(t){this._node=t},Kt.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),o=n.substring(i+1);t.print(" "+o+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Kt.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Kt.prototype.getDirectedCoordinate=function(){return this._p1},Kt.prototype.getDx=function(){return this._dx},Kt.prototype.getLabel=function(){return this._label},Kt.prototype.getEdge=function(){return this._edge},Kt.prototype.getQuadrant=function(){return this._quadrant},Kt.prototype.getNode=function(){return this._node},Kt.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);return" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Kt.prototype.computeLabel=function(t){},Kt.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=rt.quadrant(this._dx,this._dy),q.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Kt.prototype.interfaces_=function(){return[De]},Kt.prototype.getClass=function(){return Kt};var ks=function(r){function t(){var e=arguments[0],n=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new et(this._edge.getLabel()),this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,i){if(this._depth[n]!==-999&&this._depth[n]!==i)throw new Qn("assigned depths do not match",this.getCoordinate());this._depth[n]=i},t.prototype.isInteriorAreaEdge=function(){for(var n=this,i=!0,o=0;o<2;o++)n._label.isArea(o)&&n._label.getLocation(o,b.LEFT)===_.INTERIOR&&n._label.getLocation(o,b.RIGHT)===_.INTERIOR||(i=!1);return i},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(n){r.prototype.print.call(this,n),n.print(" "+this._depth[b.LEFT]+"/"+this._depth[b.RIGHT]),n.print(" ("+this.getDepthDelta()+")"),this._isInResult&&n.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),i=!this._label.isArea(0)||this._label.allPositionsEqual(0,_.EXTERIOR),o=!this._label.isArea(1)||this._label.allPositionsEqual(1,_.EXTERIOR);return n&&i&&o},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n),n.print(" "),this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n),this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,i){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var s=1;n===b.LEFT&&(s=-1);var a=b.opposite(n),u=o*s,l=i+u;this.setDepth(n,i),this.setDepth(a,l)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,i){return n===_.EXTERIOR&&i===_.INTERIOR?1:n===_.INTERIOR&&i===_.EXTERIOR?-1:0},t}(Kt),Mi=function(){};Mi.prototype.createNode=function(t){return new jo(t,null)},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var pt=function(){if(this._edges=new O,this._nodes=null,this._edgeEndList=new O,arguments.length===0)this._nodes=new yn(new Mi);else if(arguments.length===1){var t=arguments[0];this._nodes=new yn(t)}};pt.prototype.printEdges=function(t){var e=this;t.println("Edges:");for(var n=0;n<this._edges.size();n++){t.println("edge "+n+":");var i=e._edges.get(n);i.print(t),i.eiList.print(t)}},pt.prototype.find=function(t){return this._nodes.find(t)},pt.prototype.addNode=function(){if(arguments[0]instanceof jo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof v){var e=arguments[0];return this._nodes.addNode(e)}},pt.prototype.getNodeIterator=function(){return this._nodes.iterator()},pt.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},pt.prototype.debugPrintln=function(t){Gt.out.println(t)},pt.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(n===null)return!1;var i=n.getLabel();return i!==null&&i.getLocation(t)===_.BOUNDARY},pt.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},pt.prototype.matchInSameDirection=function(t,e,n,i){return t.equals(n)?M.computeOrientation(t,e,i)===M.COLLINEAR&&rt.quadrant(t,e)===rt.quadrant(n,i):!1},pt.prototype.getEdgeEnds=function(){return this._edgeEndList},pt.prototype.debugPrint=function(t){Gt.out.print(t)},pt.prototype.getEdgeIterator=function(){return this._edges.iterator()},pt.prototype.findEdgeInSameDirection=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(n.matchInSameDirection(t,e,s[0],s[1])||n.matchInSameDirection(t,e,s[s.length-1],s[s.length-2]))return o}return null},pt.prototype.insertEdge=function(t){this._edges.add(t)},pt.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},pt.prototype.addEdges=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next();e._edges.add(i);var o=new ks(i,!0),s=new ks(i,!1);o.setSym(s),s.setSym(o),e.add(o),e.add(s)}},pt.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},pt.prototype.getNodes=function(){return this._nodes.values()},pt.prototype.findEdge=function(t,e){for(var n=this,i=0;i<this._edges.size();i++){var o=n._edges.get(i),s=o.getCoordinates();if(t.equals(s[0])&&e.equals(s[1]))return o}return null},pt.prototype.interfaces_=function(){return[]},pt.prototype.getClass=function(){return pt},pt.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}};var ye=function(){this._geometryFactory=null,this._shellList=new O;var t=arguments[0];this._geometryFactory=t};ye.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var o=i.next();o.isHole()?n.add(o):e.add(o)}},ye.prototype.computePolygons=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);n.add(s)}return n},ye.prototype.placeFreeHoles=function(t,e){for(var n=this,i=e.iterator();i.hasNext();){var o=i.next();if(o.getShell()===null){var s=n.findEdgeRingContaining(o,t);if(s===null)throw new Qn("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new O,s=t.iterator();s.hasNext();){var a=s.next();if(a.getMaxNodeDegree()>2){a.linkDirectedEdgesForMinimalEdgeRings();var u=a.buildMinimalRings(),l=i.findShell(u);l!==null?(i.placePolygonHoles(l,u),e.add(l)):n.addAll(u)}else o.add(a)}return o},ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},ye.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new kc(o,e._geometryFactory);n.add(s),s.setInResult()}}return n},ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},ye.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),o=n.getCoordinateN(0),s=null,a=null,u=e.iterator();u.hasNext();){var l=u.next(),c=l.getLinearRing(),f=c.getEnvelopeInternal();s!==null&&(a=s.getLinearRing().getEnvelopeInternal());var h=!1;f.contains(i)&&M.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},ye.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var o=i.next();o.isHole()||(n=o,e++)}return q.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},ye.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];pt.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),o=new O,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye};var Ai=function(){};Ai.prototype.getBounds=function(){},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Ai,Me]},He.prototype.getClass=function(){return He};var Zn=function(){this._size=null,this._items=null,this._size=0,this._items=new O,this._items.add(null)};Zn.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Zn.prototype.size=function(){return this._size},Zn.prototype.reorder=function(t){for(var e=this,n=null,i=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(i)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,i)},Zn.prototype.clear=function(){this._size=0,this._items.clear()},Zn.prototype.isEmpty=function(){return this._size===0},Zn.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var hr=function(){};hr.prototype.visitItem=function(t){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var ri=function(){};ri.prototype.insert=function(t,e){},ri.prototype.remove=function(t,e){},ri.prototype.query=function(){},ri.prototype.interfaces_=function(){return[]},ri.prototype.getClass=function(){return ri};var Rt=function(){if(this._childBoundables=new O,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},eu={serialVersionUID:{configurable:!0}};Rt.prototype.getLevel=function(){return this._level},Rt.prototype.size=function(){return this._childBoundables.size()},Rt.prototype.getChildBoundables=function(){return this._childBoundables},Rt.prototype.addChildBoundable=function(t){q.isTrue(this._bounds===null),this._childBoundables.add(t)},Rt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Rt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Rt.prototype.interfaces_=function(){return[Ai,Me]},Rt.prototype.getClass=function(){return Rt},eu.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Rt,eu);var je=function(){};je.reverseOrder=function(){return{compare:function(e,n){return n.compareTo(e)}}},je.min=function(t){return je.sort(t),t.get(0)},je.sort=function(t,e){var n=t.toArray();e?Ar.sort(n,e):Ar.sort(n);for(var i=t.iterator(),o=0,s=n.length;o<s;o++)i.next(),i.set(n[o])},je.singletonList=function(t){var e=new O;return e.add(t),e};var xt=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};xt.prototype.expandToQueue=function(t,e){var n=xt.isComposite(this._boundable1),i=xt.isComposite(this._boundable2);if(n&&i)return xt.area(this._boundable1)>xt.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(i)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new ct("neither boundable is composite")},xt.prototype.isLeaves=function(){return!(xt.isComposite(this._boundable1)||xt.isComposite(this._boundable2))},xt.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},xt.prototype.expand=function(t,e,n,i){for(var o=this,s=t.getChildBoundables(),a=s.iterator();a.hasNext();){var u=a.next(),l=new xt(u,e,o._itemDistance);l.getDistance()<i&&n.add(l)}},xt.prototype.getBoundable=function(t){return t===0?this._boundable1:this._boundable2},xt.prototype.getDistance=function(){return this._distance},xt.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},xt.prototype.interfaces_=function(){return[De]},xt.prototype.getClass=function(){return xt},xt.area=function(t){return t.getBounds().getArea()},xt.isComposite=function(t){return t instanceof Rt};var At=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new O,this._nodeCapacity=null,arguments.length===0){var t=r.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(arguments.length===1){var e=arguments[0];q.isTrue(e>1,"Node capacity must be greater than 1"),this._nodeCapacity=e}},Ko={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};At.prototype.getNodeCapacity=function(){return this._nodeCapacity},At.prototype.lastNode=function(t){return t.get(t.size()-1)},At.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof Rt?n+=t.size(o):o instanceof He&&(n+=1)}return n}},At.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof He&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},At.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new O:e}else if(arguments.length===1){for(var n=arguments[0],i=new O,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof Rt){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof He?i.add(s.getItem()):q.shouldNeverReachHere()}return i.size()<=0?null:i}},At.prototype.insert=function(t,e){q.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},At.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new O;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];if(q.isTrue(i>-2),o.getLevel()===i)return s.add(o),null;for(var a=o.getChildBoundables().iterator();a.hasNext();){var u=a.next();u instanceof Rt?t.boundablesAtLevel(i,u,s):(q.isTrue(u instanceof He),i===-1&&s.add(u))}return null}},At.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new O;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var i=arguments[0],o=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,o)}else if(arguments.length===3){if(z(arguments[2],hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt)for(var s=arguments[0],a=arguments[1],u=arguments[2],l=a.getChildBoundables(),c=0;c<l.size();c++){var f=l.get(c);t.getIntersectsOp().intersects(f.getBounds(),s)&&(f instanceof Rt?t.query(s,f,u):f instanceof He?u.visitItem(f.getItem()):q.shouldNeverReachHere())}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt)for(var h=arguments[0],g=arguments[1],p=arguments[2],y=g.getChildBoundables(),d=0;d<y.size();d++){var m=y.get(d);t.getIntersectsOp().intersects(m.getBounds(),h)&&(m instanceof Rt?t.query(h,m,p):m instanceof He?p.add(m.getItem()):q.shouldNeverReachHere())}}},At.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},At.prototype.getRoot=function(){return this.build(),this._root},At.prototype.remove=function(){var t=this;if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.build(),this.getIntersectsOp().intersects(this._root.getBounds(),e)?this.remove(e,this._root,n):!1}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=this.removeItem(o,s);if(a)return!0;for(var u=null,l=o.getChildBoundables().iterator();l.hasNext();){var c=l.next();if(t.getIntersectsOp().intersects(c.getBounds(),i)&&c instanceof Rt&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},At.prototype.createHigherLevels=function(t,e){q.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return n.size()===1?n.get(0):this.createHigherLevels(n,e+1)},At.prototype.depth=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof Rt){var s=t.depth(o);s>n&&(n=s)}}return n+1}},At.prototype.createParentBoundables=function(t,e){var n=this;q.isTrue(!t.isEmpty());var i=new O;i.add(this.createNode(e));var o=new O(t);je.sort(o,this.getComparator());for(var s=o.iterator();s.hasNext();){var a=s.next();n.lastNode(i).getChildBoundables().size()===n.getNodeCapacity()&&i.add(n.createNode(e)),n.lastNode(i).addChildBoundable(a)}return i},At.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},At.prototype.interfaces_=function(){return[Me]},At.prototype.getClass=function(){return At},At.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Ko.IntersectsOp.get=function(){return Bc},Ko.serialVersionUID.get=function(){return-3886435814360241e3},Ko.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(At,Ko);var Bc=function(){},Fi=function(){};Fi.prototype.distance=function(t,e){},Fi.prototype.interfaces_=function(){return[]},Fi.prototype.getClass=function(){return Fi};var nu=function(r){function t(n){n=n||t.DEFAULT_NODE_CAPACITY,r.call(this,n)}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(i,o){var s=this;q.isTrue(i.length>0);for(var a=new O,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new ru(i)},t.prototype.size=function(){return arguments.length===0?r.prototype.size.call(this):r.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];if(i.isNull())return null;r.prototype.insert.call(this,i,o)}else return r.prototype.insert.apply(this,arguments)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(i,o){for(var s=Math.trunc(Math.ceil(i.size()/o)),a=new Array(o).fill(null),u=i.iterator(),l=0;l<o;l++){a[l]=new O;for(var c=0;u.hasNext()&&c<s;){var f=u.next();a[l].add(f),c++}}return a},t.prototype.query=function(){if(arguments.length===1){var i=arguments[0];return r.prototype.query.call(this,i)}else if(arguments.length===2){var o=arguments[0],s=arguments[1];r.prototype.query.call(this,o,s)}else if(arguments.length===3){if(z(arguments[2],hr)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(z(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Rt){var c=arguments[0],f=arguments[1],h=arguments[2];r.prototype.query.call(this,c,f,h)}}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(i,o){return r.prototype.createParentBoundables.call(this,i,o)},t.prototype.remove=function(){if(arguments.length===2){var i=arguments[0],o=arguments[1];return r.prototype.remove.call(this,i,o)}else return r.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return arguments.length===0?r.prototype.depth.call(this):r.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(i,o){q.isTrue(!i.isEmpty());var s=Math.trunc(Math.ceil(i.size()/this.getNodeCapacity())),a=new O(i);je.sort(a,t.xComparator);var u=this.verticalSlices(a,Math.trunc(Math.ceil(Math.sqrt(s))));return this.createParentBoundablesFromVerticalSlices(u,o)},t.prototype.nearestNeighbour=function(){if(arguments.length===1){if(z(arguments[0],Fi)){var i=arguments[0],o=new xt(this.getRoot(),this.getRoot(),i);return this.nearestNeighbour(o)}else if(arguments[0]instanceof xt){var s=arguments[0];return this.nearestNeighbour(s,V.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof t&&z(arguments[1],Fi)){var a=arguments[0],u=arguments[1],l=new xt(this.getRoot(),a.getRoot(),u);return this.nearestNeighbour(l)}else if(arguments[0]instanceof xt&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=f,g=null,p=new Zn;for(p.add(c);!p.isEmpty()&&h>0;){var y=p.poll(),d=y.getDistance();if(d>=h)break;y.isLeaves()?(h=d,g=y):y.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var m=arguments[0],E=arguments[1],C=arguments[2],L=new He(m,E),N=new xt(this.getRoot(),L,C);return this.nearestNeighbour(N)[0]}},t.prototype.interfaces_=function(){return[ri,Me]},t.prototype.getClass=function(){return t},t.centreX=function(i){return t.avg(i.getMinX(),i.getMaxX())},t.avg=function(i,o){return(i+o)/2},t.centreY=function(i){return t.avg(i.getMinY(),i.getMaxY())},e.STRtreeNode.get=function(){return ru},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[Ci]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[Ci]},compare:function(n,i){return r.compareDoubles(t.centreY(n.getBounds()),t.centreY(i.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[r.IntersectsOp]},intersects:function(n,i){return n.intersects(i)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,e),t}(At),ru=function(r){function t(){var e=arguments[0];r.call(this,e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var n=null,i=this.getChildBoundables().iterator();i.hasNext();){var o=i.next();n===null?n=new k(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Rt),he=function(){};he.prototype.interfaces_=function(){return[]},he.prototype.getClass=function(){return he},he.relativeSign=function(t,e){return t<e?-1:t>e?1:0},he.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=he.relativeSign(e.x,n.x),o=he.relativeSign(e.y,n.y);switch(t){case 0:return he.compareValue(i,o);case 1:return he.compareValue(o,i);case 2:return he.compareValue(o,-i);case 3:return he.compareValue(-i,o);case 4:return he.compareValue(-i,-o);case 5:return he.compareValue(-o,-i);case 6:return he.compareValue(-o,i);case 7:return he.compareValue(i,-o)}return q.shouldNeverReachHere("invalid octant value"),0},he.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var gr=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._segString=t,this.coord=new v(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};gr.prototype.getCoordinate=function(){return this.coord},gr.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},gr.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:he.compare(this._segmentOctant,this.coord,e.coord)},gr.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},gr.prototype.isInterior=function(){return this._isInterior},gr.prototype.interfaces_=function(){return[De]},gr.prototype.getClass=function(){return gr};var ne=function(){this._nodeMap=new jt,this._edge=null;var t=arguments[0];this._edge=t};ne.prototype.getSplitCoordinates=function(){var t=this,e=new so;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next();t.addEdgeCoordinates(i,o,e),i=o}return e.toCoordinateArray()},ne.prototype.addCollapsedNodes=function(){var t=this,e=new O;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var i=n.next().intValue();t.add(t._edge.getCoordinate(i),i)}},ne.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},ne.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n<this._edge.size()-2;n++){var i=e._edge.getCoordinate(n),o=e._edge.getCoordinate(n+2);i.equals2D(o)&&t.add(new un(n+1))}},ne.prototype.addEdgeCoordinates=function(t,e,n){var i=this,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);n.add(new v(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));s&&n.add(new v(e.coord))},ne.prototype.iterator=function(){return this._nodeMap.values().iterator()},ne.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints(),this.addCollapsedNodes();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},ne.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,i===1?(n[0]=t.segmentIndex+1,!0):!1},ne.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=this,n=new Array(1).fill(null),i=this.iterator(),o=i.next();i.hasNext();){var s=i.next(),a=e.findCollapseIndex(o,s,n);a&&t.add(new un(n[0])),o=s}},ne.prototype.getEdge=function(){return this._edge},ne.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ne.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this._edge.getCoordinate(e.segmentIndex),s=e.isInterior()||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return s&&(a[u]=new v(e.coord)),new Ct(a,this._edge.getData())},ne.prototype.add=function(t,e){var n=new gr(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return i!==null?(q.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},ne.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new Xn("bad split edge start point at "+i);var o=t.get(t.size()-1),s=o.getCoordinates(),a=s[s.length-1];if(!a.equals2D(e[e.length-1]))throw new Xn("bad split edge end point at "+a)},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne};var ii=function(){};ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new ct("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}else if(arguments[0]instanceof v&&arguments[1]instanceof v){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new ct("Cannot compute the octant for two identical points "+o);return ii.octant(a,u)}};var On=function(){};On.prototype.getCoordinates=function(){},On.prototype.size=function(){},On.prototype.getCoordinate=function(t){},On.prototype.isClosed=function(){},On.prototype.setData=function(t){},On.prototype.getData=function(){},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On};var vo=function(){};vo.prototype.addIntersection=function(t,e){},vo.prototype.interfaces_=function(){return[On]},vo.prototype.getClass=function(){return vo};var Ct=function(){this._nodeList=new ne(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ct.prototype.getCoordinates=function(){return this._pts},Ct.prototype.size=function(){return this._pts.length},Ct.prototype.getCoordinate=function(t){return this._pts[t]},Ct.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ct.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Ct.prototype.setData=function(t){this._data=t},Ct.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:ii.octant(t,e)},Ct.prototype.getData=function(){return this._data},Ct.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[3],s=new v(n.getIntersection(o));this.addIntersection(s,i)}},Ct.prototype.toString=function(){return qe.toLineString(new It(this._pts))},Ct.prototype.getNodeList=function(){return this._nodeList},Ct.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var o=this._pts[i];t.equals2D(o)&&(n=i)}var s=this._nodeList.add(t,n);return s},Ct.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},Ct.prototype.interfaces_=function(){return[vo]},Ct.prototype.getClass=function(){return Ct},Ct.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new O;return Ct.getNodedSubstrings(t,e),e}else if(arguments.length===2)for(var n=arguments[0],i=arguments[1],o=n.iterator();o.hasNext();){var s=o.next();s.getNodeList().addSplitEdges(i)}};var B=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new v,this.p1=new v;else if(arguments.length===1){var t=arguments[0];this.p0=new v(t.p0),this.p1=new v(t.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var e=arguments[0],n=arguments[1],i=arguments[2],o=arguments[3];this.p0=new v(e,n),this.p1=new v(i,o)}},iu={serialVersionUID:{configurable:!0}};B.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},B.prototype.orientationIndex=function(){if(arguments[0]instanceof B){var t=arguments[0],e=M.orientationIndex(this.p0,this.p1,t.p0),n=M.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof v){var i=arguments[0];return M.orientationIndex(this.p0,this.p1,i)}},B.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},B.prototype.isVertical=function(){return this.p0.x===this.p1.x},B.prototype.equals=function(t){if(!(t instanceof B))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},B.prototype.intersection=function(t){var e=new Dr;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},B.prototype.project=function(){if(arguments[0]instanceof v){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new v(t);var e=this.projectionFactor(t),n=new v;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof B){var i=arguments[0],o=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(o>=1&&s>=1||o<=0&&s<=0)return null;var a=this.project(i.p0);o<0&&(a=this.p0),o>1&&(a=this.p1);var u=this.project(i.p1);return s<0&&(u=this.p0),s>1&&(u=this.p1),new B(a,u)}},B.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},B.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},B.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},B.prototype.distancePerpendicular=function(t){return M.distancePointLinePerpendicular(t,this.p0,this.p1)},B.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},B.prototype.midPoint=function(){return B.midPoint(this.p0,this.p1)},B.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(i<=0)return V.NaN;var o=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return o},B.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),i=V.MAX_VALUE,o=null,s=this.closestPoint(t.p0);i=s.distance(t.p0),n[0]=s,n[1]=t.p0;var a=this.closestPoint(t.p1);o=a.distance(t.p1),o<i&&(i=o,n[0]=a,n[1]=t.p1);var u=t.closestPoint(this.p0);o=u.distance(this.p0),o<i&&(i=o,n[0]=this.p0,n[1]=u);var l=t.closestPoint(this.p1);return o=l.distance(this.p1),o<i&&(i=o,n[0]=this.p1,n[1]=l),n},B.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&e<1)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return n<i?this.p0:this.p1},B.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},B.prototype.getLength=function(){return this.p0.distance(this.p1)},B.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},B.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},B.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},B.prototype.lineIntersection=function(t){try{var e=Ue.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof Si))throw n}finally{}return null},B.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},B.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),o=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,a=Math.sqrt(o*o+s*s),u=0,l=0;if(e!==0){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");u=e*o/a,l=e*s/a}var c=n-l,f=i+u,h=new v(c,f);return h},B.prototype.setCoordinates=function(){if(arguments.length===1){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},B.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||V.isNaN(e))&&(e=1),e},B.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},B.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},B.prototype.distance=function(){if(arguments[0]instanceof B){var t=arguments[0];return M.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof v){var e=arguments[0];return M.distancePointLine(e,this.p0,this.p1)}},B.prototype.pointAlong=function(t){var e=new v;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},B.prototype.hashCode=function(){var t=V.doubleToLongBits(this.p0.x);t^=V.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=V.doubleToLongBits(this.p1.x);n^=V.doubleToLongBits(this.p1.y)*31;var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},B.prototype.interfaces_=function(){return[De,Me]},B.prototype.getClass=function(){return B},B.midPoint=function(t,e){return new v((t.x+e.x)/2,(t.y+e.y)/2)},iu.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(B,iu);var yo=function(){this.tempEnv1=new k,this.tempEnv2=new k,this._overlapSeg1=new B,this._overlapSeg2=new B};yo.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},yo.prototype.interfaces_=function(){return[]},yo.prototype.getClass=function(){return yo};var me=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i};me.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},me.prototype.computeSelect=function(t,e,n,i){var o=this._pts[e],s=this._pts[n];if(i.tempEnv1.init(o,s),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,i),a<n&&this.computeSelect(t,a,n,i)},me.prototype.getCoordinates=function(){for(var t=this,e=new Array(this._end-this._start+1).fill(null),n=0,i=this._start;i<=this._end;i++)e[n++]=t._pts[i];return e},me.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},me.prototype.setId=function(t){this._id=t},me.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},me.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new k(t,e)}return this._env},me.prototype.getEndIndex=function(){return this._end},me.prototype.getStartIndex=function(){return this._start},me.prototype.getContext=function(){return this._context},me.prototype.getId=function(){return this._id},me.prototype.computeOverlapsInternal=function(t,e,n,i,o,s){var a=this._pts[t],u=this._pts[e],l=n._pts[i],c=n._pts[o];if(e-t===1&&o-i===1)return s.overlap(this,t,n,i),null;if(s.tempEnv1.init(a,u),s.tempEnv2.init(l,c),!s.tempEnv1.intersects(s.tempEnv2))return null;var f=Math.trunc((t+e)/2),h=Math.trunc((i+o)/2);t<f&&(i<h&&this.computeOverlapsInternal(t,f,n,i,h,s),h<o&&this.computeOverlapsInternal(t,f,n,h,o,s)),f<e&&(i<h&&this.computeOverlapsInternal(f,e,n,i,h,s),h<o&&this.computeOverlapsInternal(f,e,n,h,o,s))},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new O;n.add(new un(e));do{var i=mn.findChainEnd(t,e);n.add(new un(i)),e=i}while(e<t.length-1);var o=mn.toIntArray(n);return o},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=rt.quadrant(t[n],t[n+1]),o=e+1;o<t.length;){if(!t[o-1].equals2D(t[o])){var s=rt.quadrant(t[o-1],t[o]);if(s!==i)break}o++}return o-1},mn.getChains=function(){if(arguments.length===1){var t=arguments[0];return mn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new O,o=mn.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new me(e,o[s],o[s+1],n);i.add(a)}return i}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var kr=function(){};kr.prototype.computeNodes=function(t){},kr.prototype.getNodedSubstrings=function(){},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr};var mo=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};mo.prototype.setSegmentIntersector=function(t){this._segInt=t},mo.prototype.interfaces_=function(){return[kr]},mo.prototype.getClass=function(){return mo};var Bs=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new O,this._index=new nu,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t;var e={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return Ct.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=mn.getChains(i.getCoordinates(),i),a=s.iterator();a.hasNext();){var u=a.next();u.setId(o._idCounter++),o._index.insert(u.getEnvelope(),u),o._monoChains.add(u)}},t.prototype.computeNodes=function(i){var o=this;this._nodedSegStrings=i;for(var s=i.iterator();s.hasNext();)o.add(s.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var i=this,o=new ou(this._segInt),s=this._monoChains.iterator();s.hasNext();)for(var a=s.next(),u=i._index.query(a.getEnvelope()),l=u.iterator();l.hasNext();){var c=l.next();if(c.getId()>a.getId()&&(a.computeOverlaps(c,o),i._nOverlaps++),i._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.SegmentOverlapAction.get=function(){return ou},Object.defineProperties(t,e),t}(mo),ou=function(r){function t(){r.call(this),this._si=null;var e=arguments[0];this._si=e}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=n.getContext(),u=o.getContext();this._si.processIntersections(a,i,u,s)}else return r.prototype.overlap.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(yo),$=function r(){if(this._quadrantSegments=r.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=r.CAP_ROUND,this._joinStyle=r.JOIN_ROUND,this._mitreLimit=r.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=r.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setQuadrantSegments(t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}}},Jn={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}};$.prototype.getEndCapStyle=function(){return this._endCapStyle},$.prototype.isSingleSided=function(){return this._isSingleSided},$.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=$.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=$.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==$.JOIN_ROUND&&(this._quadrantSegments=$.DEFAULT_QUADRANT_SEGMENTS)},$.prototype.getJoinStyle=function(){return this._joinStyle},$.prototype.setJoinStyle=function(t){this._joinStyle=t},$.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},$.prototype.getSimplifyFactor=function(){return this._simplifyFactor},$.prototype.getQuadrantSegments=function(){return this._quadrantSegments},$.prototype.setEndCapStyle=function(t){this._endCapStyle=t},$.prototype.getMitreLimit=function(){return this._mitreLimit},$.prototype.setMitreLimit=function(t){this._mitreLimit=t},$.prototype.setSingleSided=function(t){this._isSingleSided=t},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Jn.CAP_ROUND.get=function(){return 1},Jn.CAP_FLAT.get=function(){return 2},Jn.CAP_SQUARE.get=function(){return 3},Jn.JOIN_ROUND.get=function(){return 1},Jn.JOIN_MITRE.get=function(){return 2},Jn.JOIN_BEVEL.get=function(){return 3},Jn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Jn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Jn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties($,Jn);var vt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=M.COUNTERCLOCKWISE,this._inputLine=t||null},_o={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};vt.prototype.isDeletable=function(t,e,n,i){var o=this._inputLine[t],s=this._inputLine[e],a=this._inputLine[n];return!this.isConcave(o,s,a)||!this.isShallow(o,s,a,i)?!1:this.isShallowSampled(o,s,t,n,i)},vt.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(n),o=!1;i<this._inputLine.length;){var s=!1;t.isDeletable(e,n,i,t._distanceTol)&&(t._isDeleted[n]=vt.DELETE,s=!0,o=!0),s?e=i:e=n,n=t.findNextNonDeletedIndex(e),i=t.findNextNonDeletedIndex(n)}return o},vt.prototype.isShallowConcavity=function(t,e,n,i){var o=M.computeOrientation(t,e,n),s=o===this._angleOrientation;if(!s)return!1;var a=M.distancePointLine(e,t,n);return a<i},vt.prototype.isShallowSampled=function(t,e,n,i,o){var s=this,a=Math.trunc((i-n)/vt.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var u=n;u<i;u+=a)if(!s.isShallow(t,e,s._inputLine[u],o))return!1;return!0},vt.prototype.isConcave=function(t,e,n){var i=M.computeOrientation(t,e,n),o=i===this._angleOrientation;return o},vt.prototype.simplify=function(t){var e=this;this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=M.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var n=!1;do n=e.deleteShallowConcavities();while(n);return this.collapseLine()},vt.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===vt.DELETE;)e++;return e},vt.prototype.isShallow=function(t,e,n,i){var o=M.distancePointLine(e,t,n);return o<i},vt.prototype.collapseLine=function(){for(var t=this,e=new so,n=0;n<this._inputLine.length;n++)t._isDeleted[n]!==vt.DELETE&&e.add(t._inputLine[n]);return e.toCoordinateArray()},vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.simplify=function(t,e){var n=new vt(t);return n.simplify(e)},_o.INIT.get=function(){return 0},_o.DELETE.get=function(){return 1},_o.KEEP.get=function(){return 1},_o.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(vt,_o);var we=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new O},su={COORDINATE_ARRAY_TYPE:{configurable:!0}};we.prototype.getCoordinates=function(){var t=this._ptList.toArray(we.COORDINATE_ARRAY_TYPE);return t},we.prototype.setPrecisionModel=function(t){this._precisionModel=t},we.prototype.addPt=function(t){var e=new v(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},we.prototype.revere=function(){},we.prototype.addPts=function(t,e){var n=this;if(e)for(var i=0;i<t.length;i++)n.addPt(t[i]);else for(var o=t.length-1;o>=0;o--)n.addPt(t[o])},we.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return n<this._minimimVertexDistance},we.prototype.toString=function(){var t=new j,e=t.createLineString(this.getCoordinates());return e.toString()},we.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new v(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},we.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},we.prototype.interfaces_=function(){return[]},we.prototype.getClass=function(){return we},su.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(we,su);var K=function(){},oi={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};K.prototype.interfaces_=function(){return[]},K.prototype.getClass=function(){return K},K.toDegrees=function(t){return t*180/Math.PI},K.normalize=function(t){for(;t>Math.PI;)t-=K.PI_TIMES_2;for(;t<=-Math.PI;)t+=K.PI_TIMES_2;return t},K.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=n.x-e.x,o=n.y-e.y;return Math.atan2(o,i)}},K.isAcute=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u>0},K.isObtuse=function(t,e,n){var i=t.x-e.x,o=t.y-e.y,s=n.x-e.x,a=n.y-e.y,u=i*s+o*a;return u<0},K.interiorAngle=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return Math.abs(o-i)},K.normalizePositive=function(t){if(t<0){for(;t<0;)t+=K.PI_TIMES_2;t>=K.PI_TIMES_2&&(t=0)}else{for(;t>=K.PI_TIMES_2;)t-=K.PI_TIMES_2;t<0&&(t=0)}return t},K.angleBetween=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n);return K.diff(i,o)},K.diff=function(t,e){var n=null;return t<e?n=e-t:n=t-e,n>Math.PI&&(n=2*Math.PI-n),n},K.toRadians=function(t){return t*Math.PI/180},K.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?K.COUNTERCLOCKWISE:n<0?K.CLOCKWISE:K.NONE},K.angleBetweenOriented=function(t,e,n){var i=K.angle(e,t),o=K.angle(e,n),s=o-i;return s<=-Math.PI?s+K.PI_TIMES_2:s>Math.PI?s-K.PI_TIMES_2:s},oi.PI_TIMES_2.get=function(){return 2*Math.PI},oi.PI_OVER_2.get=function(){return Math.PI/2},oi.PI_OVER_4.get=function(){return Math.PI/4},oi.COUNTERCLOCKWISE.get=function(){return M.COUNTERCLOCKWISE},oi.CLOCKWISE.get=function(){return M.CLOCKWISE},oi.NONE.get=function(){return M.COLLINEAR},Object.defineProperties(K,oi);var lt=function r(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new B,this._seg1=new B,this._offset0=new B,this._offset1=new B,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new Dr,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===$.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Eo={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}};lt.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=M.computeOrientation(this._s0,this._s1,this._s2),i=n===M.CLOCKWISE&&this._side===b.LEFT||n===M.COUNTERCLOCKWISE&&this._side===b.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},lt.prototype.addLineEndCap=function(t,e){var n=new B(t,e),i=new B;this.computeOffsetSegment(n,b.LEFT,this._distance,i);var o=new B;this.computeOffsetSegment(n,b.RIGHT,this._distance,o);var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s);switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,M.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case $.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case $.CAP_SQUARE:var l=new v;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new v(i.p1.x+l.x,i.p1.y+l.y),f=new v(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},lt.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},lt.prototype.addMitreJoin=function(t,e,n,i){var o=!0,s=null;try{s=Ue.intersection(e.p0,e.p1,n.p0,n.p1);var a=i<=0?1:s.distance(t)/Math.abs(i);a>this._bufParams.getMitreLimit()&&(o=!1)}catch(u){if(u instanceof Si)s=new v(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},lt.prototype.addFilletCorner=function(t,e,n,i,o){var s=e.x-t.x,a=e.y-t.y,u=Math.atan2(a,s),l=n.x-t.x,c=n.y-t.y,f=Math.atan2(c,l);i===M.CLOCKWISE?u<=f&&(u+=2*Math.PI):u>=f&&(u-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,u,f,i,o),this._segList.addPt(n)},lt.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*lt.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===$.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===$.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},lt.prototype.createSquare=function(t){this._segList.addPt(new v(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new v(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new v(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},lt.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},lt.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},lt.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},lt.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},lt.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,s=K.angle(o,this._seg0.p0),a=K.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=K.normalize(s+u),c=K.normalize(l+Math.PI),f=i*n,h=f*Math.abs(Math.sin(u)),g=n-h,p=o.x+f*Math.cos(c),y=o.y+f*Math.sin(c),d=new v(p,y),m=new B(o,d),E=m.pointAlongOffset(1,g),C=m.pointAlongOffset(1,-g);this._side===b.LEFT?(this._segList.addPt(E),this._segList.addPt(C)):(this._segList.addPt(C),this._segList.addPt(E))},lt.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===b.LEFT?1:-1,s=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,u=Math.sqrt(s*s+a*a),l=o*n*s/u,c=o*n*a/u;i.p0.x=t.p0.x-c,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-c,i.p1.y=t.p1.y+l},lt.prototype.addFilletArc=function(t,e,n,i,o){var s=this,a=i===M.CLOCKWISE?-1:1,u=Math.abs(e-n),l=Math.trunc(u/this._filletAngleQuantum+.5);if(l<1)return null;for(var c=0,f=u/l,h=c,g=new v;h<u;){var p=e+a*h;g.x=t.x+o*Math.cos(p),g.y=t.y+o*Math.sin(p),s._segList.addPt(g),h+=f}},lt.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*lt.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new v((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var i=new v((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)}},lt.prototype.createCircle=function(t){var e=new v(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},lt.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},lt.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new we,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*lt.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},lt.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===$.JOIN_BEVEL||this._bufParams.getJoinStyle()===$.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,M.CLOCKWISE,this._distance))},lt.prototype.closeRing=function(){this._segList.closeRing()},lt.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return lt},Eo.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},Eo.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},Eo.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Eo.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(lt,Eo);var ge=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};ge.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,i=Math.abs(e),o=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],o):this.computeOffsetCurve(t,n,o);var s=o.getCoordinates();return n&&H.reverse(s),s},ge.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var o=vt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],b.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{n.addSegments(t,!1);var u=vt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],b.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},ge.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===b.RIGHT&&(i=-i);var o=vt.simplify(t,i),s=o.length-1;n.initSideSegments(o[s-1],o[0],e);for(var a=1;a<=s;a++){var u=a!==1;n.addNextSegment(o[a],u)}n.closeRing()},ge.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=vt.simplify(t,n),o=i.length-1;e.initSideSegments(i[0],i[1],b.LEFT);for(var s=2;s<=o;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[o-1],i[o]);var a=vt.simplify(t,-n),u=a.length-1;e.initSideSegments(a[u],a[u-1],b.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},ge.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case $.CAP_ROUND:e.createCircle(t);break;case $.CAP_SQUARE:e.createSquare(t);break}},ge.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var o=e<0;this.computeSingleSidedBufferCurve(t,o,i)}else this.computeLineBufferCurve(t,i);var s=i.getCoordinates();return s},ge.prototype.getBufferParameters=function(){return this._bufParams},ge.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},ge.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return ge.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},ge.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var o=vt.simplify(t,-i),s=o.length-1;n.initSideSegments(o[s],o[s-1],b.LEFT),n.addFirstSegment();for(var a=s-2;a>=0;a--)n.addNextSegment(o[a],!0)}else{var u=vt.simplify(t,i),l=u.length-1;n.initSideSegments(u[0],u[1],b.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},ge.prototype.getSegGen=function(t){return new lt(this._precisionModel,this._bufParams,t)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},ge.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new v(t[n]);return e};var si=function(){this._subgraphs=null,this._seg=new B,this._cga=new M;var t=arguments[0];this._subgraphs=t},au={DepthSegment:{configurable:!0}};si.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new O,i=this._subgraphs.iterator();i.hasNext();){var o=i.next(),s=o.getEnvelope();e.y<s.getMinY()||e.y>s.getMaxY()||t.findStabbedSegments(e,o.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(z(arguments[2],Xe)&&arguments[0]instanceof v&&arguments[1]instanceof ks)for(var a=arguments[0],u=arguments[1],l=arguments[2],c=u.getEdge().getCoordinates(),f=0;f<c.length-1;f++){t._seg.p0=c[f],t._seg.p1=c[f+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse();var h=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(h<a.x)&&!t._seg.isHorizontal()&&!(a.y<t._seg.p0.y||a.y>t._seg.p1.y)&&M.computeOrientation(t._seg.p0,t._seg.p1,a)!==M.RIGHT){var g=u.getDepth(b.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(b.RIGHT));var p=new Br(t._seg,g);l.add(p)}}else if(z(arguments[2],Xe)&&arguments[0]instanceof v&&z(arguments[1],Xe))for(var y=arguments[0],d=arguments[1],m=arguments[2],E=d.iterator();E.hasNext();){var C=E.next();C.isForward()&&t.findStabbedSegments(y,C,m)}}},si.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=je.min(e);return n._leftDepth},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},au.DepthSegment.get=function(){return Br},Object.defineProperties(si,au);var Br=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new B(t),this._leftDepth=e};Br.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)},Br.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},Br.prototype.toString=function(){return this._upwardSeg.toString()},Br.prototype.interfaces_=function(){return[De]},Br.prototype.getClass=function(){return Br};var tt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};tt.prototype.area=function(){return tt.area(this.p0,this.p1,this.p2)},tt.prototype.signedArea=function(){return tt.signedArea(this.p0,this.p1,this.p2)},tt.prototype.interpolateZ=function(t){if(t===null)throw new ct("Supplied point is null.");return tt.interpolateZ(t,this.p0,this.p1,this.p2)},tt.prototype.longestSideLength=function(){return tt.longestSideLength(this.p0,this.p1,this.p2)},tt.prototype.isAcute=function(){return tt.isAcute(this.p0,this.p1,this.p2)},tt.prototype.circumcentre=function(){return tt.circumcentre(this.p0,this.p1,this.p2)},tt.prototype.area3D=function(){return tt.area3D(this.p0,this.p1,this.p2)},tt.prototype.centroid=function(){return tt.centroid(this.p0,this.p1,this.p2)},tt.prototype.inCentre=function(){return tt.inCentre(this.p0,this.p1,this.p2)},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt},tt.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},tt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},tt.det=function(t,e,n,i){return t*i-e*n},tt.interpolateZ=function(t,e,n,i){var o=e.x,s=e.y,a=n.x-o,u=i.x-o,l=n.y-s,c=i.y-s,f=a*c-u*l,h=t.x-o,g=t.y-s,p=(c*h-u*g)/f,y=(-l*h+a*g)/f,d=e.z+p*(n.z-e.z)+y*(i.z-e.z);return d},tt.longestSideLength=function(t,e,n){var i=t.distance(e),o=e.distance(n),s=n.distance(t),a=i;return o>a&&(a=o),s>a&&(a=s),a},tt.isAcute=function(t,e,n){return!(!K.isAcute(t,e,n)||!K.isAcute(e,n,t)||!K.isAcute(n,t,e))},tt.circumcentre=function(t,e,n){var i=n.x,o=n.y,s=t.x-i,a=t.y-o,u=e.x-i,l=e.y-o,c=2*tt.det(s,a,u,l),f=tt.det(a,s*s+a*a,l,u*u+l*l),h=tt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new v(g,p)},tt.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,o=new Ue(t.x+n/2,t.y+i/2,1),s=new Ue(t.x-i+n/2,t.y+n+i/2,1);return new Ue(o,s)},tt.angleBisector=function(t,e,n){var i=e.distance(t),o=e.distance(n),s=i/(i+o),a=n.x-t.x,u=n.y-t.y,l=new v(t.x+s*a,t.y+s*u);return l},tt.area3D=function(t,e,n){var i=e.x-t.x,o=e.y-t.y,s=e.z-t.z,a=n.x-t.x,u=n.y-t.y,l=n.z-t.z,c=o*l-s*u,f=s*a-i*l,h=i*u-o*a,g=c*c+f*f+h*h,p=Math.sqrt(g)/2;return p},tt.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new v(i,o)},tt.inCentre=function(t,e,n){var i=e.distance(n),o=t.distance(n),s=t.distance(e),a=i+o+s,u=(i*t.x+o*e.x+s*n.x)/a,l=(i*t.y+o*e.y+s*n.y)/a;return new v(u,l)};var Ge=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Ge.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)},Ge.prototype.addPolygon=function(t){var e=this,n=this._distance,i=b.LEFT;this._distance<0&&(n=-this._distance,i=b.RIGHT);var o=t.getExteriorRing(),s=H.removeRepeatedPoints(o.getCoordinates());if(this._distance<0&&this.isErodedCompletely(o,this._distance)||this._distance<=0&&s.length<3)return null;this.addPolygonRing(s,n,i,_.EXTERIOR,_.INTERIOR);for(var a=0;a<t.getNumInteriorRing();a++){var u=t.getInteriorRingN(a),l=H.removeRepeatedPoints(u.getCoordinates());e._distance>0&&e.isErodedCompletely(u,-e._distance)||e.addPolygonRing(l,n,b.opposite(i),_.INTERIOR,_.EXTERIOR)}},Ge.prototype.isTriangleErodedCompletely=function(t,e){var n=new tt(t[0],t[1],t[2]),i=n.inCentre(),o=M.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},Ge.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=H.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,_.EXTERIOR,_.INTERIOR)},Ge.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new Ct(t,new et(0,_.BOUNDARY,e,n));this._curveList.add(i)},Ge.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ge.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<bn.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=bn.MINIMUM_VALID_SIZE&&M.isCCW(t)&&(s=o,a=i,n=b.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,s,a)},Ge.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Pt?this.addPolygon(t):t instanceof dt?this.addLineString(t):t instanceof ve?this.addPoint(t):t instanceof Di?this.addCollection(t):t instanceof Fr?this.addCollection(t):t instanceof Pn?this.addCollection(t):t instanceof te&&this.addCollection(t)},Ge.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),o=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>o},Ge.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge};var ki=function(){};ki.prototype.locate=function(t){},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var Tn=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Tn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Tn.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 Oi;var t=this._parent.getGeometryN(this._index++);return t instanceof te?(this._subcollectionIterator=new Tn(t),this._subcollectionIterator.next()):t},Tn.prototype.remove=function(){throw new Error(this.getClass().getName())},Tn.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)},Tn.prototype.interfaces_=function(){return[Ri]},Tn.prototype.getClass=function(){return Tn},Tn.isAtomic=function(t){return!(t instanceof te)};var Le=function(){this._geom=null;var t=arguments[0];this._geom=t};Le.prototype.locate=function(t){return Le.locate(t,this._geom)},Le.prototype.interfaces_=function(){return[ki]},Le.prototype.getClass=function(){return Le},Le.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.isPointInRing(t,e.getCoordinates()):!1},Le.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Le.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Le.isPointInRing(t,o))return!1}return!0},Le.containsPoint=function(t,e){if(e instanceof Pt)return Le.containsPointInPolygon(t,e);if(e instanceof te)for(var n=new Tn(e);n.hasNext();){var i=n.next();if(i!==e&&Le.containsPoint(t,i))return!0}return!1},Le.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Le.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var Qt=function(){this._edgeMap=new jt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};Qt.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return e===0&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Qt.prototype.propagateSideLabels=function(t){for(var e=_.NONE,n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.isArea(t)&&o.getLocation(t,b.LEFT)!==_.NONE&&(e=o.getLocation(t,b.LEFT))}if(e===_.NONE)return null;for(var s=e,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();if(l.getLocation(t,b.ON)===_.NONE&&l.setLocation(t,b.ON,s),l.isArea(t)){var c=l.getLocation(t,b.LEFT),f=l.getLocation(t,b.RIGHT);if(f!==_.NONE){if(f!==s)throw new Qn("side location conflict",u.getCoordinate());c===_.NONE&&q.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else q.isTrue(l.getLocation(t,b.LEFT)===_.NONE,"found single null side"),l.setLocation(t,b.RIGHT,s),l.setLocation(t,b.LEFT,s)}}},Qt.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Qt.prototype.print=function(t){Gt.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Qt.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Qt.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),o=i.getLocation(t,b.LEFT);q.isTrue(o!==_.NONE,"Found unlabelled area edge");for(var s=o,a=this.iterator();a.hasNext();){var u=a.next(),l=u.getLabel();q.isTrue(l.isArea(t),"Found non-area edge");var c=l.getLocation(t,b.LEFT),f=l.getLocation(t,b.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},Qt.prototype.findIndex=function(t){var e=this;this.iterator();for(var n=0;n<this._edgeList.size();n++){var i=e._edgeList.get(n);if(i===t)return n}return-1},Qt.prototype.iterator=function(){return this.getEdges().iterator()},Qt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new O(this._edgeMap.values())),this._edgeList},Qt.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Le.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Qt.prototype.toString=function(){var t=new an;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
24
24
  `);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
25
- `)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},Qt.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===_.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=_.NONE;if(n[f])h=_.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},Qt.prototype.getDegree=function(){return this._edgeMap.size()},Qt.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var kc=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=n._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Qn("no outgoing dirEdge found",this.getCoordinate());q.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var o=n.get(0);if(i===1)return o;var s=n.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return it.isNorthern(a)&&it.isNorthern(u)?o:!it.isNorthern(a)&&!it.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(q.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){Gt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();n.print("out "),o.print(n),n.println(),n.print("in "),o.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new O;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&n._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,n.getLocation(0)),s.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=n._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(b.LEFT),a=i.getDepth(b.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Qn("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var y=n._edgeList.get(p);y.setEdgeDepths(b.RIGHT,g),g=y.getDepth(b.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===n&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(q.isTrue(o!==null,"found null for first outgoing dirEdge"),q.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=_.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=_.INTERIOR;break}if(s.isInResult()){n=_.EXTERIOR;break}}}if(n===_.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===_.INTERIOR):(l.isInResult()&&(a=_.EXTERIOR),c.isInResult()&&(a=_.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new et(_.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===_.INTERIOR||c===_.BOUNDARY)&&i._label.setLocation(l,_.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qt),su=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new Ho(n,new kc)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Di),pr=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};pr.prototype.compareTo=function(t){var e=t,n=pr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},pr.prototype.interfaces_=function(){return[De]},pr.prototype.getClass=function(){return pr},pr.orientation=function(t){return H.increasingDirection(t)===1},pr.compareOriented=function(t,e,n,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,c=i?0:n.length-1;;){var f=t[l].compareTo(n[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var Ke=function(){this._edges=new O,this._ocaMap=new jt};Ke.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},Ke.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Ke.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Ke.prototype.iterator=function(){return this._edges.iterator()},Ke.prototype.getEdges=function(){return this._edges},Ke.prototype.get=function(t){return this._edges.get(t)},Ke.prototype.findEqualEdge=function(t){var e=new pr(t.getCoordinates()),n=this._ocaMap.get(e);return n},Ke.prototype.add=function(t){this._edges.add(t);var e=new pr(t.getCoordinates());this._ocaMap.put(e,t)},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Gr=function(){};Gr.prototype.processIntersections=function(t,e,n,i){},Gr.prototype.isDone=function(){},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr};var be=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};be.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(be.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},be.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},be.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},be.prototype.getLineIntersector=function(){return this._li},be.prototype.hasProperIntersection=function(){return this._hasProper},be.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},be.prototype.hasIntersection=function(){return this._hasIntersection},be.prototype.isDone=function(){return!1},be.prototype.hasInteriorIntersection=function(){return this._hasInterior},be.prototype.interfaces_=function(){return[Gr]},be.prototype.getClass=function(){return be},be.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var yn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new v(t),this.segmentIndex=e,this.dist=n};yn.prototype.getSegmentIndex=function(){return this.segmentIndex},yn.prototype.getCoordinate=function(){return this.coord},yn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},yn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},yn.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},yn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},yn.prototype.getDistance=function(){return this.dist},yn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},yn.prototype.interfaces_=function(){return[De]},yn.prototype.getClass=function(){return yn};var Tn=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};Tn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Tn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Tn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Tn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Tn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return s&&(a[u]=e.coord),new Ko(a,new et(this.edge._label))},Tn.prototype.add=function(t,e,n){var i=new yn(t,e,n),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Tn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn};var zr=function(){};zr.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new O;i.add(new sn(n));do{var o=e.findChainEnd(t,n);i.add(new sn(o)),n=o}while(n<t.length-1);var s=zr.toIntArray(i);return s},zr.prototype.findChainEnd=function(t,e){for(var n=it.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=it.quadrant(t[i-1],t[i]);if(o!==n)break;i++}return i-1},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var $n=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new k,this.env2=new k;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new zr;this.startIndex=e.getChainStartIndices(this.pts)};$n.prototype.getCoordinates=function(){return this.pts},$n.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},$n.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},$n.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var y=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<y&&(u<d&&this.computeIntersectsForChain(o,y,a,u,d,c),d<l&&this.computeIntersectsForChain(o,y,a,d,l,c)),y<s&&(u<d&&this.computeIntersectsForChain(y,s,a,u,d,c),d<l&&this.computeIntersectsForChain(y,s,a,d,l,c))}},$n.prototype.getStartIndexes=function(){return this.startIndex},$n.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)n.computeIntersectsForChain(i,t,o,e)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var zt=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},au={NULL_VALUE:{configurable:!0}};zt.prototype.getDepth=function(t,e){return this._depth[t][e]},zt.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},zt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==zt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===zt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===zt.NULL_VALUE}},zt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>n&&(o=1),t._depth[e][i]=o}}},zt.prototype.getDelta=function(t){return this._depth[t][b.RIGHT]-this._depth[t][b.LEFT]},zt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?_.EXTERIOR:_.INTERIOR},zt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},zt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var o=e.getLocation(n,i);(o===_.EXTERIOR||o===_.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=zt.depthAtLocation(o):t._depth[n][i]+=zt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===_.INTERIOR&&this._depth[s][a]++}},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.depthAtLocation=function(t){return t===_.EXTERIOR?0:t===_.INTERIOR?1:zt.NULL_VALUE},au.NULL_VALUE.get=function(){return-1},Object.defineProperties(zt,au);var Ko=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Tn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,et.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&n.print(","),n.print(i.pts[o].x+" "+i.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(i.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new $n(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new k;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,o,s){var a=new v(n.getIntersection(s)),u=i,l=n.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new on;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(n.pts[o].x+" "+n.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(n.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,o){for(var s=this,a=0;a<n.getIntersectionNum();a++)s.addIntersection(n,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,b.ON),n.getLocation(1,b.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,b.LEFT),n.getLocation(1,b.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,b.RIGHT),n.getLocation(1,b.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(xe),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ke,this._bufParams=t||null};re.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},re.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new et(t.getLabel()),i.flip()),n.merge(i);var o=re.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(re.depthDelta(t.getLabel()))},re.prototype.buildSubgraphs=function(t,e){for(var n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new si(n),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),n.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},re.prototype.createSubgraphs=function(t){for(var e=new O,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var o=new ee;o.create(i),e.add(o)}}return je.sort(e,je.reverseOrder()),e},re.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},re.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new ks,n=new Dr;return n.setPrecisionModel(t),e.setSegmentIntersector(new be(n)),e},re.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ge(n,this._bufParams),o=new Ge(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,n),this._graph=new gt(new su),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new ye(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},re.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Ko(a.getCoordinates(),new et(l));n.insertUniqueEdge(c)}}},re.prototype.setNoder=function(t){this._workingNoder=t},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.depthDelta=function(t){var e=t.getLocation(0,b.LEFT),n=t.getLocation(0,b.RIGHT);return e===_.INTERIOR&&n===_.EXTERIOR?1:e===_.EXTERIOR&&n===_.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new j,n=new O;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());n.add(o)}return e.buildGeometry(n)};var dr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};dr.prototype.rescale=function(){var t=this;if(z(arguments[0],bt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&Gt.out.println(o)}},dr.prototype.scale=function(){var t=this;if(z(arguments[0],bt)){for(var e=arguments[0],n=new O,i=e.iterator();i.hasNext();){var o=i.next();n.add(new Ct(t.scale(o.getCoordinates()),o.getData()))}return n}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new v(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=H.removeRepeatedPoints(a);return l}},dr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},dr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},dr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},dr.prototype.interfaces_=function(){return[kr]},dr.prototype.getClass=function(){return dr};var mn=function(){this._li=new Dr,this._segStrings=null;var t=arguments[0];this._segStrings=t},uu={fact:{configurable:!0}};mn.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new Xn("found endpt/interior pt intersection at index "+c+" :pt "+o)}},mn.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(n,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],y=arguments[3];if(h===p&&g===y)return null;var d=h.getCoordinates()[g],m=h.getCoordinates()[g+1],E=p.getCoordinates()[y],C=p.getCoordinates()[y+1];if(this._li.computeIntersection(d,m,E,C),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,m)||this.hasInteriorIntersection(this._li,E,C)))throw new Xn("found non-noded intersection at "+d+"-"+m+" and "+E+"-"+C)}},mn.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},mn.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},mn.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(n)))return!0}return!1},mn.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Xn("found non-noded collapse at "+mn.fact.createLineString([t,e,n]))},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},uu.fact.get=function(){return new j},Object.defineProperties(mn,uu);var pe=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 t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new ct("Scale factor must be non-zero");e!==1&&(this._pt=new v(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new v,this._p1Scaled=new v),this.initCorners(this._pt)},lu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pe.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return q.isTrue(!(a&&u),"Found bad envelope test"),u},pe.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new v(this._maxx,this._maxy),this._corner[1]=new v(this._minx,this._maxy),this._corner[2]=new v(this._minx,this._miny),this._corner[3]=new v(this._maxx,this._miny)},pe.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},pe.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},pe.prototype.getCoordinate=function(){return this._originalPt},pe.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},pe.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=pe.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new k(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},pe.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},pe.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},pe.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},lu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pe,lu);var Eo=function(){this.tempEnv1=new k,this.selectedSegment=new B};Eo.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Eo.prototype.interfaces_=function(){return[]},Eo.prototype.getClass=function(){return Eo};var ki=function(){this._index=null;var t=arguments[0];this._index=t},cu={HotPixelSnapAction:{configurable:!0}};ki.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new fu(e,n,i);return this._index.query(o,{interfaces_:function(){return[hr]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},cu.HotPixelSnapAction.get=function(){return fu},Object.defineProperties(ki,cu);var fu=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Eo),ai=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new O};ai.prototype.processIntersections=function(t,e,n,i){var o=this;if(t===n&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},ai.prototype.isDone=function(){return!1},ai.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ai.prototype.interfaces_=function(){return[Gr]},ai.prototype.getClass=function(){return ai};var Dn=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Dr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Dn.prototype.checkCorrectness=function(t){var e=Ct.getNodedSubstrings(t),n=new mn(e);try{n.checkValid()}catch(i){if(i instanceof Xa)i.printStackTrace();else throw i}finally{}},Dn.prototype.getNodedSubstrings=function(){return Ct.getNodedSubstrings(this._nodedSegStrings)},Dn.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Dn.prototype.findInteriorIntersections=function(t,e){var n=new ai(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Dn.prototype.computeVertexSnaps=function(){var t=this;if(z(arguments[0],bt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof Ct)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new pe(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},Dn.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ks,this._pointSnapper=new ki(this._noder.getIndex()),this.snapRound(t,this._li)},Dn.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=new pe(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},Dn.prototype.interfaces_=function(){return[kr]},Dn.prototype.getClass=function(){return Dn};var Vt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new $,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},Bi={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Vt.prototype.bufferFixedPrecision=function(t){var e=new dr(new Dn(new J(1)),t.getScale()),n=new re(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Vt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Vt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Qn)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Vt.precisionScaleFactor(this._argGeom,this._distance,n),o=new J(i);this.bufferFixedPrecision(o)}},Vt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===J.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Vt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Vt.prototype.bufferOriginalPrecision=function(){try{var t=new re(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Xn)this._saveException=e;else throw e}finally{}},Vt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Vt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Vt(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Vt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof $&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new Vt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var y=arguments[0],d=arguments[1],m=arguments[2],E=arguments[3],C=new Vt(y);C.setQuadrantSegments(m),C.setEndCapStyle(E);var L=C.getResultGeometry(d);return L}},Vt.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),o=Se.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Bi.CAP_ROUND.get=function(){return $.CAP_ROUND},Bi.CAP_BUTT.get=function(){return $.CAP_FLAT},Bi.CAP_FLAT.get=function(){return $.CAP_FLAT},Bi.CAP_SQUARE.get=function(){return $.CAP_SQUARE},Bi.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Vt,Bi);var ie=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};ie.prototype.getCoordinates=function(){return this._pt},ie.prototype.getCoordinate=function(t){return this._pt[t]},ie.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},ie.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},ie.prototype.getDistance=function(){return this._distance},ie.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var Mn=function(){};Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.computeDistance=function(){if(arguments[2]instanceof ie&&arguments[0]instanceof dt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),o=new B,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof ie&&arguments[0]instanceof Pt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];Mn.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)Mn.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof ie&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof dt)Mn.computeDistance(h,g,p);else if(h instanceof Pt)Mn.computeDistance(h,g,p);else if(h instanceof te)for(var y=h,d=0;d<y.getNumGeometries();d++){var m=y.getGeometryN(d);Mn.computeDistance(m,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof ie&&arguments[0]instanceof B&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2],N=E.closestPoint(C);L.setMinimum(N,C)}};var Vr=function(t){this._maxPtDist=new ie,this._inputGeom=t||null},Bs={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Vr.prototype.computeMaxMidpointDistance=function(t){var e=new vr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vr.prototype.computeMaxVertexDistance=function(t){var e=new ui(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Vr.prototype.getDistancePoints=function(){return this._maxPtDist},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Bs.MaxPointDistanceFilter.get=function(){return ui},Bs.MaxMidpointDistanceFilter.get=function(){return vr},Object.defineProperties(Vr,Bs);var ui=function(t){this._maxPtDist=new ie,this._minPtDist=new ie,this._geom=t||null};ui.prototype.filter=function(t){this._minPtDist.initialize(),Mn.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},ui.prototype.interfaces_=function(){return[wn]},ui.prototype.getClass=function(){return ui};var vr=function(t){this._maxPtDist=new ie,this._minPtDist=new ie,this._geom=t||null};vr.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new v((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),Mn.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},vr.prototype.isDone=function(){return!1},vr.prototype.isGeometryChanged=function(){return!1},vr.prototype.getMaxPointDistance=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[We]},vr.prototype.getClass=function(){return vr};var tr=function(t){this._comps=t||null};tr.prototype.filter=function(t){t instanceof Pt&&this._comps.add(t)},tr.prototype.interfaces_=function(){return[cn]},tr.prototype.getClass=function(){return tr},tr.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return tr.getPolygons(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Pt?n.add(e):e instanceof te&&e.apply(new tr(n)),n}};var Ut=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ln){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof dt&&this._lines.add(t)},Ut.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ut.prototype.interfaces_=function(){return[Yn]},Ut.prototype.getClass=function(){return Ut},Ut.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Ut.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,n))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(z(arguments[0],bt)&&z(arguments[1],bt)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Ut.getLines(o,n)}return n}else if(arguments[0]instanceof G&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new O;return s.apply(new Ut(u,a)),u}else if(arguments[0]instanceof G&&z(arguments[1],bt)){var l=arguments[0],c=arguments[1];return l instanceof dt?c.add(l):l.apply(new Ut(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&z(arguments[0],bt)&&z(arguments[1],bt)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var y=p.next();Ut.getLines(y,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof G&&z(arguments[1],bt)){var d=arguments[0],m=arguments[1],E=arguments[2];return d.apply(new Ut(m,E)),m}}};var Qe=function(){if(this._boundaryRule=Ae.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new ct("Rule must be non-null");this._boundaryRule=t}}};Qe.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof v&&arguments[1]instanceof Pt){var e=arguments[0],n=arguments[1];if(n.isEmpty())return _.EXTERIOR;var i=n.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===_.EXTERIOR)return _.EXTERIOR;if(o===_.BOUNDARY)return _.BOUNDARY;for(var s=0;s<n.getNumInteriorRing();s++){var a=n.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===_.INTERIOR)return _.EXTERIOR;if(u===_.BOUNDARY)return _.BOUNDARY}return _.INTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof dt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return _.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?_.BOUNDARY:M.isOnLine(l,f)?_.INTERIOR:_.EXTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof ve){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?_.INTERIOR:_.EXTERIOR}},Qe.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.locatePointInRing(t,e.getCoordinates()):_.EXTERIOR},Qe.prototype.intersects=function(t,e){return this.locate(t,e)!==_.EXTERIOR},Qe.prototype.updateLocationInfo=function(t){t===_.INTERIOR&&(this._isIn=!0),t===_.BOUNDARY&&this._numBoundaries++},Qe.prototype.computeLocation=function(t,e){var n=this;if(e instanceof ve&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof dt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Pt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fr)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);n.updateLocationInfo(n.locateInternal(t,s))}else if(e instanceof bn)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof te)for(var c=new On(e);c.hasNext();){var f=c.next();f!==e&&n.computeLocation(t,f)}},Qe.prototype.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:e instanceof dt?this.locateInternal(t,e):e instanceof Pt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?_.BOUNDARY:this._numBoundaries>0||this._isIn?_.INTERIOR:_.EXTERIOR)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var oe=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},hu={INSIDE_AREA:{configurable:!0}};oe.prototype.isInsideArea=function(){return this._segIndex===oe.INSIDE_AREA},oe.prototype.getCoordinate=function(){return this._pt},oe.prototype.getGeometryComponent=function(){return this._component},oe.prototype.getSegmentIndex=function(){return this._segIndex},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},hu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(oe,hu);var yr=function(t){this._pts=t||null};yr.prototype.filter=function(t){t instanceof ve&&this._pts.add(t)},yr.prototype.interfaces_=function(){return[cn]},yr.prototype.getClass=function(){return yr},yr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof ve?je.singletonList(t):yr.getPoints(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof ve?n.add(e):e instanceof te&&e.apply(new yr(n)),n}};var li=function(){this._locations=null;var t=arguments[0];this._locations=t};li.prototype.filter=function(t){(t instanceof ve||t instanceof dt||t instanceof Pt)&&this._locations.add(new oe(t,0,t.getCoordinate()))},li.prototype.interfaces_=function(){return[cn]},li.prototype.getClass=function(){return li},li.getLocations=function(t){var e=new O;return t.apply(new li(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Qe,this._minDistanceLocation=null,this._minDistance=V.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=o}};qt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=1-n,s=tr.getPolygons(this._geom[n]);if(s.size()>0){var a=li.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&z(arguments[0],Xe)&&z(arguments[1],Xe)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof oe&&arguments[1]instanceof Pt){var p=arguments[0],y=arguments[1],d=arguments[2],m=p.getCoordinate();if(_.EXTERIOR!==this._ptLocator.locate(m,y))return this._minDistance=0,d[0]=p,d[1]=new oe(y,m),null}}},qt.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),n=Ut.getLines(this._geom[1]),i=yr.getPoints(this._geom[0]),o=yr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},qt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},qt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},qt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},qt.prototype.computeMinDistance=function(){var t=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 dt&&arguments[1]instanceof ve){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=n.getCoordinate(),a=0;a<o.length-1;a++){var u=M.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new B(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new oe(e,a,c),i[1]=new oe(n,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof dt&&arguments[1]instanceof dt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),y=h.getCoordinates(),d=0;d<p.length-1;d++)for(var m=0;m<y.length-1;m++){var E=M.distanceLineLine(p[d],p[d+1],y[m],y[m+1]);if(E<t._minDistance){t._minDistance=E;var C=new B(p[d],p[d+1]),L=new B(y[m],y[m+1]),N=C.closestPoints(L);g[0]=new oe(f,d,N[0]),g[1]=new oe(h,m,N[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new oe(s,0,s.getCoordinate()),n[1]=new oe(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},qt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ct("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},qt.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var n=new qt(t,e);return n.distance()},qt.isWithinDistance=function(t,e,n){var i=new qt(t,e,n);return i.distance()<=n},qt.nearestPoints=function(t,e){var n=new qt(t,e);return n.nearestPoints()};var Zt=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};Zt.prototype.getCoordinates=function(){return this._pt},Zt.prototype.getCoordinate=function(t){return this._pt[t]},Zt.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Zt.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},Zt.prototype.toString=function(){return qe.toLineString(this._pt[0],this._pt[1])},Zt.prototype.getDistance=function(){return this._distance},Zt.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var _n=function(){};_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.computeDistance=function(){if(arguments[2]instanceof Zt&&arguments[0]instanceof dt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new B,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof Pt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];_n.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)_n.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof dt)_n.computeDistance(h,g,p);else if(h instanceof Pt)_n.computeDistance(h,g,p);else if(h instanceof te)for(var y=h,d=0;d<y.getNumGeometries();d++){var m=y.getGeometryN(d);_n.computeDistance(m,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof B&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2],N=E.closestPoint(C);L.setMinimum(N,C)}};var ze=function(){this._g0=null,this._g1=null,this._ptDist=new Zt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Gs={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ze.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ze.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ct("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},ze.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},ze.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ze.prototype.computeOrientedDistance=function(t,e,n){var i=new ci(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new mr(e,this._densifyFrac);t.apply(o),n.setMaximum(o.getMaxPointDistance())}},ze.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ze(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new ze(i,o);return a.setDensifyFraction(s),a.distance()}},Gs.MaxPointDistanceFilter.get=function(){return ci},Gs.MaxDensifiedByFractionDistanceFilter.get=function(){return mr},Object.defineProperties(ze,Gs);var ci=function(){this._maxPtDist=new Zt,this._minPtDist=new Zt,this._euclideanDist=new _n,this._geom=null;var t=arguments[0];this._geom=t};ci.prototype.filter=function(t){this._minPtDist.initialize(),_n.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ci.prototype.getMaxPointDistance=function(){return this._maxPtDist},ci.prototype.interfaces_=function(){return[wn]},ci.prototype.getClass=function(){return ci};var mr=function(){this._maxPtDist=new Zt,this._minPtDist=new Zt,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};mr.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new v(l,c);n._minPtDist.initialize(),_n.computeDistance(n._geom,f,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},mr.prototype.isDone=function(){return!1},mr.prototype.isGeometryChanged=function(){return!1},mr.prototype.getMaxPointDistance=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[We]},mr.prototype.getClass=function(){return mr};var _e=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},zs={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};_e.prototype.checkMaximumDistance=function(t,e,n){var i=new ze(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+qe.toLineString(o[0],o[1])+")"}},_e.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=_e.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),_e.VERBOSE&&Gt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},_e.prototype.checkNegativeValid=function(){if(!(this._input instanceof Pt||this._input instanceof bn||this._input instanceof te))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},_e.prototype.getErrorIndicator=function(){return this._errorIndicator},_e.prototype.checkMinimumDistance=function(t,e,n){var i=new qt(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+qe.toLineString(o[0],o[1])+" )"}},_e.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},_e.prototype.getErrorLocation=function(){return this._errorLocation},_e.prototype.getPolygonLines=function(t){for(var e=new O,n=new Ut(e),i=tr.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(n)}return t.getFactory().buildGeometry(e)},_e.prototype.getErrorMessage=function(){return this._errMsg},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e},zs.VERBOSE.get=function(){return!1},zs.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(_e,zs);var Xt=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Vs={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Xt.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},Xt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Xt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new k(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new k(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Xt.prototype.checkDistance=function(){var t=new _e(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Xt.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Xt.prototype.checkPolygonal=function(){this._result instanceof Pt||this._result instanceof bn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Xt.prototype.getErrorIndicator=function(){return this._errorIndicator},Xt.prototype.getErrorLocation=function(){return this._errorLocation},Xt.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")},Xt.prototype.report=function(t){if(!Xt.VERBOSE)return null;Gt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Xt.prototype.getErrorMessage=function(){return this._errorMsg},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.isValidMsg=function(t,e,n){var i=new Xt(t,e,n);return i.isValid()?null:i.getErrorMessage()},Xt.isValid=function(t,e,n){var i=new Xt(t,e,n);return!!i.isValid()},Vs.VERBOSE.get=function(){return!1},Vs.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Xt,Vs);var En=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};En.prototype.getCoordinates=function(){return this._pts},En.prototype.size=function(){return this._pts.length},En.prototype.getCoordinate=function(t){return this._pts[t]},En.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},En.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ii.octant(this.getCoordinate(t),this.getCoordinate(t+1))},En.prototype.setData=function(t){this._data=t},En.prototype.getData=function(){return this._data},En.prototype.toString=function(){return qe.toLineString(new It(this._pts))},En.prototype.interfaces_=function(){return[Rn]},En.prototype.getClass=function(){return En};var Ft=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new O,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ft.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ft.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ft.prototype.getIntersectionSegments=function(){return this._intSegments},Ft.prototype.count=function(){return this._intersectionCount},Ft.prototype.getIntersections=function(){return this._intersections},Ft.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ft.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ft.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Ft.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ft.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ft.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ft.prototype.interfaces_=function(){return[Gr]},Ft.prototype.getClass=function(){return Ft},Ft.createAllIntersectionsFinder=function(t){var e=new Ft(t);return e.setFindAllIntersections(!0),e},Ft.createAnyIntersectionFinder=function(t){return new Ft(t)},Ft.createIntersectionCounter=function(t){var e=new Ft(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ze=function(){this._li=new Dr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ze.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ze.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ze.prototype.isValid=function(){return this.execute(),this._isValid},Ze.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ze.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ft(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ks;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ze.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ze.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+qe.toLineString(t[0],t[1])+" and "+qe.toLineString(t[2],t[3])},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.computeIntersections=function(t){var e=new Ze(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Ur=function r(){this._nv=null;var t=arguments[0];this._nv=new Ze(r.toSegmentStrings(t))};Ur.prototype.checkValid=function(){this._nv.checkValid()},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.toSegmentStrings=function(t){for(var e=new O,n=t.iterator();n.hasNext();){var i=n.next();e.add(new En(i.getCoordinates(),i))}return e},Ur.checkValid=function(t){var e=new Ur(t);e.checkValid()};var fi=function(t){this._mapOp=t};fi.prototype.map=function(t){for(var e=this,n=new O,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||n.add(o)}return t.getFactory().createGeometryCollection(j.toGeometryArray(n))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.map=function(t,e){var n=new fi(e);return n.map(t)};var In=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new O,this._resultLineList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};In.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},In.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},In.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},In.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&U.isResultOfOp(i,e)&&!o.isCovered()&&(n.add(o),t.setVisitedEdge(!0))},In.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},In.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},In.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},In.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;q.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),U.isResultOfOp(i,e)&&e===U.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In};var hi=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new O;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};hi.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},hi.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===U.INTERSECTION)){var o=i.getLabel();U.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},hi.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var de=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};de.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformPolygon=function(t,e){var n=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof Ln)||o.isEmpty())&&(i=!1);for(var s=new O,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof Ln||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new O;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},de.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},de.prototype.getInputGeometry=function(){return this._inputGeom},de.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.transformCoordinates=function(t,e){return this.copy(t)},de.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.copy=function(t){return t.copy()},de.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transform(t.getGeometryN(o));s!==null&&(n._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(j.toGeometryArray(i)):this._factory.buildGeometry(i)},de.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ve)return this.transformPoint(t,null);if(t instanceof Ti)return this.transformMultiPoint(t,null);if(t instanceof Ln)return this.transformLinearRing(t,null);if(t instanceof dt)return this.transformLineString(t,null);if(t instanceof Fr)return this.transformMultiLineString(t,null);if(t instanceof Pt)return this.transformPolygon(t,null);if(t instanceof bn)return this.transformMultiPolygon(t,null);if(t instanceof te)return this.transformGeometryCollection(t,null);throw new ct("Unknown Geometry subtype: "+t.getClass().getName())},de.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de};var An=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new B,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof dt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};An.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=n.findSnapForVertex(s,e);a!==null&&(t.set(o,new v(a)),o===0&&n._isClosed&&t.set(t.size()-1,new v(a)))}},An.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},An.prototype.snapTo=function(t){var e=new oo(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},An.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=n.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new v(s),!1)}},An.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=V.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(n._seg.p0=e.get(s),n._seg.p1=e.get(s+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,o=s)}return o},An.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Nt=function(t){this._srcGeom=t||null},gu={SNAP_PRECISION_FACTOR:{configurable:!0}};Nt.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new pu(e,n);return i.transform(this._srcGeom)},Nt.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new pu(t,n,!0),o=i.transform(this._srcGeom),s=o;return e&&z(s,fr)&&(s=o.buffer(0)),s},Nt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},Nt.prototype.extractTargetCoordinates=function(t){for(var e=new ln,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},Nt.prototype.computeMinimumSegmentLength=function(t){for(var e=V.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.snap=function(t,e,n){var i=new Array(2).fill(null),o=new Nt(t);i[0]=o.snapTo(e,n);var s=new Nt(e);return i[1]=s.snapTo(i[0],n),i},Nt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Nt.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===J.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Nt.computeOverlaySnapTolerance(o),Nt.computeOverlaySnapTolerance(s))}},Nt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*Nt.SNAP_PRECISION_FACTOR;return i},Nt.snapToSelf=function(t,e,n){var i=new Nt(t);return i.snapToSelf(e,n)},gu.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Nt,gu);var pu=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var o=new An(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var o=n.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(de),se=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};se.prototype.getCommon=function(){return V.longBitsToDouble(this._commonBits)},se.prototype.add=function(t){var e=V.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=se.signExpBits(this._commonBits),this._isFirst=!1,null;var n=se.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=se.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=se.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},se.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=V.longBitsToDouble(t),n=V.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},se.getBit=function(t,e){var n=1<<e;return t&n?1:0},se.signExpBits=function(t){return t>>52},se.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,o=t&i;return o},se.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(se.getBit(t,i)!==se.getBit(e,i))return n;n++}return 52};var _r=function(){this._commonCoord=null,this._ccFilter=new gi},Us={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};_r.prototype.addCommonBits=function(t){var e=new Er(this._commonCoord);t.apply(e),t.geometryChanged()},_r.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new v(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Er(e);return t.apply(n),t.geometryChanged(),t},_r.prototype.getCommonCoordinate=function(){return this._commonCoord},_r.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},Us.CommonCoordinateFilter.get=function(){return gi},Us.Translater.get=function(){return Er},Object.defineProperties(_r,Us);var gi=function(){this._commonBitsX=new se,this._commonBitsY=new se};gi.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},gi.prototype.getCommonCoordinate=function(){return new v(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},gi.prototype.interfaces_=function(){return[wn]},gi.prototype.getClass=function(){return gi};var Er=function(){this.trans=null;var t=arguments[0];this.trans=t};Er.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},Er.prototype.isDone=function(){return!1},Er.prototype.isGeometryChanged=function(){return!0},Er.prototype.interfaces_=function(){return[We]},Er.prototype.getClass=function(){return Er};var kt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};kt.prototype.selfSnap=function(t){var e=new Nt(t),n=e.snapTo(t,this._snapTolerance);return n},kt.prototype.removeCommonBits=function(t){this._cbr=new _r,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},kt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},kt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=U.overlayOp(e[0],e[1],t);return this.prepareResult(n)},kt.prototype.checkValid=function(t){t.isValid()||Gt.out.println("Snapped geometry is invalid")},kt.prototype.computeSnapTolerance=function(){this._snapTolerance=Nt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},kt.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Nt.snap(e[0],e[1],this._snapTolerance);return n},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.overlayOp=function(t,e,n){var i=new kt(t,e);return i.getResultGeometry(n)},kt.union=function(t,e){return kt.overlayOp(t,e,U.UNION)},kt.intersection=function(t,e){return kt.overlayOp(t,e,U.INTERSECTION)},kt.symDifference=function(t,e){return kt.overlayOp(t,e,U.SYMDIFFERENCE)},kt.difference=function(t,e){return kt.overlayOp(t,e,U.DIFFERENCE)};var ae=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ae.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=U.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(n=!0)}catch(s){if(s instanceof Xn)i=s;else throw s}finally{}if(!n)try{e=kt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof Xn?i:s}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,n){var i=new ae(t,e);return i.getResultGeometry(n)},ae.union=function(t,e){return ae.overlayOp(t,e,U.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,U.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,U.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,U.DIFFERENCE)};var Io=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Io.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Ee=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=o}},qs={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ee.prototype.isDelete=function(){return this._eventType===Ee.DELETE},Ee.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ee.prototype.getObject=function(){return this._obj},Ee.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Ee.prototype.getInsertEvent=function(){return this._insertEvent},Ee.prototype.isInsert=function(){return this._eventType===Ee.INSERT},Ee.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Ee.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ee.prototype.interfaces_=function(){return[De]},Ee.prototype.getClass=function(){return Ee},qs.INSERT.get=function(){return 1},qs.DELETE.get=function(){return 2},Object.defineProperties(Ee,qs);var Qo=function(){};Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo};var Yt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Yt.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Yt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Yt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Yt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Yt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Yt.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},Yt.prototype.hasProperIntersection=function(){return this._hasProper},Yt.prototype.hasIntersection=function(){return this._hasIntersection},Yt.prototype.isDone=function(){return this._isDone},Yt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Yt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Yt.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var Bc=function(r){function t(){r.call(this),this.events=new O,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;je.sort(this.events);for(var i=0;i<this.events.size();i++){var o=n.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=n.events.get(o);if(s.isInsert()&&n.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Yt&&z(arguments[0],Xe)&&z(arguments[1],Xe)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&z(arguments[0],Xe)&&arguments[1]instanceof Yt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(n,i){for(var o=this,s=n.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Io(s,u),c=new Ee(i,s.getMinX(u),l);o.events.add(c),o.events.add(new Ee(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(n,i,o,s){for(var a=this,u=o.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();n.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qo),Fn=function(){this._min=V.POSITIVE_INFINITY,this._max=V.NEGATIVE_INFINITY},du={NodeComparator:{configurable:!0}};Fn.prototype.getMin=function(){return this._min},Fn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Fn.prototype.getMax=function(){return this._max},Fn.prototype.toString=function(){return qe.toLineString(new v(this._min,0),new v(this._max,0))},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},du.NodeComparator.get=function(){return Co},Object.defineProperties(Fn,du);var Co=function(){};Co.prototype.compare=function(t,e){var n=t,i=e,o=(n._min+n._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},Co.prototype.interfaces_=function(){return[Ii]},Co.prototype.getClass=function(){return Co};var Gc=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fn),zc=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,o),this._node2!==null&&this._node2.query(n,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Fn),kn=function(){this._leaves=new O,this._root=null,this._level=0};kn.prototype.buildTree=function(){var t=this;je.sort(this._leaves,new Fn.NodeComparator);for(var e=this._leaves,n=null,i=new O;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},kn.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Gc(t,e,n))},kn.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},kn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},kn.prototype.printNode=function(t){Gt.out.println(qe.toLineString(new v(t._min,this._level),new v(t._max,this._level)))},kn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},kn.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),o=n+1<t.size()?t.get(n):null;if(o===null)e.add(i);else{var s=new zc(t.get(n),t.get(n+1));e.add(s)}}},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn};var Gi=function(){this._items=new O};Gi.prototype.visitItem=function(t){this._items.add(t)},Gi.prototype.getItems=function(){return this._items},Gi.prototype.interfaces_=function(){return[hr]},Gi.prototype.getClass=function(){return Gi};var zi=function(){this._index=null;var t=arguments[0];if(!z(t,fr))throw new ct("Argument must be Polygonal");this._index=new qr(t)},Xs={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};zi.prototype.locate=function(t){var e=new un(t),n=new Vi(e);return this._index.query(t.y,t.y,n),e.getLocation()},zi.prototype.interfaces_=function(){return[Fi]},zi.prototype.getClass=function(){return zi},Xs.SegmentVisitor.get=function(){return Vi},Xs.IntervalIndexedGeometry.get=function(){return qr},Object.defineProperties(zi,Xs);var Vi=function(){this._counter=null;var t=arguments[0];this._counter=t};Vi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Vi.prototype.interfaces_=function(){return[hr]},Vi.prototype.getClass=function(){return Vi};var qr=function(){this._index=new kn;var t=arguments[0];this.init(t)};qr.prototype.init=function(t){for(var e=this,n=Ut.getLines(t),i=n.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},qr.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new B(t[n-1],t[n]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},qr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Gi;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var No=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Qa,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Qe,arguments.length===2){var e=arguments[0],n=arguments[1],i=Ae.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=_.NONE;u=s.getLocation(n,b.ON),u===_.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Yt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof Ln||this._parentGeom instanceof Pt||this._parentGeom instanceof bn,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,o){var s=new Yt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof ve){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,_.INTERIOR)}else if(arguments[0]instanceof v){var o=arguments[0];this.insertPoint(this._argIndex,o,_.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),_.EXTERIOR,_.INTERIOR);for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o);i.addPolygonRing(s,_.INTERIOR,_.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],_.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],_.BOUNDARY)},t.prototype.addLineString=function(n){var i=H.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Ko(i,new et(this._argIndex,_.INTERIOR));this._lineEdgeMap.put(n,o),this.insertEdge(o),q.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),o=0,s=n.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,o){if(this.isBoundaryNode(n,i))return null;o===_.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,o)},t.prototype.addPolygonRing=function(n,i,o){if(n.isEmpty())return null;var s=H.removeRepeatedPoints(n.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;M.isCCW(s)&&(a=o,u=i);var l=new Ko(s,new et(this._argIndex,_.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],_.BOUNDARY)},t.prototype.insertPoint=function(n,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new et(n,o):a.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new Bc},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(n),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof bn&&(this._useBoundaryDeterminationRule=!1),n instanceof Pt)this.addPolygon(n);else if(n instanceof dt)this.addLineString(n);else if(n instanceof ve)this.addPoint(n);else if(n instanceof Ti)this.addCollection(n);else if(n instanceof Fr)this.addCollection(n);else if(n instanceof bn)this.addCollection(n);else if(n instanceof te)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,o=0;o<n.getNumGeometries();o++){var s=n.getGeometryN(o);i.add(s)}},t.prototype.locate=function(n){return z(this._parentGeom,fr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new zi(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?_.BOUNDARY:_.INTERIOR},t}(gt),Ui=function(){if(this._li=new Dr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new No(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=Ae.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new No(0,e,i),this._arg[1]=new No(1,n,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new No(0,o,a),this._arg[1]=new No(1,s,a)}};Ui.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ui.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ui.prototype.interfaces_=function(){return[]},Ui.prototype.getClass=function(){return Ui};var Xr=function(){};Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(){if(arguments[0]instanceof G&&z(arguments[1],Xr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new O,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&n.add(o)}return t.getFactory().buildGeometry(n)}else if(z(arguments[0],bt)&&z(arguments[1],Xr.MapOp)){for(var s=arguments[0],a=arguments[1],u=new O,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},Xr.MapOp=function(){};var U=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new Qe,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ke,this._resultPolyList=new O,this._resultLineList=new O,this._resultPointList=new O,this._graph=new gt(new su),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var o=i.getLabel(),s=n.getLabel();i.isPointwiseEqual(n)||(s=new et(n.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,o,s){var a=new O;return a.addAll(n),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(n,a);if(u!==_.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new O,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),n.add(o.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,o=n.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new O;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ur.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var o=new ye(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new In(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(n);var a=new hi(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var o=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(n){for(var i=this,o=this._arg[n].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(n,s.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,b.RIGHT),s.getLocation(1,b.RIGHT),n)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(q.isTrue(!s.isNull(a,b.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,b.LEFT,s.getLocation(a,b.LEFT)),q.isTrue(!s.isNull(a,b.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,b.RIGHT,s.getLocation(a,b.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?n.labelIncompleteNode(o,0):n.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ui);U.overlayOp=function(r,t,e){var n=new U(r,t),i=n.getResultGeometry(e);return i},U.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return U.createEmptyResult(U.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return fi.map(r,{interfaces_:function(){return[Xr.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.INTERSECTION)},U.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return U.createEmptyResult(U.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.SYMDIFFERENCE)},U.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),o=-1;switch(r){case U.INTERSECTION:o=Math.min(n,i);break;case U.UNION:o=Math.max(n,i);break;case U.DIFFERENCE:o=n;break;case U.SYMDIFFERENCE:o=Math.max(n,i);break}return o},U.createEmptyResult=function(r,t,e,n){var i=null;switch(U.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},U.difference=function(r,t){return r.isEmpty()?U.createEmptyResult(U.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.DIFFERENCE))},U.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return U.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===_.BOUNDARY&&(i=_.INTERIOR),o===_.BOUNDARY&&(o=_.INTERIOR),s){case U.INTERSECTION:return i===_.INTERIOR&&o===_.INTERIOR;case U.UNION:return i===_.INTERIOR||o===_.INTERIOR;case U.DIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR;case U.SYMDIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR||i!==_.INTERIOR&&o===_.INTERIOR}return!1}},U.INTERSECTION=1,U.UNION=2,U.DIFFERENCE=3,U.SYMDIFFERENCE=4;var Ir=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Qe,this._seg=new B;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ir.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},Ir.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?_.BOUNDARY:this._ptLocator.locate(t,this._g)},Ir.prototype.extractLinework=function(t){var e=new qi;t.apply(e);var n=e.getLinework(),i=j.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir};var qi=function(){this._linework=null,this._linework=new O};qi.prototype.getLinework=function(){return this._linework},qi.prototype.filter=function(t){var e=this;if(t instanceof Pt){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},qi.prototype.interfaces_=function(){return[cn]},qi.prototype.getClass=function(){return qi};var Yr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Yr.prototype.extractPoints=function(t,e,n){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,n)},Yr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Yr.prototype.getPoints=function(t){for(var e=this,n=new O,i=Ut.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,n)}return n},Yr.prototype.computeOffsetPoints=function(t,e,n,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=n*o/a,l=n*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new v(c-l,f+u);i.add(h)}if(this._doRight){var g=new v(c+l,f-u);i.add(g)}},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Pe=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new Ir(this._geom[0],this._boundaryDistanceTolerance),new Ir(this._geom[1],this._boundaryDistanceTolerance),new Ir(this._geom[2],this._boundaryDistanceTolerance)]},vu={TOLERANCE:{configurable:!0}};Pe.prototype.reportResult=function(t,e,n){Gt.out.println("Overlay result invalid - A:"+_.toLocationSymbol(e[0])+" B:"+_.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+_.toLocationSymbol(e[2]))},Pe.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Pe.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),Pe.hasLocation(this._location,_.BOUNDARY)?!0:this.isValidResult(o,this._location)}},Pe.prototype.addTestPts=function(t){var e=new Yr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pe.prototype.isValidResult=function(t,e){var n=U.isResultOfOp(e[0],e[1],t),i=e[2]===_.INTERIOR,o=!(n^i);return o||this.reportResult(t,e,n),o},Pe.prototype.getInvalidLocation=function(){return this._invalidLocation},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pe.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Nt.computeSizeBasedSnapTolerance(t),Nt.computeSizeBasedSnapTolerance(e))},Pe.isValid=function(t,e,n,i){var o=new Pe(t,e,i);return o.isValid(n)},vu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pe,vu);var Re=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Re.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);n._skipEmpty&&o.isEmpty()||e.add(o)}},Re.prototype.combine=function(){for(var t=this,e=new O,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Re(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Re(Re.createList(n,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Re(Re.createList(s,a,u));return l.combine()}},Re.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Re.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new O;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new O;return a.add(i),a.add(o),a.add(s),a}};var wt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new O)},yu={STRTREE_NODE_CAPACITY:{configurable:!0}};wt.prototype.reduceToGeometries=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=null;z(o,Xe)?s=e.unionTree(o):o instanceof G&&(s=o),n.add(s)}return n},wt.prototype.extractByEnvelope=function(t,e,n){for(var i=new O,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):n.add(s)}return this._geomFactory.buildGeometry(i)},wt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var o=Re.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},wt.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 t=new tu(wt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},wt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var o=wt.getGeometry(e,n);return this.unionSafe(o,null)}else{if(i-n===2)return this.unionSafe(wt.getGeometry(e,n),wt.getGeometry(e,n+1));var s=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},wt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},wt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},wt.prototype.unionActual=function(t,e){return wt.restrictToPolygons(t.union(e))},wt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},wt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new O,o=this.extractByEnvelope(n,t,i),s=this.extractByEnvelope(n,e,i),a=this.unionActual(o,s);i.add(a);var u=Re.combine(i);return u},wt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.restrictToPolygons=function(t){if(z(t,fr))return t;var e=tr.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(j.toPolygonArray(e))},wt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},wt.union=function(t){var e=new wt(t);return e.union()},yu.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(wt,yu);var Zo=function(){};Zo.prototype.interfaces_=function(){return[]},Zo.prototype.getClass=function(){return Zo},Zo.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return U.createEmptyResult(U.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ae.overlayOp(t,e,U.UNION)};function Wr(){return new Jo}function Jo(){this.reset()}Jo.prototype={constructor:Jo,reset:function(){this.s=this.t=0},add:function(r){mu($o,r,this.t),mu(this,$o.s,this.s),this.s?this.t+=$o.t:this.s=$o.t},valueOf:function(){return this.s}};var $o=new Jo;function mu(r,t,e){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}var yt=1e-6,ot=Math.PI,er=ot/2,_u=ot/4,nr=ot*2,Hr=180/ot,Cn=ot/180,ue=Math.abs,Vc=Math.atan,Xi=Math.atan2,Ot=Math.cos,Tt=Math.sin,Yi=Math.sqrt;function Eu(r){return r>1?0:r<-1?ot:Math.acos(r)}function pi(r){return r>1?er:r<-1?-er:Math.asin(r)}function So(){}function ts(r,t){r&&Cu.hasOwnProperty(r.type)&&Cu[r.type](r,t)}var Iu={Feature:function(r,t){ts(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)ts(e[n].geometry,t)}},Cu={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){Ys(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Ys(e[n],t,0)},Polygon:function(r,t){Nu(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Nu(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)ts(e[n],t)}};function Ys(r,t,e){var n=-1,i=r.length-e,o;for(t.lineStart();++n<i;)o=r[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function Nu(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)Ys(r[e],t,1);t.polygonEnd()}function Uc(r,t){r&&Iu.hasOwnProperty(r.type)?Iu[r.type](r,t):ts(r,t)}Wr(),Wr();function Ws(r){return[Xi(r[1],r[0]),pi(r[2])]}function Wi(r){var t=r[0],e=r[1],n=Ot(e);return[n*Ot(t),n*Tt(t),Tt(e)]}function es(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function ns(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function Hs(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function rs(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function js(r){var t=Yi(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}Wr();function Su(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function Ks(r,t){return[r>ot?r-nr:r<-ot?r+nr:r,t]}Ks.invert=Ks;function qc(r,t,e){return(r%=nr)?t||e?Su(wu(r),Lu(t,e)):wu(r):t||e?Lu(t,e):Ks}function xu(r){return function(t,e){return t+=r,[t>ot?t-nr:t<-ot?t+nr:t,e]}}function wu(r){var t=xu(r);return t.invert=xu(-r),t}function Lu(r,t){var e=Ot(r),n=Tt(r),i=Ot(t),o=Tt(t);function s(a,u){var l=Ot(u),c=Ot(a)*l,f=Tt(a)*l,h=Tt(u),g=h*e+c*n;return[Xi(f*i-g*o,c*e-h*n),pi(g*i+f*o)]}return s.invert=function(a,u){var l=Ot(u),c=Ot(a)*l,f=Tt(a)*l,h=Tt(u),g=h*i-f*o;return[Xi(f*i+h*o,c*e+g*n),pi(g*e-c*n)]},s}function Xc(r,t,e,n,i,o){if(e){var s=Ot(t),a=Tt(t),u=n*e;i==null?(i=t+n*nr,o=t-u/2):(i=bu(s,i),o=bu(s,o),(n>0?i<o:i>o)&&(i+=n*nr));for(var l,c=i;n>0?c>o:c<o;c-=u)l=Ws([s,-a*Ot(c),-a*Tt(c)]),r.point(l[0],l[1])}}function bu(r,t){t=Wi(t),t[0]-=r,js(t);var e=Eu(-t[1]);return((-t[2]<0?-e:e)+nr-yt)%nr}function Pu(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:So,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function Yc(r,t,e,n,i,o){var s=r[0],a=r[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(r[0]=s+c*h,r[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function is(r,t){return ue(r[0]-t[0])<yt&&ue(r[1]-t[1])<yt}function os(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function Ru(r,t,e,n,i){var o=[],s=[],a,u;if(r.forEach(function(p){if(!((y=p.length-1)<=0)){var y,d=p[0],m=p[y],E;if(is(d,m)){for(i.lineStart(),a=0;a<y;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(E=new os(d,p,null,!0)),s.push(E.o=new os(d,null,E,!1)),o.push(E=new os(m,p,null,!1)),s.push(E.o=new os(m,null,E,!0))}}),!!o.length){for(s.sort(t),Ou(o),Ou(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else n(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else n(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function Ou(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function Tu(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function Wc(r){return r.length===1&&(r=Hc(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)<0?n=o+1:i=o}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function Hc(r){return function(t,e){return Tu(r(t),e)}}Wc(Tu);function Du(r){for(var t=r.length,e,n=-1,i=0,o,s;++n<t;)i+=r[n].length;for(o=new Array(i);--t>=0;)for(s=r[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var xo=1e9,ss=-xo;function jc(r,t,e,n){function i(l,c){return r<=l&&l<=e&&t<=c&&c<=n}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?r:e,g>1?n:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return ue(l[0]-r)<yt?c>0?0:3:ue(l[0]-e)<yt?c>0?2:1:ue(l[1]-t)<yt?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=Pu(),h,g,p,y,d,m,E,C,L,N,S,T={point:A,lineStart:R,lineEnd:Y,polygonStart:F,polygonEnd:X};function A(W,ut){i(W,ut)&&c.point(W,ut)}function w(){for(var W=0,ut=0,mt=g.length;ut<mt;++ut)for(var Jt=g[ut],le=1,Cr=Jt.length,Gn=Jt[0],Nr,Nn,zn=Gn[0],nt=Gn[1];le<Cr;++le)Nr=zn,Nn=nt,Gn=Jt[le],zn=Gn[0],nt=Gn[1],Nn<=n?nt>n&&(zn-Nr)*(n-Nn)>(nt-Nn)*(r-Nr)&&++W:nt<=n&&(zn-Nr)*(n-Nn)<(nt-Nn)*(r-Nr)&&--W;return W}function F(){c=f,h=[],g=[],S=!0}function X(){var W=w(),ut=S&&W,mt=(h=Du(h)).length;(ut||mt)&&(l.polygonStart(),ut&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),mt&&Ru(h,a,W,o,l),l.polygonEnd()),c=l,h=g=p=null}function R(){T.point=D,g&&g.push(p=[]),N=!0,L=!1,E=C=NaN}function Y(){h&&(D(y,d),m&&L&&f.rejoin(),h.push(f.result())),T.point=A,L&&c.lineEnd()}function D(W,ut){var mt=i(W,ut);if(g&&p.push([W,ut]),N)y=W,d=ut,m=mt,N=!1,mt&&(c.lineStart(),c.point(W,ut));else if(mt&&L)c.point(W,ut);else{var Jt=[E=Math.max(ss,Math.min(xo,E)),C=Math.max(ss,Math.min(xo,C))],le=[W=Math.max(ss,Math.min(xo,W)),ut=Math.max(ss,Math.min(xo,ut))];Yc(Jt,le,r,t,e,n)?(L||(c.lineStart(),c.point(Jt[0],Jt[1])),c.point(le[0],le[1]),mt||c.lineEnd(),S=!1):mt&&(c.lineStart(),c.point(W,ut),S=!1)}E=W,C=ut,L=mt}return T}}var Qs=Wr();function Kc(r,t){var e=t[0],n=t[1],i=[Tt(e),-Ot(e),0],o=0,s=0;Qs.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+_u,p=Tt(g),y=Ot(g),d=0;d<c;++d,h=E,p=L,y=N,f=m){var m=l[d],E=m[0],C=m[1]/2+_u,L=Tt(C),N=Ot(C),S=E-h,T=S>=0?1:-1,A=T*S,w=A>ot,F=p*L;if(Qs.add(Xi(F*T*Tt(A),y*N+F*Ot(A))),o+=w?S+T*nr:S,w^h>=e^E>=e){var X=ns(Wi(f),Wi(m));js(X);var R=ns(i,X);js(R);var Y=(w^S>=0?-1:1)*pi(R[2]);(n>Y||n===Y&&(X[0]||X[1]))&&(s+=w^S>=0?1:-1)}}return(o<-yt||o<yt&&Qs<-yt)^s&1}Wr();function Mu(r){return r}Wr(),Wr();var Hi=1/0,as=Hi,wo=-Hi,us=wo,Au={point:Qc,lineStart:So,lineEnd:So,polygonStart:So,polygonEnd:So,result:function(){var r=[[Hi,as],[wo,us]];return wo=us=-(as=Hi=1/0),r}};function Qc(r,t){r<Hi&&(Hi=r),r>wo&&(wo=r),t<as&&(as=t),t>us&&(us=t)}Wr();function Fu(r,t,e,n){return function(i,o){var s=t(o),a=i.invert(n[0],n[1]),u=Pu(),l=t(u),c=!1,f,h,g,p={point:y,lineStart:m,lineEnd:E,polygonStart:function(){p.point=C,p.lineStart=L,p.lineEnd=N,h=[],f=[]},polygonEnd:function(){p.point=y,p.lineStart=m,p.lineEnd=E,h=Du(h);var S=Kc(f,a);h.length?(c||(o.polygonStart(),c=!0),Ru(h,Jc,S,e,o)):S&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(S,T){var A=i(S,T);r(S=A[0],T=A[1])&&o.point(S,T)}function d(S,T){var A=i(S,T);s.point(A[0],A[1])}function m(){p.point=d,s.lineStart()}function E(){p.point=y,s.lineEnd()}function C(S,T){g.push([S,T]);var A=i(S,T);l.point(A[0],A[1])}function L(){l.lineStart(),g=[]}function N(){C(g[0][0],g[0][1]),l.lineEnd();var S=l.clean(),T=u.result(),A,w=T.length,F,X,R;if(g.pop(),f.push(g),g=null,!!w){if(S&1){if(X=T[0],(F=X.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),A=0;A<F;++A)o.point((R=X[A])[0],R[1]);o.lineEnd()}return}w>1&&S&2&&T.push(T.pop().concat(T.shift())),h.push(T.filter(Zc))}}return p}}function Zc(r){return r.length>1}function Jc(r,t){return((r=r.x)[0]<0?r[1]-er-yt:er-r[1])-((t=t.x)[0]<0?t[1]-er-yt:er-t[1])}const ku=Fu(function(){return!0},$c,ef,[-ot,-er]);function $c(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(o,s){var a=o>0?ot:-ot,u=ue(o-t);ue(u-ot)<yt?(r.point(t,e=(e+s)/2>0?er:-er),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(o,e),i=0):n!==a&&u>=ot&&(ue(t-n)<yt&&(t-=n*yt),ue(o-a)<yt&&(o-=a*yt),e=tf(t,e,o,s),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=o,e=s),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function tf(r,t,e,n){var i,o,s=Tt(r-e);return ue(s)>yt?Vc((Tt(t)*(o=Ot(n))*Tt(e)-Tt(n)*(i=Ot(t))*Tt(r))/(i*o*s)):(t+n)/2}function ef(r,t,e,n){var i;if(r==null)i=e*er,n.point(-ot,i),n.point(0,i),n.point(ot,i),n.point(ot,0),n.point(ot,-i),n.point(0,-i),n.point(-ot,-i),n.point(-ot,0),n.point(-ot,i);else if(ue(r[0]-t[0])>yt){var o=r[0]<t[0]?ot:-ot;i=e*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function nf(r,t){var e=Ot(r),n=e>0,i=ue(e)>yt;function o(c,f,h,g){Xc(g,r,t,h,c,f)}function s(c,f){return Ot(c)*Ot(f)>e}function a(c){var f,h,g,p,y;return{lineStart:function(){p=g=!1,y=1},point:function(d,m){var E=[d,m],C,L=s(d,m),N=n?L?0:l(d,m):L?l(d+(d<0?ot:-ot),m):0;if(!f&&(p=g=L)&&c.lineStart(),L!==g&&(C=u(f,E),(!C||is(f,C)||is(E,C))&&(E[0]+=yt,E[1]+=yt,L=s(E[0],E[1]))),L!==g)y=0,L?(c.lineStart(),C=u(E,f),c.point(C[0],C[1])):(C=u(f,E),c.point(C[0],C[1]),c.lineEnd()),f=C;else if(i&&f&&n^L){var S;!(N&h)&&(S=u(E,f,!0))&&(y=0,n?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1])))}L&&(!f||!is(f,E))&&c.point(E[0],E[1]),f=E,g=L,h=N},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return y|(p&&g)<<1}}}function u(c,f,h){var g=Wi(c),p=Wi(f),y=[1,0,0],d=ns(g,p),m=es(d,d),E=d[0],C=m-E*E;if(!C)return!h&&c;var L=e*m/C,N=-e*E/C,S=ns(y,d),T=rs(y,L),A=rs(d,N);Hs(T,A);var w=S,F=es(T,w),X=es(w,w),R=F*F-X*(es(T,T)-1);if(!(R<0)){var Y=Yi(R),D=rs(w,(-F-Y)/X);if(Hs(D,T),D=Ws(D),!h)return D;var W=c[0],ut=f[0],mt=c[1],Jt=f[1],le;ut<W&&(le=W,W=ut,ut=le);var Cr=ut-W,Gn=ue(Cr-ot)<yt,Nr=Gn||Cr<yt;if(!Gn&&Jt<mt&&(le=mt,mt=Jt,Jt=le),Nr?Gn?mt+Jt>0^D[1]<(ue(D[0]-W)<yt?mt:Jt):mt<=D[1]&&D[1]<=Jt:Cr>ot^(W<=D[0]&&D[0]<=ut)){var Nn=rs(w,(-F+Y)/X);return Hs(Nn,T),[D,Ws(Nn)]}}}function l(c,f){var h=n?r:ot-r,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return Fu(s,a,o,n?[0,-r]:[-ot,r-ot])}function Bu(r){return function(t){var e=new Zs;for(var n in r)e[n]=r[n];return e.stream=t,e}}function Zs(){}Zs.prototype={constructor:Zs,point:function(r,t){this.stream.point(r,t)},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 Gu(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o!=null&&r.clipExtent(null),Uc(e,r.stream(Au));var s=Au.result(),a=Math.min(n/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(n-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&r.clipExtent(o),r.scale(a*150).translate([u,l])}function rf(r,t,e){return Gu(r,[[0,0],t],e)}var zu=16,of=Ot(30*Cn);function Vu(r,t){return+t?af(r,t):sf(r)}function sf(r){return Bu({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function af(r,t){function e(n,i,o,s,a,u,l,c,f,h,g,p,y,d){var m=l-n,E=c-i,C=m*m+E*E;if(C>4*t&&y--){var L=s+h,N=a+g,S=u+p,T=Yi(L*L+N*N+S*S),A=pi(S/=T),w=ue(ue(S)-1)<yt||ue(o-f)<yt?(o+f)/2:Xi(N,L),F=r(w,A),X=F[0],R=F[1],Y=X-n,D=R-i,W=E*Y-m*D;(W*W/C>t||ue((m*Y+E*D)/C-.5)>.3||s*h+a*g+u*p<of)&&(e(n,i,o,s,a,u,X,R,w,L/=T,N/=T,S,y,d),d.point(X,R),e(X,R,w,L,N,S,l,c,f,h,g,p,y,d))}}return function(n){var i,o,s,a,u,l,c,f,h,g,p,y,d={point:m,lineStart:E,lineEnd:L,polygonStart:function(){n.polygonStart(),d.lineStart=N},polygonEnd:function(){n.polygonEnd(),d.lineStart=E}};function m(A,w){A=r(A,w),n.point(A[0],A[1])}function E(){f=NaN,d.point=C,n.lineStart()}function C(A,w){var F=Wi([A,w]),X=r(A,w);e(f,h,c,g,p,y,f=X[0],h=X[1],c=A,g=F[0],p=F[1],y=F[2],zu,n),n.point(f,h)}function L(){d.point=m,n.lineEnd()}function N(){E(),d.point=S,d.lineEnd=T}function S(A,w){C(i=A,w),o=f,s=h,a=g,u=p,l=y,d.point=C}function T(){e(f,h,c,g,p,y,o,s,i,a,u,l,zu,n),d.lineEnd=L,L()}return d}}var uf=Bu({point:function(r,t){this.stream.point(r*Cn,t*Cn)}});function lf(r){return cf(function(){return r})()}function cf(r){var t,e=150,n=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,y=ku,d=null,m,E,C,L=Mu,N=.5,S=Vu(X,N),T,A;function w(D){return D=g(D[0]*Cn,D[1]*Cn),[D[0]*e+o,s-D[1]*e]}function F(D){return D=g.invert((D[0]-o)/e,(s-D[1])/e),D&&[D[0]*Hr,D[1]*Hr]}function X(D,W){return D=t(D,W),[D[0]*e+o,s-D[1]*e]}w.stream=function(D){return T&&A===D?T:T=uf(y(h,S(L(A=D))))},w.clipAngle=function(D){return arguments.length?(y=+D?nf(p=D*Cn,6*Cn):(p=null,ku),Y()):p*Hr},w.clipExtent=function(D){return arguments.length?(L=D==null?(d=m=E=C=null,Mu):jc(d=+D[0][0],m=+D[0][1],E=+D[1][0],C=+D[1][1]),Y()):d==null?null:[[d,m],[E,C]]},w.scale=function(D){return arguments.length?(e=+D,R()):e},w.translate=function(D){return arguments.length?(n=+D[0],i=+D[1],R()):[n,i]},w.center=function(D){return arguments.length?(a=D[0]%360*Cn,u=D[1]%360*Cn,R()):[a*Hr,u*Hr]},w.rotate=function(D){return arguments.length?(l=D[0]%360*Cn,c=D[1]%360*Cn,f=D.length>2?D[2]%360*Cn:0,R()):[l*Hr,c*Hr,f*Hr]},w.precision=function(D){return arguments.length?(S=Vu(X,N=D*D),Y()):Yi(N)},w.fitExtent=function(D,W){return Gu(w,D,W)},w.fitSize=function(D,W){return rf(w,D,W)};function R(){g=Su(h=qc(l,c,f),t);var D=t(a,u);return o=n-D[0]*e,s=i+D[1]*e,Y()}function Y(){return T=A=null,w}return function(){return t=r.apply(this,arguments),w.invert=t.invert&&F,R()}}function Uu(r){return function(t,e){var n=Ot(t),i=Ot(e),o=r(n*i);return[o*i*Tt(t),o*Tt(e)]}}function qu(r){return function(t,e){var n=Yi(t*t+e*e),i=r(n),o=Tt(i),s=Ot(i);return[Xi(t*o,n*s),pi(n&&e*o/n)]}}var ff=Uu(function(r){return Yi(2/(1+r))});ff.invert=qu(function(r){return 2*pi(r/2)});var Xu=Uu(function(r){return(r=Eu(r))&&r/Tt(r)});Xu.invert=qu(function(r){return r});function hf(){return lf(Xu).scale(79.4188).clipAngle(180-.001)}function Yu(r,t){return[r,t]}Yu.invert=Yu;function gf(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(r.type){case"GeometryCollection":return za(r,function(s){var a=ls(s,t,n,i);a&&o.push(a)}),xs(o);case"FeatureCollection":return Ga(r,function(s){var a=ls(s,t,n,i);a&&Ga(a,function(u){u&&o.push(u)})}),xs(o)}return ls(r,t,n,i)}function ls(r,t,e,n){var i=r.properties||{},o=r.type==="Feature"?r.geometry:r;if(o.type==="GeometryCollection"){var s=[];return za(r,function(y){var d=ls(y,t,e,n);d&&s.push(d)}),xs(s)}var a=pf(o),u={type:o.type,coordinates:Hu(o.coordinates,a)},l=new As,c=l.read(u),f=yc(mc(t,e),"meters"),h=Vt.bufferOp(c,f,n),g=new Ja;if(h=g.write(h),!Wu(h.coordinates)){var p={type:h.type,coordinates:ju(h.coordinates,a)};return Do(p,i)}}function Wu(r){return Array.isArray(r[0])?Wu(r[0]):isNaN(r[0])}function Hu(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return Hu(e,t)})}function ju(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return ju(e,t)})}function pf(r){var t=Nc(r).geometry.coordinates,e=[-t[0],-t[1]];return hf().rotate(e).scale(Ne)}function df(r,t){var e=Mo(r),n=Mo(t),i=r.properties||{},o=Da.difference(e.coordinates,n.coordinates);return o.length===0?null:o.length===1?Aa(o[0],i):Fa(o,i)}function Ku(r){let t;for(const e of r)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function Qu(r,t){const e=df({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},r);if(!e)return;e.properties={isMask:"y"};const n=gf(r,0);if(n.geometry.type==="Polygon")for(const i of n.geometry.coordinates)Ku(i);else for(const i of n.geometry.coordinates)for(const o of i)Ku(o);t({type:"FeatureCollection",features:[n,e]})}function Zu(r,t=!0,e=!0,n={},i={},o=s=>{var l,c,f;const a=(l=s==null?void 0:s.geometry)==null?void 0:l.type,u=(c=s==null?void 0:s.properties)!=null&&c.isMask?0:a==="LineString"||a==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(f=s==null?void 0:s.properties)!=null&&f.isMask?.1:0,weight:u,dashArray:[u,u],lineCap:"butt"}}){let s,a,u=[],l,c,f=tn.geoJSON(void 0,{style:o,interactive:!1}).addTo(r);const h=()=>{let d;const m=r.getZoom()>10?[(d=r.getCenter().wrap()).lng,d.lat]:void 0;a!==m&&(a=m,s==null||s({type:"proximityChange",proximity:m}))},g=d=>{s==null||s({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function p(d,m=!1){const E=document.createElement("div");return new Cc({props:{displayIn:"leaflet"},target:E}),new tn.Marker(d,{interactive:m,icon:new tn.DivIcon({html:E,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(s=d,r.on("moveend",h),h(),r.on("click",g)):(r.off("moveend",h),s==null||s({type:"proximityChange",proximity:void 0}),s=void 0,r.off("click",g))},flyTo(d,m){r.flyTo([d[1],d[0]],m,{duration:2,...n})},fitBounds(d,m,E){r.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[m,m],duration:2,maxZoom:E,...i})},indicateReverse(d){r.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var E;if(!t)return;const m=d&&[d[1],d[0]];c?m?c.setLatLng(m):(c.remove(),c=void 0):m&&(c=(typeof t=="object"?new tn.Marker(m,t):p(m)).addTo(r),(E=c.getElement())==null||E.classList.add("marker-reverse"))},setMarkers(d,m){if(!t)return;function E(C){f.clearLayers(),C&&f.addData(C)}for(const C of u)C.remove();if(u.length=0,E(),m){let C=!1;if(m.geometry.type==="GeometryCollection"){const N=m.geometry.geometries.filter(S=>S.type==="Polygon"||S.type==="MultiPolygon");if(N.length>0){let S=N.pop();for(const T of N)S=_c(S,T);Qu({...m,geometry:S},E),C=!0}else{const S=m.geometry.geometries.filter(T=>T.type==="LineString"||T.type==="MultiLineString");S.length>0&&(E({...m,geometry:{type:"GeometryCollection",geometries:S}}),C=!0)}}if(!C){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Qu(m,E);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){E(m);return}}const L=[m.center[1],m.center[0]];u.push((typeof t=="object"?new tn.Marker(L,t):p(L)).addTo(r))}if(e)for(const C of d??[]){if(C===m)continue;const L=[C.center[1],C.center[0]],N=typeof e=="object"?new tn.Marker(L,e):p(L,!0);N.addTo(r).bindTooltip(C.place_name.replace(/,.*/,""),{direction:"top"});const S=N.getElement();S&&(S.addEventListener("click",T=>{T.stopPropagation(),s==null||s({type:"markerClick",id:C.id})}),S.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:C.id})}),S.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:C.id})}),S.classList.toggle("marker-fuzzy",!!C.matching_text)),u.push(N)}},setSelectedMarker(d){var m,E;l&&((m=l.getElement())==null||m.classList.toggle("marker-selected",!1)),l=d>-1?u[d]:void 0,(E=l==null?void 0:l.getElement())==null||E.classList.toggle("marker-selected",!0)}}}class Ju extends tn.Control{constructor(e){super();ra(this,Bn,void 0);ra(this,di,void 0);hs(this,di,e)}onAdd(e){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",tn.DomEvent.disableClickPropagation(n),tn.DomEvent.disableScrollPropagation(n);const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=sr(this,di),l=typeof s=="boolean"?{}:s,c=Zu(e,i,o,l,l,a);hs(this,Bn,new Hl({target:n,props:{mapController:c,flyTo:s===void 0?!0:!!s,...u}}));for(const f of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])sr(this,Bn).$on(f,h=>e.fire(f.toLowerCase(),h.detail));return n}setOptions(e){var u;hs(this,di,e);const{marker:n,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=sr(this,di);(u=sr(this,Bn))==null||u.$set(a)}setQuery(e,n=!0){var i;(i=sr(this,Bn))==null||i.setQuery(e,n)}setReverseMode(e){var n;(n=sr(this,Bn))==null||n.$set({reverseActive:e})}focus(){var e;(e=sr(this,Bn))==null||e.focus()}blur(){var e;(e=sr(this,Bn))==null||e.blur()}onRemove(){var e;(e=sr(this,Bn))==null||e.$destroy()}}Bn=new WeakMap,di=new WeakMap;function vf(...r){return new Ju(...r)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=vf),Dt.GeocodingControl=Ju,Dt.createLeafletMapController=Zu,Object.defineProperty(Dt,Symbol.toStringTag,{value:"Module"})});
25
+ `)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},Qt.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var n=[!1,!1],i=this.iterator();i.hasNext();)for(var o=i.next(),s=o.getLabel(),a=0;a<2;a++)s.isLine(a)&&s.getLocation(a)===_.BOUNDARY&&(n[a]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),c=l.getLabel(),f=0;f<2;f++)if(c.isAnyNull(f)){var h=_.NONE;if(n[f])h=_.EXTERIOR;else{var g=l.getCoordinate();h=e.getLocation(f,g,t)}c.setAllLocationsIfNull(f,h)}},Qt.prototype.getDegree=function(){return this._edgeMap.size()},Qt.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var Gc=function(r){function t(){r.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n=this;this.getResultAreaEdges();for(var i=null,o=null,s=this._SCANNING_FOR_INCOMING,a=0;a<this._resultAreaEdgeList.size();a++){var u=n._resultAreaEdgeList.get(a),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),s){case n._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;o=l,s=n._LINKING_TO_OUTGOING;break;case n._LINKING_TO_OUTGOING:if(!u.isInResult())continue;o.setNext(u),s=n._SCANNING_FOR_INCOMING;break}}if(s===this._LINKING_TO_OUTGOING){if(i===null)throw new Qn("no outgoing dirEdge found",this.getCoordinate());q.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),o.setNext(i)}},t.prototype.insert=function(n){var i=n;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var n=this.getEdges(),i=n.size();if(i<1)return null;var o=n.get(0);if(i===1)return o;var s=n.get(i-1),a=o.getQuadrant(),u=s.getQuadrant();return rt.isNorthern(a)&&rt.isNorthern(u)?o:!rt.isNorthern(a)&&!rt.isNorthern(u)?s:o.getDy()!==0?o:s.getDy()!==0?s:(q.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(n){Gt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var o=i.next();n.print("out "),o.print(n),n.println(),n.print("in "),o.getSym().print(n),n.println()}},t.prototype.getResultAreaEdges=function(){var n=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new O;for(var i=this.iterator();i.hasNext();){var o=i.next();(o.isInResult()||o.getSym().isInResult())&&n._resultAreaEdgeList.add(o)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i=this.iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.setAllLocationsIfNull(0,n.getLocation(0)),s.setAllLocationsIfNull(1,n.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var n=this;this.getEdges();for(var i=null,o=null,s=this._edgeList.size()-1;s>=0;s--){var a=n._edgeList.get(s),u=a.getSym();o===null&&(o=u),i!==null&&u.setNext(i),i=a}o.setNext(i)},t.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var i=arguments[0],o=this.findIndex(i),s=i.getDepth(b.LEFT),a=i.getDepth(b.RIGHT),u=this.computeDepths(o+1,this._edgeList.size(),s),l=this.computeDepths(0,o,u);if(l!==a)throw new Qn("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var c=arguments[0],f=arguments[1],h=arguments[2],g=h,p=c;p<f;p++){var y=n._edgeList.get(p);y.setEdgeDepths(b.RIGHT,g),g=y.getDepth(b.LEFT)}return g}},t.prototype.mergeSymLabels=function(){for(var n=this.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();o.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(n){for(var i=this,o=null,s=null,a=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),c=l.getSym();switch(o===null&&l.getEdgeRing()===n&&(o=l),a){case i._SCANNING_FOR_INCOMING:if(c.getEdgeRing()!==n)continue;s=c,a=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==n)continue;s.setNextMin(l),a=i._SCANNING_FOR_INCOMING;break}}a===this._LINKING_TO_OUTGOING&&(q.isTrue(o!==null,"found null for first outgoing dirEdge"),q.isTrue(o.getEdgeRing()===n,"unable to link last incoming dirEdge"),s.setNextMin(o))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,i=this.iterator();i.hasNext();){var o=i.next();o.isInResult()&&n++}return n}else if(arguments.length===1){for(var s=arguments[0],a=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===s&&a++}return a}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var n=_.NONE,i=this.iterator();i.hasNext();){var o=i.next(),s=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){n=_.INTERIOR;break}if(s.isInResult()){n=_.EXTERIOR;break}}}if(n===_.NONE)return null;for(var a=n,u=this.iterator();u.hasNext();){var l=u.next(),c=l.getSym();l.isLineEdge()?l.getEdge().setCovered(a===_.INTERIOR):(l.isInResult()&&(a=_.EXTERIOR),c.isInResult()&&(a=_.INTERIOR))}},t.prototype.computeLabelling=function(n){var i=this;r.prototype.computeLabelling.call(this,n),this._label=new et(_.NONE);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getEdge(),u=a.getLabel(),l=0;l<2;l++){var c=u.getLocation(l);(c===_.INTERIOR||c===_.BOUNDARY)&&i._label.setLocation(l,_.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qt),uu=function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new jo(n,new Gc)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Mi),pr=function r(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=r.orientation(t)};pr.prototype.compareTo=function(t){var e=t,n=pr.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n},pr.prototype.interfaces_=function(){return[De]},pr.prototype.getClass=function(){return pr},pr.orientation=function(t){return H.increasingDirection(t)===1},pr.compareOriented=function(t,e,n,i){for(var o=e?1:-1,s=i?1:-1,a=e?t.length:-1,u=i?n.length:-1,l=e?0:t.length-1,c=i?0:n.length-1;;){var f=t[l].compareTo(n[c]);if(f!==0)return f;l+=o,c+=s;var h=l===a,g=c===u;if(h&&!g)return-1;if(!h&&g)return 1;if(h&&g)return 0}};var Ke=function(){this._edges=new O,this._ocaMap=new jt};Ke.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n<this._edges.size();n++){var i=e._edges.get(n);n>0&&t.print(","),t.print("(");for(var o=i.getCoordinates(),s=0;s<o.length;s++)s>0&&t.print(","),t.print(o[s].x+" "+o[s].y);t.println(")")}t.print(") ")},Ke.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())},Ke.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n<this._edges.size();n++)if(e._edges.get(n).equals(t))return n;return-1},Ke.prototype.iterator=function(){return this._edges.iterator()},Ke.prototype.getEdges=function(){return this._edges},Ke.prototype.get=function(t){return this._edges.get(t)},Ke.prototype.findEqualEdge=function(t){var e=new pr(t.getCoordinates()),n=this._ocaMap.get(e);return n},Ke.prototype.add=function(t){this._edges.add(t);var e=new pr(t.getCoordinates());this._ocaMap.put(e,t)},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Gr=function(){};Gr.prototype.processIntersections=function(t,e,n,i){},Gr.prototype.isDone=function(){},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr};var be=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};be.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(be.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.size()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},be.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},be.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},be.prototype.getLineIntersector=function(){return this._li},be.prototype.hasProperIntersection=function(){return this._hasProper},be.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},be.prototype.hasIntersection=function(){return this._hasIntersection},be.prototype.isDone=function(){return!1},be.prototype.hasInteriorIntersection=function(){return this._hasInterior},be.prototype.interfaces_=function(){return[Gr]},be.prototype.getClass=function(){return be},be.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var _n=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new v(t),this.segmentIndex=e,this.dist=n};_n.prototype.getSegmentIndex=function(){return this.segmentIndex},_n.prototype.getCoordinate=function(){return this.coord},_n.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},_n.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},_n.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},_n.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},_n.prototype.getDistance=function(){return this.dist},_n.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},_n.prototype.interfaces_=function(){return[De]},_n.prototype.getClass=function(){return _n};var Dn=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};Dn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Dn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Dn.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var n=this.iterator(),i=n.next();n.hasNext();){var o=n.next(),s=e.createSplitEdge(i,o);t.add(s),i=o}},Dn.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Dn.prototype.createSplitEdge=function(t,e){var n=this,i=e.segmentIndex-t.segmentIndex+2,o=this.edge.pts[e.segmentIndex],s=e.dist>0||!e.coord.equals2D(o);s||i--;var a=new Array(i).fill(null),u=0;a[u++]=new v(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n.edge.pts[l];return s&&(a[u]=e.coord),new Qo(a,new et(this.edge._label))},Dn.prototype.add=function(t,e,n){var i=new _n(t,e,n),o=this._nodeMap.get(i);return o!==null?o:(this._nodeMap.put(i,i),i)},Dn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn};var zr=function(){};zr.prototype.getChainStartIndices=function(t){var e=this,n=0,i=new O;i.add(new un(n));do{var o=e.findChainEnd(t,n);i.add(new un(o)),n=o}while(n<t.length-1);var s=zr.toIntArray(i);return s},zr.prototype.findChainEnd=function(t,e){for(var n=rt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var o=rt.quadrant(t[i-1],t[i]);if(o!==n)break;i++}return i-1},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var $n=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new k,this.env2=new k;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new zr;this.startIndex=e.getChainStartIndices(this.pts)};$n.prototype.getCoordinates=function(){return this.pts},$n.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},$n.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},$n.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(arguments.length===6){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],c=arguments[5],f=this.pts[o],h=this.pts[s],g=a.pts[u],p=a.pts[l];if(s-o===1&&l-u===1)return c.addIntersections(this.e,o,a.e,u),null;if(this.env1.init(f,h),this.env2.init(g,p),!this.env1.intersects(this.env2))return null;var y=Math.trunc((o+s)/2),d=Math.trunc((u+l)/2);o<y&&(u<d&&this.computeIntersectsForChain(o,y,a,u,d,c),d<l&&this.computeIntersectsForChain(o,y,a,d,l,c)),y<s&&(u<d&&this.computeIntersectsForChain(y,s,a,u,d,c),d<l&&this.computeIntersectsForChain(y,s,a,d,l,c))}},$n.prototype.getStartIndexes=function(){return this.startIndex},$n.prototype.computeIntersects=function(t,e){for(var n=this,i=0;i<this.startIndex.length-1;i++)for(var o=0;o<t.startIndex.length-1;o++)n.computeIntersectsForChain(i,t,o,e)},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var zt=function r(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var n=0;n<3;n++)t._depth[e][n]=r.NULL_VALUE},lu={NULL_VALUE:{configurable:!0}};zt.prototype.getDepth=function(t,e){return this._depth[t][e]},zt.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},zt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var n=0;n<3;n++)if(t._depth[e][n]!==zt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===zt.NULL_VALUE}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._depth[o][s]===zt.NULL_VALUE}},zt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var n=t._depth[e][1];t._depth[e][2]<n&&(n=t._depth[e][2]),n<0&&(n=0);for(var i=1;i<3;i++){var o=0;t._depth[e][i]>n&&(o=1),t._depth[e][i]=o}}},zt.prototype.getDelta=function(t){return this._depth[t][b.RIGHT]-this._depth[t][b.LEFT]},zt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?_.EXTERIOR:_.INTERIOR},zt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},zt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var i=1;i<3;i++){var o=e.getLocation(n,i);(o===_.EXTERIOR||o===_.INTERIOR)&&(t.isNull(n,i)?t._depth[n][i]=zt.depthAtLocation(o):t._depth[n][i]+=zt.depthAtLocation(o))}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2];u===_.INTERIOR&&this._depth[s][a]++}},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.depthAtLocation=function(t){return t===_.EXTERIOR?0:t===_.INTERIOR?1:zt.NULL_VALUE},lu.NULL_VALUE.get=function(){return-1},Object.defineProperties(zt,lu);var Qo=function(r){function t(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new Dn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var i=new t(n,et.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var i=this;if(!(n instanceof t))return!1;var o=n;if(this.pts.length!==o.pts.length)return!1;for(var s=!0,a=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(o.pts[l])||(s=!1),i.pts[l].equals2D(o.pts[--u])||(a=!1),!s&&!a)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){var i=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&n.print(","),n.print(i.pts[o].x+" "+i.pts[o].y);n.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){var i=this;n.print("edge "+this._name+": ");for(var o=this.pts.length-1;o>=0;o--)n.print(i.pts[o]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new $n(this)),this._mce},t.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new k;for(var i=0;i<this.pts.length;i++)n._env.expandToInclude(n.pts[i])}return this._env},t.prototype.addIntersection=function(n,i,o,s){var a=new v(n.getIntersection(s)),u=i,l=n.getEdgeDistance(o,s),c=u+1;if(c<this.pts.length){var f=this.pts[c];a.equals2D(f)&&(u=c,l=0)}this.eiList.add(a,u,l)},t.prototype.toString=function(){var n=this,i=new an;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var o=0;o<this.pts.length;o++)o>0&&i.append(","),i.append(n.pts[o].x+" "+n.pts[o].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(n){var i=this;if(this.pts.length!==n.pts.length)return!1;for(var o=0;o<this.pts.length;o++)if(!i.pts[o].equals2D(n.pts[o]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,i,o){for(var s=this,a=0;a<n.getIntersectionNum();a++)s.addIntersection(n,i,o,a)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];i.setAtLeastIfValid(n.getLocation(0,b.ON),n.getLocation(1,b.ON),1),n.isArea()&&(i.setAtLeastIfValid(n.getLocation(0,b.LEFT),n.getLocation(1,b.LEFT),2),i.setAtLeastIfValid(n.getLocation(0,b.RIGHT),n.getLocation(1,b.RIGHT),2))}else return r.prototype.updateIM.apply(this,arguments)},t}(xe),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Ke,this._bufParams=t||null};re.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},re.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new et(t.getLabel()),i.flip()),n.merge(i);var o=re.depthDelta(i),s=e.getDepthDelta(),a=s+o;e.setDepthDelta(a)}else this._edgeList.add(t),t.setDepthDelta(re.depthDelta(t.getLabel()))},re.prototype.buildSubgraphs=function(t,e){for(var n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getRightmostCoordinate(),a=new si(n),u=a.getDepth(s);o.computeDepth(u),o.findResultEdges(),n.add(o),e.add(o.getDirectedEdges(),o.getNodes())}},re.prototype.createSubgraphs=function(t){for(var e=new O,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var o=new ee;o.create(i),e.add(o)}}return je.sort(e,je.reverseOrder()),e},re.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},re.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new Bs,n=new Dr;return n.setPrecisionModel(t),e.setSegmentIntersector(new be(n)),e},re.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;n===null&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new ge(n,this._bufParams),o=new Ge(t,e,i),s=o.getCurves();if(s.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(s,n),this._graph=new pt(new uu),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),u=new ye(this._geomFact);this.buildSubgraphs(a,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var c=this._geomFact.buildGeometry(l);return c},re.prototype.computeNodedEdges=function(t,e){var n=this,i=this.getNoder(e);i.computeNodes(t);for(var o=i.getNodedSubstrings(),s=o.iterator();s.hasNext();){var a=s.next(),u=a.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=a.getData(),c=new Qo(a.getCoordinates(),new et(l));n.insertUniqueEdge(c)}}},re.prototype.setNoder=function(t){this._workingNoder=t},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.depthDelta=function(t){var e=t.getLocation(0,b.LEFT),n=t.getLocation(0,b.RIGHT);return e===_.INTERIOR&&n===_.EXTERIOR?1:e===_.EXTERIOR&&n===_.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new j,n=new O;t.hasNext();){var i=t.next(),o=e.createLineString(i.getCoordinates());n.add(o)}return e.buildGeometry(n)};var dr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var n=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=o,this._offsetY=s,this._isScaled=!this.isIntegerPrecision()}};dr.prototype.rescale=function(){var t=this;if(z(arguments[0],bt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var o=arguments[0],s=0;s<o.length;s++)o[s].x=o[s].x/t._scaleFactor+t._offsetX,o[s].y=o[s].y/t._scaleFactor+t._offsetY;o.length===2&&o[0].equals2D(o[1])&&Gt.out.println(o)}},dr.prototype.scale=function(){var t=this;if(z(arguments[0],bt)){for(var e=arguments[0],n=new O,i=e.iterator();i.hasNext();){var o=i.next();n.add(new Ct(t.scale(o.getCoordinates()),o.getData()))}return n}else if(arguments[0]instanceof Array){for(var s=arguments[0],a=new Array(s.length).fill(null),u=0;u<s.length;u++)a[u]=new v(Math.round((s[u].x-t._offsetX)*t._scaleFactor),Math.round((s[u].y-t._offsetY)*t._scaleFactor),s[u].z);var l=H.removeRepeatedPoints(a);return l}},dr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},dr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},dr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},dr.prototype.interfaces_=function(){return[kr]},dr.prototype.getClass=function(){return dr};var En=function(){this._li=new Dr,this._segStrings=null;var t=arguments[0];this._segStrings=t},cu={fact:{configurable:!0}};En.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next(),i=n.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var o=arguments[0],s=arguments[1],a=s.iterator();a.hasNext();)for(var u=a.next(),l=u.getCoordinates(),c=1;c<l.length-1;c++)if(l[c].equals(o))throw new Xn("found endpt/interior pt intersection at index "+c+" :pt "+o)}},En.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var n=e.next(),i=this._segStrings.iterator();i.hasNext();){var o=i.next();t.checkInteriorIntersections(n,o)}else if(arguments.length===2)for(var s=arguments[0],a=arguments[1],u=s.getCoordinates(),l=a.getCoordinates(),c=0;c<u.length-1;c++)for(var f=0;f<l.length-1;f++)t.checkInteriorIntersections(s,c,a,f);else if(arguments.length===4){var h=arguments[0],g=arguments[1],p=arguments[2],y=arguments[3];if(h===p&&g===y)return null;var d=h.getCoordinates()[g],m=h.getCoordinates()[g+1],E=p.getCoordinates()[y],C=p.getCoordinates()[y+1];if(this._li.computeIntersection(d,m,E,C),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,m)||this.hasInteriorIntersection(this._li,E,C)))throw new Xn("found non-noded intersection at "+d+"-"+m+" and "+E+"-"+C)}},En.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},En.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var n=e.next();t.checkCollapses(n)}else if(arguments.length===1)for(var i=arguments[0],o=i.getCoordinates(),s=0;s<o.length-2;s++)t.checkCollapse(o[s],o[s+1],o[s+2])},En.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var o=t.getIntersection(i);if(!(o.equals(e)||o.equals(n)))return!0}return!1},En.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Xn("found non-noded collapse at "+En.fact.createLineString([t,e,n]))},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},cu.fact.get=function(){return new j},Object.defineProperties(En,cu);var pe=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 t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new ct("Scale factor must be non-zero");e!==1&&(this._pt=new v(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new v,this._p1Scaled=new v),this.initCorners(this._pt)},fu={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};pe.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y),a=this._maxx<n||this._minx>i||this._maxy<o||this._miny>s;if(a)return!1;var u=this.intersectsToleranceSquare(t,e);return q.isTrue(!(a&&u),"Found bad envelope test"),u},pe.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new v(this._maxx,this._maxy),this._corner[1]=new v(this._minx,this._maxy),this._corner[2]=new v(this._minx,this._miny),this._corner[3]=new v(this._maxx,this._miny)},pe.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},pe.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},pe.prototype.getCoordinate=function(){return this._originalPt},pe.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},pe.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=pe.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new k(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},pe.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))},pe.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&i||t.equals(this._pt)||e.equals(this._pt))},pe.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe},fu.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(pe,fu);var Io=function(){this.tempEnv1=new k,this.selectedSegment=new B};Io.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Bi=function(){this._index=null;var t=arguments[0];this._index=t},hu={HotPixelSnapAction:{configurable:!0}};Bi.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2],o=e.getSafeEnvelope(),s=new gu(e,n,i);return this._index.query(o,{interfaces_:function(){return[hr]},visitItem:function(a){var u=a;u.select(o,s)}}),s.isNodeAdded()}},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},hu.HotPixelSnapAction.get=function(){return gu},Object.defineProperties(Bi,hu);var gu=function(r){function t(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1],o=n.getContext();if(this._parentEdge!==null&&o===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(o,i)}else return r.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Io),ai=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new O};ai.prototype.processIntersections=function(t,e,n,i){var o=this;if(t===n&&e===i)return null;var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];if(this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var c=0;c<this._li.getIntersectionNum();c++)o._interiorIntersections.add(o._li.getIntersection(c));t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)}},ai.prototype.isDone=function(){return!1},ai.prototype.getInteriorIntersections=function(){return this._interiorIntersections},ai.prototype.interfaces_=function(){return[Gr]},ai.prototype.getClass=function(){return ai};var Mn=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Dr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Mn.prototype.checkCorrectness=function(t){var e=Ct.getNodedSubstrings(t),n=new En(e);try{n.checkValid()}catch(i){if(i instanceof Wa)i.printStackTrace();else throw i}finally{}},Mn.prototype.getNodedSubstrings=function(){return Ct.getNodedSubstrings(this._nodedSegStrings)},Mn.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Mn.prototype.findInteriorIntersections=function(t,e){var n=new ai(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Mn.prototype.computeVertexSnaps=function(){var t=this;if(z(arguments[0],bt))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof Ct)for(var o=arguments[0],s=o.getCoordinates(),a=0;a<s.length;a++){var u=new pe(s[a],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,o,a);l&&o.addIntersection(s[a],a)}},Mn.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new Bs,this._pointSnapper=new Bi(this._noder.getIndex()),this.snapRound(t,this._li)},Mn.prototype.computeIntersectionSnaps=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=new pe(i,e._scaleFactor,e._li);e._pointSnapper.snap(o)}},Mn.prototype.interfaces_=function(){return[kr]},Mn.prototype.getClass=function(){return Mn};var Vt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new $,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},Gi={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Vt.prototype.bufferFixedPrecision=function(t){var e=new dr(new Mn(new J(1)),t.getScale()),n=new re(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Vt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Vt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(s){if(s instanceof Qn)t._saveException=s;else throw s}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],i=Vt.precisionScaleFactor(this._argGeom,this._distance,n),o=new J(i);this.bufferFixedPrecision(o)}},Vt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===J.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Vt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Vt.prototype.bufferOriginalPrecision=function(){try{var t=new re(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Xn)this._saveException=e;else throw e}finally{}},Vt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Vt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Vt(t),i=n.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Vt(o);u.setQuadrantSegments(a);var l=u.getResultGeometry(s);return l}else if(arguments[2]instanceof $&&arguments[0]instanceof G&&typeof arguments[1]=="number"){var c=arguments[0],f=arguments[1],h=arguments[2],g=new Vt(c,h),p=g.getResultGeometry(f);return p}}else if(arguments.length===4){var y=arguments[0],d=arguments[1],m=arguments[2],E=arguments[3],C=new Vt(y);C.setQuadrantSegments(m),C.setEndCapStyle(E);var L=C.getResultGeometry(d);return L}},Vt.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),o=Se.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,a=o+2*s,u=Math.trunc(Math.log(a)/Math.log(10)+1),l=n-u,c=Math.pow(10,l);return c},Gi.CAP_ROUND.get=function(){return $.CAP_ROUND},Gi.CAP_BUTT.get=function(){return $.CAP_FLAT},Gi.CAP_FLAT.get=function(){return $.CAP_FLAT},Gi.CAP_SQUARE.get=function(){return $.CAP_SQUARE},Gi.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Vt,Gi);var ie=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};ie.prototype.getCoordinates=function(){return this._pt},ie.prototype.getCoordinate=function(t){return this._pt[t]},ie.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},ie.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},ie.prototype.getDistance=function(){return this._distance},ie.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie};var An=function(){};An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.computeDistance=function(){if(arguments[2]instanceof ie&&arguments[0]instanceof dt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getCoordinates(),o=new B,s=0;s<i.length-1;s++){o.setCoordinates(i[s],i[s+1]);var a=o.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof ie&&arguments[0]instanceof Pt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];An.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)An.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof ie&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof dt)An.computeDistance(h,g,p);else if(h instanceof Pt)An.computeDistance(h,g,p);else if(h instanceof te)for(var y=h,d=0;d<y.getNumGeometries();d++){var m=y.getGeometryN(d);An.computeDistance(m,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof ie&&arguments[0]instanceof B&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2],N=E.closestPoint(C);L.setMinimum(N,C)}};var Vr=function(t){this._maxPtDist=new ie,this._inputGeom=t||null},Gs={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Vr.prototype.computeMaxMidpointDistance=function(t){var e=new vr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vr.prototype.computeMaxVertexDistance=function(t){var e=new ui(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Vr.prototype.getDistancePoints=function(){return this._maxPtDist},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Gs.MaxPointDistanceFilter.get=function(){return ui},Gs.MaxMidpointDistanceFilter.get=function(){return vr},Object.defineProperties(Vr,Gs);var ui=function(t){this._maxPtDist=new ie,this._minPtDist=new ie,this._geom=t||null};ui.prototype.filter=function(t){this._minPtDist.initialize(),An.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ui.prototype.getMaxPointDistance=function(){return this._maxPtDist},ui.prototype.interfaces_=function(){return[Ln]},ui.prototype.getClass=function(){return ui};var vr=function(t){this._maxPtDist=new ie,this._minPtDist=new ie,this._geom=t||null};vr.prototype.filter=function(t,e){if(e===0)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),o=new v((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),An.computeDistance(this._geom,o,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},vr.prototype.isDone=function(){return!1},vr.prototype.isGeometryChanged=function(){return!1},vr.prototype.getMaxPointDistance=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[We]},vr.prototype.getClass=function(){return vr};var tr=function(t){this._comps=t||null};tr.prototype.filter=function(t){t instanceof Pt&&this._comps.add(t)},tr.prototype.interfaces_=function(){return[hn]},tr.prototype.getClass=function(){return tr},tr.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return tr.getPolygons(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Pt?n.add(e):e instanceof te&&e.apply(new tr(n)),n}};var Ut=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof bn){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof dt&&this._lines.add(t)},Ut.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ut.prototype.interfaces_=function(){return[Yn]},Ut.prototype.getClass=function(){return Ut},Ut.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Ut.getLines(t))}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,n))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(z(arguments[0],bt)&&z(arguments[1],bt)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var o=i.next();Ut.getLines(o,n)}return n}else if(arguments[0]instanceof G&&typeof arguments[1]=="boolean"){var s=arguments[0],a=arguments[1],u=new O;return s.apply(new Ut(u,a)),u}else if(arguments[0]instanceof G&&z(arguments[1],bt)){var l=arguments[0],c=arguments[1];return l instanceof dt?c.add(l):l.apply(new Ut(c)),c}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&z(arguments[0],bt)&&z(arguments[1],bt)){for(var f=arguments[0],h=arguments[1],g=arguments[2],p=f.iterator();p.hasNext();){var y=p.next();Ut.getLines(y,h,g)}return h}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof G&&z(arguments[1],bt)){var d=arguments[0],m=arguments[1],E=arguments[2];return d.apply(new Ut(m,E)),m}}};var Qe=function(){if(this._boundaryRule=Ae.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new ct("Rule must be non-null");this._boundaryRule=t}}};Qe.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof v&&arguments[1]instanceof Pt){var e=arguments[0],n=arguments[1];if(n.isEmpty())return _.EXTERIOR;var i=n.getExteriorRing(),o=this.locateInPolygonRing(e,i);if(o===_.EXTERIOR)return _.EXTERIOR;if(o===_.BOUNDARY)return _.BOUNDARY;for(var s=0;s<n.getNumInteriorRing();s++){var a=n.getInteriorRingN(s),u=t.locateInPolygonRing(e,a);if(u===_.INTERIOR)return _.EXTERIOR;if(u===_.BOUNDARY)return _.BOUNDARY}return _.INTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof dt){var l=arguments[0],c=arguments[1];if(!c.getEnvelopeInternal().intersects(l))return _.EXTERIOR;var f=c.getCoordinates();return!c.isClosed()&&(l.equals(f[0])||l.equals(f[f.length-1]))?_.BOUNDARY:M.isOnLine(l,f)?_.INTERIOR:_.EXTERIOR}else if(arguments[0]instanceof v&&arguments[1]instanceof ve){var h=arguments[0],g=arguments[1],p=g.getCoordinate();return p.equals2D(h)?_.INTERIOR:_.EXTERIOR}},Qe.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?M.locatePointInRing(t,e.getCoordinates()):_.EXTERIOR},Qe.prototype.intersects=function(t,e){return this.locate(t,e)!==_.EXTERIOR},Qe.prototype.updateLocationInfo=function(t){t===_.INTERIOR&&(this._isIn=!0),t===_.BOUNDARY&&this._numBoundaries++},Qe.prototype.computeLocation=function(t,e){var n=this;if(e instanceof ve&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof dt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Pt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Fr)for(var i=e,o=0;o<i.getNumGeometries();o++){var s=i.getGeometryN(o);n.updateLocationInfo(n.locateInternal(t,s))}else if(e instanceof Pn)for(var a=e,u=0;u<a.getNumGeometries();u++){var l=a.getGeometryN(u);n.updateLocationInfo(n.locateInternal(t,l))}else if(e instanceof te)for(var c=new Tn(e);c.hasNext();){var f=c.next();f!==e&&n.computeLocation(t,f)}},Qe.prototype.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:e instanceof dt?this.locateInternal(t,e):e instanceof Pt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?_.BOUNDARY:this._numBoundaries>0||this._isIn?_.INTERIOR:_.EXTERIOR)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var oe=function r(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];r.call(this,t,r.INSIDE_AREA,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},pu={INSIDE_AREA:{configurable:!0}};oe.prototype.isInsideArea=function(){return this._segIndex===oe.INSIDE_AREA},oe.prototype.getCoordinate=function(){return this._pt},oe.prototype.getGeometryComponent=function(){return this._component},oe.prototype.getSegmentIndex=function(){return this._segIndex},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},pu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(oe,pu);var yr=function(t){this._pts=t||null};yr.prototype.filter=function(t){t instanceof ve&&this._pts.add(t)},yr.prototype.interfaces_=function(){return[hn]},yr.prototype.getClass=function(){return yr},yr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof ve?je.singletonList(t):yr.getPoints(t,new O)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof ve?n.add(e):e instanceof te&&e.apply(new yr(n)),n}};var li=function(){this._locations=null;var t=arguments[0];this._locations=t};li.prototype.filter=function(t){(t instanceof ve||t instanceof dt||t instanceof Pt)&&this._locations.add(new oe(t,0,t.getCoordinate()))},li.prototype.interfaces_=function(){return[hn]},li.prototype.getClass=function(){return li},li.getLocations=function(t){var e=new O;return t.apply(new li(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Qe,this._minDistanceLocation=null,this._minDistance=V.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=o}};qt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=1-n,s=tr.getPolygons(this._geom[n]);if(s.size()>0){var a=li.getLocations(this._geom[o]);if(this.computeContainmentDistance(a,s,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[o]=i[0],this._minDistanceLocation[n]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&z(arguments[0],Xe)&&z(arguments[1],Xe)){for(var u=arguments[0],l=arguments[1],c=arguments[2],f=0;f<u.size();f++)for(var h=u.get(f),g=0;g<l.size();g++)if(t.computeContainmentDistance(h,l.get(g),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof oe&&arguments[1]instanceof Pt){var p=arguments[0],y=arguments[1],d=arguments[2],m=p.getCoordinate();if(_.EXTERIOR!==this._ptLocator.locate(m,y))return this._minDistance=0,d[0]=p,d[1]=new oe(y,m),null}}},qt.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),n=Ut.getLines(this._geom[1]),i=yr.getPoints(this._geom[0]),o=yr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,o,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,o,t),this.updateMinDistance(t,!1)},qt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},qt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},qt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},qt.prototype.computeMinDistance=function(){var t=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 dt&&arguments[1]instanceof ve){var e=arguments[0],n=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(n.getEnvelopeInternal())>this._minDistance)return null;for(var o=e.getCoordinates(),s=n.getCoordinate(),a=0;a<o.length-1;a++){var u=M.distancePointLine(s,o[a],o[a+1]);if(u<t._minDistance){t._minDistance=u;var l=new B(o[a],o[a+1]),c=l.closestPoint(s);i[0]=new oe(e,a,c),i[1]=new oe(n,0,s)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof dt&&arguments[1]instanceof dt){var f=arguments[0],h=arguments[1],g=arguments[2];if(f.getEnvelopeInternal().distance(h.getEnvelopeInternal())>this._minDistance)return null;for(var p=f.getCoordinates(),y=h.getCoordinates(),d=0;d<p.length-1;d++)for(var m=0;m<y.length-1;m++){var E=M.distanceLineLine(p[d],p[d+1],y[m],y[m+1]);if(E<t._minDistance){t._minDistance=E;var C=new B(p[d],p[d+1]),L=new B(y[m],y[m+1]),N=C.closestPoints(L);g[0]=new oe(f,d,N[0]),g[1]=new oe(h,m,N[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.prototype.computeMinDistancePoints=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a),l=s.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,n[0]=new oe(s,0,s.getCoordinate()),n[1]=new oe(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},qt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new ct("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},qt.prototype.computeMinDistanceLines=function(t,e,n){for(var i=this,o=0;o<t.size();o++)for(var s=t.get(o),a=0;a<e.size();a++){var u=e.get(a);if(i.computeMinDistance(s,u,n),i._minDistance<=i._terminateDistance)return null}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var n=new qt(t,e);return n.distance()},qt.isWithinDistance=function(t,e,n){var i=new qt(t,e,n);return i.distance()<=n},qt.nearestPoints=function(t,e){var n=new qt(t,e);return n.nearestPoints()};var Zt=function(){this._pt=[new v,new v],this._distance=V.NaN,this._isNull=!0};Zt.prototype.getCoordinates=function(){return this._pt},Zt.prototype.getCoordinate=function(t){return this._pt[t]},Zt.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Zt.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=o,this._isNull=!1}},Zt.prototype.toString=function(){return qe.toLineString(this._pt[0],this._pt[1])},Zt.prototype.getDistance=function(){return this._distance},Zt.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var In=function(){};In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.computeDistance=function(){if(arguments[2]instanceof Zt&&arguments[0]instanceof dt&&arguments[1]instanceof v)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new B,o=t.getCoordinates(),s=0;s<o.length-1;s++){i.setCoordinates(o[s],o[s+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof Pt&&arguments[1]instanceof v){var u=arguments[0],l=arguments[1],c=arguments[2];In.computeDistance(u.getExteriorRing(),l,c);for(var f=0;f<u.getNumInteriorRing();f++)In.computeDistance(u.getInteriorRingN(f),l,c)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof G&&arguments[1]instanceof v){var h=arguments[0],g=arguments[1],p=arguments[2];if(h instanceof dt)In.computeDistance(h,g,p);else if(h instanceof Pt)In.computeDistance(h,g,p);else if(h instanceof te)for(var y=h,d=0;d<y.getNumGeometries();d++){var m=y.getGeometryN(d);In.computeDistance(m,g,p)}else p.setMinimum(h.getCoordinate(),g)}else if(arguments[2]instanceof Zt&&arguments[0]instanceof B&&arguments[1]instanceof v){var E=arguments[0],C=arguments[1],L=arguments[2],N=E.closestPoint(C);L.setMinimum(N,C)}};var ze=function(){this._g0=null,this._g1=null,this._ptDist=new Zt,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},zs={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};ze.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},ze.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new ct("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},ze.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},ze.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},ze.prototype.computeOrientedDistance=function(t,e,n){var i=new ci(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var o=new mr(e,this._densifyFrac);t.apply(o),n.setMaximum(o.getMaxPointDistance())}},ze.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ze(t,e);return n.distance()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new ze(i,o);return a.setDensifyFraction(s),a.distance()}},zs.MaxPointDistanceFilter.get=function(){return ci},zs.MaxDensifiedByFractionDistanceFilter.get=function(){return mr},Object.defineProperties(ze,zs);var ci=function(){this._maxPtDist=new Zt,this._minPtDist=new Zt,this._euclideanDist=new In,this._geom=null;var t=arguments[0];this._geom=t};ci.prototype.filter=function(t){this._minPtDist.initialize(),In.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ci.prototype.getMaxPointDistance=function(){return this._maxPtDist},ci.prototype.interfaces_=function(){return[Ln]},ci.prototype.getClass=function(){return ci};var mr=function(){this._maxPtDist=new Zt,this._minPtDist=new Zt,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};mr.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),o=t.getCoordinate(e),s=(o.x-i.x)/this._numSubSegs,a=(o.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*s,c=i.y+u*a,f=new v(l,c);n._minPtDist.initialize(),In.computeDistance(n._geom,f,n._minPtDist),n._maxPtDist.setMaximum(n._minPtDist)}},mr.prototype.isDone=function(){return!1},mr.prototype.isGeometryChanged=function(){return!1},mr.prototype.getMaxPointDistance=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[We]},mr.prototype.getClass=function(){return mr};var _e=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Vs={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};_e.prototype.checkMaximumDistance=function(t,e,n){var i=new ze(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var o=i.getCoordinates();this._errorLocation=o[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+qe.toLineString(o[0],o[1])+")"}},_e.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=_e.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),_e.VERBOSE&&Gt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},_e.prototype.checkNegativeValid=function(){if(!(this._input instanceof Pt||this._input instanceof Pn||this._input instanceof te))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},_e.prototype.getErrorIndicator=function(){return this._errorIndicator},_e.prototype.checkMinimumDistance=function(t,e,n){var i=new qt(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var o=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(o),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+qe.toLineString(o[0],o[1])+" )"}},_e.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},_e.prototype.getErrorLocation=function(){return this._errorLocation},_e.prototype.getPolygonLines=function(t){for(var e=new O,n=new Ut(e),i=tr.getPolygons(t),o=i.iterator();o.hasNext();){var s=o.next();s.apply(n)}return t.getFactory().buildGeometry(e)},_e.prototype.getErrorMessage=function(){return this._errMsg},_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e},Vs.VERBOSE.get=function(){return!1},Vs.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(_e,Vs);var Xt=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Us={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Xt.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},Xt.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Xt.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new k(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new k(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Xt.prototype.checkDistance=function(){var t=new _e(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Xt.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Xt.prototype.checkPolygonal=function(){this._result instanceof Pt||this._result instanceof Pn||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Xt.prototype.getErrorIndicator=function(){return this._errorIndicator},Xt.prototype.getErrorLocation=function(){return this._errorLocation},Xt.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")},Xt.prototype.report=function(t){if(!Xt.VERBOSE)return null;Gt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Xt.prototype.getErrorMessage=function(){return this._errorMsg},Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.isValidMsg=function(t,e,n){var i=new Xt(t,e,n);return i.isValid()?null:i.getErrorMessage()},Xt.isValid=function(t,e,n){var i=new Xt(t,e,n);return!!i.isValid()},Us.VERBOSE.get=function(){return!1},Us.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Xt,Us);var Cn=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Cn.prototype.getCoordinates=function(){return this._pts},Cn.prototype.size=function(){return this._pts.length},Cn.prototype.getCoordinate=function(t){return this._pts[t]},Cn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Cn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:ii.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Cn.prototype.setData=function(t){this._data=t},Cn.prototype.getData=function(){return this._data},Cn.prototype.toString=function(){return qe.toLineString(new It(this._pts))},Cn.prototype.interfaces_=function(){return[On]},Cn.prototype.getClass=function(){return Cn};var Ft=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new O,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Ft.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Ft.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Ft.prototype.getIntersectionSegments=function(){return this._intSegments},Ft.prototype.count=function(){return this._intersectionCount},Ft.prototype.getIntersections=function(){return this._intersections},Ft.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ft.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Ft.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly){var o=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!o)return null}var s=t.getCoordinates()[e],a=t.getCoordinates()[e+1],u=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this._li.computeIntersection(s,a,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=s,this._intSegments[1]=a,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Ft.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Ft.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Ft.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Ft.prototype.interfaces_=function(){return[Gr]},Ft.prototype.getClass=function(){return Ft},Ft.createAllIntersectionsFinder=function(t){var e=new Ft(t);return e.setFindAllIntersections(!0),e},Ft.createAnyIntersectionFinder=function(t){return new Ft(t)},Ft.createIntersectionCounter=function(t){var e=new Ft(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ze=function(){this._li=new Dr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ze.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Ze.prototype.getIntersections=function(){return this._segInt.getIntersections()},Ze.prototype.isValid=function(){return this.execute(),this._isValid},Ze.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Ze.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Ft(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new Bs;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Ze.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Qn(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Ze.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+qe.toLineString(t[0],t[1])+" and "+qe.toLineString(t[2],t[3])},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze},Ze.computeIntersections=function(t){var e=new Ze(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Ur=function r(){this._nv=null;var t=arguments[0];this._nv=new Ze(r.toSegmentStrings(t))};Ur.prototype.checkValid=function(){this._nv.checkValid()},Ur.prototype.interfaces_=function(){return[]},Ur.prototype.getClass=function(){return Ur},Ur.toSegmentStrings=function(t){for(var e=new O,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Cn(i.getCoordinates(),i))}return e},Ur.checkValid=function(t){var e=new Ur(t);e.checkValid()};var fi=function(t){this._mapOp=t};fi.prototype.map=function(t){for(var e=this,n=new O,i=0;i<t.getNumGeometries();i++){var o=e._mapOp.map(t.getGeometryN(i));o.isEmpty()||n.add(o)}return t.getFactory().createGeometryCollection(j.toGeometryArray(n))},fi.prototype.interfaces_=function(){return[]},fi.prototype.getClass=function(){return fi},fi.map=function(t,e){var n=new fi(e);return n.map(t)};var Nn=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new O,this._resultLineList=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Nn.prototype.collectLines=function(t){for(var e=this,n=this._op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},Nn.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Nn.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Nn.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),o=t.getEdge();t.isLineEdge()&&!t.isVisited()&&U.isResultOfOp(i,e)&&!o.isCovered()&&(n.add(o),t.setVisitedEdge(!0))},Nn.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();n.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getEdge();if(o.isLineEdge()&&!s.isCoveredSet()){var a=t._op.isCoveredByA(o.getCoordinate());s.setCovered(a)}}},Nn.prototype.labelIsolatedLines=function(t){for(var e=this,n=t.iterator();n.hasNext();){var i=n.next(),o=i.getLabel();i.isIsolated()&&(o.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},Nn.prototype.buildLines=function(t){for(var e=this,n=this._lineEdgesList.iterator();n.hasNext();){var i=n.next(),o=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(o),i.setInResult(!0)}},Nn.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;q.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),U.isResultOfOp(i,e)&&e===U.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))},Nn.prototype.interfaces_=function(){return[]},Nn.prototype.getClass=function(){return Nn};var hi=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new O;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};hi.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},hi.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,n=this._op.getGraph().getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===U.INTERSECTION)){var o=i.getLabel();U.isResultOfOp(o,t)&&e.filterCoveredNodeToPoint(i)}}},hi.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi};var de=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};de.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformPolygon=function(t,e){var n=this,i=!0,o=this.transformLinearRing(t.getExteriorRing(),t);(o===null||!(o instanceof bn)||o.isEmpty())&&(i=!1);for(var s=new O,a=0;a<t.getNumInteriorRing();a++){var u=n.transformLinearRing(t.getInteriorRingN(a),t);u===null||u.isEmpty()||(u instanceof bn||(i=!1),s.add(u))}if(i)return this._factory.createPolygon(o,s.toArray([]));var l=new O;return o!==null&&l.add(o),l.addAll(s),this._factory.buildGeometry(l)},de.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},de.prototype.getInputGeometry=function(){return this._inputGeom},de.prototype.transformMultiLineString=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformLineString(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.transformCoordinates=function(t,e){return this.copy(t)},de.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformMultiPoint=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformPoint(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.transformMultiPolygon=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transformPolygon(t.getGeometryN(o),t);s!==null&&(s.isEmpty()||i.add(s))}return this._factory.buildGeometry(i)},de.prototype.copy=function(t){return t.copy()},de.prototype.transformGeometryCollection=function(t,e){for(var n=this,i=new O,o=0;o<t.getNumGeometries();o++){var s=n.transform(t.getGeometryN(o));s!==null&&(n._pruneEmptyGeometry&&s.isEmpty()||i.add(s))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(j.toGeometryArray(i)):this._factory.buildGeometry(i)},de.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ve)return this.transformPoint(t,null);if(t instanceof Di)return this.transformMultiPoint(t,null);if(t instanceof bn)return this.transformLinearRing(t,null);if(t instanceof dt)return this.transformLineString(t,null);if(t instanceof Fr)return this.transformMultiLineString(t,null);if(t instanceof Pt)return this.transformPolygon(t,null);if(t instanceof Pn)return this.transformMultiPolygon(t,null);if(t instanceof te)return this.transformGeometryCollection(t,null);throw new ct("Unknown Geometry subtype: "+t.getClass().getName())},de.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(n===null)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de};var Fn=function r(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new B,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof dt&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];r.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=r.isClosed(n),this._snapTolerance=i}};Fn.prototype.snapVertices=function(t,e){for(var n=this,i=this._isClosed?t.size()-1:t.size(),o=0;o<i;o++){var s=t.get(o),a=n.findSnapForVertex(s,e);a!==null&&(t.set(o,new v(a)),o===0&&n._isClosed&&t.set(t.size()-1,new v(a)))}},Fn.prototype.findSnapForVertex=function(t,e){for(var n=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<n._snapTolerance)return e[i]}return null},Fn.prototype.snapTo=function(t){var e=new so(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},Fn.prototype.snapSegments=function(t,e){var n=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var o=0;o<i;o++){var s=e[o],a=n.findSegmentIndexToSnap(s,t);a>=0&&t.add(a+1,new v(s),!1)}},Fn.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,i=V.MAX_VALUE,o=-1,s=0;s<e.size()-1;s++){if(n._seg.p0=e.get(s),n._seg.p1=e.get(s+1),n._seg.p0.equals2D(t)||n._seg.p1.equals2D(t)){if(n._allowSnappingToSourceVertices)continue;return-1}var a=n._seg.distance(t);a<n._snapTolerance&&a<i&&(i=a,o=s)}return o},Fn.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Fn.prototype.interfaces_=function(){return[]},Fn.prototype.getClass=function(){return Fn},Fn.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var Nt=function(t){this._srcGeom=t||null},du={SNAP_PRECISION_FACTOR:{configurable:!0}};Nt.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t),i=new vu(e,n);return i.transform(this._srcGeom)},Nt.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new vu(t,n,!0),o=i.transform(this._srcGeom),s=o;return e&&z(s,fr)&&(s=o.buffer(0)),s},Nt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},Nt.prototype.extractTargetCoordinates=function(t){for(var e=new fn,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},Nt.prototype.computeMinimumSegmentLength=function(t){for(var e=V.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.snap=function(t,e,n){var i=new Array(2).fill(null),o=new Nt(t);i[0]=o.snapTo(e,n);var s=new Nt(e);return i[1]=s.snapTo(i[0],n),i},Nt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=Nt.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===J.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return Math.min(Nt.computeOverlaySnapTolerance(o),Nt.computeOverlaySnapTolerance(s))}},Nt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*Nt.SNAP_PRECISION_FACTOR;return i},Nt.snapToSelf=function(t,e,n){var i=new Nt(t);return i.snapToSelf(e,n)},du.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Nt,du);var vu=function(r){function t(e,n,i){r.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=i!==void 0?i:!1}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,i){var o=new Fn(n,this._snapTolerance);return o.setAllowSnappingToSourceVertices(this._isSelfSnap),o.snapTo(i)},t.prototype.transformCoordinates=function(n,i){var o=n.toCoordinateArray(),s=this.snapLine(o,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(s)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(de),se=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};se.prototype.getCommon=function(){return V.longBitsToDouble(this._commonBits)},se.prototype.add=function(t){var e=V.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=se.signExpBits(this._commonBits),this._isFirst=!1,null;var n=se.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=se.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=se.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},se.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=V.longBitsToDouble(t),n=V.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,o=i.substring(i.length-64),s=o.substring(0,1)+" "+o.substring(1,12)+"(exp) "+o.substring(12)+" [ "+e+" ]";return s}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se},se.getBit=function(t,e){var n=1<<e;return t&n?1:0},se.signExpBits=function(t){return t>>52},se.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,o=t&i;return o},se.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(se.getBit(t,i)!==se.getBit(e,i))return n;n++}return 52};var _r=function(){this._commonCoord=null,this._ccFilter=new gi},qs={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};_r.prototype.addCommonBits=function(t){var e=new Er(this._commonCoord);t.apply(e),t.geometryChanged()},_r.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new v(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Er(e);return t.apply(n),t.geometryChanged(),t},_r.prototype.getCommonCoordinate=function(){return this._commonCoord},_r.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},qs.CommonCoordinateFilter.get=function(){return gi},qs.Translater.get=function(){return Er},Object.defineProperties(_r,qs);var gi=function(){this._commonBitsX=new se,this._commonBitsY=new se};gi.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},gi.prototype.getCommonCoordinate=function(){return new v(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},gi.prototype.interfaces_=function(){return[Ln]},gi.prototype.getClass=function(){return gi};var Er=function(){this.trans=null;var t=arguments[0];this.trans=t};Er.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},Er.prototype.isDone=function(){return!1},Er.prototype.isGeometryChanged=function(){return!0},Er.prototype.interfaces_=function(){return[We]},Er.prototype.getClass=function(){return Er};var kt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};kt.prototype.selfSnap=function(t){var e=new Nt(t),n=e.snapTo(t,this._snapTolerance);return n},kt.prototype.removeCommonBits=function(t){this._cbr=new _r,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},kt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},kt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=U.overlayOp(e[0],e[1],t);return this.prepareResult(n)},kt.prototype.checkValid=function(t){t.isValid()||Gt.out.println("Snapped geometry is invalid")},kt.prototype.computeSnapTolerance=function(){this._snapTolerance=Nt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},kt.prototype.snap=function(t){var e=this.removeCommonBits(t),n=Nt.snap(e[0],e[1],this._snapTolerance);return n},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.overlayOp=function(t,e,n){var i=new kt(t,e);return i.getResultGeometry(n)},kt.union=function(t,e){return kt.overlayOp(t,e,U.UNION)},kt.intersection=function(t,e){return kt.overlayOp(t,e,U.INTERSECTION)},kt.symDifference=function(t,e){return kt.overlayOp(t,e,U.SYMDIFFERENCE)},kt.difference=function(t,e){return kt.overlayOp(t,e,U.DIFFERENCE)};var ae=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ae.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=U.overlayOp(this._geom[0],this._geom[1],t);var o=!0;o&&(n=!0)}catch(s){if(s instanceof Xn)i=s;else throw s}finally{}if(!n)try{e=kt.overlayOp(this._geom[0],this._geom[1],t)}catch(s){throw s instanceof Xn?i:s}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,n){var i=new ae(t,e);return i.getResultGeometry(n)},ae.union=function(t,e){return ae.overlayOp(t,e,U.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,U.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,U.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,U.DIFFERENCE)};var Co=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Co.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var Ee=function r(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=r.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=r.INSERT,this._label=n,this._xValue=i,this._obj=o}},Xs={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ee.prototype.isDelete=function(){return this._eventType===Ee.DELETE},Ee.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ee.prototype.getObject=function(){return this._obj},Ee.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Ee.prototype.getInsertEvent=function(){return this._insertEvent},Ee.prototype.isInsert=function(){return this._eventType===Ee.INSERT},Ee.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Ee.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ee.prototype.interfaces_=function(){return[De]},Ee.prototype.getClass=function(){return Ee},Xs.INSERT.get=function(){return 1},Xs.DELETE.get=function(){return 2},Object.defineProperties(Ee,Xs);var Zo=function(){};Zo.prototype.interfaces_=function(){return[]},Zo.prototype.getClass=function(){return Zo};var Yt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Yt.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&this._li.getIntersectionNum()===1){if(Yt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var o=t.getNumPoints()-1;if(e===0&&i===o||i===0&&e===o)return!0}}return!1},Yt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Yt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Yt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Yt.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),o=i.getCoordinate();if(t.isIntersection(o))return!0}return!1},Yt.prototype.hasProperIntersection=function(){return this._hasProper},Yt.prototype.hasIntersection=function(){return this._hasIntersection},Yt.prototype.isDone=function(){return this._isDone},Yt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Yt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Yt.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],u=n.getCoordinates()[i+1];this._li.computeIntersection(o,s,a,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var zc=function(r){function t(){r.call(this),this.events=new O,this.nOverlaps=null}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n=this;je.sort(this.events);for(var i=0;i<this.events.size();i++){var o=n.events.get(i);o.isDelete()&&o.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var n=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var o=0;o<this.events.size();o++){var s=n.events.get(o);if(s.isInsert()&&n.processOverlaps(o,s.getDeleteEventIndex(),s,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Yt&&z(arguments[0],Xe)&&z(arguments[1],Xe)){var a=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(a,a),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&z(arguments[0],Xe)&&arguments[1]instanceof Yt){var c=arguments[0],f=arguments[1],h=arguments[2];h?this.addEdges(c,null):this.addEdges(c),this.computeIntersections(f)}}},t.prototype.addEdge=function(n,i){for(var o=this,s=n.getMonotoneChainEdge(),a=s.getStartIndexes(),u=0;u<a.length-1;u++){var l=new Co(s,u),c=new Ee(i,s.getMinX(u),l);o.events.add(c),o.events.add(new Ee(s.getMaxX(u),c))}},t.prototype.processOverlaps=function(n,i,o,s){for(var a=this,u=o.getObject(),l=n;l<i;l++){var c=a.events.get(l);if(c.isInsert()){var f=c.getObject();o.isSameLabel(c)||(u.computeIntersections(f,s),a.nOverlaps++)}}},t.prototype.addEdges=function(){var n=this;if(arguments.length===1)for(var i=arguments[0],o=i.iterator();o.hasNext();){var s=o.next();n.addEdge(s,s)}else if(arguments.length===2)for(var a=arguments[0],u=arguments[1],l=a.iterator();l.hasNext();){var c=l.next();n.addEdge(c,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Zo),kn=function(){this._min=V.POSITIVE_INFINITY,this._max=V.NEGATIVE_INFINITY},yu={NodeComparator:{configurable:!0}};kn.prototype.getMin=function(){return this._min},kn.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},kn.prototype.getMax=function(){return this._max},kn.prototype.toString=function(){return qe.toLineString(new v(this._min,0),new v(this._max,0))},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},yu.NodeComparator.get=function(){return No},Object.defineProperties(kn,yu);var No=function(){};No.prototype.compare=function(t,e){var n=t,i=e,o=(n._min+n._max)/2,s=(i._min+i._max)/2;return o<s?-1:o>s?1:0},No.prototype.interfaces_=function(){return[Ci]},No.prototype.getClass=function(){return No};var Vc=function(r){function t(){r.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;o.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(kn),Uc=function(r){function t(){r.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,i){this._min=Math.min(n._min,i._min),this._max=Math.max(n._max,i._max)},t.prototype.query=function(n,i,o){if(!this.intersects(n,i))return null;this._node1!==null&&this._node1.query(n,i,o),this._node2!==null&&this._node2.query(n,i,o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(kn),Bn=function(){this._leaves=new O,this._root=null,this._level=0};Bn.prototype.buildTree=function(){var t=this;je.sort(this._leaves,new kn.NodeComparator);for(var e=this._leaves,n=null,i=new O;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);n=e,e=i,i=n}},Bn.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Vc(t,e,n))},Bn.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Bn.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Bn.prototype.printNode=function(t){Gt.out.println(qe.toLineString(new v(t._min,this._level),new v(t._max,this._level)))},Bn.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Bn.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),o=n+1<t.size()?t.get(n):null;if(o===null)e.add(i);else{var s=new Uc(t.get(n),t.get(n+1));e.add(s)}}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn};var zi=function(){this._items=new O};zi.prototype.visitItem=function(t){this._items.add(t)},zi.prototype.getItems=function(){return this._items},zi.prototype.interfaces_=function(){return[hr]},zi.prototype.getClass=function(){return zi};var Vi=function(){this._index=null;var t=arguments[0];if(!z(t,fr))throw new ct("Argument must be Polygonal");this._index=new qr(t)},Ys={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Vi.prototype.locate=function(t){var e=new cn(t),n=new Ui(e);return this._index.query(t.y,t.y,n),e.getLocation()},Vi.prototype.interfaces_=function(){return[ki]},Vi.prototype.getClass=function(){return Vi},Ys.SegmentVisitor.get=function(){return Ui},Ys.IntervalIndexedGeometry.get=function(){return qr},Object.defineProperties(Vi,Ys);var Ui=function(){this._counter=null;var t=arguments[0];this._counter=t};Ui.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ui.prototype.interfaces_=function(){return[hr]},Ui.prototype.getClass=function(){return Ui};var qr=function(){this._index=new Bn;var t=arguments[0];this.init(t)};qr.prototype.init=function(t){for(var e=this,n=Ut.getLines(t),i=n.iterator();i.hasNext();){var o=i.next(),s=o.getCoordinates();e.addLine(s)}},qr.prototype.addLine=function(t){for(var e=this,n=1;n<t.length;n++){var i=new B(t[n-1],t[n]),o=Math.min(i.p0.y,i.p1.y),s=Math.max(i.p0.y,i.p1.y);e._index.insert(o,s,i)}},qr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new zi;return this._index.query(t,e,n),n.getItems()}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];this._index.query(i,o,s)}},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr};var So=function(r){function t(){if(r.call(this),this._parentGeom=null,this._lineEdgeMap=new Ja,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Qe,arguments.length===2){var e=arguments[0],n=arguments[1],i=Ae.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,n!==null&&this.add(n)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];this._argIndex=o,this._parentGeom=s,this._boundaryNodeRule=a,s!==null&&this.add(s)}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var o=this._nodes.addNode(i),s=o.getLabel(),a=1,u=_.NONE;u=s.getLocation(n,b.ON),u===_.BOUNDARY&&a++;var l=t.determineBoundary(this._boundaryNodeRule,a);s.setLocation(n,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.computeSelfNodes(n,i,!1)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2],u=new Yt(o,!0,!1);u.setIsDoneIfProperInt(a);var l=this.createEdgeSetIntersector(),c=this._parentGeom instanceof bn||this._parentGeom instanceof Pt||this._parentGeom instanceof Pn,f=s||!c;return l.computeIntersections(this._edges,u,f),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(n){for(var i=this._edges.iterator();i.hasNext();){var o=i.next();o.eiList.addSplitEdges(n)}},t.prototype.computeEdgeIntersections=function(n,i,o){var s=new Yt(i,o,!0);s.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes());var a=this.createEdgeSetIntersector();return a.computeIntersections(this._edges,n._edges,s),s},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof ve){var n=arguments[0],i=n.getCoordinate();this.insertPoint(this._argIndex,i,_.INTERIOR)}else if(arguments[0]instanceof v){var o=arguments[0];this.insertPoint(this._argIndex,o,_.INTERIOR)}},t.prototype.addPolygon=function(n){var i=this;this.addPolygonRing(n.getExteriorRing(),_.EXTERIOR,_.INTERIOR);for(var o=0;o<n.getNumInteriorRing();o++){var s=n.getInteriorRingN(o);i.addPolygonRing(s,_.INTERIOR,_.EXTERIOR)}},t.prototype.addEdge=function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this._argIndex,i[0],_.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],_.BOUNDARY)},t.prototype.addLineString=function(n){var i=H.removeRepeatedPoints(n.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var o=new Qo(i,new et(this._argIndex,_.INTERIOR));this._lineEdgeMap.put(n,o),this.insertEdge(o),q.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),i=new Array(n.size()).fill(null),o=0,s=n.iterator();s.hasNext();){var a=s.next();i[o++]=a.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,i,o){if(this.isBoundaryNode(n,i))return null;o===_.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,o)},t.prototype.addPolygonRing=function(n,i,o){if(n.isEmpty())return null;var s=H.removeRepeatedPoints(n.getCoordinates());if(s.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=s[0],null;var a=i,u=o;M.isCCW(s)&&(a=o,u=i);var l=new Qo(s,new et(this._argIndex,_.BOUNDARY,a,u));this._lineEdgeMap.put(n,l),this.insertEdge(l),this.insertPoint(this._argIndex,s[0],_.BOUNDARY)},t.prototype.insertPoint=function(n,i,o){var s=this._nodes.addNode(i),a=s.getLabel();a===null?s._label=new et(n,o):a.setLocation(n,o)},t.prototype.createEdgeSetIntersector=function(){return new zc},t.prototype.addSelfIntersectionNodes=function(n){for(var i=this,o=this._edges.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel().getLocation(n),u=s.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(n,l.coord,a)}},t.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Pn&&(this._useBoundaryDeterminationRule=!1),n instanceof Pt)this.addPolygon(n);else if(n instanceof dt)this.addLineString(n);else if(n instanceof ve)this.addPoint(n);else if(n instanceof Di)this.addCollection(n);else if(n instanceof Fr)this.addCollection(n);else if(n instanceof Pn)this.addCollection(n);else if(n instanceof te)this.addCollection(n);else throw new Error(n.getClass().getName())}else return r.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(n){for(var i=this,o=0;o<n.getNumGeometries();o++){var s=n.getGeometryN(o);i.add(s)}},t.prototype.locate=function(n){return z(this._parentGeom,fr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Vi(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return r.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,i){return n.isInBoundary(i)?_.BOUNDARY:_.INTERIOR},t}(pt),qi=function(){if(this._li=new Dr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new So(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],i=Ae.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,e,i),this._arg[1]=new So(1,n,i)}else if(arguments.length===3){var o=arguments[0],s=arguments[1],a=arguments[2];o.getPrecisionModel().compareTo(s.getPrecisionModel())>=0?this.setComputationPrecision(o.getPrecisionModel()):this.setComputationPrecision(s.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new So(0,o,a),this._arg[1]=new So(1,s,a)}};qi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},qi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},qi.prototype.interfaces_=function(){return[]},qi.prototype.getClass=function(){return qi};var Xr=function(){};Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(){if(arguments[0]instanceof G&&z(arguments[1],Xr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new O,i=0;i<t.getNumGeometries();i++){var o=e.map(t.getGeometryN(i));o!==null&&n.add(o)}return t.getFactory().buildGeometry(n)}else if(z(arguments[0],bt)&&z(arguments[1],Xr.MapOp)){for(var s=arguments[0],a=arguments[1],u=new O,l=s.iterator();l.hasNext();){var c=l.next(),f=a.map(c);f!==null&&u.add(f)}return u}},Xr.MapOp=function(){};var U=function(r){function t(){var e=arguments[0],n=arguments[1];r.call(this,e,n),this._ptLocator=new Qe,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Ke,this._resultPolyList=new O,this._resultLineList=new O,this._resultPointList=new O,this._graph=new pt(new uu),this._geomFact=e.getFactory()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var i=this._edgeList.findEqualEdge(n);if(i!==null){var o=i.getLabel(),s=n.getLabel();i.isPointwiseEqual(n)||(s=new et(n.getLabel()),s.flip());var a=i.getDepth();a.isNull()&&a.add(o),a.add(s),o.merge(s)}else this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var i=n.next(),o=i.getSym();i.isInResult()&&o.isInResult()&&(i.setInResult(!1),o.setInResult(!1))}},t.prototype.isCoveredByLA=function(n){return!!(this.isCovered(n,this._resultLineList)||this.isCovered(n,this._resultPolyList))},t.prototype.computeGeometry=function(n,i,o,s){var a=new O;return a.addAll(n),a.addAll(i),a.addAll(o),a.isEmpty()?t.createEmptyResult(s,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(a)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(n,i){for(var o=this,s=i.iterator();s.hasNext();){var a=s.next(),u=o._ptLocator.locate(n,a);if(u!==_.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var n=new O,i=this._edgeList.iterator();i.hasNext();){var o=i.next();o.isCollapsed()&&(i.remove(),n.add(o.getCollapsedEdge()))}this._edgeList.addAll(n)},t.prototype.updateNodeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();){var i=n.next(),o=i.getEdges().getLabel();i.getLabel().merge(o)}},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i=this,o=n.iterator();o.hasNext();){var s=o.next();i.insertUniqueEdge(s)}},t.prototype.computeOverlay=function(n){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new O;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Ur.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(n),this.cancelDuplicateResultEdges();var o=new ye(this._geomFact);o.add(this._graph),this._resultPolyList=o.getPolygons();var s=new Nn(this,this._geomFact,this._ptLocator);this._resultLineList=s.build(n);var a=new hi(this,this._geomFact,this._ptLocator);this._resultPointList=a.build(n),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,i){var o=this._ptLocator.locate(n.getCoordinate(),this._arg[i].getGeometry());n.getLabel().setLocation(i,o)},t.prototype.copyPoints=function(n){for(var i=this,o=this._arg[n].getNodeIterator();o.hasNext();){var s=o.next(),a=i._graph.addNode(s.getCoordinate());a.setLabel(n,s.getLabel().getLocation(n))}},t.prototype.findResultAreaEdges=function(n){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();s.isArea()&&!o.isInteriorAreaEdge()&&t.isResultOfOp(s.getLocation(0,b.RIGHT),s.getLocation(1,b.RIGHT),n)&&o.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var n=this._edgeList.iterator();n.hasNext();){var i=n.next(),o=i.getLabel(),s=i.getDepth();if(!s.isNull()){s.normalize();for(var a=0;a<2;a++)!o.isNull(a)&&o.isArea()&&!s.isNull(a)&&(s.getDelta(a)===0?o.toLine(a):(q.isTrue(!s.isNull(a,b.LEFT),"depth of LEFT side has not been initialized"),o.setLocation(a,b.LEFT,s.getLocation(a,b.LEFT)),q.isTrue(!s.isNull(a,b.RIGHT),"depth of RIGHT side has not been initialized"),o.setLocation(a,b.RIGHT,s.getLocation(a,b.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next();o.getEdges().computeLabelling(n._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n=this,i=this._graph.getNodes().iterator();i.hasNext();){var o=i.next(),s=o.getLabel();o.isIsolated()&&(s.isNull(0)?n.labelIncompleteNode(o,0):n.labelIncompleteNode(o,1)),o.getEdges().updateLabelling(s)}},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(qi);U.overlayOp=function(r,t,e){var n=new U(r,t),i=n.getResultGeometry(e);return i},U.intersection=function(r,t){if(r.isEmpty()||t.isEmpty())return U.createEmptyResult(U.INTERSECTION,r,t,r.getFactory());if(r.isGeometryCollection()){var e=t;return fi.map(r,{interfaces_:function(){return[Xr.MapOp]},map:function(n){return n.intersection(e)}})}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.INTERSECTION)},U.symDifference=function(r,t){if(r.isEmpty()||t.isEmpty()){if(r.isEmpty()&&t.isEmpty())return U.createEmptyResult(U.SYMDIFFERENCE,r,t,r.getFactory());if(r.isEmpty())return t.copy();if(t.isEmpty())return r.copy()}return r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.SYMDIFFERENCE)},U.resultDimension=function(r,t,e){var n=t.getDimension(),i=e.getDimension(),o=-1;switch(r){case U.INTERSECTION:o=Math.min(n,i);break;case U.UNION:o=Math.max(n,i);break;case U.DIFFERENCE:o=n;break;case U.SYMDIFFERENCE:o=Math.max(n,i);break}return o},U.createEmptyResult=function(r,t,e,n){var i=null;switch(U.resultDimension(r,t,e)){case-1:i=n.createGeometryCollection(new Array(0).fill(null));break;case 0:i=n.createPoint();break;case 1:i=n.createLineString();break;case 2:i=n.createPolygon();break}return i},U.difference=function(r,t){return r.isEmpty()?U.createEmptyResult(U.DIFFERENCE,r,t,r.getFactory()):t.isEmpty()?r.copy():(r.checkNotGeometryCollection(r),r.checkNotGeometryCollection(t),ae.overlayOp(r,t,U.DIFFERENCE))},U.isResultOfOp=function(){if(arguments.length===2){var r=arguments[0],t=arguments[1],e=r.getLocation(0),n=r.getLocation(1);return U.isResultOfOp(e,n,t)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===_.BOUNDARY&&(i=_.INTERIOR),o===_.BOUNDARY&&(o=_.INTERIOR),s){case U.INTERSECTION:return i===_.INTERIOR&&o===_.INTERIOR;case U.UNION:return i===_.INTERIOR||o===_.INTERIOR;case U.DIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR;case U.SYMDIFFERENCE:return i===_.INTERIOR&&o!==_.INTERIOR||i!==_.INTERIOR&&o===_.INTERIOR}return!1}},U.INTERSECTION=1,U.UNION=2,U.DIFFERENCE=3,U.SYMDIFFERENCE=4;var Ir=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Qe,this._seg=new B;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ir.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,n=0;n<this._linework.getNumGeometries();n++)for(var i=e._linework.getGeometryN(n),o=i.getCoordinateSequence(),s=0;s<o.size()-1;s++){o.getCoordinate(s,e._seg.p0),o.getCoordinate(s+1,e._seg.p1);var a=e._seg.distance(t);if(a<=e._boundaryDistanceTolerance)return!0}return!1},Ir.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?_.BOUNDARY:this._ptLocator.locate(t,this._g)},Ir.prototype.extractLinework=function(t){var e=new Xi;t.apply(e);var n=e.getLinework(),i=j.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},Ir.prototype.interfaces_=function(){return[]},Ir.prototype.getClass=function(){return Ir};var Xi=function(){this._linework=null,this._linework=new O};Xi.prototype.getLinework=function(){return this._linework},Xi.prototype.filter=function(t){var e=this;if(t instanceof Pt){var n=t;this._linework.add(n.getExteriorRing());for(var i=0;i<n.getNumInteriorRing();i++)e._linework.add(n.getInteriorRingN(i))}},Xi.prototype.interfaces_=function(){return[hn]},Xi.prototype.getClass=function(){return Xi};var Yr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Yr.prototype.extractPoints=function(t,e,n){for(var i=this,o=t.getCoordinates(),s=0;s<o.length-1;s++)i.computeOffsetPoints(o[s],o[s+1],e,n)},Yr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Yr.prototype.getPoints=function(t){for(var e=this,n=new O,i=Ut.getLines(this._g),o=i.iterator();o.hasNext();){var s=o.next();e.extractPoints(s,t,n)}return n},Yr.prototype.computeOffsetPoints=function(t,e,n,i){var o=e.x-t.x,s=e.y-t.y,a=Math.sqrt(o*o+s*s),u=n*o/a,l=n*s/a,c=(e.x+t.x)/2,f=(e.y+t.y)/2;if(this._doLeft){var h=new v(c-l,f+u);i.add(h)}if(this._doRight){var g=new v(c+l,f-u);i.add(g)}},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Pe=function r(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=r.TOLERANCE,this._testCoords=new O;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=r.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,n],this._locFinder=[new Ir(this._geom[0],this._boundaryDistanceTolerance),new Ir(this._geom[1],this._boundaryDistanceTolerance),new Ir(this._geom[2],this._boundaryDistanceTolerance)]},mu={TOLERANCE:{configurable:!0}};Pe.prototype.reportResult=function(t,e,n){Gt.out.println("Overlay result invalid - A:"+_.toLocationSymbol(e[0])+" B:"+_.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+_.toLocationSymbol(e[2]))},Pe.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Pe.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=0;n<this._testCoords.size();n++){var i=t._testCoords.get(n);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var o=arguments[0],s=arguments[1];return this._location[0]=this._locFinder[0].getLocation(s),this._location[1]=this._locFinder[1].getLocation(s),this._location[2]=this._locFinder[2].getLocation(s),Pe.hasLocation(this._location,_.BOUNDARY)?!0:this.isValidResult(o,this._location)}},Pe.prototype.addTestPts=function(t){var e=new Yr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pe.prototype.isValidResult=function(t,e){var n=U.isResultOfOp(e[0],e[1],t),i=e[2]===_.INTERIOR,o=!(n^i);return o||this.reportResult(t,e,n),o},Pe.prototype.getInvalidLocation=function(){return this._invalidLocation},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pe.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Nt.computeSizeBasedSnapTolerance(t),Nt.computeSizeBasedSnapTolerance(e))},Pe.isValid=function(t,e,n,i){var o=new Pe(t,e,i);return o.isValid(n)},mu.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pe,mu);var Re=function r(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=r.extractFactory(t),this._inputGeoms=t};Re.prototype.extractElements=function(t,e){var n=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var o=t.getGeometryN(i);n._skipEmpty&&o.isEmpty()||e.add(o)}},Re.prototype.combine=function(){for(var t=this,e=new O,n=this._inputGeoms.iterator();n.hasNext();){var i=n.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.combine=function(){if(arguments.length===1){var t=arguments[0],e=new Re(t);return e.combine()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new Re(Re.createList(n,i));return o.combine()}else if(arguments.length===3){var s=arguments[0],a=arguments[1],u=arguments[2],l=new Re(Re.createList(s,a,u));return l.combine()}},Re.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Re.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new O;return n.add(t),n.add(e),n}else if(arguments.length===3){var i=arguments[0],o=arguments[1],s=arguments[2],a=new O;return a.add(i),a.add(o),a.add(s),a}};var wt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new O)},_u={STRTREE_NODE_CAPACITY:{configurable:!0}};wt.prototype.reduceToGeometries=function(t){for(var e=this,n=new O,i=t.iterator();i.hasNext();){var o=i.next(),s=null;z(o,Xe)?s=e.unionTree(o):o instanceof G&&(s=o),n.add(s)}return n},wt.prototype.extractByEnvelope=function(t,e,n){for(var i=new O,o=0;o<e.getNumGeometries();o++){var s=e.getGeometryN(o);s.getEnvelopeInternal().intersects(t)?i.add(s):n.add(s)}return this._geomFactory.buildGeometry(i)},wt.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var o=Re.combine(t,e);return o}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var s=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,s)},wt.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 t=new nu(wt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree(),o=this.unionTree(i);return o},wt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1){var o=wt.getGeometry(e,n);return this.unionSafe(o,null)}else{if(i-n===2)return this.unionSafe(wt.getGeometry(e,n),wt.getGeometry(e,n+1));var s=Math.trunc((i+n)/2),a=this.binaryUnion(e,n,s),u=this.binaryUnion(e,s,i);return this.unionSafe(a,u)}}},wt.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e===null?e=i.copy():e=e.union(i)}return e},wt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},wt.prototype.unionActual=function(t,e){return wt.restrictToPolygons(t.union(e))},wt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},wt.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new O,o=this.extractByEnvelope(n,t,i),s=this.extractByEnvelope(n,e,i),a=this.unionActual(o,s);i.add(a);var u=Re.combine(i);return u},wt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}else if(arguments.length===2){var o=arguments[0],s=arguments[1],a=o.getFactory(),u=a.createGeometryCollection([o,s]),l=u.buffer(0);return l}},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.restrictToPolygons=function(t){if(z(t,fr))return t;var e=tr.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(j.toPolygonArray(e))},wt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},wt.union=function(t){var e=new wt(t);return e.union()},_u.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(wt,_u);var Jo=function(){};Jo.prototype.interfaces_=function(){return[]},Jo.prototype.getClass=function(){return Jo},Jo.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return U.createEmptyResult(U.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ae.overlayOp(t,e,U.UNION)};function Wr(){return new $o}function $o(){this.reset()}$o.prototype={constructor:$o,reset:function(){this.s=this.t=0},add:function(r){Eu(ts,r,this.t),Eu(this,ts.s,this.s),this.s?this.t+=ts.t:this.s=ts.t},valueOf:function(){return this.s}};var ts=new $o;function Eu(r,t,e){var n=r.s=t+e,i=n-t,o=n-i;r.t=t-o+(e-i)}var yt=1e-6,it=Math.PI,er=it/2,Iu=it/4,nr=it*2,Hr=180/it,Sn=it/180,ue=Math.abs,qc=Math.atan,Yi=Math.atan2,Ot=Math.cos,Tt=Math.sin,Wi=Math.sqrt;function Cu(r){return r>1?0:r<-1?it:Math.acos(r)}function pi(r){return r>1?er:r<-1?-er:Math.asin(r)}function xo(){}function es(r,t){r&&Su.hasOwnProperty(r.type)&&Su[r.type](r,t)}var Nu={Feature:function(r,t){es(r.geometry,t)},FeatureCollection:function(r,t){for(var e=r.features,n=-1,i=e.length;++n<i;)es(e[n].geometry,t)}},Su={Sphere:function(r,t){t.sphere()},Point:function(r,t){r=r.coordinates,t.point(r[0],r[1],r[2])},MultiPoint:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)r=e[n],t.point(r[0],r[1],r[2])},LineString:function(r,t){Ws(r.coordinates,t,0)},MultiLineString:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)Ws(e[n],t,0)},Polygon:function(r,t){xu(r.coordinates,t)},MultiPolygon:function(r,t){for(var e=r.coordinates,n=-1,i=e.length;++n<i;)xu(e[n],t)},GeometryCollection:function(r,t){for(var e=r.geometries,n=-1,i=e.length;++n<i;)es(e[n],t)}};function Ws(r,t,e){var n=-1,i=r.length-e,o;for(t.lineStart();++n<i;)o=r[n],t.point(o[0],o[1],o[2]);t.lineEnd()}function xu(r,t){var e=-1,n=r.length;for(t.polygonStart();++e<n;)Ws(r[e],t,1);t.polygonEnd()}function Xc(r,t){r&&Nu.hasOwnProperty(r.type)?Nu[r.type](r,t):es(r,t)}Wr(),Wr();function Hs(r){return[Yi(r[1],r[0]),pi(r[2])]}function Hi(r){var t=r[0],e=r[1],n=Ot(e);return[n*Ot(t),n*Tt(t),Tt(e)]}function ns(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function rs(r,t){return[r[1]*t[2]-r[2]*t[1],r[2]*t[0]-r[0]*t[2],r[0]*t[1]-r[1]*t[0]]}function js(r,t){r[0]+=t[0],r[1]+=t[1],r[2]+=t[2]}function is(r,t){return[r[0]*t,r[1]*t,r[2]*t]}function Ks(r){var t=Wi(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]);r[0]/=t,r[1]/=t,r[2]/=t}Wr();function wu(r,t){function e(n,i){return n=r(n,i),t(n[0],n[1])}return r.invert&&t.invert&&(e.invert=function(n,i){return n=t.invert(n,i),n&&r.invert(n[0],n[1])}),e}function Qs(r,t){return[r>it?r-nr:r<-it?r+nr:r,t]}Qs.invert=Qs;function Yc(r,t,e){return(r%=nr)?t||e?wu(bu(r),Pu(t,e)):bu(r):t||e?Pu(t,e):Qs}function Lu(r){return function(t,e){return t+=r,[t>it?t-nr:t<-it?t+nr:t,e]}}function bu(r){var t=Lu(r);return t.invert=Lu(-r),t}function Pu(r,t){var e=Ot(r),n=Tt(r),i=Ot(t),o=Tt(t);function s(a,u){var l=Ot(u),c=Ot(a)*l,f=Tt(a)*l,h=Tt(u),g=h*e+c*n;return[Yi(f*i-g*o,c*e-h*n),pi(g*i+f*o)]}return s.invert=function(a,u){var l=Ot(u),c=Ot(a)*l,f=Tt(a)*l,h=Tt(u),g=h*i-f*o;return[Yi(f*i+h*o,c*e+g*n),pi(g*e-c*n)]},s}function Wc(r,t,e,n,i,o){if(e){var s=Ot(t),a=Tt(t),u=n*e;i==null?(i=t+n*nr,o=t-u/2):(i=Ru(s,i),o=Ru(s,o),(n>0?i<o:i>o)&&(i+=n*nr));for(var l,c=i;n>0?c>o:c<o;c-=u)l=Hs([s,-a*Ot(c),-a*Tt(c)]),r.point(l[0],l[1])}}function Ru(r,t){t=Hi(t),t[0]-=r,Ks(t);var e=Cu(-t[1]);return((-t[2]<0?-e:e)+nr-yt)%nr}function Ou(){var r=[],t;return{point:function(e,n){t.push([e,n])},lineStart:function(){r.push(t=[])},lineEnd:xo,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var e=r;return r=[],t=null,e}}}function Hc(r,t,e,n,i,o){var s=r[0],a=r[1],u=t[0],l=t[1],c=0,f=1,h=u-s,g=l-a,p;if(p=e-s,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=i-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}if(p=n-a,!(!g&&p>0)){if(p/=g,g<0){if(p<c)return;p<f&&(f=p)}else if(g>0){if(p>f)return;p>c&&(c=p)}if(p=o-a,!(!g&&p<0)){if(p/=g,g<0){if(p>f)return;p>c&&(c=p)}else if(g>0){if(p<c)return;p<f&&(f=p)}return c>0&&(r[0]=s+c*h,r[1]=a+c*g),f<1&&(t[0]=s+f*h,t[1]=a+f*g),!0}}}}}function os(r,t){return ue(r[0]-t[0])<yt&&ue(r[1]-t[1])<yt}function ss(r,t,e,n){this.x=r,this.z=t,this.o=e,this.e=n,this.v=!1,this.n=this.p=null}function Tu(r,t,e,n,i){var o=[],s=[],a,u;if(r.forEach(function(p){if(!((y=p.length-1)<=0)){var y,d=p[0],m=p[y],E;if(os(d,m)){for(i.lineStart(),a=0;a<y;++a)i.point((d=p[a])[0],d[1]);i.lineEnd();return}o.push(E=new ss(d,p,null,!0)),s.push(E.o=new ss(d,null,E,!1)),o.push(E=new ss(m,p,null,!1)),s.push(E.o=new ss(m,null,E,!0))}}),!!o.length){for(s.sort(t),Du(o),Du(s),a=0,u=s.length;a<u;++a)s[a].e=e=!e;for(var l=o[0],c,f;;){for(var h=l,g=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(g)for(a=0,u=c.length;a<u;++a)i.point((f=c[a])[0],f[1]);else n(h.x,h.n.x,1,i);h=h.n}else{if(g)for(c=h.p.z,a=c.length-1;a>=0;--a)i.point((f=c[a])[0],f[1]);else n(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,g=!g}while(!h.v);i.lineEnd()}}}function Du(r){if(t=r.length){for(var t,e=0,n=r[0],i;++e<t;)n.n=i=r[e],i.p=n,n=i;n.n=i=r[0],i.p=n}}function Mu(r,t){return r<t?-1:r>t?1:r>=t?0:NaN}function jc(r){return r.length===1&&(r=Kc(r)),{left:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)<0?n=o+1:i=o}return n},right:function(t,e,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var o=n+i>>>1;r(t[o],e)>0?i=o:n=o+1}return n}}}function Kc(r){return function(t,e){return Mu(r(t),e)}}jc(Mu);function Au(r){for(var t=r.length,e,n=-1,i=0,o,s;++n<t;)i+=r[n].length;for(o=new Array(i);--t>=0;)for(s=r[t],e=s.length;--e>=0;)o[--i]=s[e];return o}var wo=1e9,as=-wo;function Qc(r,t,e,n){function i(l,c){return r<=l&&l<=e&&t<=c&&c<=n}function o(l,c,f,h){var g=0,p=0;if(l==null||(g=s(l,f))!==(p=s(c,f))||u(l,c)<0^f>0)do h.point(g===0||g===3?r:e,g>1?n:t);while((g=(g+f+4)%4)!==p);else h.point(c[0],c[1])}function s(l,c){return ue(l[0]-r)<yt?c>0?0:3:ue(l[0]-e)<yt?c>0?2:1:ue(l[1]-t)<yt?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),h=s(c,1);return f!==h?f-h:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=Ou(),h,g,p,y,d,m,E,C,L,N,x,T={point:A,lineStart:R,lineEnd:Y,polygonStart:F,polygonEnd:X};function A(W,ut){i(W,ut)&&c.point(W,ut)}function w(){for(var W=0,ut=0,mt=g.length;ut<mt;++ut)for(var Jt=g[ut],le=1,Cr=Jt.length,Je=Jt[0],Nr,zn,vi=Je[0],$e=Je[1];le<Cr;++le)Nr=vi,zn=$e,Je=Jt[le],vi=Je[0],$e=Je[1],zn<=n?$e>n&&(vi-Nr)*(n-zn)>($e-zn)*(r-Nr)&&++W:$e<=n&&(vi-Nr)*(n-zn)<($e-zn)*(r-Nr)&&--W;return W}function F(){c=f,h=[],g=[],x=!0}function X(){var W=w(),ut=x&&W,mt=(h=Au(h)).length;(ut||mt)&&(l.polygonStart(),ut&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),mt&&Tu(h,a,W,o,l),l.polygonEnd()),c=l,h=g=p=null}function R(){T.point=D,g&&g.push(p=[]),N=!0,L=!1,E=C=NaN}function Y(){h&&(D(y,d),m&&L&&f.rejoin(),h.push(f.result())),T.point=A,L&&c.lineEnd()}function D(W,ut){var mt=i(W,ut);if(g&&p.push([W,ut]),N)y=W,d=ut,m=mt,N=!1,mt&&(c.lineStart(),c.point(W,ut));else if(mt&&L)c.point(W,ut);else{var Jt=[E=Math.max(as,Math.min(wo,E)),C=Math.max(as,Math.min(wo,C))],le=[W=Math.max(as,Math.min(wo,W)),ut=Math.max(as,Math.min(wo,ut))];Hc(Jt,le,r,t,e,n)?(L||(c.lineStart(),c.point(Jt[0],Jt[1])),c.point(le[0],le[1]),mt||c.lineEnd(),x=!1):mt&&(c.lineStart(),c.point(W,ut),x=!1)}E=W,C=ut,L=mt}return T}}var Zs=Wr();function Zc(r,t){var e=t[0],n=t[1],i=[Tt(e),-Ot(e),0],o=0,s=0;Zs.reset();for(var a=0,u=r.length;a<u;++a)if(c=(l=r[a]).length)for(var l,c,f=l[c-1],h=f[0],g=f[1]/2+Iu,p=Tt(g),y=Ot(g),d=0;d<c;++d,h=E,p=L,y=N,f=m){var m=l[d],E=m[0],C=m[1]/2+Iu,L=Tt(C),N=Ot(C),x=E-h,T=x>=0?1:-1,A=T*x,w=A>it,F=p*L;if(Zs.add(Yi(F*T*Tt(A),y*N+F*Ot(A))),o+=w?x+T*nr:x,w^h>=e^E>=e){var X=rs(Hi(f),Hi(m));Ks(X);var R=rs(i,X);Ks(R);var Y=(w^x>=0?-1:1)*pi(R[2]);(n>Y||n===Y&&(X[0]||X[1]))&&(s+=w^x>=0?1:-1)}}return(o<-yt||o<yt&&Zs<-yt)^s&1}Wr();function Fu(r){return r}Wr(),Wr();var ji=1/0,us=ji,Lo=-ji,ls=Lo,ku={point:Jc,lineStart:xo,lineEnd:xo,polygonStart:xo,polygonEnd:xo,result:function(){var r=[[ji,us],[Lo,ls]];return Lo=ls=-(us=ji=1/0),r}};function Jc(r,t){r<ji&&(ji=r),r>Lo&&(Lo=r),t<us&&(us=t),t>ls&&(ls=t)}Wr();function Bu(r,t,e,n){return function(i,o){var s=t(o),a=i.invert(n[0],n[1]),u=Ou(),l=t(u),c=!1,f,h,g,p={point:y,lineStart:m,lineEnd:E,polygonStart:function(){p.point=C,p.lineStart=L,p.lineEnd=N,h=[],f=[]},polygonEnd:function(){p.point=y,p.lineStart=m,p.lineEnd=E,h=Au(h);var x=Zc(f,a);h.length?(c||(o.polygonStart(),c=!0),Tu(h,tf,x,e,o)):x&&(c||(o.polygonStart(),c=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),c&&(o.polygonEnd(),c=!1),h=f=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(x,T){var A=i(x,T);r(x=A[0],T=A[1])&&o.point(x,T)}function d(x,T){var A=i(x,T);s.point(A[0],A[1])}function m(){p.point=d,s.lineStart()}function E(){p.point=y,s.lineEnd()}function C(x,T){g.push([x,T]);var A=i(x,T);l.point(A[0],A[1])}function L(){l.lineStart(),g=[]}function N(){C(g[0][0],g[0][1]),l.lineEnd();var x=l.clean(),T=u.result(),A,w=T.length,F,X,R;if(g.pop(),f.push(g),g=null,!!w){if(x&1){if(X=T[0],(F=X.length-1)>0){for(c||(o.polygonStart(),c=!0),o.lineStart(),A=0;A<F;++A)o.point((R=X[A])[0],R[1]);o.lineEnd()}return}w>1&&x&2&&T.push(T.pop().concat(T.shift())),h.push(T.filter($c))}}return p}}function $c(r){return r.length>1}function tf(r,t){return((r=r.x)[0]<0?r[1]-er-yt:er-r[1])-((t=t.x)[0]<0?t[1]-er-yt:er-t[1])}const Gu=Bu(function(){return!0},ef,rf,[-it,-er]);function ef(r){var t=NaN,e=NaN,n=NaN,i;return{lineStart:function(){r.lineStart(),i=1},point:function(o,s){var a=o>0?it:-it,u=ue(o-t);ue(u-it)<yt?(r.point(t,e=(e+s)/2>0?er:-er),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),r.point(o,e),i=0):n!==a&&u>=it&&(ue(t-n)<yt&&(t-=n*yt),ue(o-a)<yt&&(o-=a*yt),e=nf(t,e,o,s),r.point(n,e),r.lineEnd(),r.lineStart(),r.point(a,e),i=0),r.point(t=o,e=s),n=a},lineEnd:function(){r.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function nf(r,t,e,n){var i,o,s=Tt(r-e);return ue(s)>yt?qc((Tt(t)*(o=Ot(n))*Tt(e)-Tt(n)*(i=Ot(t))*Tt(r))/(i*o*s)):(t+n)/2}function rf(r,t,e,n){var i;if(r==null)i=e*er,n.point(-it,i),n.point(0,i),n.point(it,i),n.point(it,0),n.point(it,-i),n.point(0,-i),n.point(-it,-i),n.point(-it,0),n.point(-it,i);else if(ue(r[0]-t[0])>yt){var o=r[0]<t[0]?it:-it;i=e*o/2,n.point(-o,i),n.point(0,i),n.point(o,i)}else n.point(t[0],t[1])}function of(r,t){var e=Ot(r),n=e>0,i=ue(e)>yt;function o(c,f,h,g){Wc(g,r,t,h,c,f)}function s(c,f){return Ot(c)*Ot(f)>e}function a(c){var f,h,g,p,y;return{lineStart:function(){p=g=!1,y=1},point:function(d,m){var E=[d,m],C,L=s(d,m),N=n?L?0:l(d,m):L?l(d+(d<0?it:-it),m):0;if(!f&&(p=g=L)&&c.lineStart(),L!==g&&(C=u(f,E),(!C||os(f,C)||os(E,C))&&(E[0]+=yt,E[1]+=yt,L=s(E[0],E[1]))),L!==g)y=0,L?(c.lineStart(),C=u(E,f),c.point(C[0],C[1])):(C=u(f,E),c.point(C[0],C[1]),c.lineEnd()),f=C;else if(i&&f&&n^L){var x;!(N&h)&&(x=u(E,f,!0))&&(y=0,n?(c.lineStart(),c.point(x[0][0],x[0][1]),c.point(x[1][0],x[1][1]),c.lineEnd()):(c.point(x[1][0],x[1][1]),c.lineEnd(),c.lineStart(),c.point(x[0][0],x[0][1])))}L&&(!f||!os(f,E))&&c.point(E[0],E[1]),f=E,g=L,h=N},lineEnd:function(){g&&c.lineEnd(),f=null},clean:function(){return y|(p&&g)<<1}}}function u(c,f,h){var g=Hi(c),p=Hi(f),y=[1,0,0],d=rs(g,p),m=ns(d,d),E=d[0],C=m-E*E;if(!C)return!h&&c;var L=e*m/C,N=-e*E/C,x=rs(y,d),T=is(y,L),A=is(d,N);js(T,A);var w=x,F=ns(T,w),X=ns(w,w),R=F*F-X*(ns(T,T)-1);if(!(R<0)){var Y=Wi(R),D=is(w,(-F-Y)/X);if(js(D,T),D=Hs(D),!h)return D;var W=c[0],ut=f[0],mt=c[1],Jt=f[1],le;ut<W&&(le=W,W=ut,ut=le);var Cr=ut-W,Je=ue(Cr-it)<yt,Nr=Je||Cr<yt;if(!Je&&Jt<mt&&(le=mt,mt=Jt,Jt=le),Nr?Je?mt+Jt>0^D[1]<(ue(D[0]-W)<yt?mt:Jt):mt<=D[1]&&D[1]<=Jt:Cr>it^(W<=D[0]&&D[0]<=ut)){var zn=is(w,(-F+Y)/X);return js(zn,T),[D,Hs(zn)]}}}function l(c,f){var h=n?r:it-r,g=0;return c<-h?g|=1:c>h&&(g|=2),f<-h?g|=4:f>h&&(g|=8),g}return Bu(s,a,o,n?[0,-r]:[-it,r-it])}function zu(r){return function(t){var e=new Js;for(var n in r)e[n]=r[n];return e.stream=t,e}}function Js(){}Js.prototype={constructor:Js,point:function(r,t){this.stream.point(r,t)},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 Vu(r,t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),o!=null&&r.clipExtent(null),Xc(e,r.stream(ku));var s=ku.result(),a=Math.min(n/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+t[0][0]+(n-a*(s[1][0]+s[0][0]))/2,l=+t[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return o!=null&&r.clipExtent(o),r.scale(a*150).translate([u,l])}function sf(r,t,e){return Vu(r,[[0,0],t],e)}var Uu=16,af=Ot(30*Sn);function qu(r,t){return+t?lf(r,t):uf(r)}function uf(r){return zu({point:function(t,e){t=r(t,e),this.stream.point(t[0],t[1])}})}function lf(r,t){function e(n,i,o,s,a,u,l,c,f,h,g,p,y,d){var m=l-n,E=c-i,C=m*m+E*E;if(C>4*t&&y--){var L=s+h,N=a+g,x=u+p,T=Wi(L*L+N*N+x*x),A=pi(x/=T),w=ue(ue(x)-1)<yt||ue(o-f)<yt?(o+f)/2:Yi(N,L),F=r(w,A),X=F[0],R=F[1],Y=X-n,D=R-i,W=E*Y-m*D;(W*W/C>t||ue((m*Y+E*D)/C-.5)>.3||s*h+a*g+u*p<af)&&(e(n,i,o,s,a,u,X,R,w,L/=T,N/=T,x,y,d),d.point(X,R),e(X,R,w,L,N,x,l,c,f,h,g,p,y,d))}}return function(n){var i,o,s,a,u,l,c,f,h,g,p,y,d={point:m,lineStart:E,lineEnd:L,polygonStart:function(){n.polygonStart(),d.lineStart=N},polygonEnd:function(){n.polygonEnd(),d.lineStart=E}};function m(A,w){A=r(A,w),n.point(A[0],A[1])}function E(){f=NaN,d.point=C,n.lineStart()}function C(A,w){var F=Hi([A,w]),X=r(A,w);e(f,h,c,g,p,y,f=X[0],h=X[1],c=A,g=F[0],p=F[1],y=F[2],Uu,n),n.point(f,h)}function L(){d.point=m,n.lineEnd()}function N(){E(),d.point=x,d.lineEnd=T}function x(A,w){C(i=A,w),o=f,s=h,a=g,u=p,l=y,d.point=C}function T(){e(f,h,c,g,p,y,o,s,i,a,u,l,Uu,n),d.lineEnd=L,L()}return d}}var cf=zu({point:function(r,t){this.stream.point(r*Sn,t*Sn)}});function ff(r){return hf(function(){return r})()}function hf(r){var t,e=150,n=480,i=250,o,s,a=0,u=0,l=0,c=0,f=0,h,g,p=null,y=Gu,d=null,m,E,C,L=Fu,N=.5,x=qu(X,N),T,A;function w(D){return D=g(D[0]*Sn,D[1]*Sn),[D[0]*e+o,s-D[1]*e]}function F(D){return D=g.invert((D[0]-o)/e,(s-D[1])/e),D&&[D[0]*Hr,D[1]*Hr]}function X(D,W){return D=t(D,W),[D[0]*e+o,s-D[1]*e]}w.stream=function(D){return T&&A===D?T:T=cf(y(h,x(L(A=D))))},w.clipAngle=function(D){return arguments.length?(y=+D?of(p=D*Sn,6*Sn):(p=null,Gu),Y()):p*Hr},w.clipExtent=function(D){return arguments.length?(L=D==null?(d=m=E=C=null,Fu):Qc(d=+D[0][0],m=+D[0][1],E=+D[1][0],C=+D[1][1]),Y()):d==null?null:[[d,m],[E,C]]},w.scale=function(D){return arguments.length?(e=+D,R()):e},w.translate=function(D){return arguments.length?(n=+D[0],i=+D[1],R()):[n,i]},w.center=function(D){return arguments.length?(a=D[0]%360*Sn,u=D[1]%360*Sn,R()):[a*Hr,u*Hr]},w.rotate=function(D){return arguments.length?(l=D[0]%360*Sn,c=D[1]%360*Sn,f=D.length>2?D[2]%360*Sn:0,R()):[l*Hr,c*Hr,f*Hr]},w.precision=function(D){return arguments.length?(x=qu(X,N=D*D),Y()):Wi(N)},w.fitExtent=function(D,W){return Vu(w,D,W)},w.fitSize=function(D,W){return sf(w,D,W)};function R(){g=wu(h=Yc(l,c,f),t);var D=t(a,u);return o=n-D[0]*e,s=i+D[1]*e,Y()}function Y(){return T=A=null,w}return function(){return t=r.apply(this,arguments),w.invert=t.invert&&F,R()}}function Xu(r){return function(t,e){var n=Ot(t),i=Ot(e),o=r(n*i);return[o*i*Tt(t),o*Tt(e)]}}function Yu(r){return function(t,e){var n=Wi(t*t+e*e),i=r(n),o=Tt(i),s=Ot(i);return[Yi(t*o,n*s),pi(n&&e*o/n)]}}var gf=Xu(function(r){return Wi(2/(1+r))});gf.invert=Yu(function(r){return 2*pi(r/2)});var Wu=Xu(function(r){return(r=Cu(r))&&r/Tt(r)});Wu.invert=Yu(function(r){return r});function pf(){return ff(Wu).scale(79.4188).clipAngle(180-.001)}function Hu(r,t){return[r,t]}Hu.invert=Hu;function df(r,t,e){e=e||{};var n=e.units||"kilometers",i=e.steps||8;if(!r)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(r.type){case"GeometryCollection":return Ua(r,function(s){var a=cs(s,t,n,i);a&&o.push(a)}),ws(o);case"FeatureCollection":return Va(r,function(s){var a=cs(s,t,n,i);a&&Va(a,function(u){u&&o.push(u)})}),ws(o)}return cs(r,t,n,i)}function cs(r,t,e,n){var i=r.properties||{},o=r.type==="Feature"?r.geometry:r;if(o.type==="GeometryCollection"){var s=[];return Ua(r,function(y){var d=cs(y,t,e,n);d&&s.push(d)}),ws(s)}var a=vf(o),u={type:o.type,coordinates:Ku(o.coordinates,a)},l=new Fs,c=l.read(u),f=_c(Ec(t,e),"meters"),h=Vt.bufferOp(c,f,n),g=new tu;if(h=g.write(h),!ju(h.coordinates)){var p={type:h.type,coordinates:Qu(h.coordinates,a)};return Mo(p,i)}}function ju(r){return Array.isArray(r[0])?ju(r[0]):isNaN(r[0])}function Ku(r,t){return typeof r[0]!="object"?t(r):r.map(function(e){return Ku(e,t)})}function Qu(r,t){return typeof r[0]!="object"?t.invert(r):r.map(function(e){return Qu(e,t)})}function vf(r){var t=xc(r).geometry.coordinates,e=[-t[0],-t[1]];return pf().rotate(e).scale(Ne)}function yf(r,t){var e=Ao(r),n=Ao(t),i=r.properties||{},o=Aa.difference(e.coordinates,n.coordinates);return o.length===0?null:o.length===1?ka(o[0],i):Ba(o,i)}function Zu(r){let t;for(const e of r)t&&e[0]-t[0]>=180?e[0]-=360:t&&e[0]-t[0]<-180&&(e[0]+=360),t=e}function Ju(r,t){const e=yf({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},r);if(!e)return;e.properties={isMask:"y"};const n=df(r,0);if(n.geometry.type==="Polygon")for(const i of n.geometry.coordinates)Zu(i);else for(const i of n.geometry.coordinates)for(const o of i)Zu(o);t({type:"FeatureCollection",features:[n,e]})}function $u(r,t=!0,e=!0,n={},i={},o=s=>{var l,c,f;const a=(l=s==null?void 0:s.geometry)==null?void 0:l.type,u=(c=s==null?void 0:s.properties)!=null&&c.isMask?0:a==="LineString"||a==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(f=s==null?void 0:s.properties)!=null&&f.isMask?.1:0,weight:u,dashArray:[u,u],lineCap:"butt"}}){let s,a,u=[],l,c,f=nn.geoJSON(void 0,{style:o,interactive:!1}).addTo(r);const h=()=>{let d;const m=r.getZoom()>10?[(d=r.getCenter().wrap()).lng,d.lat]:void 0;a!==m&&(a=m,s==null||s({type:"proximityChange",proximity:m}))},g=d=>{s==null||s({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function p(d,m=!1){const E=document.createElement("div");return new Sc({props:{displayIn:"leaflet"},target:E}),new nn.Marker(d,{interactive:m,icon:new nn.DivIcon({html:E,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(s=d,r.on("moveend",h),h(),r.on("click",g)):(r.off("moveend",h),s==null||s({type:"proximityChange",proximity:void 0}),s=void 0,r.off("click",g))},flyTo(d,m){r.flyTo([d[1],d[0]],m,{duration:2,...n})},fitBounds(d,m,E){r.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[m,m],duration:2,maxZoom:E,...i})},indicateReverse(d){r.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var E;if(!t)return;const m=d&&[d[1],d[0]];c?m?c.setLatLng(m):(c.remove(),c=void 0):m&&(c=(typeof t=="object"?new nn.Marker(m,t):p(m)).addTo(r),(E=c.getElement())==null||E.classList.add("marker-reverse"))},setMarkers(d,m){if(!t)return;function E(C){f.clearLayers(),C&&f.addData(C)}for(const C of u)C.remove();if(u.length=0,E(),m){let C=!1;if(m.geometry.type==="GeometryCollection"){const N=m.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");if(N.length>0){let x=N.pop();for(const T of N)x=Ic(x,T);Ju({...m,geometry:x},E),C=!0}else{const x=m.geometry.geometries.filter(T=>T.type==="LineString"||T.type==="MultiLineString");x.length>0&&(E({...m,geometry:{type:"GeometryCollection",geometries:x}}),C=!0)}}if(!C){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Ju(m,E);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){E(m);return}}const L=[m.center[1],m.center[0]];u.push((typeof t=="object"?new nn.Marker(L,t):p(L)).addTo(r))}if(e)for(const C of d??[]){if(C===m)continue;const L=[C.center[1],C.center[0]],N=typeof e=="object"?new nn.Marker(L,e):p(L,!0);N.addTo(r).bindTooltip(C.place_name.replace(/,.*/,""),{direction:"top"});const x=N.getElement();x&&(x.addEventListener("click",T=>{T.stopPropagation(),s==null||s({type:"markerClick",id:C.id})}),x.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:C.id})}),x.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:C.id})}),x.classList.toggle("marker-fuzzy",!!C.matching_text)),u.push(N)}},setSelectedMarker(d){var m,E;l&&((m=l.getElement())==null||m.classList.toggle("marker-selected",!1)),l=d>-1?u[d]:void 0,(E=l==null?void 0:l.getElement())==null||E.classList.toggle("marker-selected",!0)}}}class tl extends nn.Control{constructor(e){super();oa(this,Gn,void 0);oa(this,di,void 0);gs(this,di,e)}onAdd(e){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",nn.DomEvent.disableClickPropagation(n),nn.DomEvent.disableScrollPropagation(n);const{marker:i,showResultMarkers:o,flyTo:s,fullGeometryStyle:a,...u}=sr(this,di),l=typeof s=="boolean"?{}:s,c=$u(e,i,o,l,l,a);gs(this,Gn,new Kl({target:n,props:{mapController:c,flyTo:s===void 0?!0:!!s,...u}}));for(const f of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])sr(this,Gn).$on(f,h=>e.fire(f.toLowerCase(),h.detail));return n}setOptions(e){var u;gs(this,di,e);const{marker:n,showResultMarkers:i,flyTo:o,fullGeometryStyle:s,...a}=sr(this,di);(u=sr(this,Gn))==null||u.$set(a)}setQuery(e,n=!0){var i;(i=sr(this,Gn))==null||i.setQuery(e,n)}setReverseMode(e){var n;(n=sr(this,Gn))==null||n.$set({reverseActive:e})}focus(){var e;(e=sr(this,Gn))==null||e.focus()}blur(){var e;(e=sr(this,Gn))==null||e.blur()}onRemove(){var e;(e=sr(this,Gn))==null||e.$destroy()}}Gn=new WeakMap,di=new WeakMap;function mf(...r){return new tl(...r)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=mf),Dt.GeocodingControl=tl,Dt.createLeafletMapController=$u,Object.defineProperty(Dt,Symbol.toStringTag,{value:"Module"})});
26
26
  //# sourceMappingURL=leaflet.umd.cjs.map