@maptiler/geocoding-control 2.0.0-rc.4 → 2.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/MapLibreBasedGeocodingControl.d.ts +18 -1
  2. package/leaflet-controller.d.ts +2 -1
  3. package/leaflet-controller.js +222 -219
  4. package/leaflet-controller.js.map +1 -1
  5. package/leaflet-controller.umd.js +2 -2
  6. package/leaflet-controller.umd.js.map +1 -1
  7. package/leaflet.js +1013 -1022
  8. package/leaflet.js.map +1 -1
  9. package/leaflet.umd.js +3 -3
  10. package/leaflet.umd.js.map +1 -1
  11. package/maplibregl-controller.d.ts +2 -1
  12. package/maplibregl-controller.js +213 -210
  13. package/maplibregl-controller.js.map +1 -1
  14. package/maplibregl-controller.umd.js +3 -3
  15. package/maplibregl-controller.umd.js.map +1 -1
  16. package/maplibregl.d.ts +17 -0
  17. package/maplibregl.js +1459 -1466
  18. package/maplibregl.js.map +1 -1
  19. package/maplibregl.umd.js +3 -3
  20. package/maplibregl.umd.js.map +1 -1
  21. package/maptilersdk.d.ts +17 -0
  22. package/maptilersdk.js +1461 -1468
  23. package/maptilersdk.js.map +1 -1
  24. package/maptilersdk.umd.js +3 -3
  25. package/maptilersdk.umd.js.map +1 -1
  26. package/openlayers-controller.d.ts +2 -1
  27. package/openlayers-controller.js +298 -295
  28. package/openlayers-controller.js.map +1 -1
  29. package/openlayers-controller.umd.js +3 -3
  30. package/openlayers-controller.umd.js.map +1 -1
  31. package/openlayers.js +1301 -1310
  32. package/openlayers.js.map +1 -1
  33. package/openlayers.umd.js +3 -3
  34. package/openlayers.umd.js.map +1 -1
  35. package/package.json +1 -1
  36. package/react.js +680 -695
  37. package/react.js.map +1 -1
  38. package/react.umd.js +1 -1
  39. package/react.umd.js.map +1 -1
  40. package/svelte/GeocodingControl.svelte +22 -47
  41. package/svelte/GeocodingControl.svelte.d.ts +0 -1
  42. package/svelte/MapLibreBasedGeocodingControl.d.ts +18 -1
  43. package/svelte/MapLibreBasedGeocodingControl.js +5 -1
  44. package/svelte/leaflet-controller.d.ts +2 -1
  45. package/svelte/leaflet-controller.js +6 -2
  46. package/svelte/leaflet.js +5 -1
  47. package/svelte/maplibregl-controller.d.ts +2 -1
  48. package/svelte/maplibregl-controller.js +6 -2
  49. package/svelte/maplibregl.d.ts +17 -0
  50. package/svelte/maptilersdk.d.ts +17 -0
  51. package/svelte/openlayers-controller.d.ts +2 -1
  52. package/svelte/openlayers-controller.js +6 -2
  53. package/svelte/openlayers.js +6 -3
  54. package/svelte/types.d.ts +1 -1
  55. package/types.d.ts +1 -1
  56. package/vanilla.js +610 -625
  57. package/vanilla.js.map +1 -1
  58. package/vanilla.umd.js +1 -1
  59. package/vanilla.umd.js.map +1 -1
@@ -1,4 +1,4 @@
1
- (function(T,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],D):(T=typeof globalThis<"u"?globalThis:T||self,D(T.maptilersdkMaptilerGeocoder={},T.maptilersdk))})(this,function(T,D){"use strict";var co=Object.defineProperty;var ji=T=>{throw TypeError(T)};var fo=(T,D,J)=>D in T?co(T,D,{enumerable:!0,configurable:!0,writable:!0,value:J}):T[D]=J;var ne=(T,D,J)=>fo(T,typeof D!="symbol"?D+"":D,J),qi=(T,D,J)=>D.has(T)||ji("Cannot "+J);var Y=(T,D,J)=>(qi(T,D,"read from private field"),J?J.call(T):D.get(T)),jt=(T,D,J)=>D.has(T)?ji("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(T):D.set(T,J),vt=(T,D,J,Fe)=>(qi(T,D,"write to private field"),Fe?Fe.call(T,J):D.set(T,J),J);function J(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Fe=J(D);function U(){}function Qi(n,e){for(const t in e)n[t]=e[t];return n}function qt(n){return n()}function Qt(){return Object.create(null)}function me(n){n.forEach(qt)}function Zt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let et;function $(n,e){return n===e?!0:(et||(et=document.createElement("a")),et.href=e,n===et.href)}function Zi(n){return Object.keys(n).length===0}function Hi(n,e,t,i){if(n){const r=Ht(n,e,t,i);return n[0](r)}}function Ht(n,e,t,i){return n[1]&&i?Qi(t.ctx.slice(),n[1](i(e))):t.ctx}function Vi(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],u=Math.max(e.dirty.length,r.length);for(let s=0;s<u;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function Yi(n,e,t,i,r,o){if(r){const u=Ht(e,t,i,o);n.p(u,r)}}function Ki(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Vt(n){return n??""}function P(n,e){n.appendChild(e)}function G(n,e,t){n.insertBefore(e,t||null)}function F(n){n.parentNode&&n.parentNode.removeChild(n)}function z(n){return document.createElement(n)}function fe(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function we(n){return document.createTextNode(n)}function re(){return we(" ")}function Xi(){return we("")}function te(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Ji(n){return function(e){return e.preventDefault(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function $i(n){return Array.from(n.childNodes)}function Ge(n,e){e=""+e,n.data!==e&&(n.data=e)}function Yt(n,e){n.value=e??""}function le(n,e,t){n.classList.toggle(e,!!t)}function en(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let je;function qe(n){je=n}function Kt(){if(!je)throw new Error("Function called outside component initialization");return je}function tn(n){Kt().$$.on_destroy.push(n)}function nn(){const n=Kt();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=en(e,t,{cancelable:i});return r.slice().forEach(u=>{u.call(n,o)}),!o.defaultPrevented}return!0}}function Xt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ae=[],yt=[];let We=[];const Jt=[],rn=Promise.resolve();let pt=!1;function on(){pt||(pt=!0,rn.then($t))}function bt(n){We.push(n)}const wt=new Set;let ze=0;function $t(){if(ze!==0)return;const n=je;do{try{for(;ze<Ae.length;){const e=Ae[ze];ze++,qe(e),sn(e.$$)}}catch(e){throw Ae.length=0,ze=0,e}for(qe(null),Ae.length=0,ze=0;yt.length;)yt.pop()();for(let e=0;e<We.length;e+=1){const t=We[e];wt.has(t)||(wt.add(t),t())}We.length=0}while(Ae.length);for(;Jt.length;)Jt.pop()();pt=!1,wt.clear(),qe(n)}function sn(n){if(n.fragment!==null){n.update(),me(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(bt)}}function ln(n){const e=[],t=[];We.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),We=e}const tt=new Set;let Pe;function it(){Pe={r:0,c:[],p:Pe}}function nt(){Pe.r||me(Pe.c),Pe=Pe.p}function Z(n,e){n&&n.i&&(tt.delete(n),n.i(e))}function K(n,e,t,i){if(n&&n.o){if(tt.has(n))return;tt.add(n),Pe.c.push(()=>{tt.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function ei(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function un(n,e){K(n,1,1,()=>{e.delete(n.key)})}function an(n,e,t,i,r,o,u,s,c,l,d,a){let f=n.length,g=o.length,y=f;const w={};for(;y--;)w[n[y].key]=y;const E=[],h=new Map,m=new Map,b=[];for(y=g;y--;){const x=a(r,o,y),_=t(x);let C=u.get(_);C?b.push(()=>C.p(x,e)):(C=l(_,x),C.c()),h.set(_,E[y]=C),_ in w&&m.set(_,Math.abs(y-w[_]))}const L=new Set,M=new Set;function S(x){Z(x,1),x.m(s,d),u.set(x.key,x),d=x.first,g--}for(;f&&g;){const x=E[g-1],_=n[f-1],C=x.key,A=_.key;x===_?(d=x.first,f--,g--):h.has(A)?!u.has(C)||L.has(C)?S(x):M.has(A)?f--:m.get(C)>m.get(A)?(M.add(C),S(x)):(L.add(A),f--):(c(_,u),f--)}for(;f--;){const x=n[f];h.has(x.key)||c(x,u)}for(;g;)S(E[g-1]);return me(b),E}function Ee(n){n&&n.c()}function ve(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),bt(()=>{const o=n.$$.on_mount.map(qt).filter(Zt);n.$$.on_destroy?n.$$.on_destroy.push(...o):me(o),n.$$.on_mount=[]}),r.forEach(bt)}function ye(n,e){const t=n.$$;t.fragment!==null&&(ln(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function cn(n,e){n.$$.dirty[0]===-1&&(Ae.push(n),on(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function _e(n,e,t,i,r,o,u=null,s=[-1]){const c=je;qe(n);const l=n.$$={fragment:null,ctx:[],props:o,update:U,not_equal:r,bound:Qt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Qt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};u&&u(l.root);let d=!1;if(l.ctx=t?t(n,e.props||{},(a,f,...g)=>{const y=g.length?g[0]:f;return l.ctx&&r(l.ctx[a],l.ctx[a]=y)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](y),d&&cn(n,a)),f}):[],l.update(),d=!0,me(l.before_update),l.fragment=i?i(l.ctx):!1,e.target){if(e.hydrate){const a=$i(e.target);l.fragment&&l.fragment.l(a),a.forEach(F)}else l.fragment&&l.fragment.c();e.intro&&Z(n.$$.fragment),ve(n,e.target,e.anchor),$t()}qe(c)}class Le{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){ye(this,1),this.$destroy=U}$on(e,t){if(!Zt(t))return U;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Zi(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const fn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(fn);function dn(n){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),p(e,"viewBox","0 0 14 14"),p(e,"width","13"),p(e,"height","13"),p(e,"class","svelte-en2qvf")},m(i,r){G(i,e,r),P(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class ti extends Le{constructor(e){super(),_e(this,e,null,dn,be,{})}}function hn(n){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),p(e,"viewBox","0 0 30 30"),p(e,"fill","none"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"class","svelte-d2loi5")},m(i,r){G(i,e,r),P(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class ii extends Le{constructor(e){super(),_e(this,e,null,hn,be,{})}}function gn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"area.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function mn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function vn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"poi.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function yn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function pn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"street.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function bn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"road.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function wn(n){let e,t;return{c(){e=z("img"),$(e.src,t=n[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){G(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&F(e)}}}function En(n){let e,t,i,r;return{c(){e=z("img"),$(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[4]),p(e,"class","svelte-ltkwvy")},m(o,u){G(o,e,u),i||(r=te(e,"error",n[14]),i=!0)},p(o,u){u&32&&!$(e.src,t=o[5])&&p(e,"src",t),u&16&&p(e,"alt",o[4])},d(o){o&&F(e),i=!1,r()}}}function ni(n){let e,t;return{c(){e=z("span"),t=we(n[6]),p(e,"class","secondary svelte-ltkwvy")},m(i,r){G(i,e,r),P(e,t)},p(i,r){r&64&&Ge(t,i[6])},d(i){i&&F(e)}}}function _n(n){let e,t,i,r,o,u,s,c,l,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,g=n[2]==="always"||n[2]!=="never"&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],y,w,E=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",h,m,b;function L(_,C){return C&1&&(t=null),C&1&&(i=null),C&1&&(r=null),C&1&&(o=null),_[5]?En:_[0].address?wn:(t==null&&(t=!!_[0].id.startsWith("road.")),t?bn:(i==null&&(i=!!_[0].id.startsWith("address.")),i?pn:(r==null&&(r=!!_[0].id.startsWith("postal_code.")),r?yn:(o==null&&(o=!!_[0].id.startsWith("poi.")),o?vn:_[7]?mn:gn))))}let M=L(n,-1),S=M(n),x=g&&ni(n);return{c(){e=z("li"),S.c(),u=re(),s=z("span"),c=z("span"),l=z("span"),a=we(d),f=re(),x&&x.c(),y=re(),w=z("span"),h=we(E),p(l,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(w,"class","line2 svelte-ltkwvy"),p(s,"class","texts svelte-ltkwvy"),p(e,"tabindex","0"),p(e,"data-selected",n[1]),p(e,"class","svelte-ltkwvy"),le(e,"selected",n[1])},m(_,C){G(_,e,C),S.m(e,null),P(e,u),P(e,s),P(s,c),P(c,l),P(l,a),P(c,f),x&&x.m(c,null),P(s,y),P(s,w),P(w,h),m||(b=[te(e,"mouseenter",n[12]),te(e,"focus",n[13])],m=!0)},p(_,[C]){M===(M=L(_,C))&&S?S.p(_,C):(S.d(1),S=M(_),S&&(S.c(),S.m(e,u))),C&1&&d!==(d=(_[7]?_[0].place_name:_[0].place_name.replace(/,.*/,""))+"")&&Ge(a,d),C&37&&(g=_[2]==="always"||_[2]!=="never"&&!_[0].address&&!_[0].id.startsWith("road.")&&!_[0].id.startsWith("address.")&&!_[0].id.startsWith("postal_code.")&&(!_[0].id.startsWith("poi.")||!_[5])&&!_[7]),g?x?x.p(_,C):(x=ni(_),x.c(),x.m(c,null)):x&&(x.d(1),x=null),C&1&&E!==(E=(_[7]?"":_[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ge(h,E),C&2&&p(e,"data-selected",_[1]),C&2&&le(e,"selected",_[1])},i:U,o:U,d(_){_&&F(e),S.d(),x&&x.d(),m=!1,me(b)}}}function Ln(n,e,t){var b;let i,r,{feature:o}=e,{selected:u=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:l}=e;const d=(b=o.properties)==null?void 0:b.categories;let a,f,g=0,y=o.place_type[0]==="reverse";function w(){f&&c.add(f),t(10,g++,g)}function E(L){Xt.call(this,n,L)}function h(L){Xt.call(this,n,L)}const m=()=>w();return n.$$set=L=>{"feature"in L&&t(0,o=L.feature),"selected"in L&&t(1,u=L.selected),"showPlaceType"in L&&t(2,s=L.showPlaceType),"missingIconsCache"in L&&t(9,c=L.missingIconsCache),"iconsBaseUrl"in L&&t(3,l=L.iconsBaseUrl)},n.$$.update=()=>{var L,M,S,x;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?l+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((M=(L=o.properties)==null?void 0:L.categories)==null?void 0:M.join(", "))??((x=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:x[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,u,s,l,a,f,r,y,w,c,g,i,E,h,m]}class Sn extends Le{constructor(e){super(),_e(this,e,Ln,_n,be,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function xn(n){let e;return{c(){e=z("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',p(e,"class","svelte-7cmwmc")},m(t,i){G(t,e,i)},p:U,i:U,o:U,d(t){t&&F(e)}}}class Mn extends Le{constructor(e){super(),_e(this,e,null,xn,be,{})}}function kn(n){let e,t,i;return{c(){e=fe("svg"),t=fe("path"),p(t,"stroke-width","4"),p(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),p(t,"class","svelte-gzo3ar"),p(e,"width",i=n[0]==="list"?20:void 0),p(e,"viewBox","0 0 70 85"),p(e,"fill","none"),p(e,"class","svelte-gzo3ar"),le(e,"in-map",n[0]!=="list"),le(e,"list-icon",n[0]==="list")},m(r,o){G(r,e,o),P(e,t)},p(r,[o]){o&1&&i!==(i=r[0]==="list"?20:void 0)&&p(e,"width",i),o&1&&le(e,"in-map",r[0]!=="list"),o&1&&le(e,"list-icon",r[0]==="list")},i:U,o:U,d(r){r&&F(e)}}}function Cn(n,e,t){let{displayIn:i}=e;return n.$$set=r=>{"displayIn"in r&&t(0,i=r.displayIn)},[i]}class Nn extends Le{constructor(e){super(),_e(this,e,Cn,kn,be,{displayIn:0})}}function Tn(n){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),p(e,"viewBox","0 0 60.006 21.412"),p(e,"width","14"),p(e,"height","20"),p(e,"class","svelte-en2qvf")},m(i,r){G(i,e,r),P(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class Rn extends Le{constructor(e){super(),_e(this,e,null,Tn,be,{})}}function Pn(n){let e,t,i;return{c(){e=fe("svg"),t=fe("circle"),i=fe("path"),p(t,"cx","4.789"),p(t,"cy","4.787"),p(t,"r","3.85"),p(t,"class","svelte-1aq105l"),p(i,"d","M12.063 12.063 7.635 7.635"),p(i,"class","svelte-1aq105l"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"width","13"),p(e,"height","13"),p(e,"viewBox","0 0 13 13"),p(e,"class","svelte-1aq105l")},m(r,o){G(r,e,o),P(e,t),P(e,i)},p:U,i:U,o:U,d(r){r&&F(e)}}}class In extends Le{constructor(e){super(),_e(this,e,null,Pn,be,{})}}function On(n,e,t){const i=e[1],r=e[0],o=i-r;return n===i&&t?n:((n-r)%o+o)%o+r}function rt(n){const e=[...n];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Qe;async function An(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Qe&&r.cachedLocationExpiry&&Qe.time+r.cachedLocationExpiry>Date.now()){if(!Qe.coords)break e;return Qe.coords}let o;try{return o=await new Promise((u,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{u([c.coords.longitude,c.coords.latitude].map(l=>l.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Qe={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const Wn=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,ri=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,oi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,si=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,li=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,ui=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function zn(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(g=>Number(g.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),o=Math.abs(i),u=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${u}, ${o}° ${s}`);const l=Math.floor(r),d=Math.floor(o),a=(r-l)*60,f=(o-d)*60;if(n=="DM"){let g=ai(a,3).toFixed(3).padStart(6,"0"),y=ai(f,3).toFixed(3).padStart(6,"0");g.endsWith(".000")&&y.endsWith(".000")&&(g=g.replace(/\.000$/,""),y=y.replace(/\.000$/,"")),c=`${l}° ${g}' ${u}, ${d}° ${y}' ${s}`}if(n=="DMS"){const g=Math.floor(a),y=Math.floor(f);let w=((a-g)*60).toFixed(1).padStart(4,"0"),E=((f-y)*60).toFixed(1).padStart(4,"0");const h=g.toString().padStart(2,"0"),m=y.toString().padStart(2,"0");w.endsWith(".0")&&E.endsWith(".0")&&(w=w.replace(/\.0$/,""),E=E.replace(/\.0$/,"")),c=`${l}° ${h}' ${w}" ${u}, ${d}° ${m}' ${E}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function ai(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function Et(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",u=null,s=[],c=!1;if(Wn.test(n))throw new Error("invalid coordinate value");if(ri.test(n))if(s=ri.exec(n),c=Ze(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),i=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(i*=-1),u="DM";else throw new Error("invalid coordinate format");else if(oi.test(n))if(s=oi.exec(n),c=Ze(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),u="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(si.test(n))if(s=si.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[9])),s[11]&&(i+=s[11]/60),s[13]&&(i+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(i=-1*i),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(li.test(n))if(s=li.exec(n),c=Ze(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6]/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12]/60),s[14]&&(i+=s[14]/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ui.test(n)){if(s=ui.exec(n),c=Ze(s),s.filter(l=>l).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12].replace(",",".")/60),s[14]&&(i+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let l=/S|SOUTH/i;l.test(r)&&t>0&&(t=-1*t),l=/W|WEST/i,l.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let a,f;const g=/[,/;\u0020]/g,y=d.match(g);if(y==null){const h=Math.floor(n.length/2);a=d.substring(0,h).trim(),f=d.substring(h).trim()}else{let h;y.length%2==1?h=Math.floor(y.length/2):h=y.length/2-1;let m=0;if(h==0)m=d.indexOf(y[0]),a=d.substring(0,m).trim(),f=d.substring(m+1).trim();else{let b=0,L=0;for(;b<=h;)m=d.indexOf(y[b],L),L=m+1,b++;a=d.substring(0,m).trim(),f=d.substring(m+1).trim()}}const w=a.split(".");if(w.length==2&&w[1]==0&&w[1].length!=2)throw new Error("invalid coordinates format");const E=f.split(".");if(E.length==2&&E[1]==0&&E[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:u,closeEnough:Bn,toCoordinateFormat:zn})}else throw new Error("coordinates pattern match failed")}function Ze(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const u=e[o],s=e[o+r],c=t.test(u)&&t.test(s),l=i.test(u)&&i.test(s),d=u==s;if(!(u==null&&s==null)){if(u==null||s==null)return!1;if(c||l||d)continue;return!1}}return!0}function ci(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function Bn(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return ci(this.decimalLatitude,Number(e[0]))&&ci(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Dn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Et.to=Dn;const Un=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Fn={decimalLatitude:40.123,decimalLongitude:-74.123},Gn=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],jn=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function qn(){const n=[];return Un.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...Fn})}),[...n,...Gn,...jn]}const Qn=qn();Et.formats=Qn.map(n=>n.verbatimCoordinates);const Zn=Et;function fi(n,e,t){const i=n.slice();return i[86]=e[t],i[88]=t,i}function di(n){let e,t;return e=new Mn({}),{c(){Ee(e.$$.fragment)},m(i,r){ve(e,i,r),t=!0},i(i){t||(Z(e.$$.fragment,i),t=!0)},o(i){K(e.$$.fragment,i),t=!1},d(i){ye(e,i)}}}function hi(n){let e,t,i,r,o;return t=new Rn({}),{c(){e=z("button"),Ee(t.$$.fragment),p(e,"type","button"),p(e,"title",n[9]),p(e,"class","svelte-bz0zu3"),le(e,"active",n[0])},m(u,s){G(u,e,s),ve(t,e,null),i=!0,r||(o=te(e,"click",n[70]),r=!0)},p(u,s){(!i||s[0]&512)&&p(e,"title",u[9]),(!i||s[0]&1)&&le(e,"active",u[0])},i(u){i||(Z(t.$$.fragment,u),i=!0)},o(u){K(t.$$.fragment,u),i=!1},d(u){u&&F(e),ye(t),r=!1,o()}}}function Hn(n){let e,t=[],i=new Map,r,o,u,s=ei(n[14]);const c=l=>l[86].id+(l[86].address?","+l[86].address:"");for(let l=0;l<s.length;l+=1){let d=fi(n,s,l),a=c(d);i.set(a,t[l]=gi(a,d))}return{c(){e=z("ul");for(let l=0;l<t.length;l+=1)t[l].c();p(e,"class","options svelte-bz0zu3")},m(l,d){G(l,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(u=[te(e,"mouseleave",n[74]),te(e,"blur",n[75])],o=!0)},p(l,d){d[0]&17880064&&(s=ei(l[14]),it(),t=an(t,d,c,1,l,s,i,e,un,gi,null,fi),nt())},i(l){if(!r){for(let d=0;d<s.length;d+=1)Z(t[d]);r=!0}},o(l){for(let d=0;d<t.length;d+=1)K(t[d]);r=!1},d(l){l&&F(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,me(u)}}}function Vn(n){let e,t,i,r,o,u;return t=new ii({}),{c(){e=z("div"),Ee(t.$$.fragment),i=re(),r=z("div"),o=we(n[7]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){G(s,e,c),ve(t,e,null),P(e,i),P(e,r),P(r,o),u=!0},p(s,c){(!u||c[0]&128)&&Ge(o,s[7])},i(s){u||(Z(t.$$.fragment,s),u=!0)},o(s){K(t.$$.fragment,s),u=!1},d(s){s&&F(e),ye(t)}}}function Yn(n){let e="",t;return{c(){t=we(e)},m(i,r){G(i,t,r)},p:U,i:U,o:U,d(i){i&&F(t)}}}function Kn(n){let e,t,i,r,o,u,s,c,l,d,a;return t=new ii({}),c=new ti({}),{c(){e=z("div"),Ee(t.$$.fragment),i=re(),r=z("div"),o=we(n[6]),u=re(),s=z("button"),Ee(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,g){G(f,e,g),ve(t,e,null),P(e,i),P(e,r),P(r,o),P(e,u),P(e,s),ve(c,s,null),l=!0,d||(a=te(s,"click",n[71]),d=!0)},p(f,g){(!l||g[0]&64)&&Ge(o,f[6])},i(f){l||(Z(t.$$.fragment,f),Z(c.$$.fragment,f),l=!0)},o(f){K(t.$$.fragment,f),K(c.$$.fragment,f),l=!1},d(f){f&&F(e),ye(t),ye(c),d=!1,a()}}}function gi(n,e){let t,i,r;function o(){return e[72](e[88])}function u(){return e[73](e[86])}return i=new Sn({props:{feature:e[86],showPlaceType:e[10],selected:e[15]===e[88],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",u),{key:n,first:null,c(){t=Xi(),Ee(i.$$.fragment),this.first=t},m(s,c){G(s,t,c),ve(i,s,c),r=!0},p(s,c){e=s;const l={};c[0]&16384&&(l.feature=e[86]),c[0]&1024&&(l.showPlaceType=e[10]),c[0]&49152&&(l.selected=e[15]===e[88]),c[0]&4096&&(l.iconsBaseUrl=e[12]),i.$set(l)},i(s){r||(Z(i.$$.fragment,s),r=!0)},o(s){K(i.$$.fragment,s),r=!1},d(s){s&&F(t),ye(i,s)}}}function Xn(n){let e,t,i,r,o,u,s,c,l,d,a,f,g,y,w,E,h,m,b,L,M,S=!1;o=new In({}),a=new ti({});let x=n[19]&&di(),_=n[5]!=="never"&&hi(n);const C=n[62].default,A=Hi(C,n,n[61],null),B=[Kn,Yn,Vn,Hn],N=[];function W(k,q){var oe,Ne;return k[18]?0:k[16]?((oe=k[14])==null?void 0:oe.length)===0?2:k[16]&&((Ne=k[14])!=null&&Ne.length)?3:-1:1}return~(E=W(n))&&(h=N[E]=B[E](n)),{c(){e=re(),t=z("form"),i=z("div"),r=z("button"),Ee(o.$$.fragment),u=re(),s=z("input"),c=re(),l=z("div"),d=z("button"),Ee(a.$$.fragment),f=re(),x&&x.c(),g=re(),_&&_.c(),y=re(),A&&A.c(),w=re(),h&&h.c(),p(r,"class","search-button svelte-bz0zu3"),p(r,"type","button"),p(s,"placeholder",n[8]),p(s,"aria-label",n[8]),p(s,"class","svelte-bz0zu3"),p(d,"type","button"),p(d,"title",n[3]),p(d,"class","svelte-bz0zu3"),p(l,"class","clear-button-container svelte-bz0zu3"),le(l,"displayable",n[1]!==""),p(i,"class","input-group svelte-bz0zu3"),p(t,"tabindex","0"),p(t,"class",m=Vt(n[2])+" svelte-bz0zu3"),le(t,"can-collapse",n[4]&&n[1]==="")},m(k,q){G(k,e,q),G(k,t,q),P(t,i),P(i,r),ve(o,r,null),P(i,u),P(i,s),n[64](s),Yt(s,n[1]),P(i,c),P(i,l),P(l,d),ve(a,d,null),P(l,f),x&&x.m(l,null),P(i,g),_&&_.m(i,null),P(i,y),A&&A.m(i,null),P(t,w),~E&&N[E].m(t,null),b=!0,L||(M=[te(r,"click",n[63]),te(s,"input",n[65]),te(s,"focus",n[66]),te(s,"blur",n[67]),te(s,"keydown",n[22]),te(s,"input",n[68]),te(d,"click",n[69]),te(t,"submit",Ji(n[21]))],L=!0)},p(k,q){(!b||q[0]&256)&&p(s,"placeholder",k[8]),(!b||q[0]&256)&&p(s,"aria-label",k[8]),q[0]&2&&s.value!==k[1]&&Yt(s,k[1]),(!b||q[0]&8)&&p(d,"title",k[3]),k[19]?x?q[0]&524288&&Z(x,1):(x=di(),x.c(),Z(x,1),x.m(l,null)):x&&(it(),K(x,1,1,()=>{x=null}),nt()),(!b||q[0]&2)&&le(l,"displayable",k[1]!==""),k[5]!=="never"?_?(_.p(k,q),q[0]&32&&Z(_,1)):(_=hi(k),_.c(),Z(_,1),_.m(i,y)):_&&(it(),K(_,1,1,()=>{_=null}),nt()),A&&A.p&&(!b||q[1]&1073741824)&&Yi(A,C,k,k[61],b?Vi(C,k[61],q,null):Ki(k[61]),null);let oe=E;E=W(k),E===oe?~E&&N[E].p(k,q):(h&&(it(),K(N[oe],1,1,()=>{N[oe]=null}),nt()),~E?(h=N[E],h?h.p(k,q):(h=N[E]=B[E](k),h.c()),Z(h,1),h.m(t,null)):h=null),(!b||q[0]&4&&m!==(m=Vt(k[2])+" svelte-bz0zu3"))&&p(t,"class",m),(!b||q[0]&22)&&le(t,"can-collapse",k[4]&&k[1]==="")},i(k){b||(Z(S),Z(o.$$.fragment,k),Z(a.$$.fragment,k),Z(x),Z(_),Z(A,k),Z(h),b=!0)},o(k){K(S),K(o.$$.fragment,k),K(a.$$.fragment,k),K(x),K(_),K(A,k),K(h),b=!1},d(k){k&&(F(e),F(t)),ye(o),n[64](null),ye(a),x&&x.d(),_&&_.d(),A&&A.d(k),~E&&N[E].d(),L=!1,me(M)}}}function Jn(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const u={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:s=void 0}=e,{apiKey:c}=e,{bbox:l=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:g=void 0}=e,{debounceSearch:y=200}=e,{enableReverse:w="never"}=e,{errorMessage:E="Something went wrong…"}=e,{filter:h=()=>!0}=e,{flyTo:m=!0}=e,{fuzzyMatch:b=!0}=e,{language:L=void 0}=e,{limit:M=void 0}=e,{mapController:S=void 0}=e,{minLength:x=2}=e,{noResultsMessage:_="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:C="Search"}=e,{proximity:A=[{type:"server-geolocation"}]}=e,{reverseActive:B=w==="always"}=e,{reverseButtonTitle:N="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{pickedResultStyle:k="full-geometry"}=e,{showPlaceType:q="if-needed"}=e,{showResultsWhileTyping:oe=!0}=e,{autocompleteTimeout:Ne=void 0}=e,{selectFirst:De=!0}=e,{flyToSelected:Pt=!1}=e,{markerOnSelected:at=!0}=e,{types:Ie=void 0}=e,{exhaustiveReverseGeocoding:It=!1}=e,{excludeTypes:ct=!1}=e,{zoom:ft=u}=e,{apiUrl:Ot="https://api.maptiler.com/geocoding"}=e,{fetchParameters:At={}}=e,{iconsBaseUrl:Di="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.4/icons/"}=e,{adjustUrlQuery:Wt=()=>{}}=e;function Gr(){he.focus()}function jr(){he.blur()}function Ui(v,Q=!0,V=!1){t(1,W=v),Q?(t(15,j=-1),Gi()):(Dt(!V,V),setTimeout(()=>{he.focus(),he.select()}))}function qr(){t(14,O=void 0),t(57,R=void 0),t(15,j=-1)}function Qr(){t(56,H=[]),t(57,R=void 0)}let Ue=!1,O,H,R,Fi="",he,j=-1,ge,dt=[],Oe,Te,ae,ht,zt;const Zr=new Set,Re=nn();function Hr(){return!!ae}tn(()=>{S&&(S.setEventHandler(void 0),S.indicateReverse(!1),S.setSelectedMarker(-1),S.setMarkers(void 0,void 0))});function Gi(v){if(Te&&(window.clearTimeout(Te),Te=void 0),ae){window.clearTimeout(ae),t(58,ae=void 0),Je(W,{exact:!0});return}if(j>-1&&O)t(57,R=O[j]),t(1,W=R.place_type[0]==="reverse"?R.place_name:R.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(56,H=void 0),t(15,j=-1);else if(W){const Q=v||!Bt(W);Je(W,{exact:!0}).then(()=>{t(56,H=O),t(57,R=void 0),Q&&Vr()}).catch(V=>t(18,ge=V))}}function Bt(v){try{return Zn(v,6)}catch{return!1}}async function Je(v,{byId:Q=!1,exact:V=!1,appendSpace:ce=!1}={}){t(18,ge=void 0),Oe==null||Oe.abort();const se=new AbortController;t(19,Oe=se);try{const I=Bt(v),X=new URLSearchParams;if(L!==void 0&&X.set("language",Array.isArray(L)?L.join(","):L??""),Ie&&X.set("types",Ie.join(",")),ct&&X.set("excludeTypes",String(ct)),l&&X.set("bbox",l.map(mt=>mt.toFixed(6)).join(",")),g&&X.set("country",Array.isArray(g)?g.join(","):g),!Q&&!I){const mt=await An(S,A,se);mt&&X.set("proximity",mt),(V||!oe)&&X.set("autocomplete","false"),X.set("fuzzyMatch",String(b))}M!==void 0&&(It||!I||(Ie==null?void 0:Ie.length)===1)&&X.set("limit",String(M)),X.set("key",c),Wt(X);const gt=Ot+"/"+encodeURIComponent(I?I.decimalLongitude+","+I.decimalLatitude:v+(ce?" ":""))+".json?"+X.toString();if(gt===Fi){Q?(t(14,O=void 0),t(57,R=dt[0])):t(14,O=dt);return}Fi=gt;const Ft=await fetch(gt,{signal:se.signal,...At});if(!Ft.ok)throw new Error(await Ft.text());const Gt=await Ft.json();Re("response",{url:gt,featureCollection:Gt}),Q?(t(14,O=void 0),t(57,R=Gt.features[0]),dt=[R]):(t(14,O=Gt.features.filter(h)),I&&O.unshift({type:"Feature",properties:{},id:"reverse_"+I.decimalLongitude+"_"+I.decimalLatitude,text:I.decimalLatitude+", "+I.decimalLongitude,place_name:I.decimalLatitude+", "+I.decimalLongitude,place_type:["reverse"],center:[I.decimalLongitude,I.decimalLatitude],bbox:[I.decimalLongitude,I.decimalLatitude,I.decimalLongitude,I.decimalLatitude],geometry:{type:"Point",coordinates:[I.decimalLongitude,I.decimalLatitude]}}),dt=O,I&&he.focus())}catch(I){if(I&&typeof I=="object"&&"name"in I&&I.name==="AbortError")return;throw I}finally{se===Oe&&t(19,Oe=void 0)}}function Vr(){var ce;if(!(H!=null&&H.length)||!m)return;const v=[180,90,-180,-90],Q=!H.some(se=>!se.matching_text);let V;for(const se of H){const I=$e(se);if(V=V===void 0?I:I===void 0?V:Math.max(V,I),Q||!se.matching_text)for(const X of[0,1,2,3])v[X]=Math[X<2?"min":"max"](v[X],((ce=se.bbox)==null?void 0:ce[X])??se.center[X%2])}S&&H.length>0&&(R&&v[0]===v[2]&&v[1]===v[3]?S.flyTo(R.center,$e(R)):S.fitBounds(rt(v),50,V))}function $e(v){var V;if(!v.bbox||v.bbox[0]!==v.bbox[2]&&v.bbox[1]!==v.bbox[3])return;const Q=v.id.replace(/\..*/,"");return(Array.isArray((V=v.properties)==null?void 0:V.categories)?v.properties.categories.reduce((ce,se)=>{const I=ft[Q+"."+se];return ce===void 0?I:I===void 0?ce:Math.max(ce,I)},void 0):void 0)??ft[Q]}function Yr(v){t(0,B=w==="always"),t(14,O=void 0),t(57,R=void 0),t(15,j=-1),Ui(v[1].toFixed(6)+", "+On(v[0],[-180,180],!0).toFixed(6),!1,!0)}function Kr(v){if(!O)return;let Q=v.key==="ArrowDown"?1:v.key==="ArrowUp"?-1:0;Q&&(j===(De?0:-1)&&Q===-1&&t(15,j=O.length),t(15,j+=Q),j>=O.length&&t(15,j=-1),j<0&&De&&t(15,j=0),v.preventDefault())}function Dt(v=!0,Q=!1){if(t(18,ge=void 0),Te&&(window.clearTimeout(Te),Te=void 0),ae&&(window.clearTimeout(ae),t(58,ae=void 0)),!oe&&!Q||W.length<x){t(14,O=void 0);return}const V=W;Te=window.setTimeout(()=>{Te=void 0,Je(V).catch(ce=>t(18,ge=ce))},v?y:0),W.endsWith(" ")||t(58,ae=window.setTimeout(()=>{t(58,ae=void 0),Je(V,{appendSpace:!0}).catch(ce=>t(18,ge=ce))},Ne))}function Ut(v){t(57,R=v),t(1,W=v.place_name),t(15,j=-1)}const Xr=()=>he.focus();function Jr(v){yt[v?"unshift":"push"](()=>{he=v,t(17,he)})}function $r(){W=this.value,t(1,W),t(13,Ue),t(28,a)}const eo=()=>t(13,Ue=!0),to=()=>t(13,Ue=!1),io=()=>Dt(),no=()=>{t(1,W=""),he.focus()},ro=()=>t(0,B=!B),oo=()=>t(18,ge=void 0),so=v=>t(15,j=v),lo=v=>Ut(v),uo=()=>{De||t(15,j=-1)},ao=()=>{};return n.$$set=v=>{"class"in v&&t(2,s=v.class),"apiKey"in v&&t(26,c=v.apiKey),"bbox"in v&&t(27,l=v.bbox),"clearButtonTitle"in v&&t(3,d=v.clearButtonTitle),"clearOnBlur"in v&&t(28,a=v.clearOnBlur),"collapsed"in v&&t(4,f=v.collapsed),"country"in v&&t(29,g=v.country),"debounceSearch"in v&&t(30,y=v.debounceSearch),"enableReverse"in v&&t(5,w=v.enableReverse),"errorMessage"in v&&t(6,E=v.errorMessage),"filter"in v&&t(31,h=v.filter),"flyTo"in v&&t(32,m=v.flyTo),"fuzzyMatch"in v&&t(33,b=v.fuzzyMatch),"language"in v&&t(34,L=v.language),"limit"in v&&t(35,M=v.limit),"mapController"in v&&t(36,S=v.mapController),"minLength"in v&&t(37,x=v.minLength),"noResultsMessage"in v&&t(7,_=v.noResultsMessage),"placeholder"in v&&t(8,C=v.placeholder),"proximity"in v&&t(38,A=v.proximity),"reverseActive"in v&&t(0,B=v.reverseActive),"reverseButtonTitle"in v&&t(9,N=v.reverseButtonTitle),"searchValue"in v&&t(1,W=v.searchValue),"pickedResultStyle"in v&&t(39,k=v.pickedResultStyle),"showPlaceType"in v&&t(10,q=v.showPlaceType),"showResultsWhileTyping"in v&&t(40,oe=v.showResultsWhileTyping),"autocompleteTimeout"in v&&t(41,Ne=v.autocompleteTimeout),"selectFirst"in v&&t(11,De=v.selectFirst),"flyToSelected"in v&&t(42,Pt=v.flyToSelected),"markerOnSelected"in v&&t(43,at=v.markerOnSelected),"types"in v&&t(44,Ie=v.types),"exhaustiveReverseGeocoding"in v&&t(45,It=v.exhaustiveReverseGeocoding),"excludeTypes"in v&&t(46,ct=v.excludeTypes),"zoom"in v&&t(47,ft=v.zoom),"apiUrl"in v&&t(48,Ot=v.apiUrl),"fetchParameters"in v&&t(49,At=v.fetchParameters),"iconsBaseUrl"in v&&t(12,Di=v.iconsBaseUrl),"adjustUrlQuery"in v&&t(50,Wt=v.adjustUrlQuery),"$$scope"in v&&t(61,o=v.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,B=w==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ht=Ue),a&&!Ue&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<x&&(t(57,R=void 0),t(14,O=void 0),t(18,ge=void 0),t(56,H=O)),n.$$.dirty[1]&67109120&&k!=="marker-only"&&R&&!R.address&&R.geometry.type==="Point"&&R.place_type[0]!=="reverse"&&Je(R.id,{byId:!0}).catch(v=>t(18,ge=v)),n.$$.dirty[1]&335544354&&(S&&R&&R.id!==zt&&m&&(!R.bbox||R.bbox[0]===R.bbox[2]&&R.bbox[1]===R.bbox[3]?S.flyTo(R.center,$e(R)):S.fitBounds(rt(R.bbox),50,$e(R)),t(14,O=void 0),t(56,H=void 0),t(15,j=-1)),t(59,zt=R==null?void 0:R.id)),n.$$.dirty[0]&18432&&De&&O!=null&&O.length&&(Hr()||t(15,j=0)),n.$$.dirty[0]&2&&t(15,j=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&33554432&&H!==O&&t(56,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&33554464&&S&&S.setEventHandler(v=>{switch(v.type){case"mapClick":B&&Yr(v.coordinates);break;case"markerClick":{const Q=O==null?void 0:O.find(V=>V.id===v.id);Q&&Ut(Q)}break;case"markerMouseEnter":H&&t(15,j=ht?(O==null?void 0:O.findIndex(Q=>Q.id===v.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,j=-1);break}}),n.$$.dirty[0]&49152&&t(60,i=O==null?void 0:O[j]),n.$$.dirty[1]&536872994&&S&&i&&m&&Pt&&S.flyTo(i.center,$e(i)),n.$$.dirty[1]&4128&&(at||S==null||S.setMarkers(void 0,void 0)),n.$$.dirty[1]&570429472&&S&&at&&!H&&(S.setMarkers(i?[i]:void 0,void 0),S.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&100663328&&S&&S.setMarkers(H,R),n.$$.dirty[0]&32768|n.$$.dirty[1]&33554464&&H&&S&&S.setSelectedMarker(j),n.$$.dirty[1]&671088640&&i&&(window.clearTimeout(ae),t(58,ae=void 0)),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&S){const v=Bt(W);S.setReverseMarker(v?[v.decimalLongitude,v.decimalLatitude]:void 0)}n.$$.dirty[1]&536870912&&Re("select",{feature:i}),n.$$.dirty[1]&67108864&&Re("pick",{feature:R}),n.$$.dirty[0]&81920&&Re("optionsvisibilitychange",{optionsVisible:ht&&!!O}),n.$$.dirty[0]&16384&&Re("featureslisted",{features:O}),n.$$.dirty[1]&33554432&&Re("featuresmarked",{features:H}),n.$$.dirty[0]&1&&Re("reversetoggle",{reverse:B}),n.$$.dirty[0]&2&&Re("querychange",{query:W}),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&S&&S.indicateReverse(B)},[B,W,s,d,f,w,E,_,C,N,q,De,Di,Ue,O,j,ht,he,ge,Oe,Zr,Gi,Kr,Dt,Ut,u,c,l,a,g,y,h,m,b,L,M,S,x,A,k,oe,Ne,Pt,at,Ie,It,ct,ft,Ot,At,Wt,Gr,jr,Ui,qr,Qr,H,R,ae,zt,i,o,r,Xr,Jr,$r,eo,to,io,no,ro,oo,so,lo,uo,ao]}let $n=class extends Le{constructor(e){super(),_e(this,e,Jn,Xn,be,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,autocompleteTimeout:41,selectFirst:11,flyToSelected:42,markerOnSelected:43,types:44,exhaustiveReverseGeocoding:45,excludeTypes:46,zoom:47,apiUrl:48,fetchParameters:49,iconsBaseUrl:12,adjustUrlQuery:50,focus:51,blur:52,setQuery:53,clearList:54,clearMap:55},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[51]}get blur(){return this.$$.ctx[52]}get setQuery(){return this.$$.ctx[53]}get clearList(){return this.$$.ctx[54]}get clearMap(){return this.$$.ctx[55]}};function He(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function _t(n,e,t={}){for(const r of n){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return He({type:"Polygon",coordinates:n},e,t)}function Ve(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function mi(n,e,t={}){return He({type:"MultiPolygon",coordinates:n},e,t)}/**
1
+ (function(R,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("@maptiler/sdk")):typeof define=="function"&&define.amd?define(["exports","@maptiler/sdk"],B):(R=typeof globalThis<"u"?globalThis:R||self,B(R.maptilersdkMaptilerGeocoder={},R.maptilersdk))})(this,function(R,B){"use strict";var os=Object.defineProperty;var Ui=R=>{throw TypeError(R)};var ls=(R,B,J)=>B in R?os(R,B,{enumerable:!0,configurable:!0,writable:!0,value:J}):R[B]=J;var ne=(R,B,J)=>ls(R,typeof B!="symbol"?B+"":B,J),Fi=(R,B,J)=>B.has(R)||Ui("Cannot "+J);var Z=(R,B,J)=>(Fi(R,B,"read from private field"),J?J.call(R):B.get(R)),dt=(R,B,J)=>B.has(R)?Ui("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(R):B.set(R,J),ht=(R,B,J,De)=>(Fi(R,B,"write to private field"),De?De.call(R,J):B.set(R,J),J);function J(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const De=J(B);function U(){}function ji(n,e){for(const t in e)n[t]=e[t];return n}function Ft(n){return n()}function jt(){return Object.create(null)}function me(n){n.forEach(Ft)}function Gt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Xe;function $(n,e){return n===e?!0:(Xe||(Xe=document.createElement("a")),Xe.href=e,n===Xe.href)}function Gi(n){return Object.keys(n).length===0}function qi(n,e,t,i){if(n){const r=qt(n,e,t,i);return n[0](r)}}function qt(n,e,t,i){return n[1]&&i?ji(t.ctx.slice(),n[1](i(e))):t.ctx}function Qi(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],u=Math.max(e.dirty.length,r.length);for(let o=0;o<u;o+=1)s[o]=e.dirty[o]|r[o];return s}return e.dirty|r}return e.dirty}function Zi(n,e,t,i,r,s){if(r){const u=qt(e,t,i,s);n.p(u,r)}}function Hi(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qt(n){return n??""}function O(n,e){n.appendChild(e)}function j(n,e,t){n.insertBefore(e,t||null)}function F(n){n.parentNode&&n.parentNode.removeChild(n)}function W(n){return document.createElement(n)}function ae(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ee(n){return document.createTextNode(n)}function re(){return Ee(" ")}function Vi(){return Ee("")}function te(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yi(n){return function(e){return e.preventDefault(),n.call(this,e)}}function b(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Ki(n){return Array.from(n.childNodes)}function Ue(n,e){e=""+e,n.data!==e&&(n.data=e)}function Zt(n,e){n.value=e??""}function le(n,e,t){n.classList.toggle(e,!!t)}function Xi(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let Fe;function je(n){Fe=n}function Ht(){if(!Fe)throw new Error("Function called outside component initialization");return Fe}function Ji(n){Ht().$$.on_destroy.push(n)}function $i(){const n=Ht();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const s=Xi(e,t,{cancelable:i});return r.slice().forEach(u=>{u.call(n,s)}),!s.defaultPrevented}return!0}}function Vt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ie=[],gt=[];let Oe=[];const Yt=[],en=Promise.resolve();let mt=!1;function tn(){mt||(mt=!0,en.then(Kt))}function yt(n){Oe.push(n)}const vt=new Set;let Ae=0;function Kt(){if(Ae!==0)return;const n=Fe;do{try{for(;Ae<Ie.length;){const e=Ie[Ae];Ae++,je(e),nn(e.$$)}}catch(e){throw Ie.length=0,Ae=0,e}for(je(null),Ie.length=0,Ae=0;gt.length;)gt.pop()();for(let e=0;e<Oe.length;e+=1){const t=Oe[e];vt.has(t)||(vt.add(t),t())}Oe.length=0}while(Ie.length);for(;Yt.length;)Yt.pop()();mt=!1,vt.clear(),je(n)}function nn(n){if(n.fragment!==null){n.update(),me(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(yt)}}function rn(n){const e=[],t=[];Oe.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Oe=e}const Je=new Set;let Re;function $e(){Re={r:0,c:[],p:Re}}function et(){Re.r||me(Re.c),Re=Re.p}function H(n,e){n&&n.i&&(Je.delete(n),n.i(e))}function X(n,e,t,i){if(n&&n.o){if(Je.has(n))return;Je.add(n),Re.c.push(()=>{Je.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function Xt(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function sn(n,e){X(n,1,1,()=>{e.delete(n.key)})}function on(n,e,t,i,r,s,u,o,c,l,d,a){let f=n.length,h=s.length,v=f;const _={};for(;v--;)_[n[v].key]=v;const S=[],E=new Map,y=new Map,g=[];for(v=h;v--;){const x=a(r,s,v),w=t(x);let k=u.get(w);k?g.push(()=>k.p(x,e)):(k=l(w,x),k.c()),E.set(w,S[v]=k),w in _&&y.set(w,Math.abs(v-_[w]))}const p=new Set,M=new Set;function L(x){H(x,1),x.m(o,d),u.set(x.key,x),d=x.first,h--}for(;f&&h;){const x=S[h-1],w=n[f-1],k=x.key,T=w.key;x===w?(d=x.first,f--,h--):E.has(T)?!u.has(k)||p.has(k)?L(x):M.has(T)?f--:y.get(k)>y.get(T)?(M.add(k),L(x)):(p.add(T),f--):(c(w,u),f--)}for(;f--;){const x=n[f];E.has(x.key)||c(x,u)}for(;h;)L(S[h-1]);return me(g),S}function _e(n){n&&n.c()}function ye(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),yt(()=>{const s=n.$$.on_mount.map(Ft).filter(Gt);n.$$.on_destroy?n.$$.on_destroy.push(...s):me(s),n.$$.on_mount=[]}),r.forEach(yt)}function ve(n,e){const t=n.$$;t.fragment!==null&&(rn(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ln(n,e){n.$$.dirty[0]===-1&&(Ie.push(n),tn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function we(n,e,t,i,r,s,u=null,o=[-1]){const c=Fe;je(n);const l=n.$$={fragment:null,ctx:[],props:s,update:U,not_equal:r,bound:jt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:jt(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};u&&u(l.root);let d=!1;if(l.ctx=t?t(n,e.props||{},(a,f,...h)=>{const v=h.length?h[0]:f;return l.ctx&&r(l.ctx[a],l.ctx[a]=v)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](v),d&&ln(n,a)),f}):[],l.update(),d=!0,me(l.before_update),l.fragment=i?i(l.ctx):!1,e.target){if(e.hydrate){const a=Ki(e.target);l.fragment&&l.fragment.l(a),a.forEach(F)}else l.fragment&&l.fragment.c();e.intro&&H(n.$$.fragment),ye(n,e.target,e.anchor),Kt()}je(c)}class Le{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){ve(this,1),this.$destroy=U}$on(e,t){if(!Gt(t))return U;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Gi(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const un="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(un);function an(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),b(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),b(e,"viewBox","0 0 14 14"),b(e,"width","13"),b(e,"height","13"),b(e,"class","svelte-en2qvf")},m(i,r){j(i,e,r),O(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class Jt extends Le{constructor(e){super(),we(this,e,null,an,be,{})}}function cn(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),b(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),b(e,"viewBox","0 0 30 30"),b(e,"fill","none"),b(e,"xmlns","http://www.w3.org/2000/svg"),b(e,"class","svelte-d2loi5")},m(i,r){j(i,e,r),O(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class $t extends Le{constructor(e){super(),we(this,e,null,cn,be,{})}}function fn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"area.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"area.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function dn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"reverse.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"reverse.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function hn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"poi.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"poi.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function gn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"postal_code.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"postal_code.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function mn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"street.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"street.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function yn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"road.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"road.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function vn(n){let e,t;return{c(){e=W("img"),$(e.src,t=n[3]+"housenumber.svg")||b(e,"src",t),b(e,"alt",n[6]),b(e,"class","svelte-ltkwvy")},m(i,r){j(i,e,r)},p(i,r){r&8&&!$(e.src,t=i[3]+"housenumber.svg")&&b(e,"src",t),r&64&&b(e,"alt",i[6])},d(i){i&&F(e)}}}function pn(n){let e,t,i,r;return{c(){e=W("img"),$(e.src,t=n[5])||b(e,"src",t),b(e,"alt",n[4]),b(e,"class","svelte-ltkwvy")},m(s,u){j(s,e,u),i||(r=te(e,"error",n[14]),i=!0)},p(s,u){u&32&&!$(e.src,t=s[5])&&b(e,"src",t),u&16&&b(e,"alt",s[4])},d(s){s&&F(e),i=!1,r()}}}function ei(n){let e,t;return{c(){e=W("span"),t=Ee(n[6]),b(e,"class","secondary svelte-ltkwvy")},m(i,r){j(i,e,r),O(e,t)},p(i,r){r&64&&Ue(t,i[6])},d(i){i&&F(e)}}}function bn(n){let e,t,i,r,s,u,o,c,l,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,h=n[2]==="always"||n[2]!=="never"&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[7],v,_,S=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",E,y,g;function p(w,k){return k&1&&(t=null),k&1&&(i=null),k&1&&(r=null),k&1&&(s=null),w[5]?pn:w[0].address?vn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?yn:(i==null&&(i=!!w[0].id.startsWith("address.")),i?mn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?gn:(s==null&&(s=!!w[0].id.startsWith("poi.")),s?hn:w[7]?dn:fn))))}let M=p(n,-1),L=M(n),x=h&&ei(n);return{c(){e=W("li"),L.c(),u=re(),o=W("span"),c=W("span"),l=W("span"),a=Ee(d),f=re(),x&&x.c(),v=re(),_=W("span"),E=Ee(S),b(l,"class","primary svelte-ltkwvy"),b(c,"class","svelte-ltkwvy"),b(_,"class","line2 svelte-ltkwvy"),b(o,"class","texts svelte-ltkwvy"),b(e,"tabindex","0"),b(e,"data-selected",n[1]),b(e,"class","svelte-ltkwvy"),le(e,"selected",n[1])},m(w,k){j(w,e,k),L.m(e,null),O(e,u),O(e,o),O(o,c),O(c,l),O(l,a),O(c,f),x&&x.m(c,null),O(o,v),O(o,_),O(_,E),y||(g=[te(e,"mouseenter",n[12]),te(e,"focus",n[13])],y=!0)},p(w,[k]){M===(M=p(w,k))&&L?L.p(w,k):(L.d(1),L=M(w),L&&(L.c(),L.m(e,u))),k&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Ue(a,d),k&37&&(h=w[2]==="always"||w[2]!=="never"&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?x?x.p(w,k):(x=ei(w),x.c(),x.m(c,null)):x&&(x.d(1),x=null),k&1&&S!==(S=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ue(E,S),k&2&&b(e,"data-selected",w[1]),k&2&&le(e,"selected",w[1])},i:U,o:U,d(w){w&&F(e),L.d(),x&&x.d(),y=!1,me(g)}}}function En(n,e,t){var g;let i,r,{feature:s}=e,{selected:u=!1}=e,{showPlaceType:o}=e,{missingIconsCache:c}=e,{iconsBaseUrl:l}=e;const d=(g=s.properties)==null?void 0:g.categories;let a,f,h=0,v=s.place_type[0]==="reverse";function _(){f&&c.add(f),t(10,h++,h)}function S(p){Vt.call(this,n,p)}function E(p){Vt.call(this,n,p)}const y=()=>_();return n.$$set=p=>{"feature"in p&&t(0,s=p.feature),"selected"in p&&t(1,u=p.selected),"showPlaceType"in p&&t(2,o=p.showPlaceType),"missingIconsCache"in p&&t(9,c=p.missingIconsCache),"iconsBaseUrl"in p&&t(3,l=p.iconsBaseUrl)},n.$$.update=()=>{var p,M,L,x;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?l+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((M=(p=s.properties)==null?void 0:p.categories)==null?void 0:M.join(", "))??((x=(L=s.properties)==null?void 0:L.place_type_name)==null?void 0:x[0])??s.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[s,u,o,l,a,f,r,v,_,c,h,i,S,E,y]}class _n extends Le{constructor(e){super(),we(this,e,En,bn,be,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function wn(n){let e;return{c(){e=W("div"),e.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(e,"class","svelte-7cmwmc")},m(t,i){j(t,e,i)},p:U,i:U,o:U,d(t){t&&F(e)}}}class Ln extends Le{constructor(e){super(),we(this,e,null,wn,be,{})}}function Sn(n){let e,t,i;return{c(){e=ae("svg"),t=ae("path"),b(t,"stroke-width","4"),b(t,"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(t,"class","svelte-gzo3ar"),b(e,"width",i=n[0]==="list"?20:void 0),b(e,"viewBox","0 0 70 85"),b(e,"fill","none"),b(e,"class","svelte-gzo3ar"),le(e,"in-map",n[0]!=="list"),le(e,"list-icon",n[0]==="list")},m(r,s){j(r,e,s),O(e,t)},p(r,[s]){s&1&&i!==(i=r[0]==="list"?20:void 0)&&b(e,"width",i),s&1&&le(e,"in-map",r[0]!=="list"),s&1&&le(e,"list-icon",r[0]==="list")},i:U,o:U,d(r){r&&F(e)}}}function xn(n,e,t){let{displayIn:i}=e;return n.$$set=r=>{"displayIn"in r&&t(0,i=r.displayIn)},[i]}class Mn extends Le{constructor(e){super(),we(this,e,xn,Sn,be,{displayIn:0})}}function kn(n){let e,t;return{c(){e=ae("svg"),t=ae("path"),b(t,"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(e,"viewBox","0 0 60.006 21.412"),b(e,"width","14"),b(e,"height","20"),b(e,"class","svelte-en2qvf")},m(i,r){j(i,e,r),O(e,t)},p:U,i:U,o:U,d(i){i&&F(e)}}}class Cn extends Le{constructor(e){super(),we(this,e,null,kn,be,{})}}function Nn(n){let e,t,i;return{c(){e=ae("svg"),t=ae("circle"),i=ae("path"),b(t,"cx","4.789"),b(t,"cy","4.787"),b(t,"r","3.85"),b(t,"class","svelte-1aq105l"),b(i,"d","M12.063 12.063 7.635 7.635"),b(i,"class","svelte-1aq105l"),b(e,"xmlns","http://www.w3.org/2000/svg"),b(e,"width","13"),b(e,"height","13"),b(e,"viewBox","0 0 13 13"),b(e,"class","svelte-1aq105l")},m(r,s){j(r,e,s),O(e,t),O(e,i)},p:U,i:U,o:U,d(r){r&&F(e)}}}class Rn extends Le{constructor(e){super(),we(this,e,null,Nn,be,{})}}function Tn(n,e,t){const i=e[1],r=e[0],s=i-r;return n===i&&t?n:((n-r)%s+s)%s+r}function tt(n){const e=[...n];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Ge;async function Pn(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Ge&&r.cachedLocationExpiry&&Ge.time+r.cachedLocationExpiry>Date.now()){if(!Ge.coords)break e;return Ge.coords}let s;try{return s=await new Promise((u,o)=>{t.signal.addEventListener("abort",()=>{o(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{u([c.coords.longitude,c.coords.latitude].map(l=>l.toFixed(6)).join(","))},c=>{o(c)},r)}),s}catch{}finally{r.cachedLocationExpiry&&(Ge={time:Date.now(),coords:s})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const In=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,ti=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,ii=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,ni=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,ri=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,si=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function On(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),s=Math.abs(i),u=t>0?"N":"S",o=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${u}, ${s}° ${o}`);const l=Math.floor(r),d=Math.floor(s),a=(r-l)*60,f=(s-d)*60;if(n=="DM"){let h=oi(a,3).toFixed(3).padStart(6,"0"),v=oi(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&v.endsWith(".000")&&(h=h.replace(/\.000$/,""),v=v.replace(/\.000$/,"")),c=`${l}° ${h}' ${u}, ${d}° ${v}' ${o}`}if(n=="DMS"){const h=Math.floor(a),v=Math.floor(f);let _=((a-h)*60).toFixed(1).padStart(4,"0"),S=((f-v)*60).toFixed(1).padStart(4,"0");const E=h.toString().padStart(2,"0"),y=v.toString().padStart(2,"0");_.endsWith(".0")&&S.endsWith(".0")&&(_=_.replace(/\.0$/,""),S=S.replace(/\.0$/,"")),c=`${l}° ${E}' ${_}" ${u}, ${d}° ${y}' ${S}" ${o}`}return c}else throw new Error("no decimal coordinates to convert")}function oi(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function pt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",s="",u=null,o=[],c=!1;if(In.test(n))throw new Error("invalid coordinate value");if(ti.test(n))if(o=ti.exec(n),c=qe(o),c)t=Math.abs(o[1])+o[2]/60,Number(o[1])<0&&(t*=-1),i=Math.abs(o[3])+o[4]/60,Number(o[3])<0&&(i*=-1),u="DM";else throw new Error("invalid coordinate format");else if(ii.test(n))if(o=ii.exec(n),c=qe(o),c){if(t=o[2],i=o[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),u="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");o[1]?(r=o[1],s=o[5]):o[4]&&(r=o[4],s=o[8])}else throw new Error("invalid decimal coordinate format");else if(ni.test(n))if(o=ni.exec(n),c=qe(o),c)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,u="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,u="DMS"),parseInt(o[2])<0&&(t=-1*t),i=Math.abs(parseInt(o[9])),o[11]&&(i+=o[11]/60),o[13]&&(i+=o[13].replace(",",".")/3600),parseInt(o[9])<0&&(i=-1*i),o[1]?(r=o[1],s=o[8]):o[7]&&(r=o[7],s=o[14]);else throw new Error("invalid DMS coordinates format");else if(ri.test(n))if(o=ri.exec(n),c=qe(o),c)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4]/60,u="DM"),o[6]&&(t+=o[6]/3600,u="DMS"),parseInt(o[2])<0&&(t=-1*t),i=Math.abs(parseInt(o[10])),o[12]&&(i+=o[12]/60),o[14]&&(i+=o[14]/3600),parseInt(o[10])<0&&(i=-1*i),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid DMS coordinates format");else if(si.test(n)){if(o=si.exec(n),c=qe(o),o.filter(l=>l).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(o[2])),o[4]&&(t+=o[4].replace(",",".")/60,u="DM"),o[6]&&(t+=o[6].replace(",",".")/3600,u="DMS"),parseInt(o[2])<0&&(t=-1*t),i=Math.abs(parseInt(o[10])),o[12]&&(i+=o[12].replace(",",".")/60),o[14]&&(i+=o[14].replace(",",".")/3600),parseInt(o[10])<0&&(i=-1*i),o[1]?(r=o[1],s=o[9]):o[8]&&(r=o[8],s=o[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!s||!r&&s)throw new Error("invalid coordinates value");if(r&&r==s)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let l=/S|SOUTH/i;l.test(r)&&t>0&&(t=-1*t),l=/W|WEST/i,l.test(s)&&i>0&&(i=-1*i);const d=o[0].trim();let a,f;const h=/[,/;\u0020]/g,v=d.match(h);if(v==null){const E=Math.floor(n.length/2);a=d.substring(0,E).trim(),f=d.substring(E).trim()}else{let E;v.length%2==1?E=Math.floor(v.length/2):E=v.length/2-1;let y=0;if(E==0)y=d.indexOf(v[0]),a=d.substring(0,y).trim(),f=d.substring(y+1).trim();else{let g=0,p=0;for(;g<=E;)y=d.indexOf(v[g],p),p=y+1,g++;a=d.substring(0,y).trim(),f=d.substring(y+1).trim()}}const _=a.split(".");if(_.length==2&&_[1]==0&&_[1].length!=2)throw new Error("invalid coordinates format");const S=f.split(".");if(S.length==2&&S[1]==0&&S[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:u,closeEnough:An,toCoordinateFormat:On})}else throw new Error("coordinates pattern match failed")}function qe(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let s=0;s<r;s++){const u=e[s],o=e[s+r],c=t.test(u)&&t.test(o),l=i.test(u)&&i.test(o),d=u==o;if(!(u==null&&o==null)){if(u==null||o==null)return!1;if(c||l||d)continue;return!1}}return!0}function li(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function An(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return li(this.decimalLatitude,Number(e[0]))&&li(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Wn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});pt.to=Wn;const zn=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Bn={decimalLatitude:40.123,decimalLongitude:-74.123},Dn=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Un=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function Fn(){const n=[];return zn.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...Bn})}),[...n,...Dn,...Un]}const jn=Fn();pt.formats=jn.map(n=>n.verbatimCoordinates);const Gn=pt;function ui(n,e,t){const i=n.slice();return i[83]=e[t],i[85]=t,i}function ai(n){let e,t;return e=new Ln({}),{c(){_e(e.$$.fragment)},m(i,r){ye(e,i,r),t=!0},i(i){t||(H(e.$$.fragment,i),t=!0)},o(i){X(e.$$.fragment,i),t=!1},d(i){ve(e,i)}}}function ci(n){let e,t,i,r,s;return t=new Cn({}),{c(){e=W("button"),_e(t.$$.fragment),b(e,"type","button"),b(e,"title",n[9]),b(e,"class","svelte-bz0zu3"),le(e,"active",n[0])},m(u,o){j(u,e,o),ye(t,e,null),i=!0,r||(s=te(e,"click",n[68]),r=!0)},p(u,o){(!i||o[0]&512)&&b(e,"title",u[9]),(!i||o[0]&1)&&le(e,"active",u[0])},i(u){i||(H(t.$$.fragment,u),i=!0)},o(u){X(t.$$.fragment,u),i=!1},d(u){u&&F(e),ve(t),r=!1,s()}}}function qn(n){let e,t=[],i=new Map,r,s,u,o=Xt(n[14]);const c=l=>l[83].id+(l[83].address?","+l[83].address:"");for(let l=0;l<o.length;l+=1){let d=ui(n,o,l),a=c(d);i.set(a,t[l]=fi(a,d))}return{c(){e=W("ul");for(let l=0;l<t.length;l+=1)t[l].c();b(e,"class","options svelte-bz0zu3")},m(l,d){j(l,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,s||(u=[te(e,"mouseleave",n[72]),te(e,"blur",n[73])],s=!0)},p(l,d){d[0]&17880064&&(o=Xt(l[14]),$e(),t=on(t,d,c,1,l,o,i,e,sn,fi,null,ui),et())},i(l){if(!r){for(let d=0;d<o.length;d+=1)H(t[d]);r=!0}},o(l){for(let d=0;d<t.length;d+=1)X(t[d]);r=!1},d(l){l&&F(e);for(let d=0;d<t.length;d+=1)t[d].d();s=!1,me(u)}}}function Qn(n){let e,t,i,r,s,u;return t=new $t({}),{c(){e=W("div"),_e(t.$$.fragment),i=re(),r=W("div"),s=Ee(n[7]),b(r,"class","svelte-bz0zu3"),b(e,"class","no-results svelte-bz0zu3")},m(o,c){j(o,e,c),ye(t,e,null),O(e,i),O(e,r),O(r,s),u=!0},p(o,c){(!u||c[0]&128)&&Ue(s,o[7])},i(o){u||(H(t.$$.fragment,o),u=!0)},o(o){X(t.$$.fragment,o),u=!1},d(o){o&&F(e),ve(t)}}}function Zn(n){let e="",t;return{c(){t=Ee(e)},m(i,r){j(i,t,r)},p:U,i:U,o:U,d(i){i&&F(t)}}}function Hn(n){let e,t,i,r,s,u,o,c,l,d,a;return t=new $t({}),c=new Jt({}),{c(){e=W("div"),_e(t.$$.fragment),i=re(),r=W("div"),s=Ee(n[6]),u=re(),o=W("button"),_e(c.$$.fragment),b(r,"class","svelte-bz0zu3"),b(o,"class","svelte-bz0zu3"),b(e,"class","error svelte-bz0zu3")},m(f,h){j(f,e,h),ye(t,e,null),O(e,i),O(e,r),O(r,s),O(e,u),O(e,o),ye(c,o,null),l=!0,d||(a=te(o,"click",n[69]),d=!0)},p(f,h){(!l||h[0]&64)&&Ue(s,f[6])},i(f){l||(H(t.$$.fragment,f),H(c.$$.fragment,f),l=!0)},o(f){X(t.$$.fragment,f),X(c.$$.fragment,f),l=!1},d(f){f&&F(e),ve(t),ve(c),d=!1,a()}}}function fi(n,e){let t,i,r;function s(){return e[70](e[85])}function u(){return e[71](e[83])}return i=new _n({props:{feature:e[83],showPlaceType:e[10],selected:e[15]===e[85],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",s),i.$on("focus",u),{key:n,first:null,c(){t=Vi(),_e(i.$$.fragment),this.first=t},m(o,c){j(o,t,c),ye(i,o,c),r=!0},p(o,c){e=o;const l={};c[0]&16384&&(l.feature=e[83]),c[0]&1024&&(l.showPlaceType=e[10]),c[0]&49152&&(l.selected=e[15]===e[85]),c[0]&4096&&(l.iconsBaseUrl=e[12]),i.$set(l)},i(o){r||(H(i.$$.fragment,o),r=!0)},o(o){X(i.$$.fragment,o),r=!1},d(o){o&&F(t),ve(i,o)}}}function Vn(n){let e,t,i,r,s,u,o,c,l,d,a,f,h,v,_,S,E,y,g,p,M,L=!1;s=new Rn({}),a=new Jt({});let x=n[19]&&ai(),w=n[5]==="button"&&ci(n);const k=n[60].default,T=qi(k,n,n[59],null),z=[Hn,Zn,Qn,qn],D=[];function N(C,q){var se,fe;return C[18]?0:C[16]?((se=C[14])==null?void 0:se.length)===0?2:C[16]&&((fe=C[14])!=null&&fe.length)?3:-1:1}return~(S=N(n))&&(E=D[S]=z[S](n)),{c(){e=re(),t=W("form"),i=W("div"),r=W("button"),_e(s.$$.fragment),u=re(),o=W("input"),c=re(),l=W("div"),d=W("button"),_e(a.$$.fragment),f=re(),x&&x.c(),h=re(),w&&w.c(),v=re(),T&&T.c(),_=re(),E&&E.c(),b(r,"class","search-button svelte-bz0zu3"),b(r,"type","button"),b(o,"placeholder",n[8]),b(o,"aria-label",n[8]),b(o,"class","svelte-bz0zu3"),b(d,"type","button"),b(d,"title",n[3]),b(d,"class","svelte-bz0zu3"),b(l,"class","clear-button-container svelte-bz0zu3"),le(l,"displayable",n[1]!==""),b(i,"class","input-group svelte-bz0zu3"),b(t,"tabindex","0"),b(t,"class",y=Qt(n[2])+" svelte-bz0zu3"),le(t,"can-collapse",n[4]&&n[1]==="")},m(C,q){j(C,e,q),j(C,t,q),O(t,i),O(i,r),ye(s,r,null),O(i,u),O(i,o),n[62](o),Zt(o,n[1]),O(i,c),O(i,l),O(l,d),ye(a,d,null),O(l,f),x&&x.m(l,null),O(i,h),w&&w.m(i,null),O(i,v),T&&T.m(i,null),O(t,_),~S&&D[S].m(t,null),g=!0,p||(M=[te(r,"click",n[61]),te(o,"input",n[63]),te(o,"focus",n[64]),te(o,"blur",n[65]),te(o,"keydown",n[22]),te(o,"input",n[66]),te(d,"click",n[67]),te(t,"submit",Yi(n[21]))],p=!0)},p(C,q){(!g||q[0]&256)&&b(o,"placeholder",C[8]),(!g||q[0]&256)&&b(o,"aria-label",C[8]),q[0]&2&&o.value!==C[1]&&Zt(o,C[1]),(!g||q[0]&8)&&b(d,"title",C[3]),C[19]?x?q[0]&524288&&H(x,1):(x=ai(),x.c(),H(x,1),x.m(l,null)):x&&($e(),X(x,1,1,()=>{x=null}),et()),(!g||q[0]&2)&&le(l,"displayable",C[1]!==""),C[5]==="button"?w?(w.p(C,q),q[0]&32&&H(w,1)):(w=ci(C),w.c(),H(w,1),w.m(i,v)):w&&($e(),X(w,1,1,()=>{w=null}),et()),T&&T.p&&(!g||q[1]&268435456)&&Zi(T,k,C,C[59],g?Qi(k,C[59],q,null):Hi(C[59]),null);let se=S;S=N(C),S===se?~S&&D[S].p(C,q):(E&&($e(),X(D[se],1,1,()=>{D[se]=null}),et()),~S?(E=D[S],E?E.p(C,q):(E=D[S]=z[S](C),E.c()),H(E,1),E.m(t,null)):E=null),(!g||q[0]&4&&y!==(y=Qt(C[2])+" svelte-bz0zu3"))&&b(t,"class",y),(!g||q[0]&22)&&le(t,"can-collapse",C[4]&&C[1]==="")},i(C){g||(H(L),H(s.$$.fragment,C),H(a.$$.fragment,C),H(x),H(w),H(T,C),H(E),g=!0)},o(C){X(L),X(s.$$.fragment,C),X(a.$$.fragment,C),X(x),X(w),X(T,C),X(E),g=!1},d(C){C&&(F(e),F(t)),ve(s),n[62](null),ve(a),x&&x.d(),w&&w.d(),T&&T.d(C),~S&&D[S].d(),p=!1,me(M)}}}function Yn(n,e,t){let i,{$$slots:r={},$$scope:s}=e;const u={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:o=void 0}=e,{apiKey:c}=e,{bbox:l=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:v=200}=e,{enableReverse:_="never"}=e,{errorMessage:S="Something went wrong…"}=e,{filter:E=()=>!0}=e,{flyTo:y=!0}=e,{fuzzyMatch:g=!0}=e,{language:p=void 0}=e,{limit:M=void 0}=e,{mapController:L=void 0}=e,{minLength:x=2}=e,{noResultsMessage:w="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:k="Search"}=e,{proximity:T=[{type:"server-geolocation"}]}=e,{reverseActive:z=_==="always"}=e,{reverseButtonTitle:D="toggle reverse geocoding"}=e,{searchValue:N=""}=e,{pickedResultStyle:C="full-geometry"}=e,{showPlaceType:q="if-needed"}=e,{showResultsWhileTyping:se=!0}=e,{selectFirst:fe=!0}=e,{flyToSelected:Nt=!1}=e,{markerOnSelected:ot=!0}=e,{types:Te=void 0}=e,{exhaustiveReverseGeocoding:Rt=!1}=e,{excludeTypes:lt=!1}=e,{zoom:ut=u}=e,{apiUrl:Tt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Pt={}}=e,{iconsBaseUrl:Wi="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.6/icons/"}=e,{adjustUrlQuery:It=()=>{}}=e;function Dr(){de.focus()}function Ur(){de.blur()}function zi(m,Q=!0,K=!1){t(1,N=m),Q?(t(15,G=-1),Di()):(zt(!K,K),setTimeout(()=>{de.focus(),de.select()}))}function Fr(){t(14,A=void 0),t(56,P=void 0),t(15,G=-1)}function jr(){t(55,V=[]),t(56,P=void 0)}let ze=!1,A,V,P,Bi="",de,G=-1,he,at=[],Pe,Be,ct,Ot;const Gr=new Set,Ne=$i();Ji(()=>{L&&(L.setEventHandler(void 0),L.indicateReverse(!1),L.setSelectedMarker(-1),L.setMarkers(void 0,void 0))});function Di(m){if(Be&&(clearTimeout(Be),Be=void 0),G>-1&&A)t(56,P=A[G]),t(1,N=P.place_type[0]==="reverse"?P.place_name:P.place_name.replace(/,.*/,"")),t(18,he=void 0),t(55,V=void 0),t(15,G=-1);else if(N){const Q=m||!At(N);Wt(N,{exact:!0}).then(()=>{t(55,V=A),t(56,P=void 0),Q&&qr()}).catch(K=>t(18,he=K))}}function At(m){try{return Gn(m,6)}catch{return!1}}async function Wt(m,{byId:Q=!1,exact:K=!1}={}){t(18,he=void 0),Pe==null||Pe.abort();const oe=new AbortController;t(19,Pe=oe);try{const I=At(m),Y=new URLSearchParams;if(p!==void 0&&Y.set("language",Array.isArray(p)?p.join(","):p??""),Te&&Y.set("types",Te.join(",")),lt&&Y.set("excludeTypes",String(lt)),l&&Y.set("bbox",l.map(ft=>ft.toFixed(6)).join(",")),h&&Y.set("country",Array.isArray(h)?h.join(","):h),!Q&&!I){const ft=await Pn(L,T,oe);ft&&Y.set("proximity",ft),(K||!se)&&Y.set("autocomplete","false"),Y.set("fuzzyMatch",String(g))}M!==void 0&&(Rt||!I||(Te==null?void 0:Te.length)===1)&&Y.set("limit",String(M)),Y.set("key",c),It(Y);const ge=Tt+"/"+encodeURIComponent(I?I.decimalLongitude+","+I.decimalLatitude:m)+".json?"+Y.toString();if(ge===Bi){Q?(t(14,A=void 0),t(56,P=at[0])):t(14,A=at);return}Bi=ge;const Dt=await fetch(ge,{signal:oe.signal,...Pt});if(!Dt.ok)throw new Error(await Dt.text());const Ut=await Dt.json();Ne("response",{url:ge,featureCollection:Ut}),Q?(t(14,A=void 0),t(56,P=Ut.features[0]),at=[P]):(t(14,A=Ut.features.filter(E)),I&&A.unshift({type:"Feature",properties:{},id:"reverse_"+I.decimalLongitude+"_"+I.decimalLatitude,text:I.decimalLatitude+", "+I.decimalLongitude,place_name:I.decimalLatitude+", "+I.decimalLongitude,place_type:["reverse"],center:[I.decimalLongitude,I.decimalLatitude],bbox:[I.decimalLongitude,I.decimalLatitude,I.decimalLongitude,I.decimalLatitude],geometry:{type:"Point",coordinates:[I.decimalLongitude,I.decimalLatitude]}}),at=A,I&&de.focus())}catch(I){if(I&&typeof I=="object"&&"name"in I&&I.name==="AbortError")return;throw I}finally{oe===Pe&&t(19,Pe=void 0)}}function qr(){var oe;if(!(V!=null&&V.length)||!y)return;const m=[180,90,-180,-90],Q=!V.some(I=>!I.matching_text);let K;for(const I of V){const Y=Ke(I);if(K=K===void 0?Y:Y===void 0?K:Math.max(K,Y),Q||!I.matching_text)for(const ge of[0,1,2,3])m[ge]=Math[ge<2?"min":"max"](m[ge],((oe=I.bbox)==null?void 0:oe[ge])??I.center[ge%2])}L&&V.length>0&&(P&&m[0]===m[2]&&m[1]===m[3]?L.flyTo(P.center,Ke(P)):L.fitBounds(tt(m),50,K))}function Ke(m){var K;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;const Q=m.id.replace(/\..*/,"");return(Array.isArray((K=m.properties)==null?void 0:K.categories)?m.properties.categories.reduce((oe,I)=>{const Y=ut[Q+"."+I];return oe===void 0?Y:Y===void 0?oe:Math.max(oe,Y)},void 0):void 0)??ut[Q]}function Qr(m){t(0,z=_==="always"),t(14,A=void 0),t(56,P=void 0),t(15,G=-1),zi(m[1].toFixed(6)+", "+Tn(m[0],[-180,180],!0).toFixed(6),!1,!0)}function Zr(m){if(!A)return;let Q=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;Q&&(G===(fe?0:-1)&&Q===-1&&t(15,G=A.length),t(15,G+=Q),G>=A.length&&t(15,G=-1),G<0&&fe&&t(15,G=0),m.preventDefault())}function zt(m=!0,Q=!1){if(t(18,he=void 0),se||Q){if(Be&&clearTimeout(Be),N.length<x)return;const K=N;Be=window.setTimeout(()=>{Wt(K).catch(oe=>t(18,he=oe))},m?v:0)}else t(14,A=void 0),t(18,he=void 0)}function Bt(m){t(56,P=m),t(1,N=m.place_name),t(15,G=-1)}const Hr=()=>de.focus();function Vr(m){gt[m?"unshift":"push"](()=>{de=m,t(17,de)})}function Yr(){N=this.value,t(1,N),t(13,ze),t(28,a)}const Kr=()=>t(13,ze=!0),Xr=()=>t(13,ze=!1),Jr=()=>zt(),$r=()=>{t(1,N=""),de.focus()},es=()=>t(0,z=!z),ts=()=>t(18,he=void 0),is=m=>t(15,G=m),ns=m=>Bt(m),rs=()=>{fe||t(15,G=-1)},ss=()=>{};return n.$$set=m=>{"class"in m&&t(2,o=m.class),"apiKey"in m&&t(26,c=m.apiKey),"bbox"in m&&t(27,l=m.bbox),"clearButtonTitle"in m&&t(3,d=m.clearButtonTitle),"clearOnBlur"in m&&t(28,a=m.clearOnBlur),"collapsed"in m&&t(4,f=m.collapsed),"country"in m&&t(29,h=m.country),"debounceSearch"in m&&t(30,v=m.debounceSearch),"enableReverse"in m&&t(5,_=m.enableReverse),"errorMessage"in m&&t(6,S=m.errorMessage),"filter"in m&&t(31,E=m.filter),"flyTo"in m&&t(32,y=m.flyTo),"fuzzyMatch"in m&&t(33,g=m.fuzzyMatch),"language"in m&&t(34,p=m.language),"limit"in m&&t(35,M=m.limit),"mapController"in m&&t(36,L=m.mapController),"minLength"in m&&t(37,x=m.minLength),"noResultsMessage"in m&&t(7,w=m.noResultsMessage),"placeholder"in m&&t(8,k=m.placeholder),"proximity"in m&&t(38,T=m.proximity),"reverseActive"in m&&t(0,z=m.reverseActive),"reverseButtonTitle"in m&&t(9,D=m.reverseButtonTitle),"searchValue"in m&&t(1,N=m.searchValue),"pickedResultStyle"in m&&t(39,C=m.pickedResultStyle),"showPlaceType"in m&&t(10,q=m.showPlaceType),"showResultsWhileTyping"in m&&t(40,se=m.showResultsWhileTyping),"selectFirst"in m&&t(11,fe=m.selectFirst),"flyToSelected"in m&&t(41,Nt=m.flyToSelected),"markerOnSelected"in m&&t(42,ot=m.markerOnSelected),"types"in m&&t(43,Te=m.types),"exhaustiveReverseGeocoding"in m&&t(44,Rt=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(45,lt=m.excludeTypes),"zoom"in m&&t(46,ut=m.zoom),"apiUrl"in m&&t(47,Tt=m.apiUrl),"fetchParameters"in m&&t(48,Pt=m.fetchParameters),"iconsBaseUrl"in m&&t(12,Wi=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(49,It=m.adjustUrlQuery),"$$scope"in m&&t(59,s=m.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,z=_==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ct=ze),a&&!ze&&t(1,N="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&N.length<x&&(t(56,P=void 0),t(14,A=void 0),t(18,he=void 0),t(55,V=A)),n.$$.dirty[1]&33554688&&C!=="marker-only"&&P&&!P.address&&P.geometry.type==="Point"&&P.place_type[0]!=="reverse"&&Wt(P.id,{byId:!0}).catch(m=>t(18,he=m)),n.$$.dirty[1]&100663330&&(L&&P&&P.id!==Ot&&y&&(!P.bbox||P.bbox[0]===P.bbox[2]&&P.bbox[1]===P.bbox[3]?L.flyTo(P.center,Ke(P)):L.fitBounds(tt(P.bbox),50,Ke(P)),t(14,A=void 0),t(55,V=void 0),t(15,G=-1)),t(57,Ot=P==null?void 0:P.id)),n.$$.dirty[0]&18432&&fe&&A!=null&&A.length&&t(15,G=0),n.$$.dirty[0]&2&&t(15,G=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&16777216&&V!==A&&t(55,V=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&16777248&&L&&L.setEventHandler(m=>{switch(m.type){case"mapClick":z&&Qr(m.coordinates);break;case"markerClick":{const Q=A==null?void 0:A.find(K=>K.id===m.id);Q&&Bt(Q)}break;case"markerMouseEnter":V&&t(15,G=ct?(A==null?void 0:A.findIndex(Q=>Q.id===m.id))??-1:-1);break;case"markerMouseLeave":V&&t(15,G=-1);break}}),n.$$.dirty[0]&49152&&t(58,i=A==null?void 0:A[G]),n.$$.dirty[1]&134218786&&L&&i&&y&&Nt&&L.flyTo(i.center,Ke(i)),n.$$.dirty[1]&2080&&(ot||L==null||L.setMarkers(void 0,void 0)),n.$$.dirty[1]&150997024&&L&&ot&&!V&&(L.setMarkers(i?[i]:void 0,void 0),L.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&50331680&&L&&L.setMarkers(V,P),n.$$.dirty[0]&32768|n.$$.dirty[1]&16777248&&V&&L&&L.setSelectedMarker(G),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&L){const m=At(N);L.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}n.$$.dirty[1]&134217728&&Ne("select",{feature:i}),n.$$.dirty[1]&33554432&&Ne("pick",{feature:P}),n.$$.dirty[0]&81920&&Ne("optionsvisibilitychange",{optionsVisible:ct&&!!A}),n.$$.dirty[0]&16384&&Ne("featureslisted",{features:A}),n.$$.dirty[1]&16777216&&Ne("featuresmarked",{features:V}),n.$$.dirty[0]&1&&Ne("reversetoggle",{reverse:z}),n.$$.dirty[0]&2&&Ne("querychange",{query:N}),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&L&&L.indicateReverse(z)},[z,N,o,d,f,_,S,w,k,D,q,fe,Wi,ze,A,G,ct,de,he,Pe,Gr,Di,Zr,zt,Bt,u,c,l,a,h,v,E,y,g,p,M,L,x,T,C,se,Nt,ot,Te,Rt,lt,ut,Tt,Pt,It,Dr,Ur,zi,Fr,jr,V,P,Ot,i,s,r,Hr,Vr,Yr,Kr,Xr,Jr,$r,es,ts,is,ns,rs,ss]}let Kn=class extends Le{constructor(e){super(),we(this,e,Yn,Vn,be,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function Qe(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function bt(n,e,t={}){for(const r of n){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let s=0;s<r[r.length-1].length;s++)if(r[r.length-1][s]!==r[0][s])throw new Error("First and last Position are not equivalent.")}return Qe({type:"Polygon",coordinates:n},e,t)}function Ze(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function di(n,e,t={}){return Qe({type:"MultiPolygon",coordinates:n},e,t)}/**
2
2
  * splaytree v3.1.2
3
3
  * Fast Splay tree for Node and browser
4
4
  *
@@ -18,6 +18,6 @@
18
18
 
19
19
  See the Apache Version 2.0 License for specific language governing permissions
20
20
  and limitations under the License.
21
- ***************************************************************************** */function er(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(l){return function(d){return c([l,d])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=l[0]&2?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,r=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(l[0]===6&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(d){l=[6,d],r=0}finally{i=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Se=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function tr(n,e){return n>e?1:n<e?-1:0}function xe(n,e,t){for(var i=new Se(null,null),r=i,o=i;;){var u=t(n,e.key);if(u<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(u>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=i.right,e.right=i.left,e}function Lt(n,e,t,i){var r=new Se(n,e);if(t===null)return r.left=r.right=null,r;t=xe(n,t,i);var o=i(n,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function vi(n,e,t){var i=null,r=null;if(e){e=xe(n,e,t);var o=t(e.key,n);o===0?(i=e.left,r=e.right):o<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function ir(n,e,t){return e===null?n:(n===null||(e=xe(n.key,e,t),e.left=n),e)}function St(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
22
- `);var o=e+(t?" ":"│ ");n.left&&St(n.left,o,!1,i,r),n.right&&St(n.right,o,!0,i,r)}}var xt=function(){function n(e){e===void 0&&(e=tr),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Lt(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new Se(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=xe(e,this._root,r),u=r(e,o.key);return u===0?this._root=o:(u<0?(i.left=o.left,i.right=o,o.left=null):u>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=xe(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=xe(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=xe(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=xe(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],o=!1;!o;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):o=!0;return this},n.prototype.range=function(e,t,i,r){for(var o=[],u=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=u(s.key,t),c>0)break;if(u(s.key,e)>=0&&i.call(r,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,o=[];!i;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return rr(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,o=this._comparator;if(i&&Ct(e,t,0,r-1,o),this._root===null)this._root=Mt(e,t,0,r),this._size=r;else{var u=or(this.toList(),nr(e,t),o);r=this._size+r,this._root=kt({head:u},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return St(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=vi(e,this._root,r),u=o.left,s=o.right;r(e,t)<0?s=Lt(t,i,s,r):u=Lt(t,i,u,r),this._root=ir(u,s,r)},n.prototype.split=function(e){return vi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return er(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Mt(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),u=n[o],s=e[o],c=new Se(u,s);return c.left=Mt(n,e,t,o),c.right=Mt(n,e,o+1,i),c}return null}function nr(n,e){for(var t=new Se(null,null),i=t,r=0;r<n.length;r++)i=i.next=new Se(n[r],e[r]);return i.next=null,t.next}function rr(n){for(var e=n,t=[],i=!1,r=new Se(null,null),o=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):i=!0;return o.next=null,r.next}function kt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=kt(n,e,r),u=n.head;return u.left=o,n.head=n.head.next,u.right=kt(n,r+1,t),u}return null}function or(n,e,t){for(var i=new Se(null,null),r=i,o=n,u=e;o!==null&&u!==null;)t(o.key,u.key)<0?(r.next=o,o=o.next):(r.next=u,u=u.next),r=r.next;return o!==null?r.next=o:u!==null&&(r.next=u),i.next}function Ct(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],u=t-1,s=i+1;;){do u++;while(r(n[u],o)<0);do s--;while(r(n[s],o)>0);if(u>=s)break;var c=n[u];n[u]=n[s],n[s]=c,c=e[u],e[u]=e[s],e[s]=c}Ct(n,e,t,s,r),Ct(n,e,s+1,i,r)}}const pe=11102230246251565e-32,ee=134217729,sr=(3+8*pe)*pe;function Nt(n,e,t,i,r){let o,u,s,c,l=e[0],d=i[0],a=0,f=0;d>l==d>-l?(o=l,l=e[++a]):(o=d,d=i[++f]);let g=0;if(a<n&&f<t)for(d>l==d>-l?(u=l+o,s=o-(u-l),l=e[++a]):(u=d+o,s=o-(u-d),d=i[++f]),o=u,s!==0&&(r[g++]=s);a<n&&f<t;)d>l==d>-l?(u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a]):(u=o+d,c=u-o,s=o-(u-c)+(d-c),d=i[++f]),o=u,s!==0&&(r[g++]=s);for(;a<n;)u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a],o=u,s!==0&&(r[g++]=s);for(;f<t;)u=o+d,c=u-o,s=o-(u-c)+(d-c),d=i[++f],o=u,s!==0&&(r[g++]=s);return(o!==0||g===0)&&(r[g++]=o),g}function lr(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function Ye(n){return new Float64Array(n)}const ur=(3+16*pe)*pe,ar=(2+12*pe)*pe,cr=(9+64*pe)*pe*pe,Be=Ye(4),yi=Ye(8),pi=Ye(12),bi=Ye(16),ie=Ye(4);function fr(n,e,t,i,r,o,u){let s,c,l,d,a,f,g,y,w,E,h,m,b,L,M,S,x,_;const C=n-r,A=t-r,B=e-o,N=i-o;L=C*N,f=ee*C,g=f-(f-C),y=C-g,f=ee*N,w=f-(f-N),E=N-w,M=y*E-(L-g*w-y*w-g*E),S=B*A,f=ee*B,g=f-(f-B),y=B-g,f=ee*A,w=f-(f-A),E=A-w,x=y*E-(S-g*w-y*w-g*E),h=M-x,a=M-h,Be[0]=M-(h+a)+(a-x),m=L+h,a=m-L,b=L-(m-a)+(h-a),h=b-S,a=b-h,Be[1]=b-(h+a)+(a-S),_=m+h,a=_-m,Be[2]=m-(_-a)+(h-a),Be[3]=_;let W=lr(4,Be),k=ar*u;if(W>=k||-W>=k||(a=n-C,s=n-(C+a)+(a-r),a=t-A,l=t-(A+a)+(a-r),a=e-B,c=e-(B+a)+(a-o),a=i-N,d=i-(N+a)+(a-o),s===0&&c===0&&l===0&&d===0)||(k=cr*u+sr*Math.abs(W),W+=C*d+N*s-(B*l+A*c),W>=k||-W>=k))return W;L=s*N,f=ee*s,g=f-(f-s),y=s-g,f=ee*N,w=f-(f-N),E=N-w,M=y*E-(L-g*w-y*w-g*E),S=c*A,f=ee*c,g=f-(f-c),y=c-g,f=ee*A,w=f-(f-A),E=A-w,x=y*E-(S-g*w-y*w-g*E),h=M-x,a=M-h,ie[0]=M-(h+a)+(a-x),m=L+h,a=m-L,b=L-(m-a)+(h-a),h=b-S,a=b-h,ie[1]=b-(h+a)+(a-S),_=m+h,a=_-m,ie[2]=m-(_-a)+(h-a),ie[3]=_;const q=Nt(4,Be,4,ie,yi);L=C*d,f=ee*C,g=f-(f-C),y=C-g,f=ee*d,w=f-(f-d),E=d-w,M=y*E-(L-g*w-y*w-g*E),S=B*l,f=ee*B,g=f-(f-B),y=B-g,f=ee*l,w=f-(f-l),E=l-w,x=y*E-(S-g*w-y*w-g*E),h=M-x,a=M-h,ie[0]=M-(h+a)+(a-x),m=L+h,a=m-L,b=L-(m-a)+(h-a),h=b-S,a=b-h,ie[1]=b-(h+a)+(a-S),_=m+h,a=_-m,ie[2]=m-(_-a)+(h-a),ie[3]=_;const oe=Nt(q,yi,4,ie,pi);L=s*d,f=ee*s,g=f-(f-s),y=s-g,f=ee*d,w=f-(f-d),E=d-w,M=y*E-(L-g*w-y*w-g*E),S=c*l,f=ee*c,g=f-(f-c),y=c-g,f=ee*l,w=f-(f-l),E=l-w,x=y*E-(S-g*w-y*w-g*E),h=M-x,a=M-h,ie[0]=M-(h+a)+(a-x),m=L+h,a=m-L,b=L-(m-a)+(h-a),h=b-S,a=b-h,ie[1]=b-(h+a)+(a-S),_=m+h,a=_-m,ie[2]=m-(_-a)+(h-a),ie[3]=_;const Ne=Nt(oe,pi,4,ie,bi);return bi[Ne-1]}function dr(n,e,t,i,r,o){const u=(e-o)*(t-r),s=(n-r)*(i-o),c=u-s,l=Math.abs(u+s);return Math.abs(c)>=ur*l?c:-fr(n,e,t,i,r,o,l)}const Ke=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Tt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:o}}};let Me=Number.EPSILON;Me===void 0&&(Me=Math.pow(2,-52));const hr=Me*Me,wi=(n,e)=>{if(-Me<n&&n<Me&&-Me<e&&e<Me)return 0;const t=n-e;return t*t<hr*n*e?0:n<e?-1:1};class gr{constructor(){this.reset()}reset(){this.xRounder=new Ei,this.yRounder=new Ei}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ei{constructor(){this.tree=new xt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&wi(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&wi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Xe=new gr,ot=(n,e)=>n.x*e.y-n.y*e.x,_i=(n,e)=>n.x*e.x+n.y*e.y,Li=(n,e,t)=>{const i=dr(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},st=n=>Math.sqrt(_i(n,n)),mr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return ot(r,i)/st(r)/st(i)},vr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return _i(r,i)/st(r)/st(i)},Si=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},xi=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},yr=(n,e,t,i)=>{if(e.x===0)return xi(t,i,n.x);if(i.x===0)return xi(n,e,t.x);if(e.y===0)return Si(t,i,n.y);if(i.y===0)return Si(n,e,t.y);const r=ot(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},u=ot(o,e)/r,s=ot(o,i)/r,c=n.x+s*e.x,l=t.x+u*i.x,d=n.y+s*e.y,a=t.y+u*i.y,f=(c+l)/2,g=(d+a)/2;return{x:f,y:g}};class ue{static compare(e,t){const i=ue.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const o=t[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,i=r=>{const o=r.otherSE;t.set(r,{sine:mr(this.point,e.point,o.point),cosine:vr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:u,cosine:s}=t.get(r),{sine:c,cosine:l}=t.get(o);return u>=0&&c>=0?s<l?1:s>l?-1:0:u<0&&c<0?s<l?-1:s>l?1:0:c<u?-1:c>u?1:0}}}let pr=0;class ke{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,u=t.rightSE.point.x;if(u<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,l=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<l)return 1;if(c>s&&c>l)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(i>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<u){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>u){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==u){const a=l-s,f=o-i,g=d-c,y=u-r;if(a>f&&g<y)return 1;if(a<f&&g>y)return-1}return o>u?1:o<u||l<d?-1:l>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++pr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,o,u;const s=ue.comparePoints(e,t);if(s<0)r=e,o=t,u=1;else if(s>0)r=t,o=e,u=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new ue(r,!0),l=new ue(o,!1);return new ke(c,l,[i],[u])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(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}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,u=t.x+o*r.x;if(e.x===u)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=Tt(t,i);if(r===null)return null;const o=this.leftSE.point,u=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,l=Ke(t,s)&&this.comparePoint(s)===0,d=Ke(i,o)&&e.comparePoint(o)===0,a=Ke(t,c)&&this.comparePoint(c)===0,f=Ke(i,u)&&e.comparePoint(u)===0;if(d&&l)return f&&!a?u:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(l)return f&&u.x===s.x&&u.y===s.y?null:s;if(f&&a)return null;if(f)return u;if(a)return c;const g=yr(o,this.vector(),s,e.vector());return g===null||!Ke(r,g)?null:Xe.round(g.x,g.y)}split(e){const t=[],i=e.events!==void 0,r=new ue(e,!0),o=new ue(e,!1),u=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,u,this.rings.slice(),this.windings.slice());return ue.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ue.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=ke.compare(t,i);if(r!==0){if(r>0){const o=t;t=i,i=o}if(t.prev===i){const o=t;t=i,i=o}for(let o=0,u=i.rings.length;o<u;o++){const s=i.rings[o],c=i.windings[o],l=t.rings.indexOf(s);l===-1?(t.rings.push(s),t.windings.push(c)):t.windings[l]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const l=this.rings[s],d=this.windings[s],a=t.indexOf(l);a===-1?(t.push(l),i.push(d)):i[a]+=d}const o=[],u=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const l=t[s],d=l.poly;if(u.indexOf(d)===-1)if(l.isExterior)o.push(d);else{u.indexOf(d)===-1&&u.push(d);const a=o.indexOf(l.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const l=o[s].multiPoly;r.indexOf(l)===-1&&r.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(de.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===de.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${de.type}`)}return this._isInResult}}class Mi{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Xe.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let u=1,s=e.length;u<s;u++){if(typeof e[u][0]!="number"||typeof e[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Xe.round(e[u][0],e[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class br{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Mi(e[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(let i=1,r=e.length;i<r;i++){const o=new Mi(e[i],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=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class ki{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const o=new br(e[i],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=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class lt{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.isInResult()||o.ringOut)continue;let u=null,s=o.leftSE,c=o.rightSE;const l=[s],d=s.point,a=[];for(;u=s,s=c,l.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const w=l[0].point,E=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${w.x}, ${w.y}]. Last matching segment found ends at [${E.x}, ${E.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let w=0,E=a.length;w<E;w++)if(a[w].point===s.point){g=w;break}if(g!==null){const w=a.splice(g)[0],E=l.splice(w.index);E.unshift(E[0].otherSE),t.push(new lt(E.reverse()));continue}a.push({index:l.length,point:s.point});const y=s.getLeftmostComparator(u);c=f.sort(y)[0].otherSE;break}t.push(new lt(l))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,d=this.events.length-1;l<d;l++){const a=this.events[l].point,f=this.events[l+1].point;Li(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];Li(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let l=u;l!=s;l+=o)c.push([t[l].x,t[l].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const u=this.events[r];ue.compare(e,u)>0&&(e=u)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class Ci{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class wr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.poly)if(o.isExteriorRing())t.push(new Ci(o));else{const u=o.enclosingRing();u.poly||t.push(new Ci(u)),u.poly.addInterior(o)}}return t}}class Er{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new xt(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,u=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(e.isLeft){let l=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(l=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let g=0,y=f.length;g<y;g++)i.push(f[g])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let g=0,y=f.length;g<y;g++)i.push(f[g])}}if(l!==null||d!==null){let a=null;l===null?a=d:d===null?a=l:a=ue.comparePoints(l,d)<=0?l:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let g=0,y=f.length;g<y;g++)i.push(f[g])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const l=s.getIntersection(c);if(l!==null){if(!s.isAnEndpoint(l)){const d=this._splitSafely(s,l);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(l)){const d=this._splitSafely(c,l);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const Ni=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,_r=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Lr{run(e,t,i){de.type=e,Xe.reset();const r=[new ki(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new ki(i[a],!1));if(de.numMultiPolys=r.length,de.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Tt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(de.type==="intersection")for(let a=0,f=r.length;a<f;a++){const g=r[a];for(let y=a+1,w=r.length;y<w;y++)if(Tt(g.bbox,r[y].bbox)===null)return[]}const o=new xt(ue.compare);for(let a=0,f=r.length;a<f;a++){const g=r[a].getSweepEvents();for(let y=0,w=g.length;y<w;y++)if(o.insert(g[y]),o.size>Ni)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Er(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const g=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(o.size>Ni)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>_r)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=u.process(a);for(let g=0,y=f.length;g<y;g++){const w=f[g];w.consumedBy===void 0&&o.insert(w)}s=o.size,c=o.pop()}Xe.reset();const l=lt.factory(u.segments);return new wr(l).getGeom()}}const de=new Lr;var Ti={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return de.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return de.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return de.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return de.run("difference",n,t)}};function Ri(n,e,t){if(n!==null)for(var i,r,o,u,s,c,l,d=0,a=0,f,g=n.type,y=g==="FeatureCollection",w=g==="Feature",E=y?n.features.length:1,h=0;h<E;h++){l=y?n.features[h].geometry:w?n.geometry:n,f=l?l.type==="GeometryCollection":!1,s=f?l.geometries.length:1;for(var m=0;m<s;m++){var b=0,L=0;if(u=f?l.geometries[m]:l,u!==null){c=u.coordinates;var M=u.type;switch(d=0,M){case null:break;case"Point":if(e(c,a,h,b,L)===!1)return!1;a++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,h,b,L)===!1)return!1;a++,M==="MultiPoint"&&b++}M==="LineString"&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-d;r++){if(e(c[i][r],a,h,b,L)===!1)return!1;a++}M==="MultiLineString"&&b++,M==="Polygon"&&L++}M==="Polygon"&&b++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(L=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-d;o++){if(e(c[i][r][o],a,h,b,L)===!1)return!1;a++}L++}b++}break;case"GeometryCollection":for(i=0;i<u.geometries.length;i++)if(Ri(u.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Rt(n,e){var t,i,r,o,u,s,c,l,d,a,f=0,g=n.type==="FeatureCollection",y=n.type==="Feature",w=g?n.features.length:1;for(t=0;t<w;t++){for(s=g?n.features[t].geometry:y?n.geometry:n,l=g?n.features[t].properties:y?n.properties:{},d=g?n.features[t].bbox:y?n.bbox:void 0,a=g?n.features[t].id:y?n.id:void 0,c=s?s.type==="GeometryCollection":!1,u=c?s.geometries.length:1,r=0;r<u;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,l,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,l,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,l,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Sr(n,e){Rt(n,function(t,i,r,o,u){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(He(t,r,{bbox:o,id:u}),i,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var d=t.coordinates[l],a={type:c,coordinates:d};if(e(He(a,r),i,l)===!1)return!1}})}function xr(n,e={}){const t=[];if(Rt(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=Ti.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?_t(i[0],e.properties):mi(i,e.properties)}var Pi=xr;function Mr(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ri(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var Ii=Mr;function kr(n){const e=[];if(Rt(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=Ti.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?_t(i[0],t):mi(i,t)}var Cr=kr;function Nr(n){if(!n)throw new Error("geojson is required");var e=[];return Sr(n,function(t){e.push(t)}),Ve(e)}var Tr=Nr;function Oi(n,e){const t=Cr(Ve([_t([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=rt(Ii(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,u=i[2]>180,s=Tr(n);if(s.features.length>1&&(o||u))for(const c of s.features){const l=rt(Ii(c));if(u&&l[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&l[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ve([s.features.length<2?n:Pi(s)??n,t]))}const Ai={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}},ut="mtlr-gc-full-geom",Wi="mtlr-gc-full-geom-fill",zi="mtlr-gc-full-geom-line";function Bi(n,e,t=!0,i=!0,r={},o={},u=Ai,s=!1){let c;const l=[];let d,a,f;function g(){if(!n.loaded){n.once("load",g);return}const h=u?u===!0?Ai:u:void 0;if(!(h!=null&&h.fill)&&!(h!=null&&h.line))return;const m=n.getSource(ut);if(m)m.setData(f??Ve([]));else if(f)n.addSource(ut,{type:"geojson",data:f});else return;!n.getLayer(Wi)&&(h!=null&&h.fill)&&n.addLayer({...h==null?void 0:h.fill,id:Wi,type:"fill",source:ut}),!n.getLayer(zi)&&(h!=null&&h.line)&&n.addLayer({...h==null?void 0:h.line,id:zi,type:"line",source:ut})}function y(h){f=h,g()}n.on("styledata",()=>{setTimeout(()=>{f&&g()})});const w=h=>{c==null||c({type:"mapClick",coordinates:[h.lngLat.lng,h.lngLat.lat]})};function E(h=!1){if(!e)throw new Error;const m=document.createElement("div");return h&&m.classList.add("marker-interactive"),new Nn({props:{displayIn:"maplibre"},target:m}),new e.Marker({element:m,offset:[1,-13]})}return{setEventHandler(h){h?(c=h,n.on("click",w)):(c=void 0,n.off("click",w))},flyTo(h,m){n.flyTo({center:h,...m?{zoom:m}:{},...r})},fitBounds(h,m,b){n.fitBounds([[h[0],h[1]],[h[2],h[3]]],{padding:m,...b?{maxZoom:b}:{},...o})},indicateReverse(h){n.getCanvasContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){!e||!t||(a?h?a.setLngLat(h):(a.remove(),a=void 0):h&&(t instanceof Function?a=t(n)??void 0:(a=(typeof t=="object"?new e.Marker(t):E()).setLngLat(h).addTo(n),a.getElement().classList.add("marker-reverse"))))},setMarkers(h,m){for(const b of l)b.remove();if(l.length=0,y(void 0),!!e){if(m){let b=!1;if(m.geometry.type==="GeometryCollection"){const L=m.geometry.geometries.filter(M=>M.type==="Polygon"||M.type==="MultiPolygon");e:if(L.length>0){const M=Pi(Ve(L.map(S=>He(S))));if(!M)break e;Oi({...m,geometry:M.geometry},y),b=!0}else{const M=m.geometry.geometries.filter(S=>S.type==="LineString"||S.type==="MultiLineString");M.length>0&&(y({...m,geometry:{type:"GeometryCollection",geometries:M}}),b=!0)}}if(!b){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Oi(m,y);else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){y(m);return}}if(!s&&m.geometry.type!=="Point")return;if(t instanceof Function){const L=t(n,m);L&&l.push(L)}else t&&l.push(typeof t=="object"?new e.Marker(t):E().setLngLat(m.center).addTo(n))}if(i)for(const b of h??[]){if(b===m)continue;let L;if(i instanceof Function){if(L=i(n,b),!L)continue}else L=(typeof i=="object"?new e.Marker(i):E(!0)).setLngLat(b.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(b.place_type[0]==="reverse"?b.place_name:b.place_name.replace(/,.*/,""))).addTo(n);const M=L.getElement();M.addEventListener("click",S=>{S.stopPropagation(),c==null||c({type:"markerClick",id:b.id})}),M.addEventListener("mouseenter",()=>{c==null||c({type:"markerMouseEnter",id:b.id}),L.togglePopup()}),M.addEventListener("mouseleave",()=>{c==null||c({type:"markerMouseLeave",id:b.id}),L.togglePopup()}),l.push(L)}}},setSelectedMarker(h){d&&d.getElement().classList.toggle("marker-selected",!1),d=h>-1?l[h]:void 0,d==null||d.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=n.getCenter();return[n.getZoom(),h.lng,h.lat]}}}function Rr(n,e,t){var y,w;class i{constructor(h,m){ne(this,"type");ne(this,"target");this.type=m,this.target=h}}class r extends i{constructor(m,b){super(m,"select");ne(this,"feature");Object.assign(this,b)}}class o extends i{constructor(m,b){super(m,"featureslisted");ne(this,"features");this.features=b}}class u extends i{constructor(m,b){super(m,"featuresmarked");ne(this,"features");this.features=b}}class s extends i{constructor(m,b){super(m,"optionsvisibilitychange");ne(this,"optionsVisible");this.optionsVisible=b}}class c extends i{constructor(m,b){super(m,"pick");ne(this,"feature");this.feature=b}}class l extends i{constructor(m,b){super(m,"querychange");ne(this,"query");this.query=b}}class d extends i{constructor(m,b,L){super(m,"response");ne(this,"url");ne(this,"featureCollection");this.url=b,this.featureCollection=L}}class a extends i{constructor(m,b){super(m,"reversetoggle");ne(this,"reverse");this.reverse=b}}class f extends n{constructor(m={}){super();jt(this,y);jt(this,w);vt(this,w,m)}onAddInt(m){const b=document.createElement("div");b.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:L,showResultMarkers:M,flyTo:S,fullGeometryStyle:x,..._}=Y(this,w),C=typeof S=="boolean"?{}:S,B={mapController:Bi(m,e,L,M,C,C,x,_.pickedResultStyle==="full-geometry-including-polygon-center-marker"),flyTo:S===void 0?!0:!!S,apiKey:"",...t==null?void 0:t(m,b),..._};if(!B.apiKey)throw new Error("no apiKey provided");return vt(this,y,new $n({target:b,props:B})),Y(this,y).$on("select",N=>{this.fire(new r(this,N.detail))}),Y(this,y).$on("pick",N=>{this.fire(new c(this,N.detail.feature))}),Y(this,y).$on("featureslisted",N=>{this.fire(new o(this,N.detail.features))}),Y(this,y).$on("featuresmarked",N=>{this.fire(new u(this,N.detail.features))}),Y(this,y).$on("response",N=>{this.fire(new d(this,N.detail.url,N.detail.featureCollection))}),Y(this,y).$on("optionsvisibilitychange",N=>{this.fire(new s(this,N.detail.optionsVisible))}),Y(this,y).$on("reversetoggle",N=>{this.fire(new a(this,N.detail.reverse))}),Y(this,y).$on("querychange",N=>{this.fire(new l(this,N.detail.query))}),b}on(m,b){return super.on(m,b)}once(m,b){return super.once(m,b)}off(m,b){return super.off(m,b)}listens(m){return super.listens(m)}setOptions(m){var _;vt(this,w,m);const{marker:b,showResultMarkers:L,flyTo:M,fullGeometryStyle:S,...x}=Y(this,w);(_=Y(this,y))==null||_.$set(x)}setQuery(m,b=!0){var L;(L=Y(this,y))==null||L.setQuery(m,b)}clearMap(){var m;(m=Y(this,y))==null||m.clearMap()}clearList(){var m;(m=Y(this,y))==null||m.clearList()}setReverseMode(m){var b;(b=Y(this,y))==null||b.$set({reverseActive:m})}focus(){var m;(m=Y(this,y))==null||m.focus()}blur(){var m;(m=Y(this,y))==null||m.blur()}onRemove(){var m;(m=Y(this,y))==null||m.$destroy()}}return y=new WeakMap,w=new WeakMap,{MapLibreBasedGeocodingControl:f,events:{SelectEvent:r,FeaturesListedEvent:o,FeaturesMarkedEvent:u,OptionsVisibilityChangeEvent:s,PickEvent:c,QueryChangeEvent:l,ResponseEvent:d,ReverseToggleEvent:a}}}const{MapLibreBasedGeocodingControl:Pr,events:Ce}=Rr(Fe.Evented,Fe,(n,e)=>{const t={};if(!("getSdkConfig"in n&&typeof n.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:i,apiKey:r}=n.getSdkConfig();t.apiKey=r;const o=/^([a-z]{2})($|_|-)/.exec(i);return o&&(t.language=o[1]),e.className+=" maptiler-ctrl",t});class Ir extends Pr{onAdd(e){return super.onAddInt(e)}}const Or=Ce.SelectEvent,Ar=Ce.FeaturesListedEvent,Wr=Ce.FeaturesMarkedEvent,zr=Ce.OptionsVisibilityChangeEvent,Br=Ce.PickEvent,Dr=Ce.QueryChangeEvent,Ur=Ce.ResponseEvent,Fr=Ce.ReverseToggleEvent;T.FeaturesListedEvent=Ar,T.FeaturesMarkedEvent=Wr,T.GeocodingControl=Ir,T.OptionsVisibilityChangeEvent=zr,T.PickEvent=Br,T.QueryChangeEvent=Dr,T.ResponseEvent=Ur,T.ReverseToggleEvent=Fr,T.SelectEvent=Or,T.createMapLibreGlMapController=Bi,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
21
+ ***************************************************************************** */function Xn(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,u;return u={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function o(l){return function(d){return c([l,d])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,r=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(d){l=[6,d],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Se=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function Jn(n,e){return n>e?1:n<e?-1:0}function xe(n,e,t){for(var i=new Se(null,null),r=i,s=i;;){var u=t(n,e.key);if(u<0){if(e.left===null)break;if(t(n,e.left.key)<0){var o=e.left;if(e.left=o.right,o.right=e,e=o,e.left===null)break}s.left=e,s=e,e=e.left}else if(u>0){if(e.right===null)break;if(t(n,e.right.key)>0){var o=e.right;if(e.right=o.left,o.left=e,e=o,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,s.left=e.right,e.left=i.right,e.right=i.left,e}function Et(n,e,t,i){var r=new Se(n,e);if(t===null)return r.left=r.right=null,r;t=xe(n,t,i);var s=i(n,t.key);return s<0?(r.left=t.left,r.right=t,t.left=null):s>=0&&(r.right=t.right,r.left=t,t.right=null),r}function hi(n,e,t){var i=null,r=null;if(e){e=xe(n,e,t);var s=t(e.key,n);s===0?(i=e.left,r=e.right):s<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function $n(n,e,t){return e===null?n:(n===null||(e=xe(n.key,e,t),e.left=n),e)}function _t(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
22
+ `);var s=e+(t?" ":"│ ");n.left&&_t(n.left,s,!1,i,r),n.right&&_t(n.right,s,!0,i,r)}}var wt=function(){function n(e){e===void 0&&(e=Jn),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Et(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new Se(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,s=xe(e,this._root,r),u=r(e,s.key);return u===0?this._root=s:(u<0?(i.left=s.left,i.right=s,s.left=null):u>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=xe(e,t,i);var s=i(e,t.key);return s===0?(t.left===null?r=t.right:(r=xe(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=xe(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=xe(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],s=!1;!s;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):s=!0;return this},n.prototype.range=function(e,t,i,r){for(var s=[],u=this._comparator,o=this._root,c;s.length!==0||o;)if(o)s.push(o),o=o.left;else{if(o=s.pop(),c=u(o.key,t),c>0)break;if(u(o.key,e)>=0&&i.call(r,o))return this;o=o.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,s=[];!i;)if(t)s.push(t),t=t.left;else if(s.length>0){if(t=s.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var s=r(e.key,t.key);if(s===0)break;s<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var s=r(e.key,t.key);if(s===0)break;s<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return tr(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,s=this._comparator;if(i&&xt(e,t,0,r-1,s),this._root===null)this._root=Lt(e,t,0,r),this._size=r;else{var u=ir(this.toList(),er(e,t),s);r=this._size+r,this._root=St({head:u},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return _t(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,s=hi(e,this._root,r),u=s.left,o=s.right;r(e,t)<0?o=Et(t,i,o,r):u=Et(t,i,u,r),this._root=$n(u,o,r)},n.prototype.split=function(e){return hi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return Xn(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Lt(n,e,t,i){var r=i-t;if(r>0){var s=t+Math.floor(r/2),u=n[s],o=e[s],c=new Se(u,o);return c.left=Lt(n,e,t,s),c.right=Lt(n,e,s+1,i),c}return null}function er(n,e){for(var t=new Se(null,null),i=t,r=0;r<n.length;r++)i=i.next=new Se(n[r],e[r]);return i.next=null,t.next}function tr(n){for(var e=n,t=[],i=!1,r=new Se(null,null),s=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=s=s.next=t.pop(),e=e.right):i=!0;return s.next=null,r.next}function St(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),s=St(n,e,r),u=n.head;return u.left=s,n.head=n.head.next,u.right=St(n,r+1,t),u}return null}function ir(n,e,t){for(var i=new Se(null,null),r=i,s=n,u=e;s!==null&&u!==null;)t(s.key,u.key)<0?(r.next=s,s=s.next):(r.next=u,u=u.next),r=r.next;return s!==null?r.next=s:u!==null&&(r.next=u),i.next}function xt(n,e,t,i,r){if(!(t>=i)){for(var s=n[t+i>>1],u=t-1,o=i+1;;){do u++;while(r(n[u],s)<0);do o--;while(r(n[o],s)>0);if(u>=o)break;var c=n[u];n[u]=n[o],n[o]=c,c=e[u],e[u]=e[o],e[o]=c}xt(n,e,t,o,r),xt(n,e,o+1,i,r)}}const pe=11102230246251565e-32,ee=134217729,nr=(3+8*pe)*pe;function Mt(n,e,t,i,r){let s,u,o,c,l=e[0],d=i[0],a=0,f=0;d>l==d>-l?(s=l,l=e[++a]):(s=d,d=i[++f]);let h=0;if(a<n&&f<t)for(d>l==d>-l?(u=l+s,o=s-(u-l),l=e[++a]):(u=d+s,o=s-(u-d),d=i[++f]),s=u,o!==0&&(r[h++]=o);a<n&&f<t;)d>l==d>-l?(u=s+l,c=u-s,o=s-(u-c)+(l-c),l=e[++a]):(u=s+d,c=u-s,o=s-(u-c)+(d-c),d=i[++f]),s=u,o!==0&&(r[h++]=o);for(;a<n;)u=s+l,c=u-s,o=s-(u-c)+(l-c),l=e[++a],s=u,o!==0&&(r[h++]=o);for(;f<t;)u=s+d,c=u-s,o=s-(u-c)+(d-c),d=i[++f],s=u,o!==0&&(r[h++]=o);return(s!==0||h===0)&&(r[h++]=s),h}function rr(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function He(n){return new Float64Array(n)}const sr=(3+16*pe)*pe,or=(2+12*pe)*pe,lr=(9+64*pe)*pe*pe,We=He(4),gi=He(8),mi=He(12),yi=He(16),ie=He(4);function ur(n,e,t,i,r,s,u){let o,c,l,d,a,f,h,v,_,S,E,y,g,p,M,L,x,w;const k=n-r,T=t-r,z=e-s,D=i-s;p=k*D,f=ee*k,h=f-(f-k),v=k-h,f=ee*D,_=f-(f-D),S=D-_,M=v*S-(p-h*_-v*_-h*S),L=z*T,f=ee*z,h=f-(f-z),v=z-h,f=ee*T,_=f-(f-T),S=T-_,x=v*S-(L-h*_-v*_-h*S),E=M-x,a=M-E,We[0]=M-(E+a)+(a-x),y=p+E,a=y-p,g=p-(y-a)+(E-a),E=g-L,a=g-E,We[1]=g-(E+a)+(a-L),w=y+E,a=w-y,We[2]=y-(w-a)+(E-a),We[3]=w;let N=rr(4,We),C=or*u;if(N>=C||-N>=C||(a=n-k,o=n-(k+a)+(a-r),a=t-T,l=t-(T+a)+(a-r),a=e-z,c=e-(z+a)+(a-s),a=i-D,d=i-(D+a)+(a-s),o===0&&c===0&&l===0&&d===0)||(C=lr*u+nr*Math.abs(N),N+=k*d+D*o-(z*l+T*c),N>=C||-N>=C))return N;p=o*D,f=ee*o,h=f-(f-o),v=o-h,f=ee*D,_=f-(f-D),S=D-_,M=v*S-(p-h*_-v*_-h*S),L=c*T,f=ee*c,h=f-(f-c),v=c-h,f=ee*T,_=f-(f-T),S=T-_,x=v*S-(L-h*_-v*_-h*S),E=M-x,a=M-E,ie[0]=M-(E+a)+(a-x),y=p+E,a=y-p,g=p-(y-a)+(E-a),E=g-L,a=g-E,ie[1]=g-(E+a)+(a-L),w=y+E,a=w-y,ie[2]=y-(w-a)+(E-a),ie[3]=w;const q=Mt(4,We,4,ie,gi);p=k*d,f=ee*k,h=f-(f-k),v=k-h,f=ee*d,_=f-(f-d),S=d-_,M=v*S-(p-h*_-v*_-h*S),L=z*l,f=ee*z,h=f-(f-z),v=z-h,f=ee*l,_=f-(f-l),S=l-_,x=v*S-(L-h*_-v*_-h*S),E=M-x,a=M-E,ie[0]=M-(E+a)+(a-x),y=p+E,a=y-p,g=p-(y-a)+(E-a),E=g-L,a=g-E,ie[1]=g-(E+a)+(a-L),w=y+E,a=w-y,ie[2]=y-(w-a)+(E-a),ie[3]=w;const se=Mt(q,gi,4,ie,mi);p=o*d,f=ee*o,h=f-(f-o),v=o-h,f=ee*d,_=f-(f-d),S=d-_,M=v*S-(p-h*_-v*_-h*S),L=c*l,f=ee*c,h=f-(f-c),v=c-h,f=ee*l,_=f-(f-l),S=l-_,x=v*S-(L-h*_-v*_-h*S),E=M-x,a=M-E,ie[0]=M-(E+a)+(a-x),y=p+E,a=y-p,g=p-(y-a)+(E-a),E=g-L,a=g-E,ie[1]=g-(E+a)+(a-L),w=y+E,a=w-y,ie[2]=y-(w-a)+(E-a),ie[3]=w;const fe=Mt(se,mi,4,ie,yi);return yi[fe-1]}function ar(n,e,t,i,r,s){const u=(e-s)*(t-r),o=(n-r)*(i-s),c=u-o,l=Math.abs(u+o);return Math.abs(c)>=sr*l?c:-ur(n,e,t,i,r,s,l)}const Ve=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,kt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,s=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:s}}};let Me=Number.EPSILON;Me===void 0&&(Me=Math.pow(2,-52));const cr=Me*Me,vi=(n,e)=>{if(-Me<n&&n<Me&&-Me<e&&e<Me)return 0;const t=n-e;return t*t<cr*n*e?0:n<e?-1:1};class fr{constructor(){this.reset()}reset(){this.xRounder=new pi,this.yRounder=new pi}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class pi{constructor(){this.tree=new wt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&vi(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&vi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ye=new fr,it=(n,e)=>n.x*e.y-n.y*e.x,bi=(n,e)=>n.x*e.x+n.y*e.y,Ei=(n,e,t)=>{const i=ar(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},nt=n=>Math.sqrt(bi(n,n)),dr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return it(r,i)/nt(r)/nt(i)},hr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return bi(r,i)/nt(r)/nt(i)},_i=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},wi=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},gr=(n,e,t,i)=>{if(e.x===0)return wi(t,i,n.x);if(i.x===0)return wi(n,e,t.x);if(e.y===0)return _i(t,i,n.y);if(i.y===0)return _i(n,e,t.y);const r=it(e,i);if(r==0)return null;const s={x:t.x-n.x,y:t.y-n.y},u=it(s,e)/r,o=it(s,i)/r,c=n.x+o*e.x,l=t.x+u*i.x,d=n.y+o*e.y,a=t.y+u*i.y,f=(c+l)/2,h=(d+a)/2;return{x:f,y:h}};class ue{static compare(e,t){const i=ue.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const s=this.point.events[r];s.consumedBy===void 0&&i.otherSE.point.events===s.otherSE.point.events&&i.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,i=r=>{const s=r.otherSE;t.set(r,{sine:dr(this.point,e.point,s.point),cosine:hr(this.point,e.point,s.point)})};return(r,s)=>{t.has(r)||i(r),t.has(s)||i(s);const{sine:u,cosine:o}=t.get(r),{sine:c,cosine:l}=t.get(s);return u>=0&&c>=0?o<l?1:o>l?-1:0:u<0&&c<0?o<l?-1:o>l?1:0:c<u?-1:c>u?1:0}}}let mr=0;class ke{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,s=e.rightSE.point.x,u=t.rightSE.point.x;if(u<i)return 1;if(s<r)return-1;const o=e.leftSE.point.y,c=t.leftSE.point.y,l=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<o&&c<l)return 1;if(c>o&&c>l)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(i>r){if(o<c&&o<d)return-1;if(o>c&&o>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(o<c)return-1;if(o>c)return 1;if(s<u){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(s>u){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(s!==u){const a=l-o,f=s-i,h=d-c,v=u-r;if(a>f&&h<v)return 1;if(a<f&&h>v)return-1}return s>u?1:s<u||l<d?-1:l>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++mr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,s,u;const o=ue.comparePoints(e,t);if(o<0)r=e,s=t,u=1;else if(o>0)r=t,s=e,u=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new ue(r,!0),l=new ue(s,!1);return new ke(c,l,[i],[u])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(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}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const s=(e.y-t.y)/r.y,u=t.x+s*r.x;if(e.x===u)return 0;const o=(e.x-t.x)/r.x,c=t.y+o*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=kt(t,i);if(r===null)return null;const s=this.leftSE.point,u=this.rightSE.point,o=e.leftSE.point,c=e.rightSE.point,l=Ve(t,o)&&this.comparePoint(o)===0,d=Ve(i,s)&&e.comparePoint(s)===0,a=Ve(t,c)&&this.comparePoint(c)===0,f=Ve(i,u)&&e.comparePoint(u)===0;if(d&&l)return f&&!a?u:!f&&a?c:null;if(d)return a&&s.x===c.x&&s.y===c.y?null:s;if(l)return f&&u.x===o.x&&u.y===o.y?null:o;if(f&&a)return null;if(f)return u;if(a)return c;const h=gr(s,this.vector(),o,e.vector());return h===null||!Ve(r,h)?null:Ye.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new ue(e,!0),s=new ue(e,!1),u=this.rightSE;this.replaceRightSE(s),t.push(s),t.push(r);const o=new ke(r,u,this.rings.slice(),this.windings.slice());return ue.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),ue.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),s.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=ke.compare(t,i);if(r!==0){if(r>0){const s=t;t=i,i=s}if(t.prev===i){const s=t;t=i,i=s}for(let s=0,u=i.rings.length;s<u;s++){const o=i.rings[s],c=i.windings[s],l=t.rings.indexOf(o);l===-1?(t.rings.push(o),t.windings.push(c)):t.windings[l]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){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)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let o=0,c=this.rings.length;o<c;o++){const l=this.rings[o],d=this.windings[o],a=t.indexOf(l);a===-1?(t.push(l),i.push(d)):i[a]+=d}const s=[],u=[];for(let o=0,c=t.length;o<c;o++){if(i[o]===0)continue;const l=t[o],d=l.poly;if(u.indexOf(d)===-1)if(l.isExterior)s.push(d);else{u.indexOf(d)===-1&&u.push(d);const a=s.indexOf(l.poly);a!==-1&&s.splice(a,1)}}for(let o=0,c=s.length;o<c;o++){const l=s[o].multiPoly;r.indexOf(l)===-1&&r.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ce.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===ce.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${ce.type}`)}return this._isInResult}}class Li{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ye.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let s=r;for(let u=1,o=e.length;u<o;u++){if(typeof e[u][0]!="number"||typeof e[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ye.round(e[u][0],e[u][1]);c.x===s.x&&c.y===s.y||(this.segments.push(ke.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(r.x!==s.x||r.y!==s.y)&&this.segments.push(ke.fromRing(s,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class yr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Li(e[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(let i=1,r=e.length;i<r;i++){const s=new Li(e[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let s=0,u=r.length;s<u;s++)e.push(r[s])}return e}}class Si{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const s=new yr(e[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let s=0,u=r.length;s<u;s++)e.push(r[s])}return e}}class rt{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];if(!s.isInResult()||s.ringOut)continue;let u=null,o=s.leftSE,c=s.rightSE;const l=[o],d=o.point,a=[];for(;u=o,o=c,l.push(o),o.point!==d;)for(;;){const f=o.getAvailableLinkedEvents();if(f.length===0){const _=l[0].point,S=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${_.x}, ${_.y}]. Last matching segment found ends at [${S.x}, ${S.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let _=0,S=a.length;_<S;_++)if(a[_].point===o.point){h=_;break}if(h!==null){const _=a.splice(h)[0],S=l.splice(_.index);S.unshift(S[0].otherSE),t.push(new rt(S.reverse()));continue}a.push({index:l.length,point:o.point});const v=o.getLeftmostComparator(u);c=f.sort(v)[0].otherSE;break}t.push(new rt(l))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,d=this.events.length-1;l<d;l++){const a=this.events[l].point,f=this.events[l+1].point;Ei(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];Ei(i,e,r)===0&&t.shift(),t.push(t[0]);const s=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:t.length-1,o=this.isExteriorRing()?t.length:-1,c=[];for(let l=u;l!=o;l+=s)c.push([t[l].x,t[l].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,s=this.events.length;r<s;r++){const u=this.events[r];ue.compare(e,u)>0&&(e=u)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class xi{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class vr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const s=e[i];if(!s.poly)if(s.isExteriorRing())t.push(new xi(s));else{const u=s.enclosingRing();u.poly||t.push(new xi(u)),u.poly.addInterior(s)}}return t}}class pr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new wt(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let s=r,u=r,o,c;for(;o===void 0;)s=this.tree.prev(s),s===null?o=null:s.key.consumedBy===void 0&&(o=s.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(e.isLeft){let l=null;if(o){const a=o.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(l=a),!o.isAnEndpoint(a))){const f=this._splitSafely(o,a);for(let h=0,v=f.length;h<v;h++)i.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,v=f.length;h<v;h++)i.push(f[h])}}if(l!==null||d!==null){let a=null;l===null?a=d:d===null?a=l:a=ue.comparePoints(l,d)<=0?l:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let h=0,v=f.length;h<v;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=o)}else{if(o&&c){const l=o.getIntersection(c);if(l!==null){if(!o.isAnEndpoint(l)){const d=this._splitSafely(o,l);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(l)){const d=this._splitSafely(c,l);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const Mi=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,br=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Er{run(e,t,i){ce.type=e,Ye.reset();const r=[new Si(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new Si(i[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)kt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let v=a+1,_=r.length;v<_;v++)if(kt(h.bbox,r[v].bbox)===null)return[]}const s=new wt(ue.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let v=0,_=h.length;v<_;v++)if(s.insert(h[v]),s.size>Mi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new pr(s);let o=s.size,c=s.pop();for(;c;){const a=c.key;if(s.size===o){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(s.size>Mi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>br)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=u.process(a);for(let h=0,v=f.length;h<v;h++){const _=f[h];_.consumedBy===void 0&&s.insert(_)}o=s.size,c=s.pop()}Ye.reset();const l=rt.factory(u.segments);return new vr(l).getGeom()}}const ce=new Er;var ki={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ce.run("difference",n,t)}};function Ci(n,e,t){if(n!==null)for(var i,r,s,u,o,c,l,d=0,a=0,f,h=n.type,v=h==="FeatureCollection",_=h==="Feature",S=v?n.features.length:1,E=0;E<S;E++){l=v?n.features[E].geometry:_?n.geometry:n,f=l?l.type==="GeometryCollection":!1,o=f?l.geometries.length:1;for(var y=0;y<o;y++){var g=0,p=0;if(u=f?l.geometries[y]:l,u!==null){c=u.coordinates;var M=u.type;switch(d=0,M){case null:break;case"Point":if(e(c,a,E,g,p)===!1)return!1;a++,g++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,E,g,p)===!1)return!1;a++,M==="MultiPoint"&&g++}M==="LineString"&&g++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-d;r++){if(e(c[i][r],a,E,g,p)===!1)return!1;a++}M==="MultiLineString"&&g++,M==="Polygon"&&p++}M==="Polygon"&&g++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(p=0,r=0;r<c[i].length;r++){for(s=0;s<c[i][r].length-d;s++){if(e(c[i][r][s],a,E,g,p)===!1)return!1;a++}p++}g++}break;case"GeometryCollection":for(i=0;i<u.geometries.length;i++)if(Ci(u.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ct(n,e){var t,i,r,s,u,o,c,l,d,a,f=0,h=n.type==="FeatureCollection",v=n.type==="Feature",_=h?n.features.length:1;for(t=0;t<_;t++){for(o=h?n.features[t].geometry:v?n.geometry:n,l=h?n.features[t].properties:v?n.properties:{},d=h?n.features[t].bbox:v?n.bbox:void 0,a=h?n.features[t].id:v?n.id:void 0,c=o?o.type==="GeometryCollection":!1,u=c?o.geometries.length:1,r=0;r<u;r++){if(s=c?o.geometries[r]:o,s===null){if(e(null,f,l,d,a)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,f,l,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<s.geometries.length;i++)if(e(s.geometries[i],f,l,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function _r(n,e){Ct(n,function(t,i,r,s,u){var o=t===null?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(Qe(t,r,{bbox:s,id:u}),i,0)===!1?!1:void 0}var c;switch(o){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var d=t.coordinates[l],a={type:c,coordinates:d};if(e(Qe(a,r),i,l)===!1)return!1}})}function wr(n,e={}){const t=[];if(Ct(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=ki.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?bt(i[0],e.properties):di(i,e.properties)}var Ni=wr;function Lr(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ci(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var Ri=Lr;function Sr(n){const e=[];if(Ct(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=ki.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?bt(i[0],t):di(i,t)}var xr=Sr;function Mr(n){if(!n)throw new Error("geojson is required");var e=[];return _r(n,function(t){e.push(t)}),Ze(e)}var kr=Mr;function Ti(n,e){const t=xr(Ze([bt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=tt(Ri(n)),r=(i[2]-i[0])/360/1e3,s=i[0]<-180,u=i[2]>180,o=kr(n);if(o.features.length>1&&(s||u))for(const c of o.features){const l=tt(Ri(c));if(u&&l[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(s&&l[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ze([o.features.length<2?n:Ni(o)??n,t]))}const Pi={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}},st="mtlr-gc-full-geom",Ii="mtlr-gc-full-geom-fill",Oi="mtlr-gc-full-geom-line";function Ai(n,e,t=!0,i=!0,r={},s={},u=Pi,o=!1){let c;const l=[];let d,a,f,h=o;function v(){if(!n.loaded){n.once("load",v);return}const y=u?u===!0?Pi:u:void 0;if(!(y!=null&&y.fill)&&!(y!=null&&y.line))return;const g=n.getSource(st);if(g)g.setData(f??Ze([]));else if(f)n.addSource(st,{type:"geojson",data:f});else return;!n.getLayer(Ii)&&(y!=null&&y.fill)&&n.addLayer({...y==null?void 0:y.fill,id:Ii,type:"fill",source:st}),!n.getLayer(Oi)&&(y!=null&&y.line)&&n.addLayer({...y==null?void 0:y.line,id:Oi,type:"line",source:st})}function _(y){f=y,v()}n.on("styledata",()=>{setTimeout(()=>{f&&v()})});const S=y=>{c==null||c({type:"mapClick",coordinates:[y.lngLat.lng,y.lngLat.lat]})};function E(y=!1){if(!e)throw new Error;const g=document.createElement("div");return y&&g.classList.add("marker-interactive"),new Mn({props:{displayIn:"maplibre"},target:g}),new e.Marker({element:g,offset:[1,-13]})}return{setEventHandler(y){y?(c=y,n.on("click",S)):(c=void 0,n.off("click",S))},flyTo(y,g){n.flyTo({center:y,...g?{zoom:g}:{},...r})},fitBounds(y,g,p){n.fitBounds([[y[0],y[1]],[y[2],y[3]]],{padding:g,...p?{maxZoom:p}:{},...s})},indicateReverse(y){n.getCanvasContainer().style.cursor=y?"crosshair":""},setReverseMarker(y){!e||!t||(a?y?a.setLngLat(y):(a.remove(),a=void 0):y&&(t instanceof Function?a=t(n)??void 0:(a=(typeof t=="object"?new e.Marker(t):E()).setLngLat(y).addTo(n),a.getElement().classList.add("marker-reverse"))))},setMarkers(y,g){for(const p of l)p.remove();if(l.length=0,_(void 0),!!e){if(g){let p=!1;if(g.geometry.type==="GeometryCollection"){const M=g.geometry.geometries.filter(L=>L.type==="Polygon"||L.type==="MultiPolygon");e:if(M.length>0){const L=Ni(Ze(M.map(x=>Qe(x))));if(!L)break e;Ti({...g,geometry:L.geometry},_),p=!0}else{const L=g.geometry.geometries.filter(x=>x.type==="LineString"||x.type==="MultiLineString");L.length>0&&(_({...g,geometry:{type:"GeometryCollection",geometries:L}}),p=!0)}}if(!p){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")Ti(g,_);else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){_(g);return}}if(!h&&g.geometry.type!=="Point")return;if(t instanceof Function){const M=t(n,g);M&&l.push(M)}else t&&l.push(typeof t=="object"?new e.Marker(t):E().setLngLat(g.center).addTo(n))}if(i)for(const p of y??[]){if(p===g)continue;let M;if(i instanceof Function){if(M=i(n,p),!M)continue}else M=(typeof i=="object"?new e.Marker(i):E(!0)).setLngLat(p.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(p.place_type[0]==="reverse"?p.place_name:p.place_name.replace(/,.*/,""))).addTo(n);const L=M.getElement();L.addEventListener("click",x=>{x.stopPropagation(),c==null||c({type:"markerClick",id:p.id})}),L.addEventListener("mouseenter",()=>{c==null||c({type:"markerMouseEnter",id:p.id}),M.togglePopup()}),L.addEventListener("mouseleave",()=>{c==null||c({type:"markerMouseLeave",id:p.id}),M.togglePopup()}),l.push(M)}}},setSelectedMarker(y){d&&d.getElement().classList.toggle("marker-selected",!1),d=y>-1?l[y]:void 0,d==null||d.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const y=n.getCenter();return[n.getZoom(),y.lng,y.lat]},setShowPolygonMarker(y){h=y}}}function Cr(n,e,t){var v,_,S;class i{constructor(y,g){ne(this,"type");ne(this,"target");this.type=g,this.target=y}}class r extends i{constructor(g,p){super(g,"select");ne(this,"feature");Object.assign(this,p)}}class s extends i{constructor(g,p){super(g,"featureslisted");ne(this,"features");this.features=p}}class u extends i{constructor(g,p){super(g,"featuresmarked");ne(this,"features");this.features=p}}class o extends i{constructor(g,p){super(g,"optionsvisibilitychange");ne(this,"optionsVisible");this.optionsVisible=p}}class c extends i{constructor(g,p){super(g,"pick");ne(this,"feature");this.feature=p}}class l extends i{constructor(g,p){super(g,"querychange");ne(this,"query");this.query=p}}class d extends i{constructor(g,p,M){super(g,"response");ne(this,"url");ne(this,"featureCollection");this.url=p,this.featureCollection=M}}class a extends i{constructor(g,p){super(g,"reversetoggle");ne(this,"reverse");this.reverse=p}}class f extends n{constructor(g={}){super();dt(this,v);dt(this,_);dt(this,S);ht(this,_,g)}onAddInt(g){const p=document.createElement("div");p.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:M,showResultMarkers:L,flyTo:x,fullGeometryStyle:w,...k}=Z(this,_),T=typeof x=="boolean"?{}:x,z=Ai(g,e,M,L,T,T,w,k.pickedResultStyle==="full-geometry-including-polygon-center-marker");ht(this,S,z);const D={mapController:z,flyTo:x===void 0?!0:!!x,apiKey:"",...t==null?void 0:t(g,p),...k};if(!D.apiKey)throw new Error("no apiKey provided");return ht(this,v,new Kn({target:p,props:D})),Z(this,v).$on("select",N=>{this.fire(new r(this,N.detail))}),Z(this,v).$on("pick",N=>{this.fire(new c(this,N.detail.feature))}),Z(this,v).$on("featureslisted",N=>{this.fire(new s(this,N.detail.features))}),Z(this,v).$on("featuresmarked",N=>{this.fire(new u(this,N.detail.features))}),Z(this,v).$on("response",N=>{this.fire(new d(this,N.detail.url,N.detail.featureCollection))}),Z(this,v).$on("optionsvisibilitychange",N=>{this.fire(new o(this,N.detail.optionsVisible))}),Z(this,v).$on("reversetoggle",N=>{this.fire(new a(this,N.detail.reverse))}),Z(this,v).$on("querychange",N=>{this.fire(new l(this,N.detail.query))}),p}on(g,p){return super.on(g,p)}once(g,p){return super.once(g,p)}off(g,p){return super.off(g,p)}listens(g){return super.listens(g)}setOptions(g){var k,T;Object.assign(Z(this,_),g);const{marker:p,showResultMarkers:M,flyTo:L,fullGeometryStyle:x,...w}=Z(this,_);(k=Z(this,v))==null||k.$set(w),(T=Z(this,S))==null||T.setShowPolygonMarker(Z(this,_).pickedResultStyle==="full-geometry-including-polygon-center-marker")}setQuery(g,p=!0){var M;(M=Z(this,v))==null||M.setQuery(g,p)}clearMap(){var g;(g=Z(this,v))==null||g.clearMap()}clearList(){var g;(g=Z(this,v))==null||g.clearList()}setReverseMode(g){var p;(p=Z(this,v))==null||p.$set({reverseActive:g})}focus(){var g;(g=Z(this,v))==null||g.focus()}blur(){var g;(g=Z(this,v))==null||g.blur()}onRemove(){var g;(g=Z(this,v))==null||g.$destroy()}}return v=new WeakMap,_=new WeakMap,S=new WeakMap,{MapLibreBasedGeocodingControl:f,events:{SelectEvent:r,FeaturesListedEvent:s,FeaturesMarkedEvent:u,OptionsVisibilityChangeEvent:o,PickEvent:c,QueryChangeEvent:l,ResponseEvent:d,ReverseToggleEvent:a}}}const{MapLibreBasedGeocodingControl:Nr,events:Ce}=Cr(De.Evented,De,(n,e)=>{const t={};if(!("getSdkConfig"in n&&typeof n.getSdkConfig=="function"))throw new Error("MapTiler SDK not detected");const{primaryLanguage:i,apiKey:r}=n.getSdkConfig();t.apiKey=r;const s=/^([a-z]{2})($|_|-)/.exec(i);return s&&(t.language=s[1]),e.className+=" maptiler-ctrl",t});class Rr extends Nr{onAdd(e){return super.onAddInt(e)}}const Tr=Ce.SelectEvent,Pr=Ce.FeaturesListedEvent,Ir=Ce.FeaturesMarkedEvent,Or=Ce.OptionsVisibilityChangeEvent,Ar=Ce.PickEvent,Wr=Ce.QueryChangeEvent,zr=Ce.ResponseEvent,Br=Ce.ReverseToggleEvent;R.FeaturesListedEvent=Pr,R.FeaturesMarkedEvent=Ir,R.GeocodingControl=Rr,R.OptionsVisibilityChangeEvent=Or,R.PickEvent=Ar,R.QueryChangeEvent=Wr,R.ResponseEvent=zr,R.ReverseToggleEvent=Br,R.SelectEvent=Tr,R.createMapLibreGlMapController=Ai,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
23
23
  //# sourceMappingURL=maptilersdk.umd.js.map