@maptiler/geocoding-control 0.0.59 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maplibregl.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Wu=(Ot,K,$e)=>{if(!K.has(Ot))throw TypeError("Cannot "+$e)};var er=(Ot,K,$e)=>(Wu(Ot,K,"read from private field"),$e?$e.call(Ot):K.get(Ot)),Zs=(Ot,K,$e)=>{if(K.has(Ot))throw TypeError("Cannot add the same private member more than once");K instanceof WeakSet?K.add(Ot):K.set(Ot,$e)},as=(Ot,K,$e,Ui)=>(Wu(Ot,K,"write to private field"),Ui?Ui.call(Ot,$e):K.set(Ot,$e),$e);(function(Ot,K){typeof exports=="object"&&typeof module<"u"?K(exports):typeof define=="function"&&define.amd?define(["exports"],K):(Ot=typeof globalThis<"u"?globalThis:Ot||self,K(Ot.maplibreglMaptilerGeocoder={}))})(this,function(Ot){var Fn,ni;"use strict";function K(){}function $e(r,t){for(const e in t)r[e]=t[e];return r}function Ui(r){return r()}function $s(){return Object.create(null)}function pr(r){r.forEach(Ui)}function ta(r){return typeof r=="function"}function ai(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function ju(r){return Object.keys(r).length===0}function Ku(r,t,e,n){if(r){const i=ea(r,t,e,n);return r[0](i)}}function ea(r,t,e,n){return r[1]&&n?$e(e.ctx.slice(),r[1](n(t))):e.ctx}function Qu(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 Ju(r,t,e,n,i,o){if(i){const s=ea(t,e,n,o);r.p(s,i)}}function Zu(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 na(r){return r??""}function lt(r,t){r.appendChild(t)}function ke(r,t,e){r.insertBefore(t,e||null)}function Le(r){r.parentNode&&r.parentNode.removeChild(r)}function $u(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function Qt(r){return document.createElement(r)}function dr(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Fr(r){return document.createTextNode(r)}function Bn(){return Fr(" ")}function ze(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function tl(r){return function(t){return t.preventDefault(),r.call(this,t)}}function B(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function el(r){return Array.from(r.childNodes)}function qi(r,t){t=""+t,r.wholeText!==t&&(r.data=t)}function ra(r,t){r.value=t??""}function tn(r,t,e){r.classList[e?"add":"remove"](t)}function nl(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Xi;function Yi(r){Xi=r}function ia(){if(!Xi)throw new Error("Function called outside component initialization");return Xi}function rl(r){ia().$$.on_destroy.push(r)}function il(){const r=ia();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=nl(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}const ui=[],us=[],Co=[],oa=[],ol=Promise.resolve();let ls=!1;function sl(){ls||(ls=!0,ol.then(sa))}function cs(r){Co.push(r)}const fs=new Set;let li=0;function sa(){if(li!==0)return;const r=Xi;do{try{for(;li<ui.length;){const t=ui[li];li++,Yi(t),al(t.$$)}}catch(t){throw ui.length=0,li=0,t}for(Yi(null),ui.length=0,li=0;us.length;)us.pop()();for(let t=0;t<Co.length;t+=1){const e=Co[t];fs.has(e)||(fs.add(e),e())}Co.length=0}while(ui.length);for(;oa.length;)oa.pop()();ls=!1,fs.clear(),Yi(r)}function al(r){if(r.fragment!==null){r.update(),pr(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(cs)}}const No=new Set;let Br;function xo(){Br={r:0,c:[],p:Br}}function So(){Br.r||pr(Br.c),Br=Br.p}function Jt(r,t){r&&r.i&&(No.delete(r),r.i(t))}function be(r,t,e,n){if(r&&r.o){if(No.has(r))return;No.add(r),Br.c.push(()=>{No.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function Hi(r){r&&r.c()}function ci(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||cs(()=>{const s=r.$$.on_mount.map(Ui).filter(ta);r.$$.on_destroy?r.$$.on_destroy.push(...s):pr(s),r.$$.on_mount=[]}),o.forEach(cs)}function fi(r,t){const e=r.$$;e.fragment!==null&&(pr(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function ul(r,t){r.$$.dirty[0]===-1&&(ui.push(r),sl(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function hi(r,t,e,n,i,o,s,a=[-1]){const u=Xi;Yi(r);const l=r.$$={fragment:null,ctx:[],props:o,update:K,not_equal:i,bound:$s(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:$s(),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&&ul(r,f)),h}):[],l.update(),c=!0,pr(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=el(t.target);l.fragment&&l.fragment.l(f),f.forEach(Le)}else l.fragment&&l.fragment.c();t.intro&&Jt(r.$$.fragment),ci(r,t.target,t.anchor,t.customElement),sa()}Yi(u)}class gi{$destroy(){fi(this,1),this.$destroy=K}$on(t,e){if(!ta(e))return K;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&&!ju(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const uf="";function ll(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(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"),B(t,"viewBox","0 0 60.006 21.412"),B(t,"width","14"),B(t,"height","20"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class cl extends gi{constructor(t){super(),hi(this,t,null,ll,ai,{})}}const lf="";function fl(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),B(t,"viewBox","0 0 18 18"),B(t,"width","16"),B(t,"height","16"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class hl extends gi{constructor(t){super(),hi(this,t,null,fl,ai,{})}}const cf="";function gl(r){let t;return{c(){t=Qt("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>',B(t,"class","svelte-7cmwmc")},m(e,n){ke(e,t,n)},p:K,i:K,o:K,d(e){e&&Le(t)}}}class pl extends gi{constructor(t){super(),hi(this,t,null,gl,ai,{})}}const ff="";function dl(r){let t,e,n;return{c(){t=dr("svg"),e=dr("path"),B(e,"stroke-width","4"),B(e,"fill-rule","evenodd"),B(e,"clip-rule","evenodd"),B(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"),B(e,"class","svelte-1k1cmht"),B(t,"width",n=r[0]!=="list"?void 0:"20"),B(t,"viewBox","0 0 70 85"),B(t,"fill","none"),B(t,"class","svelte-1k1cmht"),tn(t,"in-map",r[0]!=="list"),tn(t,"list-icon",r[0]==="list")},m(i,o){ke(i,t,o),lt(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&B(t,"width",n),o&1&&tn(t,"in-map",i[0]!=="list"),o&1&&tn(t,"list-icon",i[0]==="list")},i:K,o:K,d(i){i&&Le(t)}}}function vl(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class aa extends gi{constructor(t){super(),hi(this,t,vl,dl,ai,{displayIn:0})}}const hf="";function yl(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),B(t,"viewBox","0 0 18 18"),B(t,"xml:space","preserve"),B(t,"width","20"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class ml extends gi{constructor(t){super(),hi(this,t,null,yl,ai,{})}}const gf="";function ua(r,t,e){const n=r.slice();return n[68]=t[e],n[70]=e,n}function la(r){let t,e;return t=new pl({}),{c(){Hi(t.$$.fragment)},m(n,i){ci(t,n,i),e=!0},i(n){e||(Jt(t.$$.fragment,n),e=!0)},o(n){be(t.$$.fragment,n),e=!1},d(n){fi(t,n)}}}function ca(r){let t,e,n,i,o;return e=new cl({}),{c(){t=Qt("button"),Hi(e.$$.fragment),B(t,"type","button"),B(t,"title",r[8]),B(t,"class","svelte-1h1zm6d"),tn(t,"active",r[1])},m(s,a){ke(s,t,a),ci(e,t,null),n=!0,i||(o=ze(t,"click",r[55]),i=!0)},p(s,a){(!n||a[0]&256)&&B(t,"title",s[8]),(!n||a[0]&2)&&tn(t,"active",s[1])},i(s){n||(Jt(e.$$.fragment,s),n=!0)},o(s){be(e.$$.fragment,s),n=!1},d(s){s&&Le(t),fi(e),i=!1,o()}}}function _l(r){let t,e,n,i,o=r[12],s=[];for(let u=0;u<o.length;u+=1)s[u]=ha(ua(r,o,u));const a=u=>be(s[u],1,1,()=>{s[u]=null});return{c(){t=Qt("ul");for(let u=0;u<s.length;u+=1)s[u].c();B(t,"class","svelte-1h1zm6d")},m(u,l){ke(u,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0,n||(i=[ze(t,"mouseout",r[58]),ze(t,"blur",r[59])],n=!0)},p(u,l){if(l[0]&2110464){o=u[12];let c;for(c=0;c<o.length;c+=1){const f=ua(u,o,c);s[c]?(s[c].p(f,l),Jt(s[c],1)):(s[c]=ha(f),s[c].c(),Jt(s[c],1),s[c].m(t,null))}for(xo(),c=o.length;c<s.length;c+=1)a(c);So()}},i(u){if(!e){for(let l=0;l<o.length;l+=1)Jt(s[l]);e=!0}},o(u){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)be(s[l]);e=!1},d(u){u&&Le(t),$u(s,u),n=!1,pr(i)}}}function El(r){let t,e;return{c(){t=Qt("div"),e=Fr(r[5]),B(t,"class","no-results svelte-1h1zm6d")},m(n,i){ke(n,t,i),lt(t,e)},p(n,i){i[0]&32&&qi(e,n[5])},i:K,o:K,d(n){n&&Le(t)}}}function Il(r){let t="",e;return{c(){e=Fr(t)},m(n,i){ke(n,e,i)},p:K,i:K,o:K,d(n){n&&Le(e)}}}function Cl(r){let t,e;return{c(){t=Qt("div"),e=Fr(r[4]),B(t,"class","error svelte-1h1zm6d")},m(n,i){ke(n,t,i),lt(t,e)},p(n,i){i[0]&16&&qi(e,n[4])},i:K,o:K,d(n){n&&Le(t)}}}function fa(r){let t,e=r[68].place_type+"",n;return{c(){t=Qt("span"),n=Fr(e),B(t,"class","svelte-1h1zm6d")},m(i,o){ke(i,t,o),lt(t,n)},p(i,o){o[0]&4096&&e!==(e=i[68].place_type+"")&&qi(n,e)},d(i){i&&Le(t)}}}function ha(r){let t,e,n,i,o,s,a=r[68].place_name.replace(/,.*/,"")+"",u,l,c,f,h,g=r[68].place_name.replace(/[^,]*,?\s*/,"")+"",p,v,y,m,E,N;e=new aa({props:{displayIn:"list"}});let C=r[10]&&fa(r);function L(){return r[56](r[70])}function w(){return r[57](r[68])}return{c(){t=Qt("li"),Hi(e.$$.fragment),n=Bn(),i=Qt("span"),o=Qt("span"),s=Qt("span"),u=Fr(a),l=Bn(),C&&C.c(),c=Bn(),f=Qt("span"),h=Qt("span"),p=Fr(g),v=Bn(),B(s,"class","svelte-1h1zm6d"),B(o,"class","svelte-1h1zm6d"),B(i,"class","svelte-1h1zm6d"),B(h,"class","svelte-1h1zm6d"),B(f,"class","svelte-1h1zm6d"),B(t,"tabindex","0"),B(t,"data-selected",y=r[13]===r[70]),B(t,"class","svelte-1h1zm6d"),tn(t,"selected",r[13]===r[70])},m(D,T){ke(D,t,T),ci(e,t,null),lt(t,n),lt(t,i),lt(i,o),lt(o,s),lt(s,u),lt(o,l),C&&C.m(o,null),lt(t,c),lt(t,f),lt(f,h),lt(h,p),lt(t,v),m=!0,E||(N=[ze(t,"mouseover",L),ze(t,"focus",w)],E=!0)},p(D,T){r=D,(!m||T[0]&4096)&&a!==(a=r[68].place_name.replace(/,.*/,"")+"")&&qi(u,a),r[10]?C?C.p(r,T):(C=fa(r),C.c(),C.m(o,null)):C&&(C.d(1),C=null),(!m||T[0]&4096)&&g!==(g=r[68].place_name.replace(/[^,]*,?\s*/,"")+"")&&qi(p,g),(!m||T[0]&8192&&y!==(y=r[13]===r[70]))&&B(t,"data-selected",y),(!m||T[0]&8192)&&tn(t,"selected",r[13]===r[70])},i(D){m||(Jt(e.$$.fragment,D),m=!0)},o(D){be(e.$$.fragment,D),m=!1},d(D){D&&Le(t),fi(e),C&&C.d(),E=!1,pr(N)}}}function Nl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,v,y,m,E,N,C;i=new ml({}),c=new hl({});let L=r[17]&&la(),w=r[7]===!0&&ca(r);const D=r[47].default,T=Ku(D,r,r[46],null),F=[Cl,Il,El,_l],j=[];function z(O,Y){var P,X;return O[16]?0:O[14]?((P=O[12])==null?void 0:P.length)===0?2:O[14]&&((X=O[12])!=null&&X.length)?3:-1:1}return~(v=z(r))&&(y=j[v]=F[v](r)),{c(){t=Qt("form"),e=Qt("div"),n=Qt("button"),Hi(i.$$.fragment),o=Bn(),s=Qt("input"),a=Bn(),u=Qt("div"),l=Qt("button"),Hi(c.$$.fragment),f=Bn(),L&&L.c(),h=Bn(),w&&w.c(),g=Bn(),T&&T.c(),p=Bn(),y&&y.c(),B(n,"type","button"),B(n,"class","svelte-1h1zm6d"),B(s,"placeholder",r[3]),B(s,"aria-label",r[3]),B(s,"class","svelte-1h1zm6d"),B(l,"type","button"),B(l,"title",r[9]),B(l,"class","svelte-1h1zm6d"),tn(l,"displayable",r[0]!==""),B(u,"class","clear-button-container svelte-1h1zm6d"),B(e,"class","input-group svelte-1h1zm6d"),B(t,"tabindex","0"),B(t,"class",m=na(r[2])+" svelte-1h1zm6d"),tn(t,"can-collapse",r[6]&&r[0]==="")},m(O,Y){ke(O,t,Y),lt(t,e),lt(e,n),ci(i,n,null),lt(e,o),lt(e,s),r[49](s),ra(s,r[0]),lt(e,a),lt(e,u),lt(u,l),ci(c,l,null),lt(u,f),L&&L.m(u,null),lt(e,h),w&&w.m(e,null),lt(e,g),T&&T.m(e,null),lt(t,p),~v&&j[v].m(t,null),E=!0,N||(C=[ze(n,"click",r[48]),ze(s,"input",r[50]),ze(s,"focus",r[51]),ze(s,"blur",r[52]),ze(s,"keydown",r[19]),ze(s,"input",r[53]),ze(l,"click",r[54]),ze(t,"submit",tl(r[18]))],N=!0)},p(O,Y){(!E||Y[0]&8)&&B(s,"placeholder",O[3]),(!E||Y[0]&8)&&B(s,"aria-label",O[3]),Y[0]&1&&s.value!==O[0]&&ra(s,O[0]),(!E||Y[0]&512)&&B(l,"title",O[9]),(!E||Y[0]&1)&&tn(l,"displayable",O[0]!==""),O[17]?L?Y[0]&131072&&Jt(L,1):(L=la(),L.c(),Jt(L,1),L.m(u,null)):L&&(xo(),be(L,1,1,()=>{L=null}),So()),O[7]===!0?w?(w.p(O,Y),Y[0]&128&&Jt(w,1)):(w=ca(O),w.c(),Jt(w,1),w.m(e,g)):w&&(xo(),be(w,1,1,()=>{w=null}),So()),T&&T.p&&(!E||Y[1]&32768)&&Ju(T,D,O,O[46],E?Qu(D,O[46],Y,null):Zu(O[46]),null);let P=v;v=z(O),v===P?~v&&j[v].p(O,Y):(y&&(xo(),be(j[P],1,1,()=>{j[P]=null}),So()),~v?(y=j[v],y?y.p(O,Y):(y=j[v]=F[v](O),y.c()),Jt(y,1),y.m(t,null)):y=null),(!E||Y[0]&4&&m!==(m=na(O[2])+" svelte-1h1zm6d"))&&B(t,"class",m),(!E||Y[0]&69)&&tn(t,"can-collapse",O[6]&&O[0]==="")},i(O){E||(Jt(i.$$.fragment,O),Jt(c.$$.fragment,O),Jt(L),Jt(w),Jt(T,O),Jt(y),E=!0)},o(O){be(i.$$.fragment,O),be(c.$$.fragment,O),be(L),be(w),be(T,O),be(y),E=!1},d(O){O&&Le(t),fi(i),r[49](null),fi(c),L&&L.d(),w&&w.d(),T&&T.d(O),~v&&j[v].d(),N=!1,pr(C)}}}function xl(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 Sl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{mapController:a=void 0}=t,{apiKey:u}=t,{debounceSearch:l=200}=t,{placeholder:c="Search"}=t,{errorMessage:f="Searching failed"}=t,{noResultsMessage:h="No results found"}=t,{proximity:g=void 0}=t,{bbox:p=void 0}=t,{trackProximity:v=!0}=t,{minLength:y=2}=t,{language:m=void 0}=t,{showResultsWhileTyping:E=!0}=t,{zoom:N=16}=t,{flyTo:C=!0}=t,{collapsed:L=!1}=t,{clearOnBlur:w=!1}=t,{enableReverse:D=!1}=t,{reverseButtonTitle:T="toggle reverse geocoding"}=t,{clearButtonTitle:F="clear"}=t,{filter:j=()=>!0}=t,{searchValue:z=""}=t,{reverseActive:O=D==="always"}=t,{showPlaceType:Y=!1}=t,{showFullGeometry:P=!0}=t,{limit:X=void 0}=t,{fuzzyMatch:ft=!0}=t,{country:Ct=void 0}=t,{types:Kt=void 0}=t;function Be(){$n.focus()}function ri(){$n.blur()}function In(x,Xt=!0){e(0,z=x),Xt?(e(13,qt=-1),Yu()):(js(),setTimeout(()=>{$n.focus(),$n.select()}))}let Ge=!1,Z,Ut,st,Xu="",$n,qt=-1,Mr,os=[],ii,Vi,ss;const Ar=il();rl(()=>{a&&(a.setEventHandler(void 0),a.indicateReverse(!1),a.setSelectedMarker(-1),a.setMarkers(void 0,void 0))});function Yu(x){if(Vi&&(clearTimeout(Vi),Vi=void 0),qt>-1&&Z)e(44,st=Z[qt]),e(0,z=st.place_name.replace(/,.*/,"")),e(16,Mr=void 0),e(43,Ut=void 0),e(13,qt=-1);else if(z){const Xt=x||!Hu();Ws(z,{exact:!0}).then(()=>{e(43,Ut=Z),e(44,st=void 0),Xt&&Hc()}).catch(tr=>e(16,Mr=tr))}}function Hu(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(z)}async function Ws(x,{byId:Xt=!1,exact:tr=!1}={}){e(16,Mr=void 0);const Io=Hu(),Ze=new URLSearchParams;m!=null&&Ze.set("language",Array.isArray(m)?m.join(","):m),Kt&&Ze.set("types",Kt.join(",")),Io||(p&&Ze.set("bbox",p.map(si=>si.toFixed(6)).join(",")),Ct&&Ze.set("country",Array.isArray(Ct)?Ct.join(","):Ct)),Xt||(g&&Ze.set("proximity",g.map(si=>si.toFixed(6)).join(",")),(tr||!E)&&Ze.set("autocomplete","false"),Ze.set("fuzzyMatch",String(ft))),X!==void 0&&Ze.set("limit",String(X)),Ze.set("key",u);const oi="https://api.maptiler.com/geocoding/"+encodeURIComponent(x)+".json?"+Ze.toString();if(oi===Xu){Xt?(e(12,Z=void 0),e(44,st=os[0])):e(12,Z=os);return}Xu=oi,ii==null||ii.abort();const we=new AbortController;e(17,ii=we);let Qs;try{console.log("fetch"),Qs=await fetch(oi,{signal:we.signal}).finally(()=>{we===ii&&e(17,ii=void 0)})}catch(si){if(si&&typeof si=="object"&&si.name==="AbortError")return;throw new Error}if(!Qs.ok)throw new Error;const Js=await Qs.json();Ar("response",{url:oi,featureCollection:Js}),Xt?(e(12,Z=void 0),e(44,st=Js.features[0]),os=[st]):(e(12,Z=Js.features.filter(j)),os=Z,Io&&$n.focus())}function Hc(){var tr,Io,Ze,oi;if(!(Ut!=null&&Ut.length)||!C)return;const x=[180,90,-180,-90],Xt=!Ut.some(we=>!we.matching_text);for(const we of Ut)(Xt||!we.matching_text)&&(x[0]=Math.min(x[0],((tr=we.bbox)==null?void 0:tr[0])??we.center[0]),x[1]=Math.min(x[1],((Io=we.bbox)==null?void 0:Io[1])??we.center[1]),x[2]=Math.max(x[2],((Ze=we.bbox)==null?void 0:Ze[2])??we.center[0]),x[3]=Math.max(x[3],((oi=we.bbox)==null?void 0:oi[3])??we.center[1]));a&&Ut.length>0&&(st&&x[0]===x[2]&&x[1]===x[3]?a.flyTo(st.center,N):a.fitBounds(x,50))}function Wc(x){e(1,O=D==="always"),In(xl(x[0],[-180,180],!0).toFixed(6)+","+x[1].toFixed(6))}function jc(x){if(!Z)return;let Xt=x.key==="ArrowDown"?1:x.key==="ArrowUp"?-1:0;Xt?(qt===-1&&Xt===-1&&e(13,qt=Z.length),e(13,qt+=Xt),qt>=Z.length&&e(13,qt=-1),x.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(x.key)&&e(13,qt=-1)}function js(x=!0){if(E&&z.length>y){Vi&&clearTimeout(Vi);const Xt=z;Vi=window.setTimeout(()=>{Ws(Xt).catch(tr=>e(16,Mr=tr))},x?l:0)}else e(12,Z=void 0),e(16,Mr=void 0)}function Ks(x){e(44,st=x),e(0,z=x.place_name),e(13,qt=-1)}const Kc=()=>$n.focus();function Qc(x){us[x?"unshift":"push"](()=>{$n=x,e(15,$n)})}function Jc(){z=this.value,e(0,z),e(11,Ge),e(33,w)}const Zc=()=>e(11,Ge=!0),$c=()=>e(11,Ge=!1),tf=()=>js(),ef=()=>{e(0,z=""),$n.focus()},nf=()=>e(1,O=!O),rf=x=>e(13,qt=x),of=x=>Ks(x),sf=()=>e(13,qt=-1),af=()=>{};return r.$$set=x=>{"class"in x&&e(2,s=x.class),"mapController"in x&&e(23,a=x.mapController),"apiKey"in x&&e(24,u=x.apiKey),"debounceSearch"in x&&e(25,l=x.debounceSearch),"placeholder"in x&&e(3,c=x.placeholder),"errorMessage"in x&&e(4,f=x.errorMessage),"noResultsMessage"in x&&e(5,h=x.noResultsMessage),"proximity"in x&&e(22,g=x.proximity),"bbox"in x&&e(26,p=x.bbox),"trackProximity"in x&&e(27,v=x.trackProximity),"minLength"in x&&e(28,y=x.minLength),"language"in x&&e(29,m=x.language),"showResultsWhileTyping"in x&&e(30,E=x.showResultsWhileTyping),"zoom"in x&&e(31,N=x.zoom),"flyTo"in x&&e(32,C=x.flyTo),"collapsed"in x&&e(6,L=x.collapsed),"clearOnBlur"in x&&e(33,w=x.clearOnBlur),"enableReverse"in x&&e(7,D=x.enableReverse),"reverseButtonTitle"in x&&e(8,T=x.reverseButtonTitle),"clearButtonTitle"in x&&e(9,F=x.clearButtonTitle),"filter"in x&&e(34,j=x.filter),"searchValue"in x&&e(0,z=x.searchValue),"reverseActive"in x&&e(1,O=x.reverseActive),"showPlaceType"in x&&e(10,Y=x.showPlaceType),"showFullGeometry"in x&&e(35,P=x.showFullGeometry),"limit"in x&&e(36,X=x.limit),"fuzzyMatch"in x&&e(37,ft=x.fuzzyMatch),"country"in x&&e(38,Ct=x.country),"types"in x&&e(39,Kt=x.types),"$$scope"in x&&e(46,o=x.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&134217728&&(v||e(22,g=void 0)),r.$$.dirty[0]&2048|r.$$.dirty[1]&4&&setTimeout(()=>{e(14,ss=Ge),w&&!Ge&&e(0,z="")}),r.$$.dirty[0]&4097&&(z||(e(44,st=void 0),e(12,Z=void 0),e(16,Mr=void 0),e(43,Ut=Z))),r.$$.dirty[1]&8208&&P&&st&&!st.address&&st.geometry.type==="Point"&&Ws(st.id,{byId:!0}).catch(x=>e(16,Mr=x)),r.$$.dirty[0]&8388608|r.$$.dirty[1]&8195&&a&&st&&C&&(!st.bbox||st.bbox[0]===st.bbox[2]&&st.bbox[1]===st.bbox[3]?a.flyTo(st.center,N):a.fitBounds(st.bbox,50),e(12,Z=void 0),e(43,Ut=void 0),e(13,qt=-1)),r.$$.dirty[0]&4096|r.$$.dirty[1]&4096&&Ut!==Z&&e(43,Ut=void 0),r.$$.dirty[0]&8388608|r.$$.dirty[1]&12288&&a&&a.setMarkers(Ut,st),r.$$.dirty[0]&1&&e(13,qt=-1),r.$$.dirty[0]&142626818&&a&&a.setEventHandler(x=>{switch(x.type){case"mapClick":O&&Wc(x.coordinates);break;case"proximityChange":e(22,g=v?x.proximity:void 0);break;case"markerClick":{const Xt=Z==null?void 0:Z.find(tr=>tr.id===x.id);Xt&&Ks(Xt)}break;case"markerMouseEnter":e(13,qt=ss?(Z==null?void 0:Z.findIndex(Xt=>Xt.id===x.id))??-1:-1);break;case"markerMouseLeave":e(13,qt=-1);break}}),r.$$.dirty[0]&8396800&&(a==null||a.setSelectedMarker(qt)),r.$$.dirty[0]&12288&&e(45,n=Z==null?void 0:Z[qt]),r.$$.dirty[0]&8388609){const x=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(z);a==null||a.setReverseMarker(x?[Number(x[1]),Number(x[2])]:void 0)}r.$$.dirty[1]&16384&&Ar("select",n),r.$$.dirty[1]&8192&&Ar("pick",st),r.$$.dirty[0]&20480&&Ar("optionsVisibilityChange",ss&&!!Z),r.$$.dirty[0]&4096&&Ar("featuresListed",Z),r.$$.dirty[1]&4096&&Ar("featuresMarked",Ut),r.$$.dirty[0]&2&&Ar("reverseToggle",O),r.$$.dirty[0]&1&&Ar("queryChange",z),r.$$.dirty[0]&8388610&&a&&a.indicateReverse(O)},[z,O,s,c,f,h,L,D,T,F,Y,Ge,Z,qt,ss,$n,Mr,ii,Yu,jc,js,Ks,g,a,u,l,p,v,y,m,E,N,C,w,j,P,X,ft,Ct,Kt,Be,ri,In,Ut,st,n,o,i,Kc,Qc,Jc,Zc,$c,tf,ef,nf,rf,of,sf,af]}let wl=class extends gi{constructor(t){super(),hi(this,t,Sl,Nl,ai,{class:2,mapController:23,apiKey:24,debounceSearch:25,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:22,bbox:26,trackProximity:27,minLength:28,language:29,showResultsWhileTyping:30,zoom:31,flyTo:32,collapsed:6,clearOnBlur:33,enableReverse:7,reverseButtonTitle:8,clearButtonTitle:9,filter:34,searchValue:0,reverseActive:1,showPlaceType:10,showFullGeometry:35,limit:36,fuzzyMatch:37,country:38,types:39,focus:40,blur:41,setQuery:42},null,[-1,-1,-1])}get focus(){return this.$$.ctx[40]}get blur(){return this.$$.ctx[41]}get setQuery(){return this.$$.ctx[42]}};function Ll(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 vr=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function bl(r,t){return r>t?1:r<t?-1:0}function yr(r,t,e){for(var n=new vr(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 hs(r,t,e,n){var i=new vr(r,t);if(e===null)return i.left=i.right=null,i;e=yr(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 ga(r,t,e){var n=null,i=null;if(t){t=yr(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 Pl(r,t,e){return t===null?r:(r===null||(t=yr(r.key,t,e),t.left=r),t)}function gs(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
1
|
+
var Wu=(Ot,K,$e)=>{if(!K.has(Ot))throw TypeError("Cannot "+$e)};var er=(Ot,K,$e)=>(Wu(Ot,K,"read from private field"),$e?$e.call(Ot):K.get(Ot)),Zs=(Ot,K,$e)=>{if(K.has(Ot))throw TypeError("Cannot add the same private member more than once");K instanceof WeakSet?K.add(Ot):K.set(Ot,$e)},as=(Ot,K,$e,Ui)=>(Wu(Ot,K,"write to private field"),Ui?Ui.call(Ot,$e):K.set(Ot,$e),$e);(function(Ot,K){typeof exports=="object"&&typeof module<"u"?K(exports):typeof define=="function"&&define.amd?define(["exports"],K):(Ot=typeof globalThis<"u"?globalThis:Ot||self,K(Ot.maplibreglMaptilerGeocoder={}))})(this,function(Ot){var Fn,ni;"use strict";function K(){}function $e(r,t){for(const e in t)r[e]=t[e];return r}function Ui(r){return r()}function $s(){return Object.create(null)}function pr(r){r.forEach(Ui)}function ta(r){return typeof r=="function"}function ai(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function ju(r){return Object.keys(r).length===0}function Ku(r,t,e,n){if(r){const i=ea(r,t,e,n);return r[0](i)}}function ea(r,t,e,n){return r[1]&&n?$e(e.ctx.slice(),r[1](n(t))):e.ctx}function Qu(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 Ju(r,t,e,n,i,o){if(i){const s=ea(t,e,n,o);r.p(s,i)}}function Zu(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 na(r){return r??""}function lt(r,t){r.appendChild(t)}function ke(r,t,e){r.insertBefore(t,e||null)}function Le(r){r.parentNode&&r.parentNode.removeChild(r)}function $u(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function Qt(r){return document.createElement(r)}function dr(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Fr(r){return document.createTextNode(r)}function Bn(){return Fr(" ")}function ze(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function tl(r){return function(t){return t.preventDefault(),r.call(this,t)}}function B(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function el(r){return Array.from(r.childNodes)}function qi(r,t){t=""+t,r.wholeText!==t&&(r.data=t)}function ra(r,t){r.value=t??""}function tn(r,t,e){r.classList[e?"add":"remove"](t)}function nl(r,t,{bubbles:e=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(r,e,n,t),i}let Xi;function Yi(r){Xi=r}function ia(){if(!Xi)throw new Error("Function called outside component initialization");return Xi}function rl(r){ia().$$.on_destroy.push(r)}function il(){const r=ia();return(t,e,{cancelable:n=!1}={})=>{const i=r.$$.callbacks[t];if(i){const o=nl(t,e,{cancelable:n});return i.slice().forEach(s=>{s.call(r,o)}),!o.defaultPrevented}return!0}}const ui=[],us=[],Co=[],oa=[],ol=Promise.resolve();let ls=!1;function sl(){ls||(ls=!0,ol.then(sa))}function cs(r){Co.push(r)}const fs=new Set;let li=0;function sa(){if(li!==0)return;const r=Xi;do{try{for(;li<ui.length;){const t=ui[li];li++,Yi(t),al(t.$$)}}catch(t){throw ui.length=0,li=0,t}for(Yi(null),ui.length=0,li=0;us.length;)us.pop()();for(let t=0;t<Co.length;t+=1){const e=Co[t];fs.has(e)||(fs.add(e),e())}Co.length=0}while(ui.length);for(;oa.length;)oa.pop()();ls=!1,fs.clear(),Yi(r)}function al(r){if(r.fragment!==null){r.update(),pr(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(cs)}}const No=new Set;let Br;function xo(){Br={r:0,c:[],p:Br}}function So(){Br.r||pr(Br.c),Br=Br.p}function Jt(r,t){r&&r.i&&(No.delete(r),r.i(t))}function be(r,t,e,n){if(r&&r.o){if(No.has(r))return;No.add(r),Br.c.push(()=>{No.delete(r),n&&(e&&r.d(1),n())}),r.o(t)}else n&&n()}function Hi(r){r&&r.c()}function ci(r,t,e,n){const{fragment:i,after_update:o}=r.$$;i&&i.m(t,e),n||cs(()=>{const s=r.$$.on_mount.map(Ui).filter(ta);r.$$.on_destroy?r.$$.on_destroy.push(...s):pr(s),r.$$.on_mount=[]}),o.forEach(cs)}function fi(r,t){const e=r.$$;e.fragment!==null&&(pr(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function ul(r,t){r.$$.dirty[0]===-1&&(ui.push(r),sl(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function hi(r,t,e,n,i,o,s,a=[-1]){const u=Xi;Yi(r);const l=r.$$={fragment:null,ctx:[],props:o,update:K,not_equal:i,bound:$s(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:$s(),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&&ul(r,f)),h}):[],l.update(),c=!0,pr(l.before_update),l.fragment=n?n(l.ctx):!1,t.target){if(t.hydrate){const f=el(t.target);l.fragment&&l.fragment.l(f),f.forEach(Le)}else l.fragment&&l.fragment.c();t.intro&&Jt(r.$$.fragment),ci(r,t.target,t.anchor,t.customElement),sa()}Yi(u)}class gi{$destroy(){fi(this,1),this.$destroy=K}$on(t,e){if(!ta(e))return K;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&&!ju(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const uf="";function ll(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(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"),B(t,"viewBox","0 0 60.006 21.412"),B(t,"width","14"),B(t,"height","20"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class cl extends gi{constructor(t){super(),hi(this,t,null,ll,ai,{})}}const lf="";function fl(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),B(t,"viewBox","0 0 18 18"),B(t,"width","16"),B(t,"height","16"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class hl extends gi{constructor(t){super(),hi(this,t,null,fl,ai,{})}}const cf="";function gl(r){let t;return{c(){t=Qt("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>',B(t,"class","svelte-7cmwmc")},m(e,n){ke(e,t,n)},p:K,i:K,o:K,d(e){e&&Le(t)}}}class pl extends gi{constructor(t){super(),hi(this,t,null,gl,ai,{})}}const ff="";function dl(r){let t,e,n;return{c(){t=dr("svg"),e=dr("path"),B(e,"stroke-width","4"),B(e,"fill-rule","evenodd"),B(e,"clip-rule","evenodd"),B(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"),B(e,"class","svelte-1k1cmht"),B(t,"width",n=r[0]!=="list"?void 0:"20"),B(t,"viewBox","0 0 70 85"),B(t,"fill","none"),B(t,"class","svelte-1k1cmht"),tn(t,"in-map",r[0]!=="list"),tn(t,"list-icon",r[0]==="list")},m(i,o){ke(i,t,o),lt(t,e)},p(i,[o]){o&1&&n!==(n=i[0]!=="list"?void 0:"20")&&B(t,"width",n),o&1&&tn(t,"in-map",i[0]!=="list"),o&1&&tn(t,"list-icon",i[0]==="list")},i:K,o:K,d(i){i&&Le(t)}}}function vl(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class aa extends gi{constructor(t){super(),hi(this,t,vl,dl,ai,{displayIn:0})}}const hf="";function yl(r){let t,e;return{c(){t=dr("svg"),e=dr("path"),B(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),B(t,"viewBox","0 0 18 18"),B(t,"xml:space","preserve"),B(t,"width","20"),B(t,"class","svelte-en2qvf")},m(n,i){ke(n,t,i),lt(t,e)},p:K,i:K,o:K,d(n){n&&Le(t)}}}class ml extends gi{constructor(t){super(),hi(this,t,null,yl,ai,{})}}const gf="";function ua(r,t,e){const n=r.slice();return n[68]=t[e],n[70]=e,n}function la(r){let t,e;return t=new pl({}),{c(){Hi(t.$$.fragment)},m(n,i){ci(t,n,i),e=!0},i(n){e||(Jt(t.$$.fragment,n),e=!0)},o(n){be(t.$$.fragment,n),e=!1},d(n){fi(t,n)}}}function ca(r){let t,e,n,i,o;return e=new cl({}),{c(){t=Qt("button"),Hi(e.$$.fragment),B(t,"type","button"),B(t,"title",r[8]),B(t,"class","svelte-1h1zm6d"),tn(t,"active",r[1])},m(s,a){ke(s,t,a),ci(e,t,null),n=!0,i||(o=ze(t,"click",r[55]),i=!0)},p(s,a){(!n||a[0]&256)&&B(t,"title",s[8]),(!n||a[0]&2)&&tn(t,"active",s[1])},i(s){n||(Jt(e.$$.fragment,s),n=!0)},o(s){be(e.$$.fragment,s),n=!1},d(s){s&&Le(t),fi(e),i=!1,o()}}}function _l(r){let t,e,n,i,o=r[12],s=[];for(let u=0;u<o.length;u+=1)s[u]=ha(ua(r,o,u));const a=u=>be(s[u],1,1,()=>{s[u]=null});return{c(){t=Qt("ul");for(let u=0;u<s.length;u+=1)s[u].c();B(t,"class","svelte-1h1zm6d")},m(u,l){ke(u,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0,n||(i=[ze(t,"mouseout",r[58]),ze(t,"blur",r[59])],n=!0)},p(u,l){if(l[0]&2110464){o=u[12];let c;for(c=0;c<o.length;c+=1){const f=ua(u,o,c);s[c]?(s[c].p(f,l),Jt(s[c],1)):(s[c]=ha(f),s[c].c(),Jt(s[c],1),s[c].m(t,null))}for(xo(),c=o.length;c<s.length;c+=1)a(c);So()}},i(u){if(!e){for(let l=0;l<o.length;l+=1)Jt(s[l]);e=!0}},o(u){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)be(s[l]);e=!1},d(u){u&&Le(t),$u(s,u),n=!1,pr(i)}}}function El(r){let t,e;return{c(){t=Qt("div"),e=Fr(r[5]),B(t,"class","no-results svelte-1h1zm6d")},m(n,i){ke(n,t,i),lt(t,e)},p(n,i){i[0]&32&&qi(e,n[5])},i:K,o:K,d(n){n&&Le(t)}}}function Il(r){let t="",e;return{c(){e=Fr(t)},m(n,i){ke(n,e,i)},p:K,i:K,o:K,d(n){n&&Le(e)}}}function Cl(r){let t,e;return{c(){t=Qt("div"),e=Fr(r[4]),B(t,"class","error svelte-1h1zm6d")},m(n,i){ke(n,t,i),lt(t,e)},p(n,i){i[0]&16&&qi(e,n[4])},i:K,o:K,d(n){n&&Le(t)}}}function fa(r){let t,e=r[68].place_type+"",n;return{c(){t=Qt("span"),n=Fr(e),B(t,"class","svelte-1h1zm6d")},m(i,o){ke(i,t,o),lt(t,n)},p(i,o){o[0]&4096&&e!==(e=i[68].place_type+"")&&qi(n,e)},d(i){i&&Le(t)}}}function ha(r){let t,e,n,i,o,s,a=r[68].place_name.replace(/,.*/,"")+"",u,l,c,f,h,g=r[68].place_name.replace(/[^,]*,?\s*/,"")+"",p,v,y,m,E,N;e=new aa({props:{displayIn:"list"}});let C=r[10]&&fa(r);function L(){return r[56](r[70])}function w(){return r[57](r[68])}return{c(){t=Qt("li"),Hi(e.$$.fragment),n=Bn(),i=Qt("span"),o=Qt("span"),s=Qt("span"),u=Fr(a),l=Bn(),C&&C.c(),c=Bn(),f=Qt("span"),h=Qt("span"),p=Fr(g),v=Bn(),B(s,"class","svelte-1h1zm6d"),B(o,"class","svelte-1h1zm6d"),B(i,"class","svelte-1h1zm6d"),B(h,"class","svelte-1h1zm6d"),B(f,"class","svelte-1h1zm6d"),B(t,"tabindex","0"),B(t,"data-selected",y=r[13]===r[70]),B(t,"class","svelte-1h1zm6d"),tn(t,"selected",r[13]===r[70])},m(D,T){ke(D,t,T),ci(e,t,null),lt(t,n),lt(t,i),lt(i,o),lt(o,s),lt(s,u),lt(o,l),C&&C.m(o,null),lt(t,c),lt(t,f),lt(f,h),lt(h,p),lt(t,v),m=!0,E||(N=[ze(t,"mouseover",L),ze(t,"focus",w)],E=!0)},p(D,T){r=D,(!m||T[0]&4096)&&a!==(a=r[68].place_name.replace(/,.*/,"")+"")&&qi(u,a),r[10]?C?C.p(r,T):(C=fa(r),C.c(),C.m(o,null)):C&&(C.d(1),C=null),(!m||T[0]&4096)&&g!==(g=r[68].place_name.replace(/[^,]*,?\s*/,"")+"")&&qi(p,g),(!m||T[0]&8192&&y!==(y=r[13]===r[70]))&&B(t,"data-selected",y),(!m||T[0]&8192)&&tn(t,"selected",r[13]===r[70])},i(D){m||(Jt(e.$$.fragment,D),m=!0)},o(D){be(e.$$.fragment,D),m=!1},d(D){D&&Le(t),fi(e),C&&C.d(),E=!1,pr(N)}}}function Nl(r){let t,e,n,i,o,s,a,u,l,c,f,h,g,p,v,y,m,E,N,C;i=new ml({}),c=new hl({});let L=r[17]&&la(),w=r[7]===!0&&ca(r);const D=r[47].default,T=Ku(D,r,r[46],null),F=[Cl,Il,El,_l],j=[];function z(O,Y){var P,X;return O[16]?0:O[14]?((P=O[12])==null?void 0:P.length)===0?2:O[14]&&((X=O[12])!=null&&X.length)?3:-1:1}return~(v=z(r))&&(y=j[v]=F[v](r)),{c(){t=Qt("form"),e=Qt("div"),n=Qt("button"),Hi(i.$$.fragment),o=Bn(),s=Qt("input"),a=Bn(),u=Qt("div"),l=Qt("button"),Hi(c.$$.fragment),f=Bn(),L&&L.c(),h=Bn(),w&&w.c(),g=Bn(),T&&T.c(),p=Bn(),y&&y.c(),B(n,"type","button"),B(n,"class","svelte-1h1zm6d"),B(s,"placeholder",r[3]),B(s,"aria-label",r[3]),B(s,"class","svelte-1h1zm6d"),B(l,"type","button"),B(l,"title",r[9]),B(l,"class","svelte-1h1zm6d"),tn(l,"displayable",r[0]!==""),B(u,"class","clear-button-container svelte-1h1zm6d"),B(e,"class","input-group svelte-1h1zm6d"),B(t,"tabindex","0"),B(t,"class",m=na(r[2])+" svelte-1h1zm6d"),tn(t,"can-collapse",r[6]&&r[0]==="")},m(O,Y){ke(O,t,Y),lt(t,e),lt(e,n),ci(i,n,null),lt(e,o),lt(e,s),r[49](s),ra(s,r[0]),lt(e,a),lt(e,u),lt(u,l),ci(c,l,null),lt(u,f),L&&L.m(u,null),lt(e,h),w&&w.m(e,null),lt(e,g),T&&T.m(e,null),lt(t,p),~v&&j[v].m(t,null),E=!0,N||(C=[ze(n,"click",r[48]),ze(s,"input",r[50]),ze(s,"focus",r[51]),ze(s,"blur",r[52]),ze(s,"keydown",r[19]),ze(s,"input",r[53]),ze(l,"click",r[54]),ze(t,"submit",tl(r[18]))],N=!0)},p(O,Y){(!E||Y[0]&8)&&B(s,"placeholder",O[3]),(!E||Y[0]&8)&&B(s,"aria-label",O[3]),Y[0]&1&&s.value!==O[0]&&ra(s,O[0]),(!E||Y[0]&512)&&B(l,"title",O[9]),(!E||Y[0]&1)&&tn(l,"displayable",O[0]!==""),O[17]?L?Y[0]&131072&&Jt(L,1):(L=la(),L.c(),Jt(L,1),L.m(u,null)):L&&(xo(),be(L,1,1,()=>{L=null}),So()),O[7]===!0?w?(w.p(O,Y),Y[0]&128&&Jt(w,1)):(w=ca(O),w.c(),Jt(w,1),w.m(e,g)):w&&(xo(),be(w,1,1,()=>{w=null}),So()),T&&T.p&&(!E||Y[1]&32768)&&Ju(T,D,O,O[46],E?Qu(D,O[46],Y,null):Zu(O[46]),null);let P=v;v=z(O),v===P?~v&&j[v].p(O,Y):(y&&(xo(),be(j[P],1,1,()=>{j[P]=null}),So()),~v?(y=j[v],y?y.p(O,Y):(y=j[v]=F[v](O),y.c()),Jt(y,1),y.m(t,null)):y=null),(!E||Y[0]&4&&m!==(m=na(O[2])+" svelte-1h1zm6d"))&&B(t,"class",m),(!E||Y[0]&69)&&tn(t,"can-collapse",O[6]&&O[0]==="")},i(O){E||(Jt(i.$$.fragment,O),Jt(c.$$.fragment,O),Jt(L),Jt(w),Jt(T,O),Jt(y),E=!0)},o(O){be(i.$$.fragment,O),be(c.$$.fragment,O),be(L),be(w),be(T,O),be(y),E=!1},d(O){O&&Le(t),fi(i),r[49](null),fi(c),L&&L.d(),w&&w.d(),T&&T.d(O),~v&&j[v].d(),N=!1,pr(C)}}}function xl(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 Sl(r,t,e){let n,{$$slots:i={},$$scope:o}=t,{class:s=void 0}=t,{mapController:a=void 0}=t,{apiKey:u}=t,{debounceSearch:l=200}=t,{placeholder:c="Search"}=t,{errorMessage:f="Searching failed"}=t,{noResultsMessage:h="No results found"}=t,{proximity:g=void 0}=t,{bbox:p=void 0}=t,{trackProximity:v=!0}=t,{minLength:y=2}=t,{language:m=void 0}=t,{showResultsWhileTyping:E=!0}=t,{zoom:N=16}=t,{flyTo:C=!0}=t,{collapsed:L=!1}=t,{clearOnBlur:w=!1}=t,{enableReverse:D=!1}=t,{reverseButtonTitle:T="toggle reverse geocoding"}=t,{clearButtonTitle:F="clear"}=t,{filter:j=()=>!0}=t,{searchValue:z=""}=t,{reverseActive:O=D==="always"}=t,{showPlaceType:Y=!1}=t,{showFullGeometry:P=!0}=t,{limit:X=void 0}=t,{fuzzyMatch:ft=!0}=t,{country:Ct=void 0}=t,{types:Kt=void 0}=t;function Be(){$n.focus()}function ri(){$n.blur()}function In(x,Xt=!0){e(0,z=x),Xt?(e(13,qt=-1),Yu()):(js(),setTimeout(()=>{$n.focus(),$n.select()}))}let Ge=!1,Z,Ut,st,Xu="",$n,qt=-1,Mr,os=[],ii,Vi,ss;const Ar=il();rl(()=>{a&&(a.setEventHandler(void 0),a.indicateReverse(!1),a.setSelectedMarker(-1),a.setMarkers(void 0,void 0))});function Yu(x){if(Vi&&(clearTimeout(Vi),Vi=void 0),qt>-1&&Z)e(44,st=Z[qt]),e(0,z=st.place_name.replace(/,.*/,"")),e(16,Mr=void 0),e(43,Ut=void 0),e(13,qt=-1);else if(z){const Xt=x||!Hu();Ws(z,{exact:!0}).then(()=>{e(43,Ut=Z),e(44,st=void 0),Xt&&Hc()}).catch(tr=>e(16,Mr=tr))}}function Hu(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(z)}async function Ws(x,{byId:Xt=!1,exact:tr=!1}={}){e(16,Mr=void 0);const Io=Hu(),Ze=new URLSearchParams;m!=null&&Ze.set("language",Array.isArray(m)?m.join(","):m),Kt&&Ze.set("types",Kt.join(",")),Io||(p&&Ze.set("bbox",p.map(si=>si.toFixed(6)).join(",")),Ct&&Ze.set("country",Array.isArray(Ct)?Ct.join(","):Ct)),Xt||(g&&Ze.set("proximity",g.map(si=>si.toFixed(6)).join(",")),(tr||!E)&&Ze.set("autocomplete","false"),Ze.set("fuzzyMatch",String(ft))),X!==void 0&&Ze.set("limit",String(X)),Ze.set("key",u);const oi="https://api.maptiler.com/geocoding/"+encodeURIComponent(x)+".json?"+Ze.toString();if(oi===Xu){Xt?(e(12,Z=void 0),e(44,st=os[0])):e(12,Z=os);return}Xu=oi,ii==null||ii.abort();const we=new AbortController;e(17,ii=we);let Qs;try{Qs=await fetch(oi,{signal:we.signal}).finally(()=>{we===ii&&e(17,ii=void 0)})}catch(si){if(si&&typeof si=="object"&&si.name==="AbortError")return;throw new Error}if(!Qs.ok)throw new Error;const Js=await Qs.json();Ar("response",{url:oi,featureCollection:Js}),Xt?(e(12,Z=void 0),e(44,st=Js.features[0]),os=[st]):(e(12,Z=Js.features.filter(j)),os=Z,Io&&$n.focus())}function Hc(){var tr,Io,Ze,oi;if(!(Ut!=null&&Ut.length)||!C)return;const x=[180,90,-180,-90],Xt=!Ut.some(we=>!we.matching_text);for(const we of Ut)(Xt||!we.matching_text)&&(x[0]=Math.min(x[0],((tr=we.bbox)==null?void 0:tr[0])??we.center[0]),x[1]=Math.min(x[1],((Io=we.bbox)==null?void 0:Io[1])??we.center[1]),x[2]=Math.max(x[2],((Ze=we.bbox)==null?void 0:Ze[2])??we.center[0]),x[3]=Math.max(x[3],((oi=we.bbox)==null?void 0:oi[3])??we.center[1]));a&&Ut.length>0&&(st&&x[0]===x[2]&&x[1]===x[3]?a.flyTo(st.center,N):a.fitBounds(x,50))}function Wc(x){e(1,O=D==="always"),In(xl(x[0],[-180,180],!0).toFixed(6)+","+x[1].toFixed(6))}function jc(x){if(!Z)return;let Xt=x.key==="ArrowDown"?1:x.key==="ArrowUp"?-1:0;Xt?(qt===-1&&Xt===-1&&e(13,qt=Z.length),e(13,qt+=Xt),qt>=Z.length&&e(13,qt=-1),x.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(x.key)&&e(13,qt=-1)}function js(x=!0){if(E&&z.length>y){Vi&&clearTimeout(Vi);const Xt=z;Vi=window.setTimeout(()=>{Ws(Xt).catch(tr=>e(16,Mr=tr))},x?l:0)}else e(12,Z=void 0),e(16,Mr=void 0)}function Ks(x){e(44,st=x),e(0,z=x.place_name),e(13,qt=-1)}const Kc=()=>$n.focus();function Qc(x){us[x?"unshift":"push"](()=>{$n=x,e(15,$n)})}function Jc(){z=this.value,e(0,z),e(11,Ge),e(33,w)}const Zc=()=>e(11,Ge=!0),$c=()=>e(11,Ge=!1),tf=()=>js(),ef=()=>{e(0,z=""),$n.focus()},nf=()=>e(1,O=!O),rf=x=>e(13,qt=x),of=x=>Ks(x),sf=()=>e(13,qt=-1),af=()=>{};return r.$$set=x=>{"class"in x&&e(2,s=x.class),"mapController"in x&&e(23,a=x.mapController),"apiKey"in x&&e(24,u=x.apiKey),"debounceSearch"in x&&e(25,l=x.debounceSearch),"placeholder"in x&&e(3,c=x.placeholder),"errorMessage"in x&&e(4,f=x.errorMessage),"noResultsMessage"in x&&e(5,h=x.noResultsMessage),"proximity"in x&&e(22,g=x.proximity),"bbox"in x&&e(26,p=x.bbox),"trackProximity"in x&&e(27,v=x.trackProximity),"minLength"in x&&e(28,y=x.minLength),"language"in x&&e(29,m=x.language),"showResultsWhileTyping"in x&&e(30,E=x.showResultsWhileTyping),"zoom"in x&&e(31,N=x.zoom),"flyTo"in x&&e(32,C=x.flyTo),"collapsed"in x&&e(6,L=x.collapsed),"clearOnBlur"in x&&e(33,w=x.clearOnBlur),"enableReverse"in x&&e(7,D=x.enableReverse),"reverseButtonTitle"in x&&e(8,T=x.reverseButtonTitle),"clearButtonTitle"in x&&e(9,F=x.clearButtonTitle),"filter"in x&&e(34,j=x.filter),"searchValue"in x&&e(0,z=x.searchValue),"reverseActive"in x&&e(1,O=x.reverseActive),"showPlaceType"in x&&e(10,Y=x.showPlaceType),"showFullGeometry"in x&&e(35,P=x.showFullGeometry),"limit"in x&&e(36,X=x.limit),"fuzzyMatch"in x&&e(37,ft=x.fuzzyMatch),"country"in x&&e(38,Ct=x.country),"types"in x&&e(39,Kt=x.types),"$$scope"in x&&e(46,o=x.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&134217728&&(v||e(22,g=void 0)),r.$$.dirty[0]&2048|r.$$.dirty[1]&4&&setTimeout(()=>{e(14,ss=Ge),w&&!Ge&&e(0,z="")}),r.$$.dirty[0]&4097&&(z||(e(44,st=void 0),e(12,Z=void 0),e(16,Mr=void 0),e(43,Ut=Z))),r.$$.dirty[1]&8208&&P&&st&&!st.address&&st.geometry.type==="Point"&&Ws(st.id,{byId:!0}).catch(x=>e(16,Mr=x)),r.$$.dirty[0]&8388608|r.$$.dirty[1]&8195&&a&&st&&C&&(!st.bbox||st.bbox[0]===st.bbox[2]&&st.bbox[1]===st.bbox[3]?a.flyTo(st.center,N):a.fitBounds(st.bbox,50),e(12,Z=void 0),e(43,Ut=void 0),e(13,qt=-1)),r.$$.dirty[0]&4096|r.$$.dirty[1]&4096&&Ut!==Z&&e(43,Ut=void 0),r.$$.dirty[0]&8388608|r.$$.dirty[1]&12288&&a&&a.setMarkers(Ut,st),r.$$.dirty[0]&1&&e(13,qt=-1),r.$$.dirty[0]&142626818&&a&&a.setEventHandler(x=>{switch(x.type){case"mapClick":O&&Wc(x.coordinates);break;case"proximityChange":e(22,g=v?x.proximity:void 0);break;case"markerClick":{const Xt=Z==null?void 0:Z.find(tr=>tr.id===x.id);Xt&&Ks(Xt)}break;case"markerMouseEnter":e(13,qt=ss?(Z==null?void 0:Z.findIndex(Xt=>Xt.id===x.id))??-1:-1);break;case"markerMouseLeave":e(13,qt=-1);break}}),r.$$.dirty[0]&8396800&&(a==null||a.setSelectedMarker(qt)),r.$$.dirty[0]&12288&&e(45,n=Z==null?void 0:Z[qt]),r.$$.dirty[0]&8388609){const x=/^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(z);a==null||a.setReverseMarker(x?[Number(x[1]),Number(x[2])]:void 0)}r.$$.dirty[1]&16384&&Ar("select",n),r.$$.dirty[1]&8192&&Ar("pick",st),r.$$.dirty[0]&20480&&Ar("optionsVisibilityChange",ss&&!!Z),r.$$.dirty[0]&4096&&Ar("featuresListed",Z),r.$$.dirty[1]&4096&&Ar("featuresMarked",Ut),r.$$.dirty[0]&2&&Ar("reverseToggle",O),r.$$.dirty[0]&1&&Ar("queryChange",z),r.$$.dirty[0]&8388610&&a&&a.indicateReverse(O)},[z,O,s,c,f,h,L,D,T,F,Y,Ge,Z,qt,ss,$n,Mr,ii,Yu,jc,js,Ks,g,a,u,l,p,v,y,m,E,N,C,w,j,P,X,ft,Ct,Kt,Be,ri,In,Ut,st,n,o,i,Kc,Qc,Jc,Zc,$c,tf,ef,nf,rf,of,sf,af]}let wl=class extends gi{constructor(t){super(),hi(this,t,Sl,Nl,ai,{class:2,mapController:23,apiKey:24,debounceSearch:25,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:22,bbox:26,trackProximity:27,minLength:28,language:29,showResultsWhileTyping:30,zoom:31,flyTo:32,collapsed:6,clearOnBlur:33,enableReverse:7,reverseButtonTitle:8,clearButtonTitle:9,filter:34,searchValue:0,reverseActive:1,showPlaceType:10,showFullGeometry:35,limit:36,fuzzyMatch:37,country:38,types:39,focus:40,blur:41,setQuery:42},null,[-1,-1,-1])}get focus(){return this.$$.ctx[40]}get blur(){return this.$$.ctx[41]}get setQuery(){return this.$$.ctx[42]}};function Ll(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 vr=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function bl(r,t){return r>t?1:r<t?-1:0}function yr(r,t,e){for(var n=new vr(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 hs(r,t,e,n){var i=new vr(r,t);if(e===null)return i.left=i.right=null,i;e=yr(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 ga(r,t,e){var n=null,i=null;if(t){t=yr(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 Pl(r,t,e){return t===null?r:(r===null||(t=yr(r.key,t,e),t.left=r),t)}function gs(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
2
2
|
`);var o=t+(e?" ":"│ ");r.left&&gs(r.left,o,!1,n,i),r.right&&gs(r.right,o,!0,n,i)}}var ps=function(){function r(t){t===void 0&&(t=bl),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=hs(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new vr(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=yr(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=yr(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=yr(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=yr(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=yr(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 Ol(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&&ys(t,e,0,i-1,o),this._root===null)this._root=ds(t,e,0,i),this._size=i;else{var s=Dl(this.toList(),Rl(t,e),o);i=this._size+i,this._root=vs({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 gs(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=ga(t,this._root,i),s=o.left,a=o.right;i(t,e)<0?a=hs(e,n,a,i):s=hs(e,n,s,i),this._root=Pl(s,a,i)},r.prototype.split=function(t){return ga(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t;return Ll(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 ds(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 vr(s,a);return u.left=ds(r,t,e,o),u.right=ds(r,t,o+1,n),u}return null}function Rl(r,t){for(var e=new vr(null,null),n=e,i=0;i<r.length;i++)n=n.next=new vr(r[i],t[i]);return n.next=null,e.next}function Ol(r){for(var t=r,e=[],n=!1,i=new vr(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 vs(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=vs(r,t,i),s=r.head;return s.left=o,r.head=r.head.next,s.right=vs(r,i+1,e),s}return null}function Dl(r,t,e){for(var n=new vr(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 ys(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}ys(r,t,e,a,i),ys(r,t,a+1,n,i)}}function en(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function pa(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 ye(r,t,e){return t&&pa(r.prototype,t),e&&pa(r,e),r}var Wi=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},ms=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}}},mr=Number.EPSILON;mr===void 0&&(mr=Math.pow(2,-52));var Tl=mr*mr,_s=function(t,e){if(-mr<t&&t<mr&&-mr<e&&e<mr)return 0;var n=t-e;return n*n<Tl*t*e?0:t<e?-1:1},Ml=function(){function r(){en(this,r),this.reset()}return ye(r,[{key:"reset",value:function(){this.xRounder=new da,this.yRounder=new da}},{key:"round",value:function(e,n){return{x:this.xRounder.round(e),y:this.yRounder.round(n)}}}]),r}(),da=function(){function r(){en(this,r),this.tree=new ps,this.round(0)}return ye(r,[{key:"round",value:function(e){var n=this.tree.add(e),i=this.tree.prev(n);if(i!==null&&_s(n.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(n);return o!==null&&_s(n.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),r}(),ji=new Ml,Ki=function(t,e){return t.x*e.y-t.y*e.x},va=function(t,e){return t.x*e.x+t.y*e.y},ya=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=Ki(i,o);return _s(s,0)},wo=function(t){return Math.sqrt(va(t,t))},Al=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 Ki(o,i)/wo(o)/wo(i)},Fl=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 va(o,i)/wo(o)/wo(i)},ma=function(t,e,n){return e.y===0?null:{x:t.x+e.x/e.y*(n-t.y),y:n}},_a=function(t,e,n){return e.x===0?null:{x:n,y:t.y+e.y/e.x*(n-t.x)}},Bl=function(t,e,n,i){if(e.x===0)return _a(n,i,t.x);if(i.x===0)return _a(t,e,n.x);if(e.y===0)return ma(n,i,t.y);if(i.y===0)return ma(t,e,n.y);var o=Ki(e,i);if(o==0)return null;var s={x:n.x-t.x,y:n.y-t.y},a=Ki(s,e)/o,u=Ki(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}},Gn=function(){ye(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:Lo.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){en(this,r),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return ye(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:Al(n.point,e.point,u.point),cosine:Fl(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}(),Gl=0,Lo=function(){ye(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 v=e.comparePoint(n.rightSE.point);return v<0?1:v>0?-1:1}if(u<l)return-1;if(u>l)return 1;if(s<a){var y=n.comparePoint(e.rightSE.point);if(y!==0)return y}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,N=s-i,C=f-l,L=a-o;if(E>N&&C<L)return 1;if(E<N&&C>L)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){en(this,r),this.id=++Gl,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 ye(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=ms(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=Wi(n,u)&&this.comparePoint(u)===0,f=Wi(i,s)&&e.comparePoint(s)===0,h=Wi(n,l)&&this.comparePoint(l)===0,g=Wi(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=Bl(s,this.vector(),u,e.vector());return p===null||!Wi(o,p)?null:ji.round(p.x,p.y)}},{key:"split",value:function(e){var n=[],i=e.events!==void 0,o=new Gn(e,!0),s=new Gn(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 Gn.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),Gn.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 v=n[g],y=v.poly;if(h.indexOf(y)===-1)if(v.isExterior)f.push(y);else{h.indexOf(y)===-1&&h.push(y);var m=f.indexOf(v.poly);m!==-1&&f.splice(m,1)}}for(var E=0,N=f.length;E<N;E++){var C=f[E].multiPoly;o.indexOf(C)===-1&&o.push(C)}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(Cn.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===Cn.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(Cn.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,n,i){var o,s,a,u=Gn.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 Gn(o,!0),c=new Gn(s,!1);return new r(l,c,[i],[a])}}]),r}(),Ea=function(){function r(t,e,n){if(en(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=ji.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=ji.round(t[s][0],t[s][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Lo.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(Lo.fromRing(o,i,this))}return ye(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}(),kl=function(){function r(t,e){if(en(this,r),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ea(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 Ea(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 ye(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}(),Ia=function(){function r(t,e){if(en(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 kl(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 ye(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}(),zl=function(){ye(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,v=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(v.x,", ").concat(v.y,"]."))}if(g.length===1){l=g[0].otherSE;break}for(var y=null,m=0,E=h.length;m<E;m++)if(h[m].point===u.point){y=m;break}if(y!==null){var N=h.splice(y)[0],C=c.splice(N.index);C.unshift(C[0].otherSE),n.push(new r(C.reverse()));continue}h.push({index:c.length,point:u.point});var L=u.getLeftmostComparator(a);l=g.sort(L)[0].otherSE;break}n.push(new r(c))}}return n}}]);function r(t){en(this,r),this.events=t;for(var e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}return ye(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;ya(s,e,a)!==0&&(n.push(s),e=s)}if(n.length===1)return null;var u=n[0],l=n[1];ya(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];Gn.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}(),Ca=function(){function r(t){en(this,r),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return ye(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}(),Vl=function(){function r(t){en(this,r),this.rings=t,this.polys=this._composePolys(t)}return ye(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 Ca(s));else{var a=s.enclosingRing();a.poly||n.push(new Ca(a)),a.poly.addInterior(s)}}return n}}]),r}(),Ul=function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lo.compare;en(this,r),this.queue=t,this.tree=new ps(e),this.segments=[]}return ye(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 v=null;if(l){var y=l.getIntersection(n);if(y!==null&&(n.isAnEndpoint(y)||(v=y),!l.isAnEndpoint(y)))for(var m=this._splitSafely(l,y),E=0,N=m.length;E<N;E++)i.push(m[E])}if(c!==null||v!==null){var C=null;if(c===null)C=v;else if(v===null)C=c;else{var L=Gn.comparePoints(c,v);C=L<=0?c:v}this.queue.remove(n.rightSE),i.push(n.rightSE);for(var w=n.split(C),D=0,T=w.length;D<T;D++)i.push(w[D])}i.length>0?(this.tree.remove(n),i.push(e)):(this.segments.push(n),n.prev=u)}else{if(u&&l){var F=u.getIntersection(l);if(F!==null){if(!u.isAnEndpoint(F))for(var j=this._splitSafely(u,F),z=0,O=j.length;z<O;z++)i.push(j[z]);if(!l.isAnEndpoint(F))for(var Y=this._splitSafely(l,F),P=0,X=Y.length;P<X;P++)i.push(Y[P])}}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}(),Na=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,ql=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Xl=function(){function r(){en(this,r)}return ye(r,[{key:"run",value:function(e,n,i){Cn.type=e,ji.reset();for(var o=[new Ia(n,!0)],s=0,a=i.length;s<a;s++)o.push(new Ia(i[s],!1));if(Cn.numMultiPolys=o.length,Cn.type==="difference")for(var u=o[0],l=1;l<o.length;)ms(o[l].bbox,u.bbox)!==null?l++:o.splice(l,1);if(Cn.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(ms(h.bbox,o[g].bbox)===null)return[]}for(var v=new ps(Gn.compare),y=0,m=o.length;y<m;y++)for(var E=o[y].getSweepEvents(),N=0,C=E.length;N<C;N++)if(v.insert(E[N]),v.size>Na)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var L=new Ul(v),w=v.size,D=v.pop();D;){var T=D.key;if(v.size===w){var F=T.segment;throw new Error("Unable to pop() ".concat(T.isLeft?"left":"right"," SweepEvent ")+"[".concat(T.point.x,", ").concat(T.point.y,"] from segment #").concat(F.id," ")+"[".concat(F.leftSE.point.x,", ").concat(F.leftSE.point.y,"] -> ")+"[".concat(F.rightSE.point.x,", ").concat(F.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(v.size>Na)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(L.segments.length>ql)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var j=L.process(T),z=0,O=j.length;z<O;z++){var Y=j[z];Y.consumedBy===void 0&&v.insert(Y)}w=v.size,D=v.pop()}ji.reset();var P=zl.factory(L.segments),X=new Vl(P);return X.getGeom()}}]),r}(),Cn=new Xl,Yl=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 Cn.run("union",t,n)},Hl=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 Cn.run("intersection",t,n)},Wl=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 Cn.run("xor",t,n)},jl=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 Cn.run("difference",t,n)},xa={union:Yl,intersection:Hl,xor:Wl,difference:jl},me=63710088e-1,Sa={centimeters:me*100,centimetres:me*100,degrees:me/111325,feet:me*3.28084,inches:me*39.37,kilometers:me/1e3,kilometres:me/1e3,meters:me,metres:me,miles:me/1609.344,millimeters:me*1e3,millimetres:me*1e3,nauticalmiles:me/1852,radians:1,yards:me*1.0936};function bo(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 Kl(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(!ba(r[0])||!ba(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return bo(n,t,e)}function wa(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 bo(a,t,e)}function Es(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 La(r,t,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:r};return bo(n,t,e)}function Ql(r,t){t===void 0&&(t="kilometers");var e=Sa[t];if(!e)throw new Error(t+" units is invalid");return r*e}function Jl(r,t){t===void 0&&(t="kilometers");var e=Sa[t];if(!e)throw new Error(t+" units is invalid");return r/e}function ba(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Po(r){return r.type==="Feature"?r.geometry:r}function Zl(r,t,e){e===void 0&&(e={});var n=Po(r),i=Po(t),o=xa.union(n.coordinates,i.coordinates);return o.length===0?null:o.length===1?wa(o[0],e.properties):La(o,e.properties)}function $l(r,t){var e=Po(r),n=Po(t),i=r.properties||{},o=xa.difference(e.coordinates,n.coordinates);return o.length===0?null:o.length===1?wa(o[0],i):La(o,i)}function Pa(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",v=g==="Feature",y=p?r.features.length:1,m=0;m<y;m++){l=p?r.features[m].geometry:v?r.geometry:r,h=l?l.type==="GeometryCollection":!1,a=h?l.geometries.length:1;for(var E=0;E<a;E++){var N=0,C=0;if(s=h?l.geometries[E]:l,s!==null){u=s.coordinates;var L=s.type;switch(c=e&&(L==="Polygon"||L==="MultiPolygon")?1:0,L){case null:break;case"Point":if(t(u,f,m,N,C)===!1)return!1;f++,N++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(t(u[n],f,m,N,C)===!1)return!1;f++,L==="MultiPoint"&&N++}L==="LineString"&&N++;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,N,C)===!1)return!1;f++}L==="MultiLineString"&&N++,L==="Polygon"&&C++}L==="Polygon"&&N++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(C=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,N,C)===!1)return!1;f++}C++}N++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(Pa(s.geometries[n],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ra(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 Oa(r,t){var e,n,i,o,s,a,u,l,c,f,h=0,g=r.type==="FeatureCollection",p=r.type==="Feature",v=g?r.features.length:1;for(e=0;e<v;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 Is(r){var t=[1/0,1/0,-1/0,-1/0];return Pa(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}Is.default=Is;function tc(r,t){t===void 0&&(t={});var e=Is(r),n=(e[0]+e[2])/2,i=(e[1]+e[3])/2;return Kl([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 Gr=function(){};Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var ht=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(){},Da={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)},Da.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(V,Da);var Pe=function(){},Ro=function(){},pi=function(){};function Re(){}var d=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])},kr={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};d.prototype.setOrdinate=function(t,e){switch(t){case d.X:this.x=e;break;case d.Y:this.y=e;break;case d.Z:this.z=e;break;default:throw new ht("Invalid ordinate index: "+t)}},d.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!(!Gr.equalsWithTolerance(this.x,e.x,n)||!Gr.equalsWithTolerance(this.y,e.y,n))}},d.prototype.getOrdinate=function(t){switch(t){case d.X:return this.x;case d.Y:return this.y;case d.Z:return this.z}throw new ht("Invalid ordinate index: "+t)},d.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)},d.prototype.equals=function(t){return t instanceof d?this.equals2D(t):!1},d.prototype.equalInZ=function(t,e){return Gr.equalsWithTolerance(this.z,t.z,e)},d.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},d.prototype.clone=function(){},d.prototype.copy=function(){return new d(this)},d.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},d.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)},d.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},d.prototype.hashCode=function(){var t=17;return t=37*t+d.hashCode(this.x),t=37*t+d.hashCode(this.y),t},d.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},d.prototype.interfaces_=function(){return[Pe,Ro,Re]},d.prototype.getClass=function(){return d},d.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=V.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},kr.DimensionalComparator.get=function(){return nr},kr.serialVersionUID.get=function(){return 6683108902428367e3},kr.NULL_ORDINATE.get=function(){return V.NaN},kr.X.get=function(){return 0},kr.Y.get=function(){return 1},kr.Z.get=function(){return 2},Object.defineProperties(d,kr);var nr=function(t){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new ht("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}};nr.prototype.compare=function(t,e){var n=t,i=e,o=nr.compare(n.x,i.x);if(o!==0)return o;var s=nr.compare(n.y,i.y);if(s!==0)return s;if(this._dimensionsToTest<=2)return 0;var a=nr.compare(n.z,i.z);return a},nr.prototype.interfaces_=function(){return[pi]},nr.prototype.getClass=function(){return nr},nr.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 di=function(){};di.prototype.create=function(){},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di};var _=function(){},Qi={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 ht("Unknown location value: "+t)},Qi.INTERIOR.get=function(){return 0},Qi.BOUNDARY.get=function(){return 1},Qi.EXTERIOR.get=function(){return 2},Qi.NONE.get=function(){return-1},Object.defineProperties(_,Qi);var k=function(r,t){return r.interfaces_&&r.interfaces_().indexOf(t)>-1},_e=function(){},Ta={LOG_10:{configurable:!0}};_e.prototype.interfaces_=function(){return[]},_e.prototype.getClass=function(){return _e},_e.log10=function(t){var e=Math.log(t);return V.isInfinite(e)||V.isNaN(e)?e:e/_e.LOG_10},_e.min=function(t,e,n,i){var o=t;return e<o&&(o=e),n<o&&(o=n),i<o&&(o=i),o},_e.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}},_e.wrap=function(t,e){return t<0?e- -t%e:t%e},_e.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}},_e.average=function(t,e){return(t+e)/2},Ta.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(_e,Ta);var nn=function(t){this.str=t};nn.prototype.append=function(t){this.str+=t},nn.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},nn.prototype.toString=function(t){return this.str};var rn=function(t){this.value=t};rn.prototype.intValue=function(){return this.value},rn.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},rn.isNaN=function(t){return Number.isNaN(t)};var Ji=function(){};Ji.isWhitespace=function(t){return t<=32&&t>=0||t===127},Ji.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 nn,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,v=null,y=null,m=null,E=null;v=this._hi+l,g=this._lo+c,m=v-this._hi,E=g-this._lo,y=v-m,p=g-E,y=l-m+(this._hi-y),p=c-E+(this._lo-p),m=y+g,f=v+m,h=m+(v-f),m=p+h;var N=f+m,C=m+(f-N);return this._hi=N,this._lo=C,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[Re,Pe,Ro]},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;Ji.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++,Ji.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=rn.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 v=I.TEN.pow(p);g=s.divide(v)}else if(p<0){var y=I.TEN.pow(-p);g=s.multiply(y)}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 nn,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 ae=function(){},Ma={DP_SAFE_EPSILON:{configurable:!0}};ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.orientationIndex=function(t,e,n){var i=ae.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()},ae.signOfDet2x2=function(t,e,n,i){var o=t.multiply(i).selfSubtract(e.multiply(n));return o.signum()},ae.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)),v=g.subtract(p),y=v.selfDivide(a).doubleValue(),m=I.valueOf(n.y).selfAdd(I.valueOf(i.y).selfSubtract(n.y).selfMultiply(y)).doubleValue();return new d(h,m)},ae.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 ae.signum(a);i=o+s}else if(o<0){if(s>=0)return ae.signum(a);i=-o-s}else return ae.signum(a);var u=ae.DP_SAFE_EPSILON*i;return a>=u||-a>=u?ae.signum(a):2},ae.signum=function(t){return t>0?1:t<0?-1:0},Ma.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(ae,Ma);var J=function(){},Zi={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Zi.X.get=function(){return 0},Zi.Y.get=function(){return 1},Zi.Z.get=function(){return 2},Zi.M.get=function(){return 3},J.prototype.setOrdinate=function(t,e,n){},J.prototype.size=function(){},J.prototype.getOrdinate=function(t,e){},J.prototype.getCoordinate=function(){},J.prototype.getCoordinateCopy=function(t){},J.prototype.getDimension=function(){},J.prototype.getX=function(t){},J.prototype.clone=function(){},J.prototype.expandEnvelope=function(t){},J.prototype.copy=function(){},J.prototype.getY=function(t){},J.prototype.toCoordinateArray=function(){},J.prototype.interfaces_=function(){return[Ro]},J.prototype.getClass=function(){return J},Object.defineProperties(J,Zi);var Aa=function(){},vi=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}(Aa),At=function(){};At.arraycopy=function(t,e,n,i,o){for(var s=0,a=e;a<e+o;a++)n[i+s]=t[a],s++},At.getProperty=function(t){return{"line.separator":`
|
|
3
3
|
`}[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 d&&arguments[1]instanceof d){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],v=f.y-h.y,y=h.x-f.x,m=f.x*h.y-h.x*f.y,E=g.y-p.y,N=p.x-g.x,C=g.x*p.y-p.x*g.y;this.x=y*C-N*m,this.y=E*m-v*C,this.w=v*N-E*y}};Ue.prototype.getY=function(){var t=this.y/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new vi;return t},Ue.prototype.getX=function(){var t=this.x/this.w;if(V.isNaN(t)||V.isInfinite(t))throw new vi;return t},Ue.prototype.getCoordinate=function(){var t=new d;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,v=h/g;if(V.isNaN(p)||V.isInfinite(p)||V.isNaN(v)||V.isInfinite(v))throw new vi;return new d(p,v)};var M=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 d){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)}},Fa={serialVersionUID:{configurable:!0}};M.prototype.getArea=function(){return this.getWidth()*this.getHeight()},M.prototype.equals=function(t){if(!(t instanceof M))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()},M.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new M;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 M(e,i,n,o)},M.prototype.isNull=function(){return this._maxx<this._minx},M.prototype.getMaxX=function(){return this._maxx},M.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.covers(t.x,t.y)}else if(arguments[0]instanceof M){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}},M.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof M){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 d){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)}},M.prototype.getMinY=function(){return this._miny},M.prototype.getMinX=function(){return this._minx},M.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof M){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))}},M.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},M.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},M.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},M.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},M.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},M.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},M.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},M.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},M.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()}},M.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof M){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof d){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)}},M.prototype.centre=function(){return this.isNull()?null:new d((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},M.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof M){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)}},M.prototype.getMaxY=function(){return this._maxy},M.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)},M.prototype.hashCode=function(){var t=17;return t=37*t+d.hashCode(this._minx),t=37*t+d.hashCode(this._maxx),t=37*t+d.hashCode(this._miny),t=37*t+d.hashCode(this._maxy),t},M.prototype.interfaces_=function(){return[Pe,Re]},M.prototype.getClass=function(){return M},M.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)}},Fa.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(M,Fa);var on={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*$/},Oo=function(t){this.geometryFactory=t||new W};Oo.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var o=on.typeStr.exec(t);if(t.search("EMPTY")!==-1&&(o=on.emptyTypeStr.exec(t),o[2]=void 0),o&&(n=o[1].toLowerCase(),i=o[2],yi[n]&&(e=yi[n].apply(this,[i]))),e===void 0)throw new Error("Could not parse WKT "+t);return e},Oo.prototype.write=function(t){return this.extractGeometry(t)},Oo.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!kn[e])return null;var n=e.toUpperCase(),i;return t.isEmpty()?i=n+" EMPTY":i=n+"("+kn[e].apply(this,[t])+")",i};var kn={coordinate:function(t){return t.x+" "+t.y},point:function(t){return kn.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("("+kn.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(kn.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(kn.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("("+kn.linestring.apply(e,[t._geometries[i]])+")");return n.join(",")},polygon:function(t){var e=this,n=[];n.push("("+kn.linestring.apply(this,[t._shell])+")");for(var i=0,o=t._holes.length;i<o;++i)n.push("("+kn.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("("+kn.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(",")}},yi={point:function(t){if(t===void 0)return this.geometryFactory.createPoint();var e=t.trim().split(on.spaces);return this.geometryFactory.createPoint(new d(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(on.trimParens,"$1"),o.push(yi.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(on.spaces),n.push(new d(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(on.spaces),n.push(new d(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(on.parenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(on.trimParens,"$1"),o.push(yi.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(on.parenComma),a,u=[],l=0,c=s.length;l<c;++l)n=s[l].replace(on.trimParens,"$1"),i=yi.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(on.doubleParenComma),o=[],s=0,a=i.length;s<a;++s)n=i[s].replace(on.trimParens,"$1"),o.push(yi.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 Oo(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 zn=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),Do=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}(zn),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 Do("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 Do:new Do(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 Do("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 d,this._intPt[1]=new d,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},zr={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 nn;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},zr.DONT_INTERSECT.get=function(){return 0},zr.DO_INTERSECT.get=function(){return 1},zr.COLLINEAR.get=function(){return 2},zr.NO_INTERSECTION.get=function(){return 0},zr.POINT_INTERSECTION.get=function(){return 1},zr.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(gt,zr);var _r=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 M(this._inputLines[0][0],this._inputLines[0][1]),o=new M(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,M.intersects(i,o,n)&&R.orientationIndex(i,o,n)===0&&R.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 vi)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 d(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=ae.intersection(n,i,o,s),l=this.isInSegmentEnvelopes(u);At.out.println("DD in env = "+l+" --------------------- "+u),a.distance(u)>1e-4&&At.out.println("Distance = "+a.distance(u))},t.prototype.intersectionWithNormalization=function(n,i,o,s){var a=new d(n),u=new d(i),l=new d(o),c=new d(s),f=new d;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=M.intersects(n,i,o),u=M.intersects(n,i,s),l=M.intersects(o,s,n),c=M.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,v=o.y>s.y?o.y:s.y,y=u>h?u:h,m=c<p?c:p,E=l>g?l:g,N=f<v?f:v,C=(y+m)/2,L=(E+N)/2;a.x=C,a.y=L,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,!M.intersects(n,i,o,s))return r.NO_INTERSECTION;var a=R.orientationIndex(n,i,o),u=R.orientationIndex(n,i,s);if(a>0&&u>0||a<0&&u<0)return r.NO_INTERSECTION;var l=R.orientationIndex(o,s,n),c=R.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 d(o):u===0?this._intPt[0]=new d(s):l===0?this._intPt[0]=new d(n):c===0&&(this._intPt[0]=new d(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=R.distancePointLine(n,o,s),l=R.distancePointLine(i,o,s);return l<u&&(u=l,a=i),l=R.distancePointLine(o,n,i),l<u&&(u=l,a=o),l=R.distancePointLine(s,n,i),l<u&&(u=l,a=s),a},t}(gt),Vr=function(){};Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.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 Vr.signOfDet2x2(i,o,s,a)},Vr.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 sn=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};sn.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=Vr.signOfDet2x2(o,s,a,u);if(l===0)return this._isPointOnSegment=!0,null;u<s&&(l=-l),l>0&&this._crossingCount++}},sn.prototype.isPointInPolygon=function(){return this.getLocation()!==_.EXTERIOR},sn.prototype.getLocation=function(){return this._isPointOnSegment?_.BOUNDARY:this._crossingCount%2===1?_.INTERIOR:_.EXTERIOR},sn.prototype.isOnSegment=function(){return this._isPointOnSegment},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},sn.locatePointInRing=function(){if(arguments[0]instanceof d&&k(arguments[1],J)){for(var t=arguments[0],e=arguments[1],n=new sn(t),i=new d,o=new d,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 d&&arguments[1]instanceof Array){for(var a=arguments[0],u=arguments[1],l=new sn(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 R=function(){},Ur={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.orientationIndex=function(t,e,n){return ae.orientationIndex(t,e,n)},R.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(k(arguments[0],J)){var u=arguments[0],l=u.size();if(l<3)return 0;var c=new d,f=new d,h=new d;u.getCoordinate(0,f),u.getCoordinate(1,h);var g=f.x;h.x-=g;for(var p=0,v=1;v<l-1;v++)c.y=f.y,f.x=h.x,f.y=h.y,u.getCoordinate(v+1,h),h.x-=g,p+=f.x*(c.y-h.y);return p/2}},R.distanceLineLine=function(t,e,n,i){if(t.equals(e))return R.distancePointLine(t,n,i);if(n.equals(i))return R.distancePointLine(i,t,e);var o=!1;if(!M.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?_e.min(R.distancePointLine(t,n,i),R.distancePointLine(e,n,i),R.distancePointLine(n,t,e),R.distancePointLine(i,t,e)):0},R.isPointInRing=function(t,e){return R.locatePointInRing(t,e)!==_.EXTERIOR},R.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new d;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},R.isCCW=function(t){var e=t.length-1;if(e<3)throw new ht("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=R.computeOrientation(l,n,c),h=!1;return f===0?h=l.x>c.x:h=f>0,h},R.locatePointInRing=function(t,e){return sn.locatePointInRing(t,e)},R.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)},R.computeOrientation=function(t,e,n){return R.orientationIndex(t,e,n)},R.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new ht("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var o=R.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)}},R.isOnLine=function(t,e){for(var n=new _r,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},Ur.CLOCKWISE.get=function(){return-1},Ur.RIGHT.get=function(){return R.CLOCKWISE},Ur.COUNTERCLOCKWISE.get=function(){return 1},Ur.LEFT.get=function(){return R.COUNTERCLOCKWISE},Ur.COLLINEAR.get=function(){return 0},Ur.STRAIGHT.get=function(){return R.COLLINEAR},Object.defineProperties(R,Ur);var Vn=function(){};Vn.prototype.filter=function(t){},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};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()},Nn={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 ht("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 M(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[Ro,Pe,Re]},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},Nn.serialVersionUID.get=function(){return 8763622679187377e3},Nn.SORTINDEX_POINT.get=function(){return 0},Nn.SORTINDEX_MULTIPOINT.get=function(){return 1},Nn.SORTINDEX_LINESTRING.get=function(){return 2},Nn.SORTINDEX_LINEARRING.get=function(){return 3},Nn.SORTINDEX_MULTILINESTRING.get=function(){return 4},Nn.SORTINDEX_POLYGON.get=function(){return 5},Nn.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Nn.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Nn.geometryChangedFilter.get=function(){return Cs},Object.defineProperties(G,Nn);var Cs=function(){};Cs.interfaces_=function(){return[Vn]},Cs.filter=function(t){t.geometryChangedAction()};var xn=function(){};xn.prototype.filter=function(t){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var Oe=function(){},Un={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}};Oe.prototype.isInBoundary=function(t){},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Un.Mod2BoundaryNodeRule.get=function(){return mi},Un.EndPointBoundaryNodeRule.get=function(){return _i},Un.MultiValentEndPointBoundaryNodeRule.get=function(){return Ei},Un.MonoValentEndPointBoundaryNodeRule.get=function(){return Ii},Un.MOD2_BOUNDARY_RULE.get=function(){return new mi},Un.ENDPOINT_BOUNDARY_RULE.get=function(){return new _i},Un.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ei},Un.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ii},Un.OGC_SFS_BOUNDARY_RULE.get=function(){return Oe.MOD2_BOUNDARY_RULE},Object.defineProperties(Oe,Un);var mi=function(){};mi.prototype.isInBoundary=function(t){return t%2===1},mi.prototype.interfaces_=function(){return[Oe]},mi.prototype.getClass=function(){return mi};var _i=function(){};_i.prototype.isInBoundary=function(t){return t>0},_i.prototype.interfaces_=function(){return[Oe]},_i.prototype.getClass=function(){return _i};var Ei=function(){};Ei.prototype.isInBoundary=function(t){return t>1},Ei.prototype.interfaces_=function(){return[Oe]},Ei.prototype.getClass=function(){return Ei};var Ii=function(){};Ii.prototype.isInBoundary=function(t){return t===1},Ii.prototype.interfaces_=function(){return[Oe]},Ii.prototype.getClass=function(){return Ii};var wt=function(){};wt.prototype.add=function(){},wt.prototype.addAll=function(){},wt.prototype.isEmpty=function(){},wt.prototype.iterator=function(){},wt.prototype.size=function(){},wt.prototype.toArray=function(){},wt.prototype.remove=function(){};function Ns(r){this.message=r||""}Ns.prototype=new Error,Ns.prototype.name="IndexOutOfBoundsException";var Ci=function(){};Ci.prototype.hasNext=function(){},Ci.prototype.next=function(){},Ci.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}(wt);function Ni(r){this.message=r||""}Ni.prototype=new Error,Ni.prototype.name="NoSuchElementException";var b=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof wt&&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,wt]},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 ec(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new Ns;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),ec=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 Ni;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}(Ci),$i=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 d&&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],v=arguments[2];if(v)for(var y=0;y<g.length;y++)i.add(g[y],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 d){var E=arguments[0],N=arguments[1],C=arguments[2];if(!C){var L=this.size();if(L>0){if(E>0){var w=this.get(E-1);if(w.equals2D(N))return null}if(E<L){var D=this.get(E);if(D.equals2D(N))return null}}}r.prototype.add.call(this,E,N)}}else if(arguments.length===4){var T=arguments[0],F=arguments[1],j=arguments[2],z=arguments[3],O=1;j>z&&(O=-1);for(var Y=j;Y!==z;Y+=O)i.add(T[Y],F);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new d(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,e),t}(b),H=function(){},To={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};To.ForwardComparator.get=function(){return to},To.BidirectionalComparator.get=function(){return xi},To.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);At.arraycopy(t,n,i,0,t.length-n),At.arraycopy(t,0,i,t.length-n,n),At.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 $i,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 $i(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 d(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 d(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 M,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=_e.clamp(e,0,t.length),n=_e.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,To);var to=function(){};to.prototype.compare=function(t,e){var n=t,i=e;return H.compare(n,i)},to.prototype.interfaces_=function(){return[pi]},to.prototype.getClass=function(){return to};var xi=function(){};xi.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},xi.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},xi.prototype.interfaces_=function(){return[pi]},xi.prototype.getClass=function(){return xi};var qr=function(){};qr.prototype.get=function(){},qr.prototype.put=function(){},qr.prototype.size=function(){},qr.prototype.values=function(){},qr.prototype.entrySet=function(){};var nc=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}(qr);function eo(r){this.message=r||""}eo.prototype=new Error,eo.prototype.name="OperationNotSupported";function Mo(){}Mo.prototype=new wt,Mo.prototype.contains=function(){};var xs=function(r){function t(){r.call(this),this.array_=[],arguments[0]instanceof wt&&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 rc(this)},t}(Mo),rc=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 Ni;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new eo},t}(Ci),qn=0,Er=1;function Ba(r){return r===null?qn:r.color}function at(r){return r===null?null:r.parent}function Xn(r,t){r!==null&&(r.color=t)}function Ss(r){return r===null?null:r.left}function Ga(r){return r===null?null:r.right}function Yt(){this.root_=null,this.size_=0}Yt.prototype=new nc,Yt.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},Yt.prototype.put=function(r,t){if(this.root_===null)return this.root_={key:r,value:t,left:null,right:null,parent:null,color:qn,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:qn,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},Yt.prototype.fixAfterInsertion=function(r){var t=this;for(r.color=Er;r!=null&&r!==this.root_&&r.parent.color===Er;)if(at(r)===Ss(at(at(r)))){var e=Ga(at(at(r)));Ba(e)===Er?(Xn(at(r),qn),Xn(e,qn),Xn(at(at(r)),Er),r=at(at(r))):(r===Ga(at(r))&&(r=at(r),t.rotateLeft(r)),Xn(at(r),qn),Xn(at(at(r)),Er),t.rotateRight(at(at(r))))}else{var n=Ss(at(at(r)));Ba(n)===Er?(Xn(at(r),qn),Xn(n,qn),Xn(at(at(r)),Er),r=at(at(r))):(r===Ss(at(r))&&(r=at(r),t.rotateRight(r)),Xn(at(r),qn),Xn(at(at(r)),Er),t.rotateLeft(at(at(r))))}this.root_.color=qn},Yt.prototype.values=function(){var r=new b,t=this.getFirstEntry();if(t!==null)for(r.add(t.value);(t=Yt.successor(t))!==null;)r.add(t.value);return r},Yt.prototype.entrySet=function(){var r=new xs,t=this.getFirstEntry();if(t!==null)for(r.add(t);(t=Yt.successor(t))!==null;)r.add(t);return r},Yt.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}},Yt.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}},Yt.prototype.getFirstEntry=function(){var r=this.root_;if(r!=null)for(;r.left!=null;)r=r.left;return r},Yt.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}},Yt.prototype.size=function(){return this.size_};var no=function(){};no.prototype.interfaces_=function(){return[]},no.prototype.getClass=function(){return no};function ka(){}ka.prototype=new Mo;function an(){this.array_=[],arguments[0]instanceof wt&&this.addAll(arguments[0])}an.prototype=new ka,an.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},an.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},an.prototype.addAll=function(r){for(var t=this,e=r.iterator();e.hasNext();)t.add(e.next());return!0},an.prototype.remove=function(r){throw new eo},an.prototype.size=function(){return this.array_.length},an.prototype.isEmpty=function(){return this.array_.length===0},an.prototype.toArray=function(){for(var r=this,t=[],e=0,n=this.array_.length;e<n;e++)t.push(r.array_[e]);return t},an.prototype.iterator=function(){return new Ao(this)};var Ao=function(r){this.treeSet_=r,this.position_=0};Ao.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Ni;return this.treeSet_.array_[this.position_++]},Ao.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ao.prototype.remove=function(){throw new eo};var Ir=function(){};Ir.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])},Ir.asList=function(t){for(var e=new b,n=0,i=t.length;n<i;n++)e.add(t[n]);return e};var $=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"},$.prototype.interfaces_=function(){return[]},$.prototype.getClass=function(){return $},$.toDimensionSymbol=function(t){switch(t){case $.FALSE:return $.SYM_FALSE;case $.TRUE:return $.SYM_TRUE;case $.DONTCARE:return $.SYM_DONTCARE;case $.P:return $.SYM_P;case $.L:return $.SYM_L;case $.A:return $.SYM_A}throw new ht("Unknown dimension value: "+t)},$.toDimensionValue=function(t){switch(Ji.toUpperCase(t)){case $.SYM_FALSE:return $.FALSE;case $.SYM_TRUE:return $.TRUE;case $.SYM_DONTCARE:return $.DONTCARE;case $.SYM_P:return $.P;case $.SYM_L:return $.L;case $.SYM_A:return $.A}throw new ht("Unknown dimension symbol: "+t)},Object.defineProperties($,Ye);var un=function(){};un.prototype.filter=function(t){},un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un};var He=function(){};He.prototype.filter=function(t,e){},He.prototype.isDone=function(){},He.prototype.isGeometryChanged=function(){},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Zt=function(r){function t(n,i){if(r.call(this,i),this._geometries=n||[],r.hasNullElements(this._geometries))throw new ht("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 M,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();Ir.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var i=this,o=$.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=$.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 an(Ir.asList(this._geometries)),a=new an(Ir.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),v=c.getGeometryN(g),y=p.compareToSameClass(v,l);if(y!==0)return y;g++}return g<f?1:g<h?-1:0}},t.prototype.apply=function(){var i=this;if(k(arguments[0],xn))for(var o=arguments[0],s=0;s<this._geometries.length;s++)i._geometries[s].apply(o);else if(k(arguments[0],He)){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(k(arguments[0],un)){var l=arguments[0];l.filter(this);for(var c=0;c<this._geometries.length;c++)i._geometries[c].apply(l)}else if(k(arguments[0],Vn)){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),Cr=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()?$.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 De(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[no]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(t,e),t}(Zt),De=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var t=arguments[0],e=Oe.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}};De.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)},De.prototype.getBoundary=function(){return this._geom instanceof dt?this.boundaryLineString(this._geom):this._geom instanceof Cr?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},De.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()])},De.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},De.prototype.computeBoundaryCoordinates=function(t){var e=this,n=new b;this._endpointMap=new Yt;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)},De.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);e===null&&(e=new Fo,this._endpointMap.put(t,e)),e.count++},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.getBoundary=function(){if(arguments.length===1){var t=arguments[0],e=new De(t);return e.getBoundary()}else if(arguments.length===2){var n=arguments[0],i=arguments[1],o=new De(n,i);return o.getBoundary()}};var Fo=function(){this.count=null};Fo.prototype.interfaces_=function(){return[]},Fo.prototype.getClass=function(){return Fo};function ic(){}function oc(){}var sc=function(){};function ac(){}function uc(){}function lc(){}var Te=function(){},ws={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},Te.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=t;return String(n)},Te.getStackTrace=function(){if(arguments.length===1){var t=arguments[0],e=new ac,n=new ic;return t.printStackTrace(n),e.toString()}else if(arguments.length===2){var i=arguments[0],o=arguments[1],s="";new oc(Te.getStackTrace(i));for(var a=new lc,u=0;u<o;u++)try{s+=a.readLine()+Te.NEWLINE}catch(l){if(l instanceof uc)q.shouldNeverReachHere();else throw l}finally{}return s}},Te.split=function(t,e){for(var n=e.length,i=new b,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},Te.toString=function(){if(arguments.length===1){var t=arguments[0];return Te.SIMPLE_ORDINATE_FORMAT.format(t)}},Te.spaces=function(t){return Te.chars(" ",t)},ws.NEWLINE.get=function(){return At.getProperty("line.separator")},ws.SIMPLE_ORDINATE_FORMAT.get=function(){return new sc},Object.defineProperties(Te,ws);var mt=function(){};mt.prototype.interfaces_=function(){return[]},mt.prototype.getClass=function(){return mt},mt.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))},mt.isRing=function(t){var e=t.size();return e===0?!0:e<=3?!1:t.getOrdinate(0,J.X)===t.getOrdinate(e-1,J.X)&&t.getOrdinate(0,J.Y)===t.getOrdinate(e-1,J.Y)},mt.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},mt.extend=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();if(mt.copy(e,0,i,0,o),o>0)for(var s=o;s<n;s++)mt.copy(e,o-1,i,s,1);return i},mt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)mt.swap(t,i,e-i)},mt.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)}},mt.copy=function(t,e,n,i,o){for(var s=0;s<o;s++)mt.copyCoord(t,e+s,n,i+s)},mt.toString=function(){if(arguments.length===1){var t=arguments[0],e=t.size();if(e===0)return"()";var n=t.getDimension(),i=new nn;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(Te.toString(t.getOrdinate(o,s)))}return i.append(")"),i.toString()}},mt.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return mt.createClosedRing(t,e,4);var i=e.getOrdinate(0,J.X)===e.getOrdinate(n-1,J.X)&&e.getOrdinate(0,J.Y)===e.getOrdinate(n-1,J.Y);return i?e:mt.createClosedRing(t,e,n+1)},mt.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),o=e.size();mt.copy(e,0,i,0,o);for(var s=o;s<n;s++)mt.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 M:this._points.expandEnvelope(new M)},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&&mt.reverse(i._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?$.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 R.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var i=this._points.copy();mt.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(k(arguments[0],xn))for(var o=arguments[0],s=0;s<this._points.size();s++)o.filter(i._points.getCoordinate(s));else if(k(arguments[0],He)){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(k(arguments[0],un)){var l=arguments[0];l.filter(this)}else if(k(arguments[0],Vn)){var c=arguments[0];c.filter(this)}},t.prototype.getBoundary=function(){return new De(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 ht("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[no]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(G),ro=function(){};ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro};var he=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 M;var i=new M;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 $.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(k(arguments[0],xn)){var i=arguments[0];if(this.isEmpty())return null;i.filter(this.getCoordinate())}else if(k(arguments[0],He)){var o=arguments[0];if(this.isEmpty())return null;o.filter(this._coordinates,0),o.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],un)){var s=arguments[0];s.filter(this)}else if(k(arguments[0],Vn)){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[ro]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(t,e),t}(G),rr=function(){};rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr};var Lt=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 ht("holes must not contain null elements");if(n.isEmpty()&&r.hasNonEmptyElements(i))throw new ht("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(R.signedArea(this._shell.getCoordinateSequence()));for(var s=0;s<this._holes.length;s++)o-=Math.abs(R.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,v=g!==c;if(p===v)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);Ir.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);At.arraycopy(s.getCoordinates(),0,u,0,u.length);var l=H.minCoordinate(s.getCoordinates());H.scroll(u,l),At.arraycopy(u,0,s.getCoordinates(),0,u.length),s.getCoordinates()[u.length]=u[0],R.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(),v=c.getNumInteriorRing(),y=0;y<p&&y<v;){var m=i.getInteriorRingN(y),E=c.getInteriorRingN(y),N=m.compareToSameClass(E,l);if(N!==0)return N;y++}return y<p?1:y<v?-1:0}},t.prototype.apply=function(i){var o=this;if(k(i,xn)){this._shell.apply(i);for(var s=0;s<this._holes.length;s++)o._holes[s].apply(i)}else if(k(i,He)){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(k(i,un))i.filter(this);else if(k(i,Vn)){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[rr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,e),t}(G),Si=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 $.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[ro]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(t,e),t}(Zt),Sn=function(r){function t(n,i){n instanceof d&&i instanceof W&&(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 $.FALSE},t.prototype.isClosed=function(){return this.isEmpty()?!0:r.prototype.isClosed.call(this)},t.prototype.reverse=function(){var i=this._points.copy();mt.reverse(i);var o=this.getFactory().createLinearRing(i);return o},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!r.prototype.isClosed.call(this))throw new ht("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ht("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),wn=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 b,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[rr]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,e),t}(Zt),Me=function(t){this._factory=t||null,this._isUserDataCopied=!1},Bo={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Me.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Me.prototype.edit=function(t,e){if(t===null)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Me.prototype.editInternal=function(t,e){return this._factory===null&&(this._factory=t.getFactory()),t instanceof Zt?this.editGeometryCollection(t,e):t instanceof Lt?this.editPolygon(t,e):t instanceof he?e.edit(t,this._factory):t instanceof dt?e.edit(t,this._factory):(q.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Me.prototype.editGeometryCollection=function(t,e){for(var n=this,i=e.edit(t,this._factory),o=new b,s=0;s<i.getNumGeometries();s++){var a=n.edit(i.getGeometryN(s),e);a===null||a.isEmpty()||o.add(a)}return i.getClass()===Si?this._factory.createMultiPoint(o.toArray([])):i.getClass()===Cr?this._factory.createMultiLineString(o.toArray([])):i.getClass()===wn?this._factory.createMultiPolygon(o.toArray([])):this._factory.createGeometryCollection(o.toArray([]))},Me.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 b,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([]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.GeometryEditorOperation=function(){},Bo.NoOpGeometryOperation.get=function(){return io},Bo.CoordinateOperation.get=function(){return oo},Bo.CoordinateSequenceOperation.get=function(){return so},Object.defineProperties(Me,Bo);var io=function(){};io.prototype.edit=function(t,e){return t},io.prototype.interfaces_=function(){return[Me.GeometryEditorOperation]},io.prototype.getClass=function(){return io};var oo=function(){};oo.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return n===null?t:t instanceof Sn?e.createLinearRing(n):t instanceof dt?e.createLineString(n):t instanceof he?n.length>0?e.createPoint(n[0]):e.createPoint():t},oo.prototype.interfaces_=function(){return[Me.GeometryEditorOperation]},oo.prototype.getClass=function(){return oo};var so=function(){};so.prototype.edit=function(t,e){return t instanceof Sn?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof dt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof he?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},so.prototype.interfaces_=function(){return[Me.GeometryEditorOperation]},so.prototype.getClass=function(){return so};var _t=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 d}else if(k(arguments[0],J)){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 d}}},za={serialVersionUID:{configurable:!0}};_t.prototype.setOrdinate=function(t,e,n){switch(e){case J.X:this._coordinates[t].x=n;break;case J.Y:this._coordinates[t].y=n;break;case J.Z:this._coordinates[t].z=n;break;default:throw new ht("invalid ordinateIndex")}},_t.prototype.size=function(){return this._coordinates.length},_t.prototype.getOrdinate=function(t,e){switch(e){case J.X:return this._coordinates[t].x;case J.Y:return this._coordinates[t].y;case J.Z:return this._coordinates[t].z}return V.NaN},_t.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}},_t.prototype.getCoordinateCopy=function(t){return new d(this._coordinates[t])},_t.prototype.getDimension=function(){return this._dimension},_t.prototype.getX=function(t){return this._coordinates[t].x},_t.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 _t(e,this._dimension)},_t.prototype.expandEnvelope=function(t){for(var e=this,n=0;n<this._coordinates.length;n++)t.expandToInclude(e._coordinates[n]);return t},_t.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 _t(e,this._dimension)},_t.prototype.toString=function(){var t=this;if(this._coordinates.length>0){var e=new nn(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"()"},_t.prototype.getY=function(t){return this._coordinates[t].y},_t.prototype.toCoordinateArray=function(){return this._coordinates},_t.prototype.interfaces_=function(){return[J,Re]},_t.prototype.getClass=function(){return _t},za.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(_t,za);var Ln=function(){},Ls={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ln.prototype.readResolve=function(){return Ln.instance()},Ln.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return new _t(t)}else if(k(arguments[0],J)){var e=arguments[0];return new _t(e)}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];return i>3&&(i=3),i<2?new _t(n):new _t(n,i)}},Ln.prototype.interfaces_=function(){return[di,Re]},Ln.prototype.getClass=function(){return Ln},Ln.instance=function(){return Ln.instanceObject},Ls.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ls.instanceObject.get=function(){return new Ln},Object.defineProperties(Ln,Ls);var Va=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 b,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 xs;return this.map_.entries().forEach(function(i){return n.add(i)}),n},t.prototype.size=function(){return this.map_.size()},t}(qr),tt=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 ln){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}}},bs={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};tt.prototype.equals=function(t){if(!(t instanceof tt))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},tt.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new rn(n).compareTo(new rn(i))},tt.prototype.getScale=function(){return this._scale},tt.prototype.isFloating=function(){return this._modelType===tt.FLOATING||this._modelType===tt.FLOATING_SINGLE},tt.prototype.getType=function(){return this._modelType},tt.prototype.toString=function(){var t="UNKNOWN";return this._modelType===tt.FLOATING?t="Floating":this._modelType===tt.FLOATING_SINGLE?t="Floating-Single":this._modelType===tt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},tt.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(V.isNaN(t))return t;if(this._modelType===tt.FLOATING_SINGLE){var e=t;return e}return this._modelType===tt.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof d){var n=arguments[0];if(this._modelType===tt.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},tt.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===tt.FLOATING?t=16:this._modelType===tt.FLOATING_SINGLE?t=6:this._modelType===tt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},tt.prototype.setScale=function(t){this._scale=Math.abs(t)},tt.prototype.interfaces_=function(){return[Re,Pe]},tt.prototype.getClass=function(){return tt},tt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},bs.serialVersionUID.get=function(){return 7777263578777804e3},bs.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(tt,bs);var ln=function r(t){this._name=t||null,r.nameToTypeMap.put(t,this)},Ps={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ln.prototype.readResolve=function(){return ln.nameToTypeMap.get(this._name)},ln.prototype.toString=function(){return this._name},ln.prototype.interfaces_=function(){return[Re]},ln.prototype.getClass=function(){return ln},Ps.serialVersionUID.get=function(){return-552860263173159e4},Ps.nameToTypeMap.get=function(){return new Va},Object.defineProperties(ln,Ps),tt.Type=ln,tt.FIXED=new ln("FIXED"),tt.FLOATING=new ln("FLOATING"),tt.FLOATING_SINGLE=new ln("FLOATING SINGLE");var W=function r(){this._precisionModel=new tt,this._SRID=0,this._coordinateSequenceFactory=r.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?k(arguments[0],di)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof tt&&(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]))},Ua={serialVersionUID:{configurable:!0}};W.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new d(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new d(t.getMinX(),t.getMinY()),new d(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new d(t.getMinX(),t.getMinY()),new d(t.getMinX(),t.getMaxY()),new d(t.getMaxX(),t.getMaxY()),new d(t.getMaxX(),t.getMinY()),new d(t.getMinX(),t.getMinY())]),null)},W.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new dt(this.getCoordinateSequenceFactory().create(t),this);if(k(t,J))return new dt(t,this)}else return new dt(this.getCoordinateSequenceFactory().create([]),this)},W.prototype.createMultiLineString=function(){if(arguments.length===0)return new Cr(null,this);if(arguments.length===1){var t=arguments[0];return new Cr(t,this)}},W.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(W.toGeometryArray(t));var u=t.iterator().next(),l=t.size()>1;if(l){if(u instanceof Lt)return this.createMultiPolygon(W.toPolygonArray(t));if(u instanceof dt)return this.createMultiLineString(W.toLineStringArray(t));if(u instanceof he)return this.createMultiPoint(W.toPointArray(t));q.shouldNeverReachHere("Unhandled class: "+u.getClass().getName())}return u},W.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)},W.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof d){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(k(arguments[0],J)){var e=arguments[0];return new he(e,this)}}},W.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},W.prototype.createPolygon=function(){if(arguments.length===0)return new Lt(null,null,this);if(arguments.length===1){if(k(arguments[0],J)){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 Sn){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return new Lt(i,o,this)}},W.prototype.getSRID=function(){return this._SRID},W.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Zt(null,this);if(arguments.length===1){var t=arguments[0];return new Zt(t,this)}},W.prototype.createGeometry=function(t){var e=new Me(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})},W.prototype.getPrecisionModel=function(){return this._precisionModel},W.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(k(arguments[0],J)){var e=arguments[0];return new Sn(e,this)}}},W.prototype.createMultiPolygon=function(){if(arguments.length===0)return new wn(null,this);if(arguments.length===1){var t=arguments[0];return new wn(t,this)}},W.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Si(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Si(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(k(arguments[0],J)){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());mt.copy(i,s,a,0,1),o[s]=t.createPoint(a)}return this.createMultiPoint(o)}}},W.prototype.interfaces_=function(){return[Re]},W.prototype.getClass=function(){return W},W.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toGeometryArray=function(t){if(t===null)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},W.getDefaultCoordinateSequenceFactory=function(){return Ln.instance()},W.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},W.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Ua.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(W,Ua);var cc=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Go=function(t){this.geometryFactory=t||new W};Go.prototype.read=function(t){var e;typeof t=="string"?e=JSON.parse(t):e=t;var n=e.type;if(!cn[n])throw new Error("Unknown GeoJSON type: "+e.type);return cc.indexOf(n)!==-1?cn[n].apply(this,[e.coordinates]):n==="GeometryCollection"?cn[n].apply(this,[e.geometries]):cn[n].apply(this,[e])},Go.prototype.write=function(t){var e=t.getGeometryType();if(!Yn[e])throw new Error("Geometry is not supported");return Yn[e].apply(this,[t])};var cn={Feature:function(r){var t={};for(var e in r)t[e]=r[e];if(r.geometry){var n=r.geometry.type;if(!cn[n])throw new Error("Unknown GeoJSON type: "+r.type);t.geometry=this.read(r.geometry)}return r.bbox&&(t.bbox=cn.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 d(n[0],n[1]))}return t},bbox:function(r){return this.geometryFactory.createLinearRing([new d(r[0],r[1]),new d(r[2],r[1]),new d(r[2],r[3]),new d(r[0],r[3]),new d(r[0],r[1])])},Point:function(r){var t=new d(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(cn.Point.apply(t,[r[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(r){var t=cn.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(cn.LineString.apply(t,[r[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(r){for(var t=this,e=cn.coordinates.apply(this,[r[0]]),n=this.geometryFactory.createLinearRing(e),i=[],o=1;o<r.length;++o){var s=r[o],a=cn.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(cn.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)}},Yn={coordinate:function(r){return[r.x,r.y]},Point:function(r){var t=Yn.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=Yn.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(Yn.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=Yn.LineString.apply(t,[i]);e.push(o.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(r){var t=this,e=[],n=Yn.LineString.apply(this,[r._shell]);e.push(n.coordinates);for(var i=0;i<r._holes.length;++i){var o=r._holes[i],s=Yn.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=Yn.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(Yn[o].apply(t,[i]))}return{type:"GeometryCollection",geometries:e}}},Rs=function(t){this.geometryFactory=t||new W,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Go(this.geometryFactory)};Rs.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===tt.FIXED&&this.reducePrecision(e),e},Rs.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 qa=function(){this.parser=new Go(this.geometryFactory)};qa.prototype.write=function(t){return this.parser.write(t)};var S=function(){},ko={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.opposite=function(t){return t===S.LEFT?S.RIGHT:t===S.RIGHT?S.LEFT:t},ko.ON.get=function(){return 0},ko.LEFT.get=function(){return 1},ko.RIGHT.get=function(){return 2},Object.defineProperties(S,ko);function zo(r){this.message=r||""}zo.prototype=new Error,zo.prototype.name="EmptyStackException";function fn(){this.array_=[]}fn.prototype=new Xe,fn.prototype.add=function(r){return this.array_.push(r),!0},fn.prototype.get=function(r){if(r<0||r>=this.size())throw new Error;return this.array_[r]},fn.prototype.push=function(r){return this.array_.push(r),r},fn.prototype.pop=function(r){if(this.array_.length===0)throw new zo;return this.array_.pop()},fn.prototype.peek=function(){if(this.array_.length===0)throw new zo;return this.array_[this.array_.length-1]},fn.prototype.empty=function(){return this.array_.length===0},fn.prototype.isEmpty=function(){return this.empty()},fn.prototype.search=function(r){return this.array_.indexOf(r)},fn.prototype.size=function(){return this.array_.length},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};var hn=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};hn.prototype.getCoordinate=function(){return this._minCoord},hn.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},hn.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=R.computeOrientation(this._minCoord,n,e),o=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===R.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===R.CLOCKWISE)&&(o=!0),o&&(this._minIndex=this._minIndex-1)},hn.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=S.LEFT;return i[e].y<i[e+1].y&&(o=S.RIGHT),o},hn.prototype.getEdge=function(){return this._orientedDe},hn.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])},hn.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)},hn.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===S.LEFT&&(this._orientedDe=this._minDe.getSym())},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var Hn=function(r){function t(e,n){r.call(this,t.msgWithCoord(e,n)),this.pt=n?new d(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}(zn),Vo=function(){this.array_=[]};Vo.prototype.addLast=function(t){this.array_.push(t)},Vo.prototype.removeFirst=function(){return this.array_.shift()},Vo.prototype.isEmpty=function(){return this.array_.length===0};var $t=function(){this._finder=null,this._dirEdgeList=new b,this._nodes=new b,this._rightMostCoord=null,this._env=null,this._finder=new hn};$t.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},$t.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},$t.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 Hn("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)}},$t.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(S.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},$t.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},$t.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(S.RIGHT)>=1&&e.getDepth(S.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},$t.prototype.computeDepths=function(t){var e=this,n=new xs,i=new Vo,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))}}}},$t.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},$t.prototype.getEnvelope=function(){if(this._env===null){for(var t=new M,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},$t.prototype.addReachable=function(t){var e=this,n=new fn;for(n.add(t);!n.empty();){var i=n.pop();e.add(i,n)}},$t.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(S.LEFT,t.getDepth(S.RIGHT)),e.setDepth(S.RIGHT,t.getDepth(S.LEFT))},$t.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)}},$t.prototype.getNodes=function(){return this._nodes},$t.prototype.getDirectedEdges=function(){return this._dirEdgeList},$t.prototype.interfaces_=function(){return[Pe]},$t.prototype.getClass=function(){return $t};var ut=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[S.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[S.ON]=s,this.location[S.LEFT]=a,this.location[S.RIGHT]=u}};ut.prototype.setAllLocations=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]=t},ut.prototype.isNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]!==_.NONE)return!1;return!0},ut.prototype.setAllLocationsIfNull=function(t){for(var e=this,n=0;n<this.location.length;n++)e.location[n]===_.NONE&&(e.location[n]=t)},ut.prototype.isLine=function(){return this.location.length===1},ut.prototype.merge=function(t){var e=this;if(t.location.length>this.location.length){var n=new Array(3).fill(null);n[S.ON]=this.location[S.ON],n[S.LEFT]=_.NONE,n[S.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])},ut.prototype.getLocations=function(){return this.location},ut.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[S.LEFT];this.location[S.LEFT]=this.location[S.RIGHT],this.location[S.RIGHT]=t},ut.prototype.toString=function(){var t=new nn;return this.location.length>1&&t.append(_.toLocationSymbol(this.location[S.LEFT])),t.append(_.toLocationSymbol(this.location[S.ON])),this.location.length>1&&t.append(_.toLocationSymbol(this.location[S.RIGHT])),t.toString()},ut.prototype.setLocations=function(t,e,n){this.location[S.ON]=t,this.location[S.LEFT]=e,this.location[S.RIGHT]=n},ut.prototype.get=function(t){return t<this.location.length?this.location[t]:_.NONE},ut.prototype.isArea=function(){return this.location.length>1},ut.prototype.isAnyNull=function(){for(var t=this,e=0;e<this.location.length;e++)if(t.location[e]===_.NONE)return!0;return!1},ut.prototype.setLocation=function(){if(arguments.length===1){var t=arguments[0];this.setLocation(S.ON,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];this.location[e]=n}},ut.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(_.NONE)},ut.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},ut.prototype.allPositionsEqual=function(t){for(var e=this,n=0;n<this.location.length;n++)if(e.location[n]!==t)return!1;return!0},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var rt=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 ut(t),this.elt[1]=new ut(t)}else if(arguments[0]instanceof r){var e=arguments[0];this.elt[0]=new ut(e.elt[0]),this.elt[1]=new ut(e.elt[1])}}else if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[0]=new ut(_.NONE),this.elt[1]=new ut(_.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 ut(o,s,a),this.elt[1]=new ut(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 ut(_.NONE,_.NONE,_.NONE),this.elt[1]=new ut(_.NONE,_.NONE,_.NONE),this.elt[u].setLocations(l,c,f)}};rt.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},rt.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},rt.prototype.isNull=function(t){return this.elt[t].isNull()},rt.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)}},rt.prototype.isLine=function(t){return this.elt[t].isLine()},rt.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 ut(t.elt[n]):e.elt[n].merge(t.elt[n])},rt.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},rt.prototype.getLocation=function(){if(arguments.length===1){var t=arguments[0];return this.elt[t].get(S.ON)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},rt.prototype.toString=function(){var t=new nn;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()},rt.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()}},rt.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},rt.prototype.setLocation=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(S.ON,e)}else if(arguments.length===3){var n=arguments[0],i=arguments[1],o=arguments[2];this.elt[n].setLocation(i,o)}},rt.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},rt.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},rt.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ut(this.elt[t].location[0]))},rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.toLineLabel=function(t){for(var e=new rt(_.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Nt=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new b,this._pts=new b,this._label=new rt(_.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new b,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Nt.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=R.isCCW(this._ring.getCoordinates())},Nt.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Nt.prototype.computePoints=function(t){var e=this;this._startDe=t;var n=t,i=!0;do{if(n===null)throw new Hn("Found null DirectedEdge");if(n.getEdgeRing()===e)throw new Hn("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)},Nt.prototype.getLinearRing=function(){return this._ring},Nt.prototype.getCoordinate=function(t){return this._pts.get(t)},Nt.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},Nt.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])}},Nt.prototype.isHole=function(){return this._isHole},Nt.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Nt.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!R.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},Nt.prototype.addHole=function(t){this._holes.add(t)},Nt.prototype.isShell=function(){return this._shell===null},Nt.prototype.getLabel=function(){return this._label},Nt.prototype.getEdges=function(){return this._edges},Nt.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Nt.prototype.getShell=function(){return this._shell},Nt.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,S.RIGHT);if(i===_.NONE)return null;if(this._label.getLocation(n)===_.NONE)return this._label.setLocation(n,i),null}},Nt.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)},Nt.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},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt};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}(Nt),hc=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 b,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}(Nt),Ee=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}}};Ee.prototype.setVisited=function(t){this._isVisited=t},Ee.prototype.setInResult=function(t){this._isInResult=t},Ee.prototype.isCovered=function(){return this._isCovered},Ee.prototype.isCoveredSet=function(){return this._isCoveredSet},Ee.prototype.setLabel=function(t){this._label=t},Ee.prototype.getLabel=function(){return this._label},Ee.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Ee.prototype.updateIM=function(t){q.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Ee.prototype.isInResult=function(){return this._isInResult},Ee.prototype.isVisited=function(){return this._isVisited},Ee.prototype.interfaces_=function(){return[]},Ee.prototype.getClass=function(){return Ee};var Uo=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 rt(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 rt(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 rt)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}(Ee),gn=function(){this.nodeMap=new Yt,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};gn.prototype.find=function(t){return this.nodeMap.get(t)},gn.prototype.addNode=function(){if(arguments[0]instanceof d){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 Uo){var n=arguments[0],i=this.nodeMap.get(n.getCoordinate());return i===null?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},gn.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},gn.prototype.iterator=function(){return this.nodeMap.values().iterator()},gn.prototype.values=function(){return this.nodeMap.values()},gn.prototype.getBoundaryNodes=function(t){for(var e=new b,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===_.BOUNDARY&&e.add(i)}return e},gn.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn};var it=function(){},ao={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 ht("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 d&&arguments[1]instanceof d){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new ht("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}},ao.NE.get=function(){return 0},ao.NW.get=function(){return 1},ao.SW.get=function(){return 2},ao.SE.get=function(){return 3},Object.defineProperties(it,ao);var Ht=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}};Ht.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:R.computeOrientation(t._p0,t._p1,this._p1)},Ht.prototype.getDy=function(){return this._dy},Ht.prototype.getCoordinate=function(){return this._p0},Ht.prototype.setNode=function(t){this._node=t},Ht.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)},Ht.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ht.prototype.getDirectedCoordinate=function(){return this._p1},Ht.prototype.getDx=function(){return this._dx},Ht.prototype.getLabel=function(){return this._label},Ht.prototype.getEdge=function(){return this._edge},Ht.prototype.getQuadrant=function(){return this._quadrant},Ht.prototype.getNode=function(){return this._node},Ht.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},Ht.prototype.computeLabel=function(t){},Ht.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")},Ht.prototype.interfaces_=function(){return[Pe]},Ht.prototype.getClass=function(){return Ht};var Os=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 rt(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 Hn("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,S.LEFT)===_.INTERIOR&&n._label.getLocation(o,S.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[S.LEFT]+"/"+this._depth[S.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===S.LEFT&&(s=-1);var a=S.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}(Ht),wi=function(){};wi.prototype.createNode=function(t){return new Uo(t,null)},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var pt=function(){if(this._edges=new b,this._nodes=null,this._edgeEndList=new b,arguments.length===0)this._nodes=new gn(new wi);else if(arguments.length===1){var t=arguments[0];this._nodes=new gn(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 Uo){var t=arguments[0];return this._nodes.addNode(t)}else if(arguments[0]instanceof d){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){At.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)?R.computeOrientation(t,e,i)===R.COLLINEAR&&it.quadrant(t,e)===it.quadrant(n,i):!1},pt.prototype.getEdgeEnds=function(){return this._edgeEndList},pt.prototype.debugPrint=function(t){At.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 Os(i,!0),s=new Os(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 ge=function(){this._geometryFactory=null,this._shellList=new b;var t=arguments[0];this._geometryFactory=t};ge.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)}},ge.prototype.computePolygons=function(t){for(var e=this,n=new b,i=t.iterator();i.hasNext();){var o=i.next(),s=o.toPolygon(e._geometryFactory);n.add(s)}return n},ge.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 Hn("unable to assign hole to a shell",o.getCoordinate(0));o.setShell(s)}}},ge.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=this,o=new b,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},ge.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},ge.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new b,i=t.iterator();i.hasNext();){var o=i.next();if(o.isInResult()&&o.getLabel().isArea()&&o.getEdgeRing()===null){var s=new hc(o,e._geometryFactory);n.add(s),s.setInResult()}}return n},ge.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},ge.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t},ge.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)&&R.isPointInRing(o,c.getCoordinates())&&(h=!0),h&&(s===null||a.contains(f))&&(s=l)}return s},ge.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},ge.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 b,s=this.buildMinimalEdgeRings(i,this._shellList,o);this.sortShellsAndHoles(s,this._shellList,o),this.placeFreeHoles(this._shellList,o)}},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var Li=function(){};Li.prototype.getBounds=function(){},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item},We.prototype.getBounds=function(){return this._bounds},We.prototype.interfaces_=function(){return[Li,Re]},We.prototype.getClass=function(){return We};var Wn=function(){this._size=null,this._items=null,this._size=0,this._items=new b,this._items.add(null)};Wn.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},Wn.prototype.size=function(){return this._size},Wn.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)},Wn.prototype.clear=function(){this._size=0,this._items.clear()},Wn.prototype.isEmpty=function(){return this._size===0},Wn.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)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var ir=function(){};ir.prototype.visitItem=function(t){},ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir};var Xr=function(){};Xr.prototype.insert=function(t,e){},Xr.prototype.remove=function(t,e){},Xr.prototype.query=function(){},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var bt=function(){if(this._childBoundables=new b,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this._level=t}}},Xa={serialVersionUID:{configurable:!0}};bt.prototype.getLevel=function(){return this._level},bt.prototype.size=function(){return this._childBoundables.size()},bt.prototype.getChildBoundables=function(){return this._childBoundables},bt.prototype.addChildBoundable=function(t){q.isTrue(this._bounds===null),this._childBoundables.add(t)},bt.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},bt.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},bt.prototype.interfaces_=function(){return[Li,Re]},bt.prototype.getClass=function(){return bt},Xa.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(bt,Xa);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?Ir.sort(n,e):Ir.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 b;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 ht("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[Pe]},xt.prototype.getClass=function(){return xt},xt.area=function(t){return t.getBounds().getArea()},xt.isComposite=function(t){return t instanceof bt};var Dt=function r(){if(this._root=null,this._built=!1,this._itemBoundables=new b,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}},qo={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Dt.prototype.getNodeCapacity=function(){return this._nodeCapacity},Dt.prototype.lastNode=function(t){return t.get(t.size()-1)},Dt.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 bt?n+=t.size(o):o instanceof We&&(n+=1)}return n}},Dt.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next();o instanceof We&&o.getItem()===e&&(n=o)}return n!==null?(t.getChildBoundables().remove(n),!0):!1},Dt.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new b:e}else if(arguments.length===1){for(var n=arguments[0],i=new b,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(s instanceof bt){var a=t.itemsTree(s);a!==null&&i.add(a)}else s instanceof We?i.add(s.getItem()):q.shouldNeverReachHere()}return i.size()<=0?null:i}},Dt.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 We(t,e))},Dt.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new b;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 bt?t.boundablesAtLevel(i,u,s):(q.isTrue(u instanceof We),i===-1&&s.add(u))}return null}},Dt.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new b;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(k(arguments[2],ir)&&arguments[0]instanceof Object&&arguments[1]instanceof bt)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 bt?t.query(s,f,u):f instanceof We?u.visitItem(f.getItem()):q.shouldNeverReachHere())}else if(k(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof bt)for(var h=arguments[0],g=arguments[1],p=arguments[2],v=g.getChildBoundables(),y=0;y<v.size();y++){var m=v.get(y);t.getIntersectsOp().intersects(m.getBounds(),h)&&(m instanceof bt?t.query(h,m,p):m instanceof We?p.add(m.getItem()):q.shouldNeverReachHere())}}},Dt.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},Dt.prototype.getRoot=function(){return this.build(),this._root},Dt.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 bt&&(a=t.remove(i,c,s),a)){u=c;break}}return u!==null&&u.getChildBoundables().isEmpty()&&o.getChildBoundables().remove(u),a}},Dt.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)},Dt.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 bt){var s=t.depth(o);s>n&&(n=s)}}return n+1}},Dt.prototype.createParentBoundables=function(t,e){var n=this;q.isTrue(!t.isEmpty());var i=new b;i.add(this.createNode(e));var o=new b(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},Dt.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Dt.prototype.interfaces_=function(){return[Re]},Dt.prototype.getClass=function(){return Dt},Dt.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},qo.IntersectsOp.get=function(){return gc},qo.serialVersionUID.get=function(){return-3886435814360241e3},qo.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Dt,qo);var gc=function(){},bi=function(){};bi.prototype.distance=function(t,e){},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return bi};var Ya=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 b,u=0;u<i.length;u++)a.addAll(s.createParentBoundablesFromVerticalSlice(i[u],o));return a},t.prototype.createNode=function(i){return new Ha(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 b;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(k(arguments[2],ir)&&arguments[0]instanceof Object&&arguments[1]instanceof bt){var a=arguments[0],u=arguments[1],l=arguments[2];r.prototype.query.call(this,a,u,l)}else if(k(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof bt){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 b(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(k(arguments[0],bi)){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&&k(arguments[1],bi)){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 Wn;for(p.add(c);!p.isEmpty()&&h>0;){var v=p.poll(),y=v.getDistance();if(y>=h)break;v.isLeaves()?(h=y,g=v):v.expandToQueue(p,h)}return[g.getBoundable(0).getItem(),g.getBoundable(1).getItem()]}}else if(arguments.length===3){var m=arguments[0],E=arguments[1],N=arguments[2],C=new We(m,E),L=new xt(this.getRoot(),C,N);return this.nearestNeighbour(L)[0]}},t.prototype.interfaces_=function(){return[Xr,Re]},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 Ha},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[pi]},compare:function(n,i){return r.compareDoubles(t.centreX(n.getBounds()),t.centreX(i.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[pi]},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}(Dt),Ha=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 M(o.getBounds()):n.expandToInclude(o.getBounds())}return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(bt),ue=function(){};ue.prototype.interfaces_=function(){return[]},ue.prototype.getClass=function(){return ue},ue.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ue.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=ue.relativeSign(e.x,n.x),o=ue.relativeSign(e.y,n.y);switch(t){case 0:return ue.compareValue(i,o);case 1:return ue.compareValue(o,i);case 2:return ue.compareValue(o,-i);case 3:return ue.compareValue(-i,o);case 4:return ue.compareValue(-i,-o);case 5:return ue.compareValue(-o,-i);case 6:return ue.compareValue(-o,i);case 7:return ue.compareValue(i,-o)}return q.shouldNeverReachHere("invalid octant value"),0},ue.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var or=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 d(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))};or.prototype.getCoordinate=function(){return this.coord},or.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},or.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ue.compare(this._segmentOctant,this.coord,e.coord)},or.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t},or.prototype.isInterior=function(){return this._isInterior},or.prototype.interfaces_=function(){return[Pe]},or.prototype.getClass=function(){return or};var te=function(){this._nodeMap=new Yt,this._edge=null;var t=arguments[0];this._edge=t};te.prototype.getSplitCoordinates=function(){var t=this,e=new $i;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()},te.prototype.addCollapsedNodes=function(){var t=this,e=new b;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)}},te.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},te.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 rn(n+1))}},te.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 d(t.coord),!1);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)n.add(i._edge.getCoordinate(a));s&&n.add(new d(e.coord))},te.prototype.iterator=function(){return this._nodeMap.values().iterator()},te.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}},te.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},te.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 rn(n[0])),o=s}},te.prototype.getEdge=function(){return this._edge},te.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},te.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 d(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)a[u++]=n._edge.getCoordinate(l);return s&&(a[u]=new d(e.coord)),new Et(a,this._edge.getData())},te.prototype.add=function(t,e){var n=new or(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)},te.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new zn("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 zn("bad split edge end point at "+a)},te.prototype.interfaces_=function(){return[]},te.prototype.getClass=function(){return te};var Yr=function(){};Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.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 ht("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 d&&arguments[1]instanceof d){var o=arguments[0],s=arguments[1],a=s.x-o.x,u=s.y-o.y;if(a===0&&u===0)throw new ht("Cannot compute the octant for two identical points "+o);return Yr.octant(a,u)}};var bn=function(){};bn.prototype.getCoordinates=function(){},bn.prototype.size=function(){},bn.prototype.getCoordinate=function(t){},bn.prototype.isClosed=function(){},bn.prototype.setData=function(t){},bn.prototype.getData=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn};var uo=function(){};uo.prototype.addIntersection=function(t,e){},uo.prototype.interfaces_=function(){return[bn]},uo.prototype.getClass=function(){return uo};var Et=function(){this._nodeList=new te(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Et.prototype.getCoordinates=function(){return this._pts},Et.prototype.size=function(){return this._pts.length},Et.prototype.getCoordinate=function(t){return this._pts[t]},Et.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Et.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Et.prototype.setData=function(t){this._data=t},Et.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Yr.octant(t,e)},Et.prototype.getData=function(){return this._data},Et.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 d(n.getIntersection(o));this.addIntersection(s,i)}},Et.prototype.toString=function(){return qe.toLineString(new _t(this._pts))},Et.prototype.getNodeList=function(){return this._nodeList},Et.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},Et.prototype.addIntersections=function(t,e,n){for(var i=this,o=0;o<t.getIntersectionNum();o++)i.addIntersection(t,e,n,o)},Et.prototype.interfaces_=function(){return[uo]},Et.prototype.getClass=function(){return Et},Et.getNodedSubstrings=function(){if(arguments.length===1){var t=arguments[0],e=new b;return Et.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 A=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new d,this.p1=new d;else if(arguments.length===1){var t=arguments[0];this.p0=new d(t.p0),this.p1=new d(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 d(e,n),this.p1=new d(i,o)}},Wa={serialVersionUID:{configurable:!0}};A.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},A.prototype.orientationIndex=function(){if(arguments[0]instanceof A){var t=arguments[0],e=R.orientationIndex(this.p0,this.p1,t.p0),n=R.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 d){var i=arguments[0];return R.orientationIndex(this.p0,this.p1,i)}},A.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},A.prototype.isVertical=function(){return this.p0.x===this.p1.x},A.prototype.equals=function(t){if(!(t instanceof A))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},A.prototype.intersection=function(t){var e=new _r;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},A.prototype.project=function(){if(arguments[0]instanceof d){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new d(t);var e=this.projectionFactor(t),n=new d;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 A){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 A(a,u)}},A.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},A.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},A.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1},A.prototype.distancePerpendicular=function(t){return R.distancePointLinePerpendicular(t,this.p0,this.p1)},A.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},A.prototype.midPoint=function(){return A.midPoint(this.p0,this.p1)},A.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},A.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},A.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},A.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},A.prototype.getLength=function(){return this.p0.distance(this.p1)},A.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return n!==0?n:this.p1.compareTo(e.p1)},A.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},A.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)},A.prototype.lineIntersection=function(t){try{var e=Ue.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){if(!(n instanceof vi))throw n}finally{}return null},A.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},A.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 d(c,f);return h},A.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}},A.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||V.isNaN(e))&&(e=1),e},A.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},A.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},A.prototype.distance=function(){if(arguments[0]instanceof A){var t=arguments[0];return R.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof d){var e=arguments[0];return R.distancePointLine(e,this.p0,this.p1)}},A.prototype.pointAlong=function(t){var e=new d;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},A.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},A.prototype.interfaces_=function(){return[Pe,Re]},A.prototype.getClass=function(){return A},A.midPoint=function(t,e){return new d((t.x+e.x)/2,(t.y+e.y)/2)},Wa.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(A,Wa);var lo=function(){this.tempEnv1=new M,this.tempEnv2=new M,this._overlapSeg1=new A,this._overlapSeg2=new A};lo.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)}}},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo};var pe=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};pe.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},pe.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)},pe.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},pe.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},pe.prototype.setId=function(t){this._id=t},pe.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},pe.prototype.getEnvelope=function(){if(this._env===null){var t=this._pts[this._start],e=this._pts[this._end];this._env=new M(t,e)}return this._env},pe.prototype.getEndIndex=function(){return this._end},pe.prototype.getStartIndex=function(){return this._start},pe.prototype.getContext=function(){return this._context},pe.prototype.getId=function(){return this._id},pe.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))},pe.prototype.interfaces_=function(){return[]},pe.prototype.getClass=function(){return pe};var pn=function(){};pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.getChainStartIndices=function(t){var e=0,n=new b;n.add(new rn(e));do{var i=pn.findChainEnd(t,e);n.add(new rn(i)),e=i}while(e<t.length-1);var o=pn.toIntArray(n);return o},pn.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},pn.getChains=function(){if(arguments.length===1){var t=arguments[0];return pn.getChains(t,null)}else if(arguments.length===2){for(var e=arguments[0],n=arguments[1],i=new b,o=pn.getChainStartIndices(e),s=0;s<o.length-1;s++){var a=new pe(e,o[s],o[s+1],n);i.add(a)}return i}},pn.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 Nr=function(){};Nr.prototype.computeNodes=function(t){},Nr.prototype.getNodedSubstrings=function(){},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var co=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];this.setSegmentIntersector(t)}}};co.prototype.setSegmentIntersector=function(t){this._segInt=t},co.prototype.interfaces_=function(){return[Nr]},co.prototype.getClass=function(){return co};var Ds=function(r){function t(n){n?r.call(this,n):r.call(this),this._monoChains=new b,this._index=new Ya,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 Et.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(i){for(var o=this,s=pn.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 ja(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 ja},Object.defineProperties(t,e),t}(co),ja=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}(lo),et=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}};et.prototype.getEndCapStyle=function(){return this._endCapStyle},et.prototype.isSingleSided=function(){return this._isSingleSided},et.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=et.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=et.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==et.JOIN_ROUND&&(this._quadrantSegments=et.DEFAULT_QUADRANT_SEGMENTS)},et.prototype.getJoinStyle=function(){return this._joinStyle},et.prototype.setJoinStyle=function(t){this._joinStyle=t},et.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},et.prototype.getSimplifyFactor=function(){return this._simplifyFactor},et.prototype.getQuadrantSegments=function(){return this._quadrantSegments},et.prototype.setEndCapStyle=function(t){this._endCapStyle=t},et.prototype.getMitreLimit=function(){return this._mitreLimit},et.prototype.setMitreLimit=function(t){this._mitreLimit=t},et.prototype.setSingleSided=function(t){this._isSingleSided=t},et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.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(et,jn);var vt=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=R.COUNTERCLOCKWISE,this._inputLine=t||null},fo={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=R.computeOrientation(t,e,n),s=o===this._angleOrientation;if(!s)return!1;var a=R.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=R.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=R.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=R.distancePointLine(e,t,n);return o<i},vt.prototype.collapseLine=function(){for(var t=this,e=new $i,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)},fo.INIT.get=function(){return 0},fo.DELETE.get=function(){return 1},fo.KEEP.get=function(){return 1},fo.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(vt,fo);var Ie=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new b},Ka={COORDINATE_ARRAY_TYPE:{configurable:!0}};Ie.prototype.getCoordinates=function(){var t=this._ptList.toArray(Ie.COORDINATE_ARRAY_TYPE);return t},Ie.prototype.setPrecisionModel=function(t){this._precisionModel=t},Ie.prototype.addPt=function(t){var e=new d(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Ie.prototype.revere=function(){},Ie.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])},Ie.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},Ie.prototype.toString=function(){var t=new W,e=t.createLineString(this.getCoordinates());return e.toString()},Ie.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new d(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Ie.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Ie.prototype.interfaces_=function(){return[]},Ie.prototype.getClass=function(){return Ie},Ka.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Ie,Ka);var Q=function(){},Hr={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Q.prototype.interfaces_=function(){return[]},Q.prototype.getClass=function(){return Q},Q.toDegrees=function(t){return t*180/Math.PI},Q.normalize=function(t){for(;t>Math.PI;)t-=Q.PI_TIMES_2;for(;t<=-Math.PI;)t+=Q.PI_TIMES_2;return t},Q.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)}},Q.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},Q.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},Q.interiorAngle=function(t,e,n){var i=Q.angle(e,t),o=Q.angle(e,n);return Math.abs(o-i)},Q.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Q.PI_TIMES_2;t>=Q.PI_TIMES_2&&(t=0)}else{for(;t>=Q.PI_TIMES_2;)t-=Q.PI_TIMES_2;t<0&&(t=0)}return t},Q.angleBetween=function(t,e,n){var i=Q.angle(e,t),o=Q.angle(e,n);return Q.diff(i,o)},Q.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},Q.toRadians=function(t){return t*Math.PI/180},Q.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Q.COUNTERCLOCKWISE:n<0?Q.CLOCKWISE:Q.NONE},Q.angleBetweenOriented=function(t,e,n){var i=Q.angle(e,t),o=Q.angle(e,n),s=o-i;return s<=-Math.PI?s+Q.PI_TIMES_2:s>Math.PI?s-Q.PI_TIMES_2:s},Hr.PI_TIMES_2.get=function(){return 2*Math.PI},Hr.PI_OVER_2.get=function(){return Math.PI/2},Hr.PI_OVER_4.get=function(){return Math.PI/4},Hr.COUNTERCLOCKWISE.get=function(){return R.COUNTERCLOCKWISE},Hr.CLOCKWISE.get=function(){return R.CLOCKWISE},Hr.NONE.get=function(){return R.COLLINEAR},Object.defineProperties(Q,Hr);var ct=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 A,this._seg1=new A,this._offset0=new A,this._offset1=new A,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 _r,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===et.JOIN_ROUND&&(this._closingSegLengthFactor=r.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},ho={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}};ct.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=R.computeOrientation(this._s0,this._s1,this._s2),i=n===R.CLOCKWISE&&this._side===S.LEFT||n===R.COUNTERCLOCKWISE&&this._side===S.RIGHT;n===0?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},ct.prototype.addLineEndCap=function(t,e){var n=new A(t,e),i=new A;this.computeOffsetSegment(n,S.LEFT,this._distance,i);var o=new A;this.computeOffsetSegment(n,S.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 et.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,u+Math.PI/2,u-Math.PI/2,R.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case et.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(o.p1);break;case et.CAP_SQUARE:var l=new d;l.x=Math.abs(this._distance)*Math.cos(u),l.y=Math.abs(this._distance)*Math.sin(u);var c=new d(i.p1.x+l.x,i.p1.y+l.y),f=new d(o.p1.x+l.x,o.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(f);break}},ct.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t},ct.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 vi)s=new d(0,0),o=!1;else throw u}finally{}o?this._segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},ct.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===R.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)},ct.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ct.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===et.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===et.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))},ct.prototype.createSquare=function(t){this._segList.addPt(new d(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new d(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new d(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new d(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ct.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ct.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ct.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ct.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)},ct.prototype.addLimitedMitreJoin=function(t,e,n,i){var o=this._seg0.p1,s=Q.angle(o,this._seg0.p0),a=Q.angleBetweenOriented(this._seg0.p0,o,this._seg1.p1),u=a/2,l=Q.normalize(s+u),c=Q.normalize(l+Math.PI),f=i*n,h=f*Math.abs(Math.sin(u)),g=n-h,p=o.x+f*Math.cos(c),v=o.y+f*Math.sin(c),y=new d(p,v),m=new A(o,y),E=m.pointAlongOffset(1,g),N=m.pointAlongOffset(1,-g);this._side===S.LEFT?(this._segList.addPt(E),this._segList.addPt(N)):(this._segList.addPt(N),this._segList.addPt(E))},ct.prototype.computeOffsetSegment=function(t,e,n,i){var o=e===S.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},ct.prototype.addFilletArc=function(t,e,n,i,o){var s=this,a=i===R.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 d;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}},ct.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*ct.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 d((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 d((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)}},ct.prototype.createCircle=function(t){var e=new d(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ct.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ct.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Ie,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ct.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ct.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()===et.JOIN_BEVEL||this._bufParams.getJoinStyle()===et.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,R.CLOCKWISE,this._distance))},ct.prototype.closeRing=function(){this._segList.closeRing()},ct.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct},ho.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},ho.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},ho.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ho.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ct,ho);var le=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};le.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},le.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],S.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],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment(),n.closeRing()},le.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===S.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()},le.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],S.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],S.LEFT);for(var l=u-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},le.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case et.CAP_ROUND:e.createCircle(t);break;case et.CAP_SQUARE:e.createSquare(t);break}},le.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},le.prototype.getBufferParameters=function(){return this._bufParams},le.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},le.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return le.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},le.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],S.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],S.LEFT),n.addFirstSegment();for(var c=2;c<=l;c++)n.addNextSegment(u[c],!0)}n.addLastSegment()},le.prototype.getSegGen=function(t){return new ct(this._precisionModel,this._bufParams,t)},le.prototype.interfaces_=function(){return[]},le.prototype.getClass=function(){return le},le.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new d(t[n]);return e};var Wr=function(){this._subgraphs=null,this._seg=new A,this._cga=new R;var t=arguments[0];this._subgraphs=t},Qa={DepthSegment:{configurable:!0}};Wr.prototype.findStabbedSegments=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],n=new b,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(k(arguments[2],Xe)&&arguments[0]instanceof d&&arguments[1]instanceof Os)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)&&R.computeOrientation(t._seg.p0,t._seg.p1,a)!==R.RIGHT){var g=u.getDepth(S.LEFT);t._seg.p0.equals(c[f])||(g=u.getDepth(S.RIGHT));var p=new xr(t._seg,g);l.add(p)}}else if(k(arguments[2],Xe)&&arguments[0]instanceof d&&k(arguments[1],Xe))for(var v=arguments[0],y=arguments[1],m=arguments[2],E=y.iterator();E.hasNext();){var N=E.next();N.isForward()&&t.findStabbedSegments(v,N,m)}}},Wr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=je.min(e);return n._leftDepth},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},Qa.DepthSegment.get=function(){return xr},Object.defineProperties(Wr,Qa);var xr=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new A(t),this._leftDepth=e};xr.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)},xr.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)},xr.prototype.toString=function(){return this._upwardSeg.toString()},xr.prototype.interfaces_=function(){return[Pe]},xr.prototype.getClass=function(){return xr};var nt=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};nt.prototype.area=function(){return nt.area(this.p0,this.p1,this.p2)},nt.prototype.signedArea=function(){return nt.signedArea(this.p0,this.p1,this.p2)},nt.prototype.interpolateZ=function(t){if(t===null)throw new ht("Supplied point is null.");return nt.interpolateZ(t,this.p0,this.p1,this.p2)},nt.prototype.longestSideLength=function(){return nt.longestSideLength(this.p0,this.p1,this.p2)},nt.prototype.isAcute=function(){return nt.isAcute(this.p0,this.p1,this.p2)},nt.prototype.circumcentre=function(){return nt.circumcentre(this.p0,this.p1,this.p2)},nt.prototype.area3D=function(){return nt.area3D(this.p0,this.p1,this.p2)},nt.prototype.centroid=function(){return nt.centroid(this.p0,this.p1,this.p2)},nt.prototype.inCentre=function(){return nt.inCentre(this.p0,this.p1,this.p2)},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.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)},nt.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},nt.det=function(t,e,n,i){return t*i-e*n},nt.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,v=(-l*h+a*g)/f,y=e.z+p*(n.z-e.z)+v*(i.z-e.z);return y},nt.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},nt.isAcute=function(t,e,n){return!(!Q.isAcute(t,e,n)||!Q.isAcute(e,n,t)||!Q.isAcute(n,t,e))},nt.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*nt.det(s,a,u,l),f=nt.det(a,s*s+a*a,l,u*u+l*l),h=nt.det(s,s*s+a*a,u,u*u+l*l),g=i-f/c,p=o+h/c;return new d(g,p)},nt.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)},nt.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 d(t.x+s*a,t.y+s*u);return l},nt.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},nt.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,o=(t.y+e.y+n.y)/3;return new d(i,o)},nt.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 d(u,l)};var Ae=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new b;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Ae.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)},Ae.prototype.addPolygon=function(t){var e=this,n=this._distance,i=S.LEFT;this._distance<0&&(n=-this._distance,i=S.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,S.opposite(i),_.INTERIOR,_.EXTERIOR)}},Ae.prototype.isTriangleErodedCompletely=function(t,e){var n=new nt(t[0],t[1],t[2]),i=n.inCentre(),o=R.distancePointLine(i,n.p0,n.p1);return o<Math.abs(e)},Ae.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)},Ae.prototype.addCurve=function(t,e,n){if(t===null||t.length<2)return null;var i=new Et(t,new rt(0,_.BOUNDARY,e,n));this._curveList.add(i)},Ae.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ae.prototype.addPolygonRing=function(t,e,n,i,o){if(e===0&&t.length<Sn.MINIMUM_VALID_SIZE)return null;var s=i,a=o;t.length>=Sn.MINIMUM_VALID_SIZE&&R.isCCW(t)&&(s=o,a=i,n=S.opposite(n));var u=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(u,s,a)},Ae.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Lt?this.addPolygon(t):t instanceof dt?this.addLineString(t):t instanceof he?this.addPoint(t):t instanceof Si?this.addCollection(t):t instanceof Cr?this.addCollection(t):t instanceof wn?this.addCollection(t):t instanceof Zt&&this.addCollection(t)},Ae.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},Ae.prototype.addCollection=function(t){for(var e=this,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);e.add(i)}},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};var Pi=function(){};Pi.prototype.locate=function(t){},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Pn=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()};Pn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Pn.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 Ni;var t=this._parent.getGeometryN(this._index++);return t instanceof Zt?(this._subcollectionIterator=new Pn(t),this._subcollectionIterator.next()):t},Pn.prototype.remove=function(){throw new Error(this.getClass().getName())},Pn.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)},Pn.prototype.interfaces_=function(){return[Ci]},Pn.prototype.getClass=function(){return Pn},Pn.isAtomic=function(t){return!(t instanceof Zt)};var Ce=function(){this._geom=null;var t=arguments[0];this._geom=t};Ce.prototype.locate=function(t){return Ce.locate(t,this._geom)},Ce.prototype.interfaces_=function(){return[Pi]},Ce.prototype.getClass=function(){return Ce},Ce.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?R.isPointInRing(t,e.getCoordinates()):!1},Ce.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Ce.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i);if(Ce.isPointInRing(t,o))return!1}return!0},Ce.containsPoint=function(t,e){if(e instanceof Lt)return Ce.containsPointInPolygon(t,e);if(e instanceof Zt)for(var n=new Pn(e);n.hasNext();){var i=n.next();if(i!==e&&Ce.containsPoint(t,i))return!0}return!1},Ce.locate=function(t,e){return e.isEmpty()?_.EXTERIOR:Ce.containsPoint(t,e)?_.INTERIOR:_.EXTERIOR};var Wt=function(){this._edgeMap=new Yt,this._edgeList=null,this._ptInAreaLocation=[_.NONE,_.NONE]};Wt.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)},Wt.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,S.LEFT)!==_.NONE&&(e=o.getLocation(t,S.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,S.ON)===_.NONE&&l.setLocation(t,S.ON,s),l.isArea(t)){var c=l.getLocation(t,S.LEFT),f=l.getLocation(t,S.RIGHT);if(f!==_.NONE){if(f!==s)throw new Hn("side location conflict",u.getCoordinate());c===_.NONE&&q.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")"),s=c}else q.isTrue(l.getLocation(t,S.LEFT)===_.NONE,"found single null side"),l.setLocation(t,S.RIGHT,s),l.setLocation(t,S.LEFT,s)}}},Wt.prototype.getCoordinate=function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},Wt.prototype.print=function(t){At.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},Wt.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Wt.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,S.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,S.LEFT),f=l.getLocation(t,S.RIGHT);if(c===f||f!==s)return!1;s=c}return!0},Wt.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},Wt.prototype.iterator=function(){return this.getEdges().iterator()},Wt.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new b(this._edgeMap.values())),this._edgeList},Wt.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===_.NONE&&(this._ptInAreaLocation[t]=Ce.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Wt.prototype.toString=function(){var t=new nn;t.append("EdgeEndStar: "+this.getCoordinate()),t.append(`
|
|
4
4
|
`);for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append(`
|