@maptiler/geocoding-control 1.4.2-dev.2 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MapLibreBasedGeocodingControl.d.ts +2971 -35
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +580 -569
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +3 -3
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +74 -16
- package/leaflet.js +1344 -1311
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +7 -7
- package/maplibregl-controller.js +683 -661
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +3 -3
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +1632 -1481
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1642 -1488
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +1 -1
- package/openlayers-controller.js +308 -306
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +3 -3
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +21 -0
- package/openlayers.js +1301 -1313
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +18 -18
- package/react.d.ts +4 -4
- package/react.js +663 -644
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte.d.ts +1 -1
- package/svelte/GeocodingControl.svelte +64 -33
- package/svelte/GeocodingControl.svelte.d.ts +25 -9
- package/svelte/MapLibreBasedGeocodingControl.d.ts +2971 -35
- package/svelte/MapLibreBasedGeocodingControl.js +166 -58
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +50 -24
- package/svelte/leaflet.d.ts +74 -16
- package/svelte/leaflet.js +25 -15
- package/svelte/maplibregl-controller.d.ts +7 -7
- package/svelte/maplibregl-controller.js +96 -66
- package/svelte/maplibregl.js +10 -7
- package/svelte/maptilersdk.js +23 -18
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +4 -1
- package/svelte/openlayers.d.ts +21 -0
- package/svelte/openlayers.js +30 -45
- package/svelte/react.d.ts +4 -4
- package/svelte/types.d.ts +38 -12
- package/svelte/vanilla.d.ts +14 -1
- package/svelte/vanilla.js +31 -8
- package/types.d.ts +38 -12
- package/vanilla.d.ts +14 -1
- package/vanilla.js +838 -791
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/maplibregl.d.ts +0 -16
- package/maptilersdk.d.ts +0 -11
- package/svelte/maplibregl.d.ts +0 -16
- package/svelte/maptilersdk.d.ts +0 -11
package/openlayers.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(k,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],F):(k=typeof globalThis<"u"?globalThis:k||self,F(k.openlayersMaptilerGeocoder={},k.ol.control,k.ol.events.Event,k.ol,k.ol.geom,k.ol.layer.Vector,k.ol.proj,k.ol.source.Vector,k.ol.style.Fill,k.ol.style.Icon,k.ol.style.Stroke,k.ol.style.Style,k.ol.style.Text))})(this,function(k,F,D,oe,se,Ki,_e,Ji,qt,$i,jt,en,tn){"use strict";var ao=Object.defineProperty;var Yi=k=>{throw TypeError(k)};var co=(k,F,D)=>F in k?ao(k,F,{enumerable:!0,configurable:!0,writable:!0,value:D}):k[F]=D;var ae=(k,F,D)=>co(k,typeof F!="symbol"?F+"":F,D),Xi=(k,F,D)=>F.has(k)||Yi("Cannot "+D);var de=(k,F,D)=>(Xi(k,F,"read from private field"),D?D.call(k):F.get(k)),zt=(k,F,D)=>F.has(k)?Yi("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(k):F.set(k,D),gt=(k,F,D,oe)=>(Xi(k,F,"write to private field"),oe?oe.call(k,D):F.set(k,D),D);var ue,Oe;function z(){}function nn(n,e){for(const t in e)n[t]=e[t];return n}function Vt(n){return n()}function Zt(){return Object.create(null)}function ye(n){n.forEach(Vt)}function Qt(n){return typeof n=="function"}function Pe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Je;function J(n,e){return n===e?!0:(Je||(Je=document.createElement("a")),Je.href=e,n===Je.href)}function rn(n){return Object.keys(n).length===0}function on(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?nn(t.ctx.slice(),n[1](i(e))):t.ctx}function sn(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=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function ln(n,e,t,i,r,o){if(r){const l=Ht(e,t,i,o);n.p(l,r)}}function un(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 Yt(n){return n??""}function R(n,e){n.appendChild(e)}function q(n,e,t){n.insertBefore(e,t||null)}function B(n){n.parentNode&&n.parentNode.removeChild(n)}function A(n){return document.createElement(n)}function ve(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ee(n){return document.createTextNode(n)}function ie(){return Ee(" ")}function an(){return Ee("")}function ee(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function cn(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 fn(n){return Array.from(n.childNodes)}function qe(n,e){e=""+e,n.data!==e&&(n.data=e)}function Xt(n,e){n.value=e??""}function Le(n,e,t){n.classList.toggle(e,!!t)}function dn(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let je;function Ve(n){je=n}function Kt(){if(!je)throw new Error("Function called outside component initialization");return je}function hn(n){Kt().$$.on_destroy.push(n)}function gn(){const n=Kt();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=dn(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function Jt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ae=[],mt=[];let Fe=[];const $t=[],mn=Promise.resolve();let yt=!1;function yn(){yt||(yt=!0,mn.then(ei))}function vt(n){Fe.push(n)}const pt=new Set;let De=0;function ei(){if(De!==0)return;const n=je;do{try{for(;De<Ae.length;){const e=Ae[De];De++,Ve(e),vn(e.$$)}}catch(e){throw Ae.length=0,De=0,e}for(Ve(null),Ae.length=0,De=0;mt.length;)mt.pop()();for(let e=0;e<Fe.length;e+=1){const t=Fe[e];pt.has(t)||(pt.add(t),t())}Fe.length=0}while(Ae.length);for(;$t.length;)$t.pop()();yt=!1,pt.clear(),Ve(n)}function vn(n){if(n.fragment!==null){n.update(),ye(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(vt)}}function pn(n){const e=[],t=[];Fe.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Fe=e}const $e=new Set;let Te;function et(){Te={r:0,c:[],p:Te}}function tt(){Te.r||ye(Te.c),Te=Te.p}function Q(n,e){n&&n.i&&($e.delete(n),n.i(e))}function K(n,e,t,i){if(n&&n.o){if($e.has(n))return;$e.add(n),Te.c.push(()=>{$e.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function ti(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function bn(n,e){K(n,1,1,()=>{e.delete(n.key)})}function wn(n,e,t,i,r,o,l,s,c,u,d,a){let f=n.length,h=o.length,m=f;const y={};for(;m--;)y[n[m].key]=m;const b=[],v=new Map,E=new Map,_=[];for(m=h;m--;){const L=a(r,o,m),w=t(L);let C=l.get(w);C?_.push(()=>C.p(L,e)):(C=u(w,L),C.c()),v.set(w,b[m]=C),w in y&&E.set(w,Math.abs(m-y[w]))}const x=new Set,N=new Set;function S(L){Q(L,1),L.m(s,d),l.set(L.key,L),d=L.first,h--}for(;f&&h;){const L=b[h-1],w=n[f-1],C=L.key,O=w.key;L===w?(d=L.first,f--,h--):v.has(O)?!l.has(C)||x.has(C)?S(L):N.has(O)?f--:E.get(C)>E.get(O)?(N.add(C),S(L)):(x.add(O),f--):(c(w,l),f--)}for(;f--;){const L=n[f];v.has(L.key)||c(L,l)}for(;h;)S(b[h-1]);return ye(_),b}function Se(n){n&&n.c()}function pe(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),vt(()=>{const o=n.$$.on_mount.map(Vt).filter(Qt);n.$$.on_destroy?n.$$.on_destroy.push(...o):ye(o),n.$$.on_mount=[]}),r.forEach(vt)}function be(n,e){const t=n.$$;t.fragment!==null&&(pn(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function _n(n,e){n.$$.dirty[0]===-1&&(Ae.push(n),yn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Re(n,e,t,i,r,o,l=null,s=[-1]){const c=je;Ve(n);const u=n.$$={fragment:null,ctx:[],props:o,update:z,not_equal:r,bound:Zt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Zt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let d=!1;if(u.ctx=t?t(n,e.props||{},(a,f,...h)=>{const m=h.length?h[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=m)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](m),d&&_n(n,a)),f}):[],u.update(),d=!0,ye(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const a=fn(e.target);u.fragment&&u.fragment.l(a),a.forEach(B)}else u.fragment&&u.fragment.c();e.intro&&Q(n.$$.fragment),pe(n,e.target,e.anchor),ei()}Ve(c)}class Ie{constructor(){ae(this,"$$");ae(this,"$$set")}$destroy(){be(this,1),this.$destroy=z}$on(e,t){if(!Qt(t))return z;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&&!rn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const En="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(En);function Ln(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:z,i:z,o:z,d(i){i&&B(e)}}}class ii extends Ie{constructor(e){super(),Re(this,e,null,Ln,Pe,{})}}function Sn(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:z,i:z,o:z,d(i){i&&B(e)}}}class ni extends Ie{constructor(e){super(),Re(this,e,null,Sn,Pe,{})}}function xn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"area.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Mn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function kn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"poi.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Cn(n){let e,t;return{c(){e=A("img"),J(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){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Nn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"street.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Pn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"road.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Tn(n){let e,t;return{c(){e=A("img"),J(e.src,t=n[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!J(e.src,t=i[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&B(e)}}}function Rn(n){let e,t,i,r;return{c(){e=A("img"),J(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[4]),p(e,"class","svelte-ltkwvy")},m(o,l){q(o,e,l),i||(r=ee(e,"error",n[14]),i=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4])},d(o){o&&B(e),i=!1,r()}}}function ri(n){let e,t;return{c(){e=A("span"),t=Ee(n[6]),p(e,"class","secondary svelte-ltkwvy")},m(i,r){q(i,e,r),R(e,t)},p(i,r){r&64&&qe(t,i[6])},d(i){i&&B(e)}}}function In(n){let e,t,i,r,o,l,s,c,u,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,f,h=n[2]==="always"||n[2]&&!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],m,y,b=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",v,E,_;function x(w,C){return C&1&&(t=null),C&1&&(i=null),C&1&&(r=null),C&1&&(o=null),w[5]?Rn:w[0].address?Tn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?Pn:(i==null&&(i=!!w[0].id.startsWith("address.")),i?Nn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?Cn:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?kn:w[7]?Mn:xn))))}let N=x(n,-1),S=N(n),L=h&&ri(n);return{c(){e=A("li"),S.c(),l=ie(),s=A("span"),c=A("span"),u=A("span"),a=Ee(d),f=ie(),L&&L.c(),m=ie(),y=A("span"),v=Ee(b),p(u,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(y,"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(w,C){q(w,e,C),S.m(e,null),R(e,l),R(e,s),R(s,c),R(c,u),R(u,a),R(c,f),L&&L.m(c,null),R(s,m),R(s,y),R(y,v),E||(_=[ee(e,"mouseenter",n[12]),ee(e,"focus",n[13])],E=!0)},p(w,[C]){N===(N=x(w,C))&&S?S.p(w,C):(S.d(1),S=N(w),S&&(S.c(),S.m(e,l))),C&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&qe(a,d),C&37&&(h=w[2]==="always"||w[2]&&!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?L?L.p(w,C):(L=ri(w),L.c(),L.m(c,null)):L&&(L.d(1),L=null),C&1&&b!==(b=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&qe(v,b),C&2&&p(e,"data-selected",w[1]),C&2&&Le(e,"selected",w[1])},i:z,o:z,d(w){w&&B(e),S.d(),L&&L.d(),E=!1,ye(_)}}}function On(n,e,t){var _;let i,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const d=(_=o.properties)==null?void 0:_.categories;let a,f,h=0,m=o.place_type[0]==="reverse";function y(){f&&c.add(f),t(10,h++,h)}function b(x){Jt.call(this,n,x)}function v(x){Jt.call(this,n,x)}const E=()=>y();return n.$$set=x=>{"feature"in x&&t(0,o=x.feature),"selected"in x&&t(1,l=x.selected),"showPlaceType"in x&&t(2,s=x.showPlaceType),"missingIconsCache"in x&&t(9,c=x.missingIconsCache),"iconsBaseUrl"in x&&t(3,u=x.iconsBaseUrl)},n.$$.update=()=>{var x,N,S,L;if(n.$$.dirty&3640)do t(11,i--,i),t(4,a=d==null?void 0:d[i]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((N=(x=o.properties)==null?void 0:x.categories)==null?void 0:N.join(", "))??((L=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,l,s,u,a,f,r,m,y,c,h,i,b,v,E]}class Wn extends Ie{constructor(e){super(),Re(this,e,On,In,Pe,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function An(n){let e;return{c(){e=A("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){q(t,e,i)},p:z,i:z,o:z,d(t){t&&B(e)}}}class Fn extends Ie{constructor(e){super(),Re(this,e,null,An,Pe,{})}}function Dn(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:z,i:z,o:z,d(i){i&&B(e)}}}class Bn extends Ie{constructor(e){super(),Re(this,e,null,Dn,Pe,{})}}function Un(n){let e,t,i;return{c(){e=ve("svg"),t=ve("circle"),i=ve("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){q(r,e,o),R(e,t),R(e,i)},p:z,i:z,o:z,d(r){r&&B(e)}}}class Gn extends Ie{constructor(e){super(),Re(this,e,null,Un,Pe,{})}}function zn(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 it(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 Ze;async function qn(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(Ze&&r.cachedLocationExpiry&&Ze.time+r.cachedLocationExpiry>Date.now()){if(!Ze.coords)break e;return Ze.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Ze={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 jn=/^(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,oi=/^([+-]?[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,})$/,si=/^(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,li=/^(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,ui=/^(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,ai=/^(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 Vn(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),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),d=Math.floor(o),a=(r-u)*60,f=(o-d)*60;if(n=="DM"){let h=ci(a,3).toFixed(3).padStart(6,"0"),m=ci(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&m.endsWith(".000")&&(h=h.replace(/\.000$/,""),m=m.replace(/\.000$/,"")),c=`${u}° ${h}' ${l}, ${d}° ${m}' ${s}`}if(n=="DMS"){const h=Math.floor(a),m=Math.floor(f);let y=((a-h)*60).toFixed(1).padStart(4,"0"),b=((f-m)*60).toFixed(1).padStart(4,"0");const v=h.toString().padStart(2,"0"),E=m.toString().padStart(2,"0");y.endsWith(".0")&&b.endsWith(".0")&&(y=y.replace(/\.0$/,""),b=b.replace(/\.0$/,"")),c=`${u}° ${v}' ${y}" ${l}, ${d}° ${E}' ${b}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function ci(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function bt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(jn.test(n))throw new Error("invalid coordinate value");if(oi.test(n))if(s=oi.exec(n),c=Qe(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),l="DM";else throw new Error("invalid coordinate format");else if(si.test(n))if(s=si.exec(n),c=Qe(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="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(li.test(n))if(s=li.exec(n),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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(ui.test(n))if(s=ui.exec(n),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="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(ai.test(n)){if(s=ai.exec(n),c=Qe(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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 u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,m=d.match(h);if(m==null){const v=Math.floor(n.length/2);a=d.substring(0,v).trim(),f=d.substring(v).trim()}else{let v;m.length%2==1?v=Math.floor(m.length/2):v=m.length/2-1;let E=0;if(v==0)E=d.indexOf(m[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let _=0,x=0;for(;_<=v;)E=d.indexOf(m[_],x),x=E+1,_++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const y=a.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");const b=f.split(".");if(b.length==2&&b[1]==0&&b[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:l,closeEnough:Zn,toCoordinateFormat:Vn})}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 o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=i.test(l)&&i.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||d)continue;return!1}}return!0}function fi(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function Zn(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 fi(this.decimalLatitude,Number(e[0]))&&fi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Qn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});bt.to=Qn;const Hn=[{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"}],Yn={decimalLatitude:40.123,decimalLongitude:-74.123},Xn=[{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}],Kn=[{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 Jn(){const n=[];return Hn.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...Yn})}),[...n,...Xn,...Kn]}const $n=Jn();bt.formats=$n.map(n=>n.verbatimCoordinates);const er=bt;function di(n,e,t){const i=n.slice();return i[83]=e[t],i[85]=t,i}function hi(n){let e,t;return e=new Fn({}),{c(){Se(e.$$.fragment)},m(i,r){pe(e,i,r),t=!0},i(i){t||(Q(e.$$.fragment,i),t=!0)},o(i){K(e.$$.fragment,i),t=!1},d(i){be(e,i)}}}function gi(n){let e,t,i,r,o;return t=new Bn({}),{c(){e=A("button"),Se(t.$$.fragment),p(e,"type","button"),p(e,"title",n[9]),p(e,"class","svelte-1uvos7g"),Le(e,"active",n[0])},m(l,s){q(l,e,s),pe(t,e,null),i=!0,r||(o=ee(e,"click",n[68]),r=!0)},p(l,s){(!i||s[0]&512)&&p(e,"title",l[9]),(!i||s[0]&1)&&Le(e,"active",l[0])},i(l){i||(Q(t.$$.fragment,l),i=!0)},o(l){K(t.$$.fragment,l),i=!1},d(l){l&&B(e),be(t),r=!1,o()}}}function tr(n){let e,t=[],i=new Map,r,o,l,s=ti(n[14]);const c=u=>u[83].id+(u[83].address?","+u[83].address:"");for(let u=0;u<s.length;u+=1){let d=di(n,s,u),a=c(d);i.set(a,t[u]=mi(a,d))}return{c(){e=A("ul");for(let u=0;u<t.length;u+=1)t[u].c();p(e,"class","svelte-1uvos7g")},m(u,d){q(u,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[ee(e,"mouseleave",n[72]),ee(e,"blur",n[73])],o=!0)},p(u,d){d[0]&17880064&&(s=ti(u[14]),et(),t=wn(t,d,c,1,u,s,i,e,bn,mi,null,di),tt())},i(u){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(u){for(let d=0;d<t.length;d+=1)K(t[d]);r=!1},d(u){u&&B(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,ye(l)}}}function ir(n){let e,t,i,r,o,l;return t=new ni({}),{c(){e=A("div"),Se(t.$$.fragment),i=ie(),r=A("div"),o=Ee(n[7]),p(r,"class","svelte-1uvos7g"),p(e,"class","no-results svelte-1uvos7g")},m(s,c){q(s,e,c),pe(t,e,null),R(e,i),R(e,r),R(r,o),l=!0},p(s,c){(!l||c[0]&128)&&qe(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){K(t.$$.fragment,s),l=!1},d(s){s&&B(e),be(t)}}}function nr(n){let e="",t;return{c(){t=Ee(e)},m(i,r){q(i,t,r)},p:z,i:z,o:z,d(i){i&&B(t)}}}function rr(n){let e,t,i,r,o,l,s,c,u,d,a;return t=new ni({}),c=new ii({}),{c(){e=A("div"),Se(t.$$.fragment),i=ie(),r=A("div"),o=Ee(n[6]),l=ie(),s=A("button"),Se(c.$$.fragment),p(r,"class","svelte-1uvos7g"),p(s,"class","svelte-1uvos7g"),p(e,"class","error svelte-1uvos7g")},m(f,h){q(f,e,h),pe(t,e,null),R(e,i),R(e,r),R(r,o),R(e,l),R(e,s),pe(c,s,null),u=!0,d||(a=ee(s,"click",n[69]),d=!0)},p(f,h){(!u||h[0]&64)&&qe(o,f[6])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){K(t.$$.fragment,f),K(c.$$.fragment,f),u=!1},d(f){f&&B(e),be(t),be(c),d=!1,a()}}}function mi(n,e){let t,i,r;function o(){return e[70](e[85])}function l(){return e[71](e[83])}return i=new Wn({props:{feature:e[83],showPlaceType:e[10],selected:e[15]===e[85],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",l),{key:n,first:null,c(){t=an(),Se(i.$$.fragment),this.first=t},m(s,c){q(s,t,c),pe(i,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[83]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[85]),c[0]&4096&&(u.iconsBaseUrl=e[12]),i.$set(u)},i(s){r||(Q(i.$$.fragment,s),r=!0)},o(s){K(i.$$.fragment,s),r=!1},d(s){s&&B(t),be(i,s)}}}function or(n){let e,t,i,r,o,l,s,c,u,d,a,f,h,m,y,b,v,E,_,x,N,S=!1;o=new Gn({}),a=new ii({});let L=n[19]&&hi(),w=n[5]===!0&&gi(n);const C=n[60].default,O=on(C,n,n[59],null),U=[rr,nr,ir,tr],j=[];function W(M,V){var ne,fe;return M[18]?0:M[16]?((ne=M[14])==null?void 0:ne.length)===0?2:M[16]&&((fe=M[14])!=null&&fe.length)?3:-1:1}return~(b=W(n))&&(v=j[b]=U[b](n)),{c(){e=ie(),t=A("form"),i=A("div"),r=A("button"),Se(o.$$.fragment),l=ie(),s=A("input"),c=ie(),u=A("div"),d=A("button"),Se(a.$$.fragment),f=ie(),L&&L.c(),h=ie(),w&&w.c(),m=ie(),O&&O.c(),y=ie(),v&&v.c(),p(r,"class","search-button svelte-1uvos7g"),p(r,"type","button"),p(s,"placeholder",n[8]),p(s,"aria-label",n[8]),p(s,"class","svelte-1uvos7g"),p(d,"type","button"),p(d,"title",n[3]),p(d,"class","svelte-1uvos7g"),p(u,"class","clear-button-container svelte-1uvos7g"),Le(u,"displayable",n[1]!==""),p(i,"class","input-group svelte-1uvos7g"),p(t,"tabindex","0"),p(t,"class",E=Yt(n[2])+" svelte-1uvos7g"),Le(t,"can-collapse",n[4]&&n[1]==="")},m(M,V){q(M,e,V),q(M,t,V),R(t,i),R(i,r),pe(o,r,null),R(i,l),R(i,s),n[62](s),Xt(s,n[1]),R(i,c),R(i,u),R(u,d),pe(a,d,null),R(u,f),L&&L.m(u,null),R(i,h),w&&w.m(i,null),R(i,m),O&&O.m(i,null),R(t,y),~b&&j[b].m(t,null),_=!0,x||(N=[ee(r,"click",n[61]),ee(s,"input",n[63]),ee(s,"focus",n[64]),ee(s,"blur",n[65]),ee(s,"keydown",n[22]),ee(s,"input",n[66]),ee(d,"click",n[67]),ee(t,"submit",cn(n[21]))],x=!0)},p(M,V){(!_||V[0]&256)&&p(s,"placeholder",M[8]),(!_||V[0]&256)&&p(s,"aria-label",M[8]),V[0]&2&&s.value!==M[1]&&Xt(s,M[1]),(!_||V[0]&8)&&p(d,"title",M[3]),M[19]?L?V[0]&524288&&Q(L,1):(L=hi(),L.c(),Q(L,1),L.m(u,null)):L&&(et(),K(L,1,1,()=>{L=null}),tt()),(!_||V[0]&2)&&Le(u,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,V),V[0]&32&&Q(w,1)):(w=gi(M),w.c(),Q(w,1),w.m(i,m)):w&&(et(),K(w,1,1,()=>{w=null}),tt()),O&&O.p&&(!_||V[1]&268435456)&&ln(O,C,M,M[59],_?sn(C,M[59],V,null):un(M[59]),null);let ne=b;b=W(M),b===ne?~b&&j[b].p(M,V):(v&&(et(),K(j[ne],1,1,()=>{j[ne]=null}),tt()),~b?(v=j[b],v?v.p(M,V):(v=j[b]=U[b](M),v.c()),Q(v,1),v.m(t,null)):v=null),(!_||V[0]&4&&E!==(E=Yt(M[2])+" svelte-1uvos7g"))&&p(t,"class",E),(!_||V[0]&22)&&Le(t,"can-collapse",M[4]&&M[1]==="")},i(M){_||(Q(S),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(L),Q(w),Q(O,M),Q(v),_=!0)},o(M){K(S),K(o.$$.fragment,M),K(a.$$.fragment,M),K(L),K(w),K(O,M),K(v),_=!1},d(M){M&&(B(e),B(t)),be(o),n[62](null),be(a),L&&L.d(),w&&w.d(),O&&O.d(M),~b&&j[b].d(),x=!1,ye(N)}}}function sr(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const l={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:u=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:m=200}=e,{enableReverse:y=!1}=e,{errorMessage:b="Something went wrong…"}=e,{filter:v=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:_=!0}=e,{language:x=void 0}=e,{limit:N=void 0}=e,{mapController:S=void 0}=e,{minLength:L=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:C="Search"}=e,{proximity:O=[{type:"server-geolocation"}]}=e,{reverseActive:U=y==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:V="ifNeeded"}=e,{showResultsWhileTyping:ne=!0}=e,{selectFirst:fe=!0}=e,{flyToSelected:Tt=!1}=e,{markerOnSelected:lt=!0}=e,{types:ut=void 0}=e,{excludeTypes:at=!1}=e,{zoom:Ue=l}=e,{maxZoom:ct=void 0}=e,{apiUrl:Rt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:It={}}=e,{iconsBaseUrl:Vi="https://cdn.maptiler.com/maptiler-geocoding-control/v1.4.2-dev.2/icons/"}=e,{adjustUrlQuery:Ot=()=>{}}=e;function zr(){he.focus()}function qr(){he.blur()}function Zi(g,Z=!0,X=!1){t(1,W=g),Z?(t(15,G=-1),Hi()):(Dt(!X,X),setTimeout(()=>{he.focus(),he.select()}))}function jr(){t(14,I=void 0),t(56,P=void 0),t(15,G=-1)}function Vr(){t(55,H=[]),t(56,P=void 0)}let Ge=!1,I,H,P,Qi="",he,G=-1,ge,ft=[],We,ze,dt,Wt;const Zr=new Set,Ne=gn();hn(()=>{S&&(S.setEventHandler(void 0),S.indicateReverse(!1),S.setSelectedMarker(-1),S.setMarkers(void 0,void 0))});function Hi(g){if(ze&&(clearTimeout(ze),ze=void 0),G>-1&&I)t(56,P=I[G]),t(1,W=P.place_type[0]==="reverse"?P.place_name:P.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(55,H=void 0),t(15,G=-1);else if(W){const Z=g||!At(W);Ft(W,{exact:!0}).then(()=>{t(55,H=I),t(56,P=void 0),Z&&Qr()}).catch(X=>t(18,ge=X))}}function At(g){try{return er(g,6)}catch{return!1}}async function Ft(g,{byId:Z=!1,exact:X=!1}={}){t(18,ge=void 0),We==null||We.abort();const re=new AbortController;t(19,We=re);try{const T=At(g),Y=new URLSearchParams;if(x!==void 0&&Y.set("language",Array.isArray(x)?x.join(","):x??""),ut&&Y.set("types",ut.join(",")),at&&Y.set("excludeTypes",String(at)),u&&Y.set("bbox",u.map(ht=>ht.toFixed(6)).join(",")),h&&Y.set("country",Array.isArray(h)?h.join(","):h),!Z&&!T){const ht=await qn(S,O,re);ht&&Y.set("proximity",ht),(X||!ne)&&Y.set("autocomplete","false"),Y.set("fuzzyMatch",String(_))}N!==void 0&&Y.set("limit",String(N)),Y.set("key",c),Ot(Y);const me=Rt+"/"+encodeURIComponent(T?T.decimalLongitude+","+T.decimalLatitude:g)+".json?"+Y.toString();if(me===Qi){Z?(t(14,I=void 0),t(56,P=ft[0])):t(14,I=ft);return}Qi=me;const Ut=await fetch(me,{signal:re.signal,...It});if(!Ut.ok)throw new Error(await Ut.text());const Gt=await Ut.json();Ne("response",{url:me,featureCollection:Gt}),Z?(t(14,I=void 0),t(56,P=Gt.features[0]),ft=[P]):(t(14,I=Gt.features.filter(v)),T&&I.unshift({type:"Feature",properties:{},id:"reverse_"+T.decimalLongitude+"_"+T.decimalLatitude,text:T.decimalLatitude+", "+T.decimalLongitude,place_name:T.decimalLatitude+", "+T.decimalLongitude,place_type:["reverse"],center:[T.decimalLongitude,T.decimalLatitude],bbox:[T.decimalLongitude,T.decimalLatitude,T.decimalLongitude,T.decimalLatitude],geometry:{type:"Point",coordinates:[T.decimalLongitude,T.decimalLatitude]}}),ft=I,T&&he.focus())}catch(T){if(T&&typeof T=="object"&&"name"in T&&T.name==="AbortError")return;throw T}finally{re===We&&t(19,We=void 0)}}function Qr(){var re;if(!(H!=null&&H.length)||!E)return;const g=[180,90,-180,-90],Z=!H.some(T=>!T.matching_text);let X;for(const T of H){const Y=Ke(T);if(X=ct??(X===void 0?Y:Y===void 0?X:Math.max(X,Y)),Z||!T.matching_text)for(const me of[0,1,2,3])g[me]=Math[me<2?"min":"max"](g[me],((re=T.bbox)==null?void 0:re[me])??T.center[me%2])}S&&H.length>0&&(P&&g[0]===g[2]&&g[1]===g[3]?S.flyTo(P.center,Ke(P)):S.fitBounds(it(g),50,X))}function Ke(g){var X;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;if(typeof Ue=="number")return g.id.startsWith("poi.")||g.id.startsWith("address.")?ct:Ue;const Z=g.id.replace(/\..*/,"");return(Array.isArray((X=g.properties)==null?void 0:X.categories)?g.properties.categories.reduce((re,T)=>{const Y=Ue[Z+"."+T];return re===void 0?Y:Y===void 0?re:Math.max(re,Y)},void 0):void 0)??Ue[Z]}function Hr(g){t(0,U=y==="always"),t(14,I=void 0),t(56,P=void 0),t(15,G=-1),Zi(g[1].toFixed(6)+", "+zn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function Yr(g){if(!I)return;let Z=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;Z&&(G===(fe?0:-1)&&Z===-1&&t(15,G=I.length),t(15,G+=Z),G>=I.length&&t(15,G=-1),G<0&&fe&&t(15,G=0),g.preventDefault())}function Dt(g=!0,Z=!1){if(t(18,ge=void 0),ne||Z){if(ze&&clearTimeout(ze),W.length<L)return;const X=W;ze=window.setTimeout(()=>{Ft(X).catch(re=>t(18,ge=re))},g?m:0)}else t(14,I=void 0),t(18,ge=void 0)}function Bt(g){t(56,P=g),t(1,W=g.place_name),t(15,G=-1)}const Xr=()=>he.focus();function Kr(g){mt[g?"unshift":"push"](()=>{he=g,t(17,he)})}function Jr(){W=this.value,t(1,W),t(13,Ge),t(28,a)}const $r=()=>t(13,Ge=!0),eo=()=>t(13,Ge=!1),to=()=>Dt(),io=()=>{t(1,W=""),he.focus()},no=()=>t(0,U=!U),ro=()=>t(18,ge=void 0),oo=g=>t(15,G=g),so=g=>Bt(g),lo=()=>{fe||t(15,G=-1)},uo=()=>{};return n.$$set=g=>{"class"in g&&t(2,s=g.class),"apiKey"in g&&t(26,c=g.apiKey),"bbox"in g&&t(27,u=g.bbox),"clearButtonTitle"in g&&t(3,d=g.clearButtonTitle),"clearOnBlur"in g&&t(28,a=g.clearOnBlur),"collapsed"in g&&t(4,f=g.collapsed),"country"in g&&t(29,h=g.country),"debounceSearch"in g&&t(30,m=g.debounceSearch),"enableReverse"in g&&t(5,y=g.enableReverse),"errorMessage"in g&&t(6,b=g.errorMessage),"filter"in g&&t(31,v=g.filter),"flyTo"in g&&t(32,E=g.flyTo),"fuzzyMatch"in g&&t(33,_=g.fuzzyMatch),"language"in g&&t(34,x=g.language),"limit"in g&&t(35,N=g.limit),"mapController"in g&&t(36,S=g.mapController),"minLength"in g&&t(37,L=g.minLength),"noResultsMessage"in g&&t(7,w=g.noResultsMessage),"placeholder"in g&&t(8,C=g.placeholder),"proximity"in g&&t(38,O=g.proximity),"reverseActive"in g&&t(0,U=g.reverseActive),"reverseButtonTitle"in g&&t(9,j=g.reverseButtonTitle),"searchValue"in g&&t(1,W=g.searchValue),"showFullGeometry"in g&&t(39,M=g.showFullGeometry),"showPlaceType"in g&&t(10,V=g.showPlaceType),"showResultsWhileTyping"in g&&t(40,ne=g.showResultsWhileTyping),"selectFirst"in g&&t(11,fe=g.selectFirst),"flyToSelected"in g&&t(41,Tt=g.flyToSelected),"markerOnSelected"in g&&t(42,lt=g.markerOnSelected),"types"in g&&t(43,ut=g.types),"excludeTypes"in g&&t(44,at=g.excludeTypes),"zoom"in g&&t(45,Ue=g.zoom),"maxZoom"in g&&t(46,ct=g.maxZoom),"apiUrl"in g&&t(47,Rt=g.apiUrl),"fetchParameters"in g&&t(48,It=g.fetchParameters),"iconsBaseUrl"in g&&t(12,Vi=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(49,Ot=g.adjustUrlQuery),"$$scope"in g&&t(59,o=g.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,U=y==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,dt=Ge),a&&!Ge&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<L&&(t(56,P=void 0),t(14,I=void 0),t(18,ge=void 0),t(55,H=I)),n.$$.dirty[1]&33554688&&M&&P&&!P.address&&P.geometry.type==="Point"&&P.place_type[0]!=="reverse"&&Ft(P.id,{byId:!0}).catch(g=>t(18,ge=g)),n.$$.dirty[1]&100663330&&(S&&P&&P.id!==Wt&&E&&(!P.bbox||P.bbox[0]===P.bbox[2]&&P.bbox[1]===P.bbox[3]?S.flyTo(P.center,Ke(P)):S.fitBounds(it(P.bbox),50,Ke(P)),t(14,I=void 0),t(55,H=void 0),t(15,G=-1)),t(57,Wt=P==null?void 0:P.id)),n.$$.dirty[0]&18432&&fe&&I!=null&&I.length&&t(15,G=0),n.$$.dirty[0]&2&&t(15,G=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&16777216&&H!==I&&t(55,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&16777248&&S&&S.setEventHandler(g=>{switch(g.type){case"mapClick":U&&Hr(g.coordinates);break;case"markerClick":{const Z=I==null?void 0:I.find(X=>X.id===g.id);Z&&Bt(Z)}break;case"markerMouseEnter":H&&t(15,G=dt?(I==null?void 0:I.findIndex(Z=>Z.id===g.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,G=-1);break}}),n.$$.dirty[0]&49152&&t(58,i=I==null?void 0:I[G]),n.$$.dirty[1]&134218786&&S&&i&&E&&Tt&&S.flyTo(i.center,Ke(i)),n.$$.dirty[1]&2080&&(lt||S==null||S.setMarkers(void 0,void 0)),n.$$.dirty[1]&150997024&&S&<&&!H&&(S.setMarkers(i?[i]:void 0,void 0),S.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&50331680&&S&&S.setMarkers(H,P),n.$$.dirty[0]&32768|n.$$.dirty[1]&16777248&&H&&S&&S.setSelectedMarker(G),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&S){const g=At(W);S.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}n.$$.dirty[1]&134217728&&Ne("select",i),n.$$.dirty[1]&33554432&&Ne("pick",P),n.$$.dirty[0]&81920&&Ne("optionsVisibilityChange",dt&&!!I),n.$$.dirty[0]&16384&&Ne("featuresListed",I),n.$$.dirty[1]&16777216&&Ne("featuresMarked",H),n.$$.dirty[0]&1&&Ne("reverseToggle",U),n.$$.dirty[0]&2&&Ne("queryChange",W),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&S&&S.indicateReverse(U)},[U,W,s,d,f,y,b,w,C,j,V,fe,Vi,Ge,I,G,dt,he,ge,We,Zr,Hi,Yr,Dt,Bt,l,c,u,a,h,m,v,E,_,x,N,S,L,O,M,ne,Tt,lt,ut,at,Ue,ct,Rt,It,Ot,zr,qr,Zi,jr,Vr,H,P,Wt,i,o,r,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo,so,lo,uo]}let lr=class extends Ie{constructor(e){super(),Re(this,e,sr,or,Pe,{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,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,excludeTypes:44,zoom:45,maxZoom: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 nt(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 wt(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 nt({type:"Polygon",coordinates:n},e,t)}function _t(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function yi(n,e,t={}){return nt({type:"MultiPolygon",coordinates:n},e,t)}function vi(n,e,t){if(n!==null)for(var i,r,o,l,s,c,u,d=0,a=0,f,h=n.type,m=h==="FeatureCollection",y=h==="Feature",b=m?n.features.length:1,v=0;v<b;v++){u=m?n.features[v].geometry:y?n.geometry:n,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var _=0,x=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var N=l.type;switch(d=0,N){case null:break;case"Point":if(e(c,a,v,_,x)===!1)return!1;a++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,v,_,x)===!1)return!1;a++,N==="MultiPoint"&&_++}N==="LineString"&&_++;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,v,_,x)===!1)return!1;a++}N==="MultiLineString"&&_++,N==="Polygon"&&x++}N==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(x=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,v,_,x)===!1)return!1;a++}x++}_++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(vi(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Et(n,e){var t,i,r,o,l,s,c,u,d,a,f=0,h=n.type==="FeatureCollection",m=n.type==="Feature",y=h?n.features.length:1;for(t=0;t<y;t++){for(s=h?n.features[t].geometry:m?n.geometry:n,u=h?n.features[t].properties:m?n.properties:{},d=h?n.features[t].bbox:m?n.bbox:void 0,a=h?n.features[t].id:m?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,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,u,d,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,u,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function ur(n,e){Et(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(nt(t,r,{bbox:o,id:l}),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 u=0;u<t.coordinates.length;u++){var d=t.coordinates[u],a={type:c,coordinates:d};if(e(nt(a,r),i,u)===!1)return!1}})}function ar(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return vi(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 pi=ar;/**
|
|
1
|
+
(function(k,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],z):(k=typeof globalThis<"u"?globalThis:k||self,z(k.openlayersMaptilerGeocoder={},k.ol.control,k.ol.events.Event,k.ol,k.ol.geom,k.ol.layer.Vector,k.ol.proj,k.ol.source.Vector,k.ol.style.Fill,k.ol.style.Icon,k.ol.style.Stroke,k.ol.style.Style,k.ol.style.Text))})(this,function(k,z,F,le,ue,tn,_e,nn,Qt,rn,Ht,on,sn){"use strict";var go=Object.defineProperty;var $i=k=>{throw TypeError(k)};var yo=(k,z,F)=>z in k?go(k,z,{enumerable:!0,configurable:!0,writable:!0,value:F}):k[z]=F;var de=(k,z,F)=>yo(k,typeof z!="symbol"?z+"":z,F),en=(k,z,F)=>z.has(k)||$i("Cannot "+F);var K=(k,z,F)=>(en(k,z,"read from private field"),F?F.call(k):z.get(k)),Zt=(k,z,F)=>z.has(k)?$i("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(k):z.set(k,F),pt=(k,z,F,le)=>(en(k,z,"write to private field"),le?le.call(k,F):z.set(k,F),F);var X,Pe;function U(){}function ln(n,e){for(const t in e)n[t]=e[t];return n}function Yt(n){return n()}function Xt(){return Object.create(null)}function ye(n){n.forEach(Yt)}function Kt(n){return typeof n=="function"}function Ie(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let it;function ee(n,e){return n===e?!0:(it||(it=document.createElement("a")),it.href=e,n===it.href)}function un(n){return Object.keys(n).length===0}function an(n,e,t,i){if(n){const r=Jt(n,e,t,i);return n[0](r)}}function Jt(n,e,t,i){return n[1]&&i?ln(t.ctx.slice(),n[1](i(e))):t.ctx}function cn(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=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function fn(n,e,t,i,r,o){if(r){const l=Jt(e,t,i,o);n.p(l,r)}}function dn(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 $t(n){return n??""}function R(n,e){n.appendChild(e)}function q(n,e,t){n.insertBefore(e,t||null)}function D(n){n.parentNode&&n.parentNode.removeChild(n)}function A(n){return document.createElement(n)}function ve(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ee(n){return document.createTextNode(n)}function re(){return Ee(" ")}function hn(){return Ee("")}function ie(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function mn(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 gn(n){return Array.from(n.childNodes)}function Ze(n,e){e=""+e,n.data!==e&&(n.data=e)}function ei(n,e){n.value=e??""}function Le(n,e,t){n.classList.toggle(e,!!t)}function yn(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let Qe;function He(n){Qe=n}function ti(){if(!Qe)throw new Error("Function called outside component initialization");return Qe}function vn(n){ti().$$.on_destroy.push(n)}function pn(){const n=ti();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=yn(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function ii(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const De=[],bt=[];let Ge=[];const ni=[],bn=Promise.resolve();let wt=!1;function wn(){wt||(wt=!0,bn.then(ri))}function _t(n){Ge.push(n)}const Et=new Set;let Be=0;function ri(){if(Be!==0)return;const n=Qe;do{try{for(;Be<De.length;){const e=De[Be];Be++,He(e),_n(e.$$)}}catch(e){throw De.length=0,Be=0,e}for(He(null),De.length=0,Be=0;bt.length;)bt.pop()();for(let e=0;e<Ge.length;e+=1){const t=Ge[e];Et.has(t)||(Et.add(t),t())}Ge.length=0}while(De.length);for(;ni.length;)ni.pop()();wt=!1,Et.clear(),He(n)}function _n(n){if(n.fragment!==null){n.update(),ye(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(_t)}}function En(n){const e=[],t=[];Ge.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Ge=e}const nt=new Set;let Oe;function rt(){Oe={r:0,c:[],p:Oe}}function ot(){Oe.r||ye(Oe.c),Oe=Oe.p}function Q(n,e){n&&n.i&&(nt.delete(n),n.i(e))}function J(n,e,t,i){if(n&&n.o){if(nt.has(n))return;nt.add(n),Oe.c.push(()=>{nt.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function oi(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ln(n,e){J(n,1,1,()=>{e.delete(n.key)})}function Sn(n,e,t,i,r,o,l,s,c,a,d,u){let f=n.length,h=o.length,b=f;const g={};for(;b--;)g[n[b].key]=b;const y=[],v=new Map,E=new Map,S=[];for(b=h;b--;){const L=u(r,o,b),_=t(L);let P=l.get(_);P?S.push(()=>P.p(L,e)):(P=a(_,L),P.c()),v.set(_,y[b]=P),_ in g&&E.set(_,Math.abs(b-g[_]))}const w=new Set,C=new Set;function x(L){Q(L,1),L.m(s,d),l.set(L.key,L),d=L.first,h--}for(;f&&h;){const L=y[h-1],_=n[f-1],P=L.key,O=_.key;L===_?(d=L.first,f--,h--):v.has(O)?!l.has(P)||w.has(P)?x(L):C.has(O)?f--:E.get(P)>E.get(O)?(C.add(P),x(L)):(w.add(O),f--):(c(_,l),f--)}for(;f--;){const L=n[f];v.has(L.key)||c(L,l)}for(;h;)x(y[h-1]);return ye(S),y}function Se(n){n&&n.c()}function pe(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),_t(()=>{const o=n.$$.on_mount.map(Yt).filter(Kt);n.$$.on_destroy?n.$$.on_destroy.push(...o):ye(o),n.$$.on_mount=[]}),r.forEach(_t)}function be(n,e){const t=n.$$;t.fragment!==null&&(En(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function xn(n,e){n.$$.dirty[0]===-1&&(De.push(n),wn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function We(n,e,t,i,r,o,l=null,s=[-1]){const c=Qe;He(n);const a=n.$$={fragment:null,ctx:[],props:o,update:U,not_equal:r,bound:Xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Xt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(a.root);let d=!1;if(a.ctx=t?t(n,e.props||{},(u,f,...h)=>{const b=h.length?h[0]:f;return a.ctx&&r(a.ctx[u],a.ctx[u]=b)&&(!a.skip_bound&&a.bound[u]&&a.bound[u](b),d&&xn(n,u)),f}):[],a.update(),d=!0,ye(a.before_update),a.fragment=i?i(a.ctx):!1,e.target){if(e.hydrate){const u=gn(e.target);a.fragment&&a.fragment.l(u),u.forEach(D)}else a.fragment&&a.fragment.c();e.intro&&Q(n.$$.fragment),pe(n,e.target,e.anchor),ri()}He(c)}class Ae{constructor(){de(this,"$$");de(this,"$$set")}$destroy(){be(this,1),this.$destroy=U}$on(e,t){if(!Kt(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&&!un(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Mn);function kn(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:U,i:U,o:U,d(i){i&&D(e)}}}class si extends Ae{constructor(e){super(),We(this,e,null,kn,Ie,{})}}function Cn(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:U,i:U,o:U,d(i){i&&D(e)}}}class li extends Ae{constructor(e){super(),We(this,e,null,Cn,Ie,{})}}function Pn(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"area.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function Nn(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function Tn(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"poi.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function Rn(n){let e,t;return{c(){e=A("img"),ee(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){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function In(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"street.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function On(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"road.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function Wn(n){let e,t;return{c(){e=A("img"),ee(e.src,t=n[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",n[6]),p(e,"class","svelte-ltkwvy")},m(i,r){q(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",i[6])},d(i){i&&D(e)}}}function An(n){let e,t,i,r;return{c(){e=A("img"),ee(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[4]),p(e,"class","svelte-ltkwvy")},m(o,l){q(o,e,l),i||(r=ie(e,"error",n[14]),i=!0)},p(o,l){l&32&&!ee(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4])},d(o){o&&D(e),i=!1,r()}}}function ui(n){let e,t;return{c(){e=A("span"),t=Ee(n[6]),p(e,"class","secondary svelte-ltkwvy")},m(i,r){q(i,e,r),R(e,t)},p(i,r){r&64&&Ze(t,i[6])},d(i){i&&D(e)}}}function zn(n){let e,t,i,r,o,l,s,c,a,d=(n[7]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",u,f,h=n[2]==="always"||n[2]&&!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],b,g,y=(n[7]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",v,E,S;function w(_,P){return P&1&&(t=null),P&1&&(i=null),P&1&&(r=null),P&1&&(o=null),_[5]?An:_[0].address?Wn:(t==null&&(t=!!_[0].id.startsWith("road.")),t?On:(i==null&&(i=!!_[0].id.startsWith("address.")),i?In:(r==null&&(r=!!_[0].id.startsWith("postal_code.")),r?Rn:(o==null&&(o=!!_[0].id.startsWith("poi.")),o?Tn:_[7]?Nn:Pn))))}let C=w(n,-1),x=C(n),L=h&&ui(n);return{c(){e=A("li"),x.c(),l=re(),s=A("span"),c=A("span"),a=A("span"),u=Ee(d),f=re(),L&&L.c(),b=re(),g=A("span"),v=Ee(y),p(a,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(g,"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(_,P){q(_,e,P),x.m(e,null),R(e,l),R(e,s),R(s,c),R(c,a),R(a,u),R(c,f),L&&L.m(c,null),R(s,b),R(s,g),R(g,v),E||(S=[ie(e,"mouseenter",n[12]),ie(e,"focus",n[13])],E=!0)},p(_,[P]){C===(C=w(_,P))&&x?x.p(_,P):(x.d(1),x=C(_),x&&(x.c(),x.m(e,l))),P&1&&d!==(d=(_[7]?_[0].place_name:_[0].place_name.replace(/,.*/,""))+"")&&Ze(u,d),P&37&&(h=_[2]==="always"||_[2]&&!_[0].address&&!_[0].id.startsWith("road.")&&!_[0].id.startsWith("address.")&&!_[0].id.startsWith("postal_code.")&&(!_[0].id.startsWith("poi.")||!_[5])&&!_[7]),h?L?L.p(_,P):(L=ui(_),L.c(),L.m(c,null)):L&&(L.d(1),L=null),P&1&&y!==(y=(_[7]?"":_[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ze(v,y),P&2&&p(e,"data-selected",_[1]),P&2&&Le(e,"selected",_[1])},i:U,o:U,d(_){_&&D(e),x.d(),L&&L.d(),E=!1,ye(S)}}}function Fn(n,e,t){var S;let i,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:a}=e;const d=(S=o.properties)==null?void 0:S.categories;let u,f,h=0,b=o.place_type[0]==="reverse";function g(){f&&c.add(f),t(10,h++,h)}function y(w){ii.call(this,n,w)}function v(w){ii.call(this,n,w)}const E=()=>g();return n.$$set=w=>{"feature"in w&&t(0,o=w.feature),"selected"in w&&t(1,l=w.selected),"showPlaceType"in w&&t(2,s=w.showPlaceType),"missingIconsCache"in w&&t(9,c=w.missingIconsCache),"iconsBaseUrl"in w&&t(3,a=w.iconsBaseUrl)},n.$$.update=()=>{var w,C,x,L;if(n.$$.dirty&3640)do t(11,i--,i),t(4,u=d==null?void 0:d[i]),t(5,f=u?a+u.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!f||c.has(f)));n.$$.dirty&1&&t(6,r=((C=(w=o.properties)==null?void 0:w.categories)==null?void 0:C.join(", "))??((L=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,i=(d==null?void 0:d.length)??0),[o,l,s,a,u,f,r,b,g,c,h,i,y,v,E]}class Dn extends Ae{constructor(e){super(),We(this,e,Fn,zn,Ie,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Gn(n){let e;return{c(){e=A("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){q(t,e,i)},p:U,i:U,o:U,d(t){t&&D(e)}}}class Bn extends Ae{constructor(e){super(),We(this,e,null,Gn,Ie,{})}}function Un(n){let e,t;return{c(){e=ve("svg"),t=ve("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){q(i,e,r),R(e,t)},p:U,i:U,o:U,d(i){i&&D(e)}}}class qn extends Ae{constructor(e){super(),We(this,e,null,Un,Ie,{})}}function jn(n){let e,t,i;return{c(){e=ve("svg"),t=ve("circle"),i=ve("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){q(r,e,o),R(e,t),R(e,i)},p:U,i:U,o:U,d(r){r&&D(e)}}}class Vn extends Ae{constructor(e){super(),We(this,e,null,jn,Ie,{})}}function Zn(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 st(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 Ye;async function Qn(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(Ye&&r.cachedLocationExpiry&&Ye.time+r.cachedLocationExpiry>Date.now()){if(!Ye.coords)break e;return Ye.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(a=>a.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Ye={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 Hn=/^(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,ai=/^([+-]?[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,})$/,ci=/^(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,fi=/^(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,di=/^(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,hi=/^(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 Yn(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),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const a=Math.floor(r),d=Math.floor(o),u=(r-a)*60,f=(o-d)*60;if(n=="DM"){let h=mi(u,3).toFixed(3).padStart(6,"0"),b=mi(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&b.endsWith(".000")&&(h=h.replace(/\.000$/,""),b=b.replace(/\.000$/,"")),c=`${a}° ${h}' ${l}, ${d}° ${b}' ${s}`}if(n=="DMS"){const h=Math.floor(u),b=Math.floor(f);let g=((u-h)*60).toFixed(1).padStart(4,"0"),y=((f-b)*60).toFixed(1).padStart(4,"0");const v=h.toString().padStart(2,"0"),E=b.toString().padStart(2,"0");g.endsWith(".0")&&y.endsWith(".0")&&(g=g.replace(/\.0$/,""),y=y.replace(/\.0$/,"")),c=`${a}° ${v}' ${g}" ${l}, ${d}° ${E}' ${y}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function mi(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function Lt(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(Hn.test(n))throw new Error("invalid coordinate value");if(ai.test(n))if(s=ai.exec(n),c=Xe(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),l="DM";else throw new Error("invalid coordinate format");else if(ci.test(n))if(s=ci.exec(n),c=Xe(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="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(fi.test(n))if(s=fi.exec(n),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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(di.test(n))if(s=di.exec(n),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="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(hi.test(n)){if(s=hi.exec(n),c=Xe(s),s.filter(a=>a).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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 a=/S|SOUTH/i;a.test(r)&&t>0&&(t=-1*t),a=/W|WEST/i,a.test(o)&&i>0&&(i=-1*i);const d=s[0].trim();let u,f;const h=/[,/;\u0020]/g,b=d.match(h);if(b==null){const v=Math.floor(n.length/2);u=d.substring(0,v).trim(),f=d.substring(v).trim()}else{let v;b.length%2==1?v=Math.floor(b.length/2):v=b.length/2-1;let E=0;if(v==0)E=d.indexOf(b[0]),u=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let S=0,w=0;for(;S<=v;)E=d.indexOf(b[S],w),w=E+1,S++;u=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const g=u.split(".");if(g.length==2&&g[1]==0&&g[1].length!=2)throw new Error("invalid coordinates format");const y=f.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(u)||/^\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:u,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:l,closeEnough:Xn,toCoordinateFormat:Yn})}else throw new Error("coordinates pattern match failed")}function Xe(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 l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),a=i.test(l)&&i.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||a||d)continue;return!1}}return!0}function gi(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function Xn(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 gi(this.decimalLatitude,Number(e[0]))&&gi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Kn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Lt.to=Kn;const Jn=[{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"}],$n={decimalLatitude:40.123,decimalLongitude:-74.123},er=[{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}],tr=[{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 ir(){const n=[];return Jn.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...$n})}),[...n,...er,...tr]}const nr=ir();Lt.formats=nr.map(n=>n.verbatimCoordinates);const rr=Lt;function yi(n,e,t){const i=n.slice();return i[87]=e[t],i[89]=t,i}function vi(n){let e,t;return e=new Bn({}),{c(){Se(e.$$.fragment)},m(i,r){pe(e,i,r),t=!0},i(i){t||(Q(e.$$.fragment,i),t=!0)},o(i){J(e.$$.fragment,i),t=!1},d(i){be(e,i)}}}function pi(n){let e,t,i,r,o;return t=new qn({}),{c(){e=A("button"),Se(t.$$.fragment),p(e,"type","button"),p(e,"title",n[9]),p(e,"class","svelte-bz0zu3"),Le(e,"active",n[0])},m(l,s){q(l,e,s),pe(t,e,null),i=!0,r||(o=ie(e,"click",n[71]),r=!0)},p(l,s){(!i||s[0]&512)&&p(e,"title",l[9]),(!i||s[0]&1)&&Le(e,"active",l[0])},i(l){i||(Q(t.$$.fragment,l),i=!0)},o(l){J(t.$$.fragment,l),i=!1},d(l){l&&D(e),be(t),r=!1,o()}}}function or(n){let e,t=[],i=new Map,r,o,l,s=oi(n[14]);const c=a=>a[87].id+(a[87].address?","+a[87].address:"");for(let a=0;a<s.length;a+=1){let d=yi(n,s,a),u=c(d);i.set(u,t[a]=bi(u,d))}return{c(){e=A("ul");for(let a=0;a<t.length;a+=1)t[a].c();p(e,"class","options svelte-bz0zu3")},m(a,d){q(a,e,d);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);r=!0,o||(l=[ie(e,"mouseleave",n[75]),ie(e,"blur",n[76])],o=!0)},p(a,d){d[0]&17880064&&(s=oi(a[14]),rt(),t=Sn(t,d,c,1,a,s,i,e,Ln,bi,null,yi),ot())},i(a){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(a){for(let d=0;d<t.length;d+=1)J(t[d]);r=!1},d(a){a&&D(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,ye(l)}}}function sr(n){let e,t,i,r,o,l;return t=new li({}),{c(){e=A("div"),Se(t.$$.fragment),i=re(),r=A("div"),o=Ee(n[7]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){q(s,e,c),pe(t,e,null),R(e,i),R(e,r),R(r,o),l=!0},p(s,c){(!l||c[0]&128)&&Ze(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){J(t.$$.fragment,s),l=!1},d(s){s&&D(e),be(t)}}}function lr(n){let e="",t;return{c(){t=Ee(e)},m(i,r){q(i,t,r)},p:U,i:U,o:U,d(i){i&&D(t)}}}function ur(n){let e,t,i,r,o,l,s,c,a,d,u;return t=new li({}),c=new si({}),{c(){e=A("div"),Se(t.$$.fragment),i=re(),r=A("div"),o=Ee(n[6]),l=re(),s=A("button"),Se(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,h){q(f,e,h),pe(t,e,null),R(e,i),R(e,r),R(r,o),R(e,l),R(e,s),pe(c,s,null),a=!0,d||(u=ie(s,"click",n[72]),d=!0)},p(f,h){(!a||h[0]&64)&&Ze(o,f[6])},i(f){a||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),a=!0)},o(f){J(t.$$.fragment,f),J(c.$$.fragment,f),a=!1},d(f){f&&D(e),be(t),be(c),d=!1,u()}}}function bi(n,e){let t,i,r;function o(){return e[73](e[89])}function l(){return e[74](e[87])}return i=new Dn({props:{feature:e[87],showPlaceType:e[10],selected:e[15]===e[89],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("focus",l),{key:n,first:null,c(){t=hn(),Se(i.$$.fragment),this.first=t},m(s,c){q(s,t,c),pe(i,s,c),r=!0},p(s,c){e=s;const a={};c[0]&16384&&(a.feature=e[87]),c[0]&1024&&(a.showPlaceType=e[10]),c[0]&49152&&(a.selected=e[15]===e[89]),c[0]&4096&&(a.iconsBaseUrl=e[12]),i.$set(a)},i(s){r||(Q(i.$$.fragment,s),r=!0)},o(s){J(i.$$.fragment,s),r=!1},d(s){s&&D(t),be(i,s)}}}function ar(n){let e,t,i,r,o,l,s,c,a,d,u,f,h,b,g,y,v,E,S,w,C,x=!1;o=new Vn({}),u=new si({});let L=n[19]&&vi(),_=n[5]===!0&&pi(n);const P=n[63].default,O=an(P,n,n[62],null),G=[ur,lr,sr,or],j=[];function W(M,V){var oe,Ne;return M[18]?0:M[16]?((oe=M[14])==null?void 0:oe.length)===0?2:M[16]&&((Ne=M[14])!=null&&Ne.length)?3:-1:1}return~(y=W(n))&&(v=j[y]=G[y](n)),{c(){e=re(),t=A("form"),i=A("div"),r=A("button"),Se(o.$$.fragment),l=re(),s=A("input"),c=re(),a=A("div"),d=A("button"),Se(u.$$.fragment),f=re(),L&&L.c(),h=re(),_&&_.c(),b=re(),O&&O.c(),g=re(),v&&v.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(a,"class","clear-button-container svelte-bz0zu3"),Le(a,"displayable",n[1]!==""),p(i,"class","input-group svelte-bz0zu3"),p(t,"tabindex","0"),p(t,"class",E=$t(n[2])+" svelte-bz0zu3"),Le(t,"can-collapse",n[4]&&n[1]==="")},m(M,V){q(M,e,V),q(M,t,V),R(t,i),R(i,r),pe(o,r,null),R(i,l),R(i,s),n[65](s),ei(s,n[1]),R(i,c),R(i,a),R(a,d),pe(u,d,null),R(a,f),L&&L.m(a,null),R(i,h),_&&_.m(i,null),R(i,b),O&&O.m(i,null),R(t,g),~y&&j[y].m(t,null),S=!0,w||(C=[ie(r,"click",n[64]),ie(s,"input",n[66]),ie(s,"focus",n[67]),ie(s,"blur",n[68]),ie(s,"keydown",n[22]),ie(s,"input",n[69]),ie(d,"click",n[70]),ie(t,"submit",mn(n[21]))],w=!0)},p(M,V){(!S||V[0]&256)&&p(s,"placeholder",M[8]),(!S||V[0]&256)&&p(s,"aria-label",M[8]),V[0]&2&&s.value!==M[1]&&ei(s,M[1]),(!S||V[0]&8)&&p(d,"title",M[3]),M[19]?L?V[0]&524288&&Q(L,1):(L=vi(),L.c(),Q(L,1),L.m(a,null)):L&&(rt(),J(L,1,1,()=>{L=null}),ot()),(!S||V[0]&2)&&Le(a,"displayable",M[1]!==""),M[5]===!0?_?(_.p(M,V),V[0]&32&&Q(_,1)):(_=pi(M),_.c(),Q(_,1),_.m(i,b)):_&&(rt(),J(_,1,1,()=>{_=null}),ot()),O&&O.p&&(!S||V[2]&1)&&fn(O,P,M,M[62],S?cn(P,M[62],V,null):dn(M[62]),null);let oe=y;y=W(M),y===oe?~y&&j[y].p(M,V):(v&&(rt(),J(j[oe],1,1,()=>{j[oe]=null}),ot()),~y?(v=j[y],v?v.p(M,V):(v=j[y]=G[y](M),v.c()),Q(v,1),v.m(t,null)):v=null),(!S||V[0]&4&&E!==(E=$t(M[2])+" svelte-bz0zu3"))&&p(t,"class",E),(!S||V[0]&22)&&Le(t,"can-collapse",M[4]&&M[1]==="")},i(M){S||(Q(x),Q(o.$$.fragment,M),Q(u.$$.fragment,M),Q(L),Q(_),Q(O,M),Q(v),S=!0)},o(M){J(x),J(o.$$.fragment,M),J(u.$$.fragment,M),J(L),J(_),J(O,M),J(v),S=!1},d(M){M&&(D(e),D(t)),be(o),n[65](null),be(u),L&&L.d(),_&&_.d(),O&&O.d(M),~y&&j[y].d(),w=!1,ye(C)}}}function cr(n,e,t){let i,{$$slots:r={},$$scope:o}=e;const l={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:a=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:u=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:b=200}=e,{enableReverse:g=!1}=e,{errorMessage:y="Something went wrong…"}=e,{filter:v=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:S=!0}=e,{language:w=void 0}=e,{limit:C=void 0}=e,{mapController:x=void 0}=e,{minLength:L=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:P="Search"}=e,{proximity:O=[{type:"server-geolocation"}]}=e,{reverseActive:G=g==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:V="if-needed"}=e,{showResultsWhileTyping:oe=!0}=e,{autocompleteTimeout:Ne=void 0}=e,{selectFirst:qe=!0}=e,{flyToSelected:Wt=!1}=e,{markerOnSelected:ft=!0}=e,{types:ze=void 0}=e,{exhaustiveReverseGeocoding:At=!1}=e,{excludeTypes:dt=!1}=e,{zoom:je=l}=e,{maxZoom:ht=void 0}=e,{apiUrl:zt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ft={}}=e,{iconsBaseUrl:Yi="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.1/icons/"}=e,{adjustUrlQuery:Dt=()=>{}}=e;function Zr(){me.focus()}function Qr(){me.blur()}function Xi(m,Z=!0,Y=!1){t(1,W=m),Z?(t(15,B=-1),Ji()):(Ut(!Y,Y),setTimeout(()=>{me.focus(),me.select()}))}function Hr(){t(14,I=void 0),t(58,N=void 0),t(15,B=-1)}function Yr(){t(57,H=[]),t(58,N=void 0)}let Ve=!1,I,H,N,Ki="",me,B=-1,ge,mt=[],Fe,Te,ce,gt,Gt;const Xr=new Set,Re=pn();function Kr(){return!!ce}vn(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Ji(m){if(Te&&(window.clearTimeout(Te),Te=void 0),ce){window.clearTimeout(ce),t(59,ce=void 0),et(W,{exact:!0});return}if(B>-1&&I)t(58,N=I[B]),t(1,W=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(57,H=void 0),t(15,B=-1);else if(W){const Z=m||!Bt(W);et(W,{exact:!0}).then(()=>{t(57,H=I),t(58,N=void 0),Z&&Jr()}).catch(Y=>t(18,ge=Y))}}function Bt(m){try{return rr(m,6)}catch{return!1}}async function et(m,{byId:Z=!1,exact:Y=!1,appendSpace:fe=!1}={}){t(18,ge=void 0),Fe==null||Fe.abort();const se=new AbortController;t(19,Fe=se);try{const T=Bt(m),$=new URLSearchParams;if(w!==void 0&&$.set("language",Array.isArray(w)?w.join(","):w??""),ze&&$.set("types",ze.join(",")),dt&&$.set("excludeTypes",String(dt)),a&&$.set("bbox",a.map(vt=>vt.toFixed(6)).join(",")),h&&$.set("country",Array.isArray(h)?h.join(","):h),!Z&&!T){const vt=await Qn(x,O,se);vt&&$.set("proximity",vt),(Y||!oe)&&$.set("autocomplete","false"),$.set("fuzzyMatch",String(S))}C!==void 0&&(At||!T||(ze==null?void 0:ze.length)===1)&&$.set("limit",String(C)),$.set("key",c),Dt($);const yt=zt+"/"+encodeURIComponent(T?T.decimalLongitude+","+T.decimalLatitude:m+(fe?" ":""))+".json?"+$.toString();if(yt===Ki){Z?(t(14,I=void 0),t(58,N=mt[0])):t(14,I=mt);return}Ki=yt;const jt=await fetch(yt,{signal:se.signal,...Ft});if(!jt.ok)throw new Error(await jt.text());const Vt=await jt.json();Re("response",{url:yt,featureCollection:Vt}),Z?(t(14,I=void 0),t(58,N=Vt.features[0]),mt=[N]):(t(14,I=Vt.features.filter(v)),T&&I.unshift({type:"Feature",properties:{},id:"reverse_"+T.decimalLongitude+"_"+T.decimalLatitude,text:T.decimalLatitude+", "+T.decimalLongitude,place_name:T.decimalLatitude+", "+T.decimalLongitude,place_type:["reverse"],center:[T.decimalLongitude,T.decimalLatitude],bbox:[T.decimalLongitude,T.decimalLatitude,T.decimalLongitude,T.decimalLatitude],geometry:{type:"Point",coordinates:[T.decimalLongitude,T.decimalLatitude]}}),mt=I,T&&me.focus())}catch(T){if(T&&typeof T=="object"&&"name"in T&&T.name==="AbortError")return;throw T}finally{se===Fe&&t(19,Fe=void 0)}}function Jr(){var fe;if(!(H!=null&&H.length)||!E)return;const m=[180,90,-180,-90],Z=!H.some(se=>!se.matching_text);let Y;for(const se of H){const T=tt(se);if(Y=ht??(Y===void 0?T:T===void 0?Y:Math.max(Y,T)),Z||!se.matching_text)for(const $ of[0,1,2,3])m[$]=Math[$<2?"min":"max"](m[$],((fe=se.bbox)==null?void 0:fe[$])??se.center[$%2])}x&&H.length>0&&(N&&m[0]===m[2]&&m[1]===m[3]?x.flyTo(N.center,tt(N)):x.fitBounds(st(m),50,Y))}function tt(m){var Y;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;if(typeof je=="number")return m.id.startsWith("poi.")||m.id.startsWith("address.")?ht:je;const Z=m.id.replace(/\..*/,"");return(Array.isArray((Y=m.properties)==null?void 0:Y.categories)?m.properties.categories.reduce((fe,se)=>{const T=je[Z+"."+se];return fe===void 0?T:T===void 0?fe:Math.max(fe,T)},void 0):void 0)??je[Z]}function $r(m){t(0,G=g==="always"),t(14,I=void 0),t(58,N=void 0),t(15,B=-1),Xi(m[1].toFixed(6)+", "+Zn(m[0],[-180,180],!0).toFixed(6),!1,!0)}function eo(m){if(!I)return;let Z=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;Z&&(B===(qe?0:-1)&&Z===-1&&t(15,B=I.length),t(15,B+=Z),B>=I.length&&t(15,B=-1),B<0&&qe&&t(15,B=0),m.preventDefault())}function Ut(m=!0,Z=!1){if(t(18,ge=void 0),Te&&(window.clearTimeout(Te),Te=void 0),ce&&(window.clearTimeout(ce),t(59,ce=void 0)),!oe&&!Z||W.length<L){t(14,I=void 0);return}const Y=W;Te=window.setTimeout(()=>{Te=void 0,et(Y).catch(fe=>t(18,ge=fe))},m?b:0),W.endsWith(" ")||t(59,ce=window.setTimeout(()=>{t(59,ce=void 0),et(Y,{appendSpace:!0}).catch(fe=>t(18,ge=fe))},Ne))}function qt(m){t(58,N=m),t(1,W=m.place_name),t(15,B=-1)}const to=()=>me.focus();function io(m){bt[m?"unshift":"push"](()=>{me=m,t(17,me)})}function no(){W=this.value,t(1,W),t(13,Ve),t(28,u)}const ro=()=>t(13,Ve=!0),oo=()=>t(13,Ve=!1),so=()=>Ut(),lo=()=>{t(1,W=""),me.focus()},uo=()=>t(0,G=!G),ao=()=>t(18,ge=void 0),co=m=>t(15,B=m),fo=m=>qt(m),ho=()=>{qe||t(15,B=-1)},mo=()=>{};return n.$$set=m=>{"class"in m&&t(2,s=m.class),"apiKey"in m&&t(26,c=m.apiKey),"bbox"in m&&t(27,a=m.bbox),"clearButtonTitle"in m&&t(3,d=m.clearButtonTitle),"clearOnBlur"in m&&t(28,u=m.clearOnBlur),"collapsed"in m&&t(4,f=m.collapsed),"country"in m&&t(29,h=m.country),"debounceSearch"in m&&t(30,b=m.debounceSearch),"enableReverse"in m&&t(5,g=m.enableReverse),"errorMessage"in m&&t(6,y=m.errorMessage),"filter"in m&&t(31,v=m.filter),"flyTo"in m&&t(32,E=m.flyTo),"fuzzyMatch"in m&&t(33,S=m.fuzzyMatch),"language"in m&&t(34,w=m.language),"limit"in m&&t(35,C=m.limit),"mapController"in m&&t(36,x=m.mapController),"minLength"in m&&t(37,L=m.minLength),"noResultsMessage"in m&&t(7,_=m.noResultsMessage),"placeholder"in m&&t(8,P=m.placeholder),"proximity"in m&&t(38,O=m.proximity),"reverseActive"in m&&t(0,G=m.reverseActive),"reverseButtonTitle"in m&&t(9,j=m.reverseButtonTitle),"searchValue"in m&&t(1,W=m.searchValue),"showFullGeometry"in m&&t(39,M=m.showFullGeometry),"showPlaceType"in m&&t(10,V=m.showPlaceType),"showResultsWhileTyping"in m&&t(40,oe=m.showResultsWhileTyping),"autocompleteTimeout"in m&&t(41,Ne=m.autocompleteTimeout),"selectFirst"in m&&t(11,qe=m.selectFirst),"flyToSelected"in m&&t(42,Wt=m.flyToSelected),"markerOnSelected"in m&&t(43,ft=m.markerOnSelected),"types"in m&&t(44,ze=m.types),"exhaustiveReverseGeocoding"in m&&t(45,At=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(46,dt=m.excludeTypes),"zoom"in m&&t(47,je=m.zoom),"maxZoom"in m&&t(48,ht=m.maxZoom),"apiUrl"in m&&t(49,zt=m.apiUrl),"fetchParameters"in m&&t(50,Ft=m.fetchParameters),"iconsBaseUrl"in m&&t(12,Yi=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(51,Dt=m.adjustUrlQuery),"$$scope"in m&&t(62,o=m.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&32&&t(0,G=g==="always"),n.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,gt=Ve),u&&!Ve&&t(1,W="")}),n.$$.dirty[0]&16386|n.$$.dirty[1]&64&&W.length<L&&(t(58,N=void 0),t(14,I=void 0),t(18,ge=void 0),t(57,H=I)),n.$$.dirty[1]&134217984&&M&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&et(N.id,{byId:!0}).catch(m=>t(18,ge=m)),n.$$.dirty[1]&671088674&&(x&&N&&N.id!==Gt&&E&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,tt(N)):x.fitBounds(st(N.bbox),50,tt(N)),t(14,I=void 0),t(57,H=void 0),t(15,B=-1)),t(60,Gt=N==null?void 0:N.id)),n.$$.dirty[0]&18432&&qe&&I!=null&&I.length&&(Kr()||t(15,B=0)),n.$$.dirty[0]&2&&t(15,B=-1),n.$$.dirty[0]&16384|n.$$.dirty[1]&67108864&&H!==I&&t(57,H=void 0),n.$$.dirty[0]&81921|n.$$.dirty[1]&67108896&&x&&x.setEventHandler(m=>{switch(m.type){case"mapClick":G&&$r(m.coordinates);break;case"markerClick":{const Z=I==null?void 0:I.find(Y=>Y.id===m.id);Z&&qt(Z)}break;case"markerMouseEnter":H&&t(15,B=gt?(I==null?void 0:I.findIndex(Z=>Z.id===m.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,B=-1);break}}),n.$$.dirty[0]&49152&&t(61,i=I==null?void 0:I[B]),n.$$.dirty[1]&1073743906&&x&&i&&E&&Wt&&x.flyTo(i.center,tt(i)),n.$$.dirty[1]&4128&&(ft||x==null||x.setMarkers(void 0,void 0)),n.$$.dirty[1]&1140854816&&x&&ft&&!H&&(x.setMarkers(i?[i]:void 0,void 0),x.setSelectedMarker(i?0:-1)),n.$$.dirty[1]&201326624&&x&&x.setMarkers(H,N),n.$$.dirty[0]&32768|n.$$.dirty[1]&67108896&&H&&x&&x.setSelectedMarker(B),n.$$.dirty[1]&1342177280&&i&&(window.clearTimeout(ce),t(59,ce=void 0)),n.$$.dirty[0]&2|n.$$.dirty[1]&32&&x){const m=Bt(W);x.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}n.$$.dirty[1]&1073741824&&Re("select",{feature:i}),n.$$.dirty[1]&134217728&&Re("pick",{feature:N}),n.$$.dirty[0]&81920&&Re("optionsvisibilitychange",{optionsVisible:gt&&!!I}),n.$$.dirty[0]&16384&&Re("featureslisted",{features:I}),n.$$.dirty[1]&67108864&&Re("featuresmarked",{features:H}),n.$$.dirty[0]&1&&Re("reversetoggle",{reverse:G}),n.$$.dirty[0]&2&&Re("querychange",{query:W}),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&x&&x.indicateReverse(G)},[G,W,s,d,f,g,y,_,P,j,V,qe,Yi,Ve,I,B,gt,me,ge,Fe,Xr,Ji,eo,Ut,qt,l,c,a,u,h,b,v,E,S,w,C,x,L,O,M,oe,Ne,Wt,ft,ze,At,dt,je,ht,zt,Ft,Dt,Zr,Qr,Xi,Hr,Yr,H,N,ce,Gt,i,o,r,to,io,no,ro,oo,so,lo,uo,ao,co,fo,ho,mo]}let fr=class extends Ae{constructor(e){super(),We(this,e,cr,ar,Ie,{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,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,autocompleteTimeout:41,selectFirst:11,flyToSelected:42,markerOnSelected:43,types:44,exhaustiveReverseGeocoding:45,excludeTypes:46,zoom:47,maxZoom:48,apiUrl:49,fetchParameters:50,iconsBaseUrl:12,adjustUrlQuery:51,focus:52,blur:53,setQuery:54,clearList:55,clearMap:56},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[52]}get blur(){return this.$$.ctx[53]}get setQuery(){return this.$$.ctx[54]}get clearList(){return this.$$.ctx[55]}get clearMap(){return this.$$.ctx[56]}};function lt(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 St(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 lt({type:"Polygon",coordinates:n},e,t)}function xt(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function wi(n,e,t={}){return lt({type:"MultiPolygon",coordinates:n},e,t)}function _i(n,e,t){if(n!==null)for(var i,r,o,l,s,c,a,d=0,u=0,f,h=n.type,b=h==="FeatureCollection",g=h==="Feature",y=b?n.features.length:1,v=0;v<y;v++){a=b?n.features[v].geometry:g?n.geometry:n,f=a?a.type==="GeometryCollection":!1,s=f?a.geometries.length:1;for(var E=0;E<s;E++){var S=0,w=0;if(l=f?a.geometries[E]:a,l!==null){c=l.coordinates;var C=l.type;switch(d=0,C){case null:break;case"Point":if(e(c,u,v,S,w)===!1)return!1;u++,S++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],u,v,S,w)===!1)return!1;u++,C==="MultiPoint"&&S++}C==="LineString"&&S++;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],u,v,S,w)===!1)return!1;u++}C==="MultiLineString"&&S++,C==="Polygon"&&w++}C==="Polygon"&&S++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(w=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-d;o++){if(e(c[i][r][o],u,v,S,w)===!1)return!1;u++}w++}S++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(_i(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Mt(n,e){var t,i,r,o,l,s,c,a,d,u,f=0,h=n.type==="FeatureCollection",b=n.type==="Feature",g=h?n.features.length:1;for(t=0;t<g;t++){for(s=h?n.features[t].geometry:b?n.geometry:n,a=h?n.features[t].properties:b?n.properties:{},d=h?n.features[t].bbox:b?n.bbox:void 0,u=h?n.features[t].id:b?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,a,d,u)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,a,d,u)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],f,a,d,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function dr(n,e){Mt(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(lt(t,r,{bbox:o,id:l}),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 a=0;a<t.coordinates.length;a++){var d=t.coordinates[a],u={type:c,coordinates:d};if(e(lt(u,r),i,a)===!1)return!1}})}function hr(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return _i(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 Ei=hr;/**
|
|
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
|
|
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=fr),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 xe(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=Me(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>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=Me(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(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=Me(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=Me(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=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(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 gr(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 l=mr(this.toList(),hr(e,t),o);r=this._size+r,this._root=kt({head:l},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=bi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Lt(t,i,s,r):l=Lt(t,i,l,r),this._root=dr(l,s,r)},n.prototype.split=function(e){return bi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return cr(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),l=n[o],s=e[o],c=new xe(l,s);return c.left=Mt(n,e,t,o),c.right=Mt(n,e,o+1,i),c}return null}function hr(n,e){for(var t=new xe(null,null),i=t,r=0;r<n.length;r++)i=i.next=new xe(n[r],e[r]);return i.next=null,t.next}function gr(n){for(var e=n,t=[],i=!1,r=new xe(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),l=n.head;return l.left=o,n.head=n.head.next,l.right=kt(n,r+1,t),l}return null}function mr(n,e,t){for(var i=new xe(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function Ct(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}Ct(n,e,t,s,r),Ct(n,e,s+1,i,r)}}const we=11102230246251565e-32,$=134217729,yr=(3+8*we)*we;function Nt(n,e,t,i,r){let o,l,s,c,u=e[0],d=i[0],a=0,f=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=i[++f]);let h=0;if(a<n&&f<t)for(d>u==d>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=d+o,s=o-(l-d),d=i[++f]),o=l,s!==0&&(r[h++]=s);a<n&&f<t;)d>u==d>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f]),o=l,s!==0&&(r[h++]=s);for(;a<n;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function vr(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 pr=(3+16*we)*we,br=(2+12*we)*we,wr=(9+64*we)*we*we,Be=He(4),wi=He(8),_i=He(12),Ei=He(16),te=He(4);function _r(n,e,t,i,r,o,l){let s,c,u,d,a,f,h,m,y,b,v,E,_,x,N,S,L,w;const C=n-r,O=t-r,U=e-o,j=i-o;x=C*j,f=$*C,h=f-(f-C),m=C-h,f=$*j,y=f-(f-j),b=j-y,N=m*b-(x-h*y-m*y-h*b),S=U*O,f=$*U,h=f-(f-U),m=U-h,f=$*O,y=f-(f-O),b=O-y,L=m*b-(S-h*y-m*y-h*b),v=N-L,a=N-v,Be[0]=N-(v+a)+(a-L),E=x+v,a=E-x,_=x-(E-a)+(v-a),v=_-S,a=_-v,Be[1]=_-(v+a)+(a-S),w=E+v,a=w-E,Be[2]=E-(w-a)+(v-a),Be[3]=w;let W=vr(4,Be),M=br*l;if(W>=M||-W>=M||(a=n-C,s=n-(C+a)+(a-r),a=t-O,u=t-(O+a)+(a-r),a=e-U,c=e-(U+a)+(a-o),a=i-j,d=i-(j+a)+(a-o),s===0&&c===0&&u===0&&d===0)||(M=wr*l+yr*Math.abs(W),W+=C*d+j*s-(U*u+O*c),W>=M||-W>=M))return W;x=s*j,f=$*s,h=f-(f-s),m=s-h,f=$*j,y=f-(f-j),b=j-y,N=m*b-(x-h*y-m*y-h*b),S=c*O,f=$*c,h=f-(f-c),m=c-h,f=$*O,y=f-(f-O),b=O-y,L=m*b-(S-h*y-m*y-h*b),v=N-L,a=N-v,te[0]=N-(v+a)+(a-L),E=x+v,a=E-x,_=x-(E-a)+(v-a),v=_-S,a=_-v,te[1]=_-(v+a)+(a-S),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const V=Nt(4,Be,4,te,wi);x=C*d,f=$*C,h=f-(f-C),m=C-h,f=$*d,y=f-(f-d),b=d-y,N=m*b-(x-h*y-m*y-h*b),S=U*u,f=$*U,h=f-(f-U),m=U-h,f=$*u,y=f-(f-u),b=u-y,L=m*b-(S-h*y-m*y-h*b),v=N-L,a=N-v,te[0]=N-(v+a)+(a-L),E=x+v,a=E-x,_=x-(E-a)+(v-a),v=_-S,a=_-v,te[1]=_-(v+a)+(a-S),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const ne=Nt(V,wi,4,te,_i);x=s*d,f=$*s,h=f-(f-s),m=s-h,f=$*d,y=f-(f-d),b=d-y,N=m*b-(x-h*y-m*y-h*b),S=c*u,f=$*c,h=f-(f-c),m=c-h,f=$*u,y=f-(f-u),b=u-y,L=m*b-(S-h*y-m*y-h*b),v=N-L,a=N-v,te[0]=N-(v+a)+(a-L),E=x+v,a=E-x,_=x-(E-a)+(v-a),v=_-S,a=_-v,te[1]=_-(v+a)+(a-S),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const fe=Nt(ne,_i,4,te,Ei);return Ei[fe-1]}function Er(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=pr*u?c:-_r(n,e,t,i,r,o,u)}const Ye=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Pt=(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 ke=Number.EPSILON;ke===void 0&&(ke=Math.pow(2,-52));const Lr=ke*ke,Li=(n,e)=>{if(-ke<n&&n<ke&&-ke<e&&e<ke)return 0;const t=n-e;return t*t<Lr*n*e?0:n<e?-1:1};class Sr{constructor(){this.reset()}reset(){this.xRounder=new Si,this.yRounder=new Si}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Si{constructor(){this.tree=new xt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&Li(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&Li(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Xe=new Sr,rt=(n,e)=>n.x*e.y-n.y*e.x,xi=(n,e)=>n.x*e.x+n.y*e.y,Mi=(n,e,t)=>{const i=Er(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},ot=n=>Math.sqrt(xi(n,n)),xr=(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 rt(r,i)/ot(r)/ot(i)},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 xi(r,i)/ot(r)/ot(i)},ki=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},Ci=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},kr=(n,e,t,i)=>{if(e.x===0)return Ci(t,i,n.x);if(i.x===0)return Ci(n,e,t.x);if(e.y===0)return ki(t,i,n.y);if(i.y===0)return ki(n,e,t.y);const r=rt(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=rt(o,e)/r,s=rt(o,i)/r,c=n.x+s*e.x,u=t.x+l*i.x,d=n.y+s*e.y,a=t.y+l*i.y,f=(c+u)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const i=le.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Ce.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:xr(this.point,e.point,o.point),cosine:Mr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Cr=0;class Ce{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<u)return 1;if(c>s&&c>u)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<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-i,h=d-c,m=l-r;if(a>f&&h<m)return 1;if(a<f&&h>m)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++Cr,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,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new Ce(c,u,[i],[l])}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,l=t.x+o*r.x;if(e.x===l)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=Pt(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Ye(t,s)&&this.comparePoint(s)===0,d=Ye(i,o)&&e.comparePoint(o)===0,a=Ye(t,c)&&this.comparePoint(c)===0,f=Ye(i,l)&&e.comparePoint(l)===0;if(d&&u)return f&&!a?l:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const h=kr(o,this.vector(),s,e.vector());return h===null||!Ye(r,h)?null:Xe.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Ce(r,l,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.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=Ce.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,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=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 u=this.rings[s],d=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),i.push(d)):i[a]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const u=t[s],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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 Ni{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 l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Xe.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Ce.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(Ce.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 Nr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ni(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 Ni(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class Pi{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 Nr(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class st{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 l=null,s=o.leftSE,c=o.rightSE;const u=[s],d=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,b=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let y=0,b=a.length;y<b;y++)if(a[y].point===s.point){h=y;break}if(h!==null){const y=a.splice(h)[0],b=u.splice(y.index);b.unshift(b[0].otherSE),t.push(new st(b.reverse()));continue}a.push({index:u.length,point:s.point});const m=s.getLeftmostComparator(l);c=f.sort(m)[0].otherSE;break}t.push(new st(u))}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 u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,f=this.events[u+1].point;Mi(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];Mi(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].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 l=this.events[r];le.compare(e,l)>0&&(e=l)}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 Ti{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 Pr{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 Ti(o));else{const l=o.enclosingRing();l.poly||t.push(new Ti(l)),l.poly.addInterior(o)}}return t}}class Tr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.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,l=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;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,m=f.length;h<m;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,m=f.length;h<m;h++)i.push(f[h])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=le.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(a);for(let h=0,m=f.length;h<m;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const d=this._splitSafely(s,u);for(let a=0,f=d.length;a<f;a++)i.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);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 Ri=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Rr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Ir{run(e,t,i){ce.type=e,Xe.reset();const r=[new Pi(t,!0)];for(let a=0,f=i.length;a<f;a++)r.push(new Pi(i[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Pt(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 m=a+1,y=r.length;m<y;m++)if(Pt(h.bbox,r[m].bbox)===null)return[]}const o=new xt(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let m=0,y=h.length;m<y;m++)if(o.insert(h[m]),o.size>Ri)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Tr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){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(o.size>Ri)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Rr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let h=0,m=f.length;h<m;h++){const y=f[h];y.consumedBy===void 0&&o.insert(y)}s=o.size,c=o.pop()}Xe.reset();const u=st.factory(l.segments);return new Pr(u).getGeom()}}const ce=new Ir;var Ii={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 Or(n){const e=[];if(Et(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=Ii.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?wt(i[0],t):yi(i,t)}var Wr=Or;function Ar(n){if(!n)throw new Error("geojson is required");var e=[];return ur(n,function(t){e.push(t)}),_t(e)}var Fr=Ar;function Dr(n,e={}){const t=[];if(Et(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=Ii.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?wt(i[0],e.properties):yi(i,e.properties)}var Br=Dr;function Oi(n,e){const t=Wr(_t([wt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=it(pi(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Fr(n);if(s.features.length>1&&(o||l))for(const c of s.features){const u=it(pi(c));if(l&&u[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&u[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(_t([s.features.length<2?n:Br(s)??n,t]))}const Wi="EPSG:4326";function Ur(n){var o;const e=n.getProperties(),{isMask:t}=e,i=(o=n.getGeometry())==null?void 0:o.getType(),r=t?0:i==="LineString"||i==="MultiLineString"?3:2;return new en({stroke:t?void 0:new jt({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new qt({color:"#00000020"}):void 0,image:new $i({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new tn({backgroundFill:new qt({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new jt({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function Ai(n,e={},t={},i=Ur){let r=-1,o,l,s,c=!1;const u=new Ki({updateWhileAnimating:!0});n.addLayer(u);const d=new Ji({});u.setSource(d),u.setStyle(i),n.on("click",m=>{n.forEachFeatureAtPixel(m.pixel,y=>{const b=y.getId();if(b)return m.stopPropagation(),l==null||l({type:"markerClick",id:b}),y})}),n.on("pointermove",m=>{const y=n.forEachFeatureAtPixel(m.pixel,b=>b.getId());o!==y&&(o&&(l==null||l({type:"markerMouseLeave",id:o})),y&&(l==null||l({type:"markerMouseEnter",id:y})),n.getTargetElement().style.cursor=y?"pointer":c?"crosshair":"",o=y)});function a(){return _e.getUserProjection()??n.getView().getProjection()}function f(m){return m.transform(Wi,a())}const h=m=>{l==null||l({type:"mapClick",coordinates:_e.toLonLat(m.coordinate,a())})};return{setEventHandler(m){m?(l=m,n.on("click",h)):(l=void 0,n.un("click",h))},flyTo(m,y){n.getView().animate({center:_e.fromLonLat(m,a()),...y?{zoom:y}:{},duration:2e3,...e})},fitBounds(m,y,b){n.getView().fit(_e.transformExtent(m,Wi,a()),{padding:[y,y,y,y],...b?{maxZoom:b}:{},duration:2e3,...t})},indicateReverse(m){c=m,n.getTargetElement().style.cursor=m?"crosshair":""},setReverseMarker(m){s?m?s.getGeometry().setCoordinates(_e.fromLonLat(m,a())):(d.removeFeature(s),s.dispose(),s=void 0):m&&(s=new oe.Feature(new se.Point(_e.fromLonLat(m,a()))),s.setProperties({isReverse:!0}),d.addFeature(s))},setMarkers(m,y){function b(v){var E;if(v)for(const _ of v.features){const x=_.geometry.type==="Polygon"?new se.Polygon(_.geometry.coordinates):_.geometry.type==="MultiPolygon"?new se.MultiPolygon(_.geometry.coordinates):null;x&&d.addFeature(new oe.Feature({isMask:!!((E=_.properties)!=null&&E.isMask),geometry:f(x)}))}}if(d.clear(),s&&d.addFeature(s),y){let v=!1;if(y.geometry.type==="GeometryCollection"){const E=y.geometry.geometries.map(_=>_.type==="Polygon"?new se.Polygon(_.coordinates):_.type==="MultiPolygon"?new se.MultiPolygon(_.coordinates):null).filter(_=>!!_);if(E.length>0)d.addFeature(new oe.Feature(f(new se.GeometryCollection(E)))),v=!0;else for(const _ of y.geometry.geometries)_.type==="LineString"?(d.addFeature(new oe.Feature(f(new se.LineString(_.coordinates)))),v=!0):_.type==="MultiLineString"&&d.addFeature(new oe.Feature(f(new se.MultiLineString(_.coordinates)))),v=!0}if(!v){if(y.geometry.type==="Polygon")Oi(y,b);else if(y.geometry.type==="MultiPolygon")Oi(y,b);else if(y.geometry.type==="LineString"){d.addFeature(new oe.Feature(f(new se.LineString(y.geometry.coordinates))));return}else if(y.geometry.type==="MultiLineString"){d.addFeature(new oe.Feature(f(new se.MultiLineString(y.geometry.coordinates))));return}}d.addFeature(new oe.Feature(f(new se.Point(y.center))))}for(const v of m??[]){if(v===y)continue;const E=new oe.Feature(new se.Point(_e.fromLonLat(v.center,a())));E.setId(v.id),E.setProperties({fuzzy:!!v.matching_text,tooltip:v.place_type[0]==="reverse"?v.place_name:v.place_name.replace(/,.*/,"")}),d.addFeature(E)}},setSelectedMarker(m){var v,E,_;const y=d.getFeatures(),b=(v=y[0])!=null&&v.getProperties().isReverse?1:0;r>-1&&((E=y[r+b])==null||E.setProperties({isSelected:!1})),m>-1&&((_=y[m+b])==null||_.setProperties({isSelected:!0})),r=m},getCenterAndZoom(){const m=n.getView(),y=m.getCenter(),b=m.getZoom();if(!(!y||b===void 0))return[b,..._e.toLonLat(y,a())]}}}class Gr extends F.Control{constructor(t){const i=document.createElement("div");i.className="ol-search";super({element:i,target:t.target});zt(this,ue);zt(this,Oe);const{flyTo:r,fullGeometryStyle:o,...l}=t;gt(this,ue,new lr({target:i,props:{flyTo:r===void 0?!0:!!r,...l}}));for(const s of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])de(this,ue).$on(s,c=>{switch(s){case"select":this.dispatchEvent(new Fi(c.detail));break;case"featuresListed":this.dispatchEvent(new Di(c.detail));break;case"featuresMarked":this.dispatchEvent(new Bi(c.detail));break;case"optionsVisibilityChange":this.dispatchEvent(new Ui(c.detail));break;case"pick":this.dispatchEvent(new Gi(c.detail));break;case"queryChange":this.dispatchEvent(new zi(c.detail));break;case"response":this.dispatchEvent(new qi(c.detail.url,c.detail.featureCollection));break;case"reverseToggle":this.dispatchEvent(new ji(c.detail));break}});gt(this,Oe,t)}setMap(t){var i;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:o}=de(this,Oe),l=Ai(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,o);(i=de(this,ue))==null||i.$set({mapController:l})}}setOptions(t){var l;gt(this,Oe,t);const{flyTo:i,fullGeometryStyle:r,...o}=de(this,Oe);(l=de(this,ue))==null||l.$set({...o,flyTo:i===void 0?!0:!!i})}setQuery(t,i=!0){var r;(r=de(this,ue))==null||r.setQuery(t,i)}clearMap(){var t;(t=de(this,ue))==null||t.clearMap()}clearList(){var t;(t=de(this,ue))==null||t.clearList()}focus(){var t;(t=de(this,ue))==null||t.focus()}blur(){var t;(t=de(this,ue))==null||t.blur()}}ue=new WeakMap,Oe=new WeakMap;class Fi extends D{constructor(t){super("select");ae(this,"feature");this.feature=t}}class Di extends D{constructor(t){super("featuresListed");ae(this,"features");this.features=t}}class Bi extends D{constructor(t){super("featuresMarked");ae(this,"features");this.features=t}}class Ui extends D{constructor(t){super("optionsVisibilityChange");ae(this,"optionsVisible");this.optionsVisible=t}}class Gi extends D{constructor(t){super("pick");ae(this,"feature");this.feature=t}}class zi extends D{constructor(t){super("queryChange");ae(this,"query");this.query=t}}class qi extends D{constructor(t,i){super("response");ae(this,"url");ae(this,"featureCollection");this.url=t,this.featureCollection=i}}class ji extends D{constructor(t){super("reverseToggle");ae(this,"reverse");this.reverse=t}}k.FeaturesListedEvent=Di,k.FeaturesMarkedEvent=Bi,k.GeocodingControl=Gr,k.OptionsVisibilityChangeEvent=Ui,k.PickEvent=Gi,k.QueryChangeEvent=zi,k.ResponseEvent=qi,k.ReverseToggleEvent=ji,k.SelectEvent=Fi,k.createOpenLayersMapController=Ai,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
21
|
+
***************************************************************************** */function mr(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(a){return function(d){return c([a,d])}}function c(a){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=a[0]&2?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,r=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1],o=a;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(a);break}o[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(d){a=[6,d],r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}var xe=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function gr(n,e){return n>e?1:n<e?-1:0}function Me(n,e,t){for(var i=new xe(null,null),r=i,o=i;;){var l=t(n,e.key);if(l<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(l>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 kt(n,e,t,i){var r=new xe(n,e);if(t===null)return r.left=r.right=null,r;t=Me(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 Li(n,e,t){var i=null,r=null;if(e){e=Me(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 yr(n,e,t){return e===null?n:(n===null||(e=Me(n.key,e,t),e.left=n),e)}function Ct(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
|
|
22
|
+
`);var o=e+(t?" ":"│ ");n.left&&Ct(n.left,o,!1,i,r),n.right&&Ct(n.right,o,!0,i,r)}}var Pt=function(){function n(e){e===void 0&&(e=gr),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=kt(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new xe(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=Me(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>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=Me(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(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=Me(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=Me(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=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(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 pr(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&&Rt(e,t,0,r-1,o),this._root===null)this._root=Nt(e,t,0,r),this._size=r;else{var l=br(this.toList(),vr(e,t),o);r=this._size+r,this._root=Tt({head:l},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 Ct(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=Li(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=kt(t,i,s,r):l=kt(t,i,l,r),this._root=yr(l,s,r)},n.prototype.split=function(e){return Li(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return mr(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 Nt(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),l=n[o],s=e[o],c=new xe(l,s);return c.left=Nt(n,e,t,o),c.right=Nt(n,e,o+1,i),c}return null}function vr(n,e){for(var t=new xe(null,null),i=t,r=0;r<n.length;r++)i=i.next=new xe(n[r],e[r]);return i.next=null,t.next}function pr(n){for(var e=n,t=[],i=!1,r=new xe(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 Tt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=Tt(n,e,r),l=n.head;return l.left=o,n.head=n.head.next,l.right=Tt(n,r+1,t),l}return null}function br(n,e,t){for(var i=new xe(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function Rt(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}Rt(n,e,t,s,r),Rt(n,e,s+1,i,r)}}const we=11102230246251565e-32,te=134217729,wr=(3+8*we)*we;function It(n,e,t,i,r){let o,l,s,c,a=e[0],d=i[0],u=0,f=0;d>a==d>-a?(o=a,a=e[++u]):(o=d,d=i[++f]);let h=0;if(u<n&&f<t)for(d>a==d>-a?(l=a+o,s=o-(l-a),a=e[++u]):(l=d+o,s=o-(l-d),d=i[++f]),o=l,s!==0&&(r[h++]=s);u<n&&f<t;)d>a==d>-a?(l=o+a,c=l-o,s=o-(l-c)+(a-c),a=e[++u]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f]),o=l,s!==0&&(r[h++]=s);for(;u<n;)l=o+a,c=l-o,s=o-(l-c)+(a-c),a=e[++u],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=i[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function _r(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function Ke(n){return new Float64Array(n)}const Er=(3+16*we)*we,Lr=(2+12*we)*we,Sr=(9+64*we)*we*we,Ue=Ke(4),Si=Ke(8),xi=Ke(12),Mi=Ke(16),ne=Ke(4);function xr(n,e,t,i,r,o,l){let s,c,a,d,u,f,h,b,g,y,v,E,S,w,C,x,L,_;const P=n-r,O=t-r,G=e-o,j=i-o;w=P*j,f=te*P,h=f-(f-P),b=P-h,f=te*j,g=f-(f-j),y=j-g,C=b*y-(w-h*g-b*g-h*y),x=G*O,f=te*G,h=f-(f-G),b=G-h,f=te*O,g=f-(f-O),y=O-g,L=b*y-(x-h*g-b*g-h*y),v=C-L,u=C-v,Ue[0]=C-(v+u)+(u-L),E=w+v,u=E-w,S=w-(E-u)+(v-u),v=S-x,u=S-v,Ue[1]=S-(v+u)+(u-x),_=E+v,u=_-E,Ue[2]=E-(_-u)+(v-u),Ue[3]=_;let W=_r(4,Ue),M=Lr*l;if(W>=M||-W>=M||(u=n-P,s=n-(P+u)+(u-r),u=t-O,a=t-(O+u)+(u-r),u=e-G,c=e-(G+u)+(u-o),u=i-j,d=i-(j+u)+(u-o),s===0&&c===0&&a===0&&d===0)||(M=Sr*l+wr*Math.abs(W),W+=P*d+j*s-(G*a+O*c),W>=M||-W>=M))return W;w=s*j,f=te*s,h=f-(f-s),b=s-h,f=te*j,g=f-(f-j),y=j-g,C=b*y-(w-h*g-b*g-h*y),x=c*O,f=te*c,h=f-(f-c),b=c-h,f=te*O,g=f-(f-O),y=O-g,L=b*y-(x-h*g-b*g-h*y),v=C-L,u=C-v,ne[0]=C-(v+u)+(u-L),E=w+v,u=E-w,S=w-(E-u)+(v-u),v=S-x,u=S-v,ne[1]=S-(v+u)+(u-x),_=E+v,u=_-E,ne[2]=E-(_-u)+(v-u),ne[3]=_;const V=It(4,Ue,4,ne,Si);w=P*d,f=te*P,h=f-(f-P),b=P-h,f=te*d,g=f-(f-d),y=d-g,C=b*y-(w-h*g-b*g-h*y),x=G*a,f=te*G,h=f-(f-G),b=G-h,f=te*a,g=f-(f-a),y=a-g,L=b*y-(x-h*g-b*g-h*y),v=C-L,u=C-v,ne[0]=C-(v+u)+(u-L),E=w+v,u=E-w,S=w-(E-u)+(v-u),v=S-x,u=S-v,ne[1]=S-(v+u)+(u-x),_=E+v,u=_-E,ne[2]=E-(_-u)+(v-u),ne[3]=_;const oe=It(V,Si,4,ne,xi);w=s*d,f=te*s,h=f-(f-s),b=s-h,f=te*d,g=f-(f-d),y=d-g,C=b*y-(w-h*g-b*g-h*y),x=c*a,f=te*c,h=f-(f-c),b=c-h,f=te*a,g=f-(f-a),y=a-g,L=b*y-(x-h*g-b*g-h*y),v=C-L,u=C-v,ne[0]=C-(v+u)+(u-L),E=w+v,u=E-w,S=w-(E-u)+(v-u),v=S-x,u=S-v,ne[1]=S-(v+u)+(u-x),_=E+v,u=_-E,ne[2]=E-(_-u)+(v-u),ne[3]=_;const Ne=It(oe,xi,4,ne,Mi);return Mi[Ne-1]}function Mr(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,a=Math.abs(l+s);return Math.abs(c)>=Er*a?c:-xr(n,e,t,i,r,o,a)}const Je=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,Ot=(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 ke=Number.EPSILON;ke===void 0&&(ke=Math.pow(2,-52));const kr=ke*ke,ki=(n,e)=>{if(-ke<n&&n<ke&&-ke<e&&e<ke)return 0;const t=n-e;return t*t<kr*n*e?0:n<e?-1:1};class Cr{constructor(){this.reset()}reset(){this.xRounder=new Ci,this.yRounder=new Ci}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ci{constructor(){this.tree=new Pt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&ki(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&ki(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const $e=new Cr,ut=(n,e)=>n.x*e.y-n.y*e.x,Pi=(n,e)=>n.x*e.x+n.y*e.y,Ni=(n,e,t)=>{const i=Mr(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},at=n=>Math.sqrt(Pi(n,n)),Pr=(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 ut(r,i)/at(r)/at(i)},Nr=(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 Pi(r,i)/at(r)/at(i)},Ti=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},Ri=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},Tr=(n,e,t,i)=>{if(e.x===0)return Ri(t,i,n.x);if(i.x===0)return Ri(n,e,t.x);if(e.y===0)return Ti(t,i,n.y);if(i.y===0)return Ti(n,e,t.y);const r=ut(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=ut(o,e)/r,s=ut(o,i)/r,c=n.x+s*e.x,a=t.x+l*i.x,d=n.y+s*e.y,u=t.y+l*i.y,f=(c+a)/2,h=(d+u)/2;return{x:f,y:h}};class ae{static compare(e,t){const i=ae.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Ce.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:Pr(this.point,e.point,o.point),cosine:Nr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:a}=t.get(o);return l>=0&&c>=0?s<a?1:s>a?-1:0:l<0&&c<0?s<a?-1:s>a?1:0:c<l?-1:c>l?1:0}}}let Rr=0;class Ce{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,a=e.rightSE.point.y,d=t.rightSE.point.y;if(i<r){if(c<s&&c<a)return 1;if(c>s&&c>a)return-1;const u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>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 u=t.comparePoint(e.leftSE.point);if(u!==0)return u;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<l){const u=t.comparePoint(e.rightSE.point);if(u!==0)return u}if(o>l){const u=e.comparePoint(t.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(o!==l){const u=a-s,f=o-i,h=d-c,b=l-r;if(u>f&&h<b)return 1;if(u<f&&h>b)return-1}return o>l?1:o<l||a<d?-1:a>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++Rr,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,l;const s=ae.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new ae(r,!0),a=new ae(o,!1);return new Ce(c,a,[i],[l])}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,l=t.x+o*r.x;if(e.x===l)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=Ot(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,a=Je(t,s)&&this.comparePoint(s)===0,d=Je(i,o)&&e.comparePoint(o)===0,u=Je(t,c)&&this.comparePoint(c)===0,f=Je(i,l)&&e.comparePoint(l)===0;if(d&&a)return f&&!u?l:!f&&u?c:null;if(d)return u&&o.x===c.x&&o.y===c.y?null:o;if(a)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&u)return null;if(f)return l;if(u)return c;const h=Tr(o,this.vector(),s,e.vector());return h===null||!Je(r,h)?null:$e.round(h.x,h.y)}split(e){const t=[],i=e.events!==void 0,r=new ae(e,!0),o=new ae(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Ce(r,l,this.rings.slice(),this.windings.slice());return ae.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ae.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=Ce.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,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],a=t.rings.indexOf(s);a===-1?(t.rings.push(s),t.windings.push(c)):t.windings[a]+=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 a=this.rings[s],d=this.windings[s],u=t.indexOf(a);u===-1?(t.push(a),i.push(d)):i[u]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const a=t[s],d=a.poly;if(l.indexOf(d)===-1)if(a.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const u=o.indexOf(a.poly);u!==-1&&o.splice(u,1)}}for(let s=0,c=o.length;s<c;s++){const a=o[s].multiPoly;r.indexOf(a)===-1&&r.push(a)}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(he.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===he.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 ${he.type}`)}return this._isInResult}}class Ii{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=$e.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 l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=$e.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Ce.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(Ce.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 Ir{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ii(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 Ii(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class Oi{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 Ir(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class ct{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 l=null,s=o.leftSE,c=o.rightSE;const a=[s],d=s.point,u=[];for(;l=s,s=c,a.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=a[0].point,y=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${y.x}, ${y.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let g=0,y=u.length;g<y;g++)if(u[g].point===s.point){h=g;break}if(h!==null){const g=u.splice(h)[0],y=a.splice(g.index);y.unshift(y[0].otherSE),t.push(new ct(y.reverse()));continue}u.push({index:a.length,point:s.point});const b=s.getLeftmostComparator(l);c=f.sort(b)[0].otherSE;break}t.push(new ct(a))}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 a=1,d=this.events.length-1;a<d;a++){const u=this.events[a].point,f=this.events[a+1].point;Ni(u,e,f)!==0&&(t.push(u),e=u)}if(t.length===1)return null;const i=t[0],r=t[1];Ni(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let a=l;a!=s;a+=o)c.push([t[a].x,t[a].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 l=this.events[r];ae.compare(e,l)>0&&(e=l)}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 Wi{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 Or{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 Wi(o));else{const l=o.enclosingRing();l.poly||t.push(new Wi(l)),l.poly.addInterior(o)}}return t}}class Wr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.compare;this.queue=e,this.tree=new Pt(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,l=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;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let a=null;if(s){const u=s.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(a=u),!s.isAnEndpoint(u))){const f=this._splitSafely(s,u);for(let h=0,b=f.length;h<b;h++)i.push(f[h])}}let d=null;if(c){const u=c.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(d=u),!c.isAnEndpoint(u))){const f=this._splitSafely(c,u);for(let h=0,b=f.length;h<b;h++)i.push(f[h])}}if(a!==null||d!==null){let u=null;a===null?u=d:d===null?u=a:u=ae.comparePoints(a,d)<=0?a:d,this.queue.remove(t.rightSE),i.push(t.rightSE);const f=t.split(u);for(let h=0,b=f.length;h<b;h++)i.push(f[h])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const a=s.getIntersection(c);if(a!==null){if(!s.isAnEndpoint(a)){const d=this._splitSafely(s,a);for(let u=0,f=d.length;u<f;u++)i.push(d[u])}if(!c.isAnEndpoint(a)){const d=this._splitSafely(c,a);for(let u=0,f=d.length;u<f;u++)i.push(d[u])}}}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 Ai=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ar=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class zr{run(e,t,i){he.type=e,$e.reset();const r=[new Oi(t,!0)];for(let u=0,f=i.length;u<f;u++)r.push(new Oi(i[u],!1));if(he.numMultiPolys=r.length,he.type==="difference"){const u=r[0];let f=1;for(;f<r.length;)Ot(r[f].bbox,u.bbox)!==null?f++:r.splice(f,1)}if(he.type==="intersection")for(let u=0,f=r.length;u<f;u++){const h=r[u];for(let b=u+1,g=r.length;b<g;b++)if(Ot(h.bbox,r[b].bbox)===null)return[]}const o=new Pt(ae.compare);for(let u=0,f=r.length;u<f;u++){const h=r[u].getSweepEvents();for(let b=0,g=h.length;b<g;b++)if(o.insert(h[b]),o.size>Ai)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Wr(o);let s=o.size,c=o.pop();for(;c;){const u=c.key;if(o.size===s){const h=u.segment;throw new Error(`Unable to pop() ${u.isLeft?"left":"right"} SweepEvent [${u.point.x}, ${u.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(o.size>Ai)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Ar)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(u);for(let h=0,b=f.length;h<b;h++){const g=f[h];g.consumedBy===void 0&&o.insert(g)}s=o.size,c=o.pop()}$e.reset();const a=ct.factory(l.segments);return new Or(a).getGeom()}}const he=new zr;var zi={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 he.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 he.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 he.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 he.run("difference",n,t)}};function Fr(n){const e=[];if(Mt(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=zi.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?St(i[0],t):wi(i,t)}var Dr=Fr;function Gr(n){if(!n)throw new Error("geojson is required");var e=[];return dr(n,function(t){e.push(t)}),xt(e)}var Br=Gr;function Ur(n,e={}){const t=[];if(Mt(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=zi.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?St(i[0],e.properties):wi(i,e.properties)}var qr=Ur;function Fi(n,e){const t=Dr(xt([St([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=st(Ei(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Br(n);if(s.features.length>1&&(o||l))for(const c of s.features){const a=st(Ei(c));if(l&&a[0]<-180+r)for(const d of c.geometry.coordinates)for(const u of d)u[0]+=360-r;if(o&&a[2]>180-r)for(const d of c.geometry.coordinates)for(const u of d)u[0]-=360-r}e(xt([s.features.length<2?n:qr(s)??n,t]))}const Di="EPSG:4326";function jr(n){var o;const e=n.getProperties(),{isMask:t}=e,i=(o=n.getGeometry())==null?void 0:o.getType(),r=t?0:i==="LineString"||i==="MultiLineString"?3:2;return new on({stroke:t?void 0:new Ht({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new Qt({color:"#00000020"}):void 0,image:new rn({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new sn({backgroundFill:new Qt({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new Ht({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function Gi(n,e={},t={},i=jr,r=!1){let o=-1,l,s,c,a=!1;const d=new tn({updateWhileAnimating:!0});n.addLayer(d);const u=new nn({});d.setSource(u),d.setStyle(i),n.on("click",g=>{n.forEachFeatureAtPixel(g.pixel,y=>{const v=y.getId();if(v)return g.stopPropagation(),s==null||s({type:"markerClick",id:v}),y})}),n.on("pointermove",g=>{const y=n.forEachFeatureAtPixel(g.pixel,v=>v.getId());l!==y&&(l&&(s==null||s({type:"markerMouseLeave",id:l})),y&&(s==null||s({type:"markerMouseEnter",id:y})),n.getTargetElement().style.cursor=y?"pointer":a?"crosshair":"",l=y)});function f(){return _e.getUserProjection()??n.getView().getProjection()}function h(g){return g.transform(Di,f())}const b=g=>{s==null||s({type:"mapClick",coordinates:_e.toLonLat(g.coordinate,f())})};return{setEventHandler(g){g?(s=g,n.on("click",b)):(s=void 0,n.un("click",b))},flyTo(g,y){n.getView().animate({center:_e.fromLonLat(g,f()),...y?{zoom:y}:{},duration:2e3,...e})},fitBounds(g,y,v){n.getView().fit(_e.transformExtent(g,Di,f()),{padding:[y,y,y,y],...v?{maxZoom:v}:{},duration:2e3,...t})},indicateReverse(g){a=g,n.getTargetElement().style.cursor=g?"crosshair":""},setReverseMarker(g){c?g?c.getGeometry().setCoordinates(_e.fromLonLat(g,f())):(u.removeFeature(c),c.dispose(),c=void 0):g&&(c=new le.Feature(new ue.Point(_e.fromLonLat(g,f()))),c.setProperties({isReverse:!0}),u.addFeature(c))},setMarkers(g,y){function v(E){var S;if(E)for(const w of E.features){const C=w.geometry.type==="Polygon"?new ue.Polygon(w.geometry.coordinates):w.geometry.type==="MultiPolygon"?new ue.MultiPolygon(w.geometry.coordinates):null;C&&u.addFeature(new le.Feature({isMask:!!((S=w.properties)!=null&&S.isMask),geometry:h(C)}))}}if(u.clear(),c&&u.addFeature(c),y){let E=!1;if(y.geometry.type==="GeometryCollection"){const S=y.geometry.geometries.map(w=>w.type==="Polygon"?new ue.Polygon(w.coordinates):w.type==="MultiPolygon"?new ue.MultiPolygon(w.coordinates):null).filter(w=>!!w);if(S.length>0)u.addFeature(new le.Feature(h(new ue.GeometryCollection(S)))),E=!0;else for(const w of y.geometry.geometries)w.type==="LineString"?(u.addFeature(new le.Feature(h(new ue.LineString(w.coordinates)))),E=!0):w.type==="MultiLineString"&&u.addFeature(new le.Feature(h(new ue.MultiLineString(w.coordinates)))),E=!0}if(!E){if(y.geometry.type==="Polygon")Fi(y,v);else if(y.geometry.type==="MultiPolygon")Fi(y,v);else if(y.geometry.type==="LineString"){u.addFeature(new le.Feature(h(new ue.LineString(y.geometry.coordinates))));return}else if(y.geometry.type==="MultiLineString"){u.addFeature(new le.Feature(h(new ue.MultiLineString(y.geometry.coordinates))));return}}if(!r&&y.geometry.type!=="Point")return;u.addFeature(new le.Feature(h(new ue.Point(y.center))))}for(const E of g??[]){if(E===y)continue;const S=new le.Feature(new ue.Point(_e.fromLonLat(E.center,f())));S.setId(E.id),S.setProperties({fuzzy:!!E.matching_text,tooltip:E.place_type[0]==="reverse"?E.place_name:E.place_name.replace(/,.*/,"")}),u.addFeature(S)}},setSelectedMarker(g){var E,S,w;const y=u.getFeatures(),v=(E=y[0])!=null&&E.getProperties().isReverse?1:0;o>-1&&((S=y[o+v])==null||S.setProperties({isSelected:!1})),g>-1&&((w=y[g+v])==null||w.setProperties({isSelected:!0})),o=g},getCenterAndZoom(){const g=n.getView(),y=g.getCenter(),v=g.getZoom();if(!(!y||v===void 0))return[v,..._e.toLonLat(y,f())]}}}class Vr extends z.Control{constructor(t){const i=document.createElement("div");i.className="ol-search";super({element:i,target:t.target});Zt(this,X);Zt(this,Pe);const{flyTo:r,fullGeometryStyle:o,...l}=t;pt(this,X,new fr({target:i,props:{flyTo:r===void 0?!0:!!r,...l}})),K(this,X).$on("select",s=>{this.dispatchEvent(new Bi(s.detail.feature))}),K(this,X).$on("pick",s=>{this.dispatchEvent(new Vi(s.detail.feature))}),K(this,X).$on("featureslisted",s=>{this.dispatchEvent(new Ui(s.detail.features))}),K(this,X).$on("featuresmarked",s=>{this.dispatchEvent(new qi(s.detail.features))}),K(this,X).$on("response",s=>{this.dispatchEvent(new Qi(s.detail.url,s.detail.featureCollection))}),K(this,X).$on("optionsvisibilitychange",s=>{this.dispatchEvent(new ji(s.detail.optionsVisible))}),K(this,X).$on("reversetoggle",s=>{this.dispatchEvent(new Hi(s.detail.reverse))}),K(this,X).$on("querychange",s=>{this.dispatchEvent(new Zi(s.detail.query))}),pt(this,Pe,t)}setMap(t){var i;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:o}=K(this,Pe),l=Gi(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,o,K(this,Pe).showFullGeometry==="polygon-with-marker");(i=K(this,X))==null||i.$set({mapController:l})}}setOptions(t){var l;pt(this,Pe,t);const{flyTo:i,fullGeometryStyle:r,...o}=K(this,Pe);(l=K(this,X))==null||l.$set({...o,flyTo:i===void 0?!0:!!i})}setQuery(t,i=!0){var r;(r=K(this,X))==null||r.setQuery(t,i)}clearMap(){var t;(t=K(this,X))==null||t.clearMap()}clearList(){var t;(t=K(this,X))==null||t.clearList()}focus(){var t;(t=K(this,X))==null||t.focus()}blur(){var t;(t=K(this,X))==null||t.blur()}}X=new WeakMap,Pe=new WeakMap;class Bi extends F{constructor(t){super("select");de(this,"feature");this.feature=t}}class Ui extends F{constructor(t){super("featureslisted");de(this,"features");this.features=t}}class qi extends F{constructor(t){super("featuresmarked");de(this,"features");this.features=t}}class ji extends F{constructor(t){super("optionsvisibilitychange");de(this,"optionsVisible");this.optionsVisible=t}}class Vi extends F{constructor(t){super("pick");de(this,"feature");this.feature=t}}class Zi extends F{constructor(t){super("querychange");de(this,"query");this.query=t}}class Qi extends F{constructor(t,i){super("response");de(this,"url");de(this,"featureCollection");this.url=t,this.featureCollection=i}}class Hi extends F{constructor(t){super("reversetoggle");de(this,"reverse");this.reverse=t}}k.FeaturesListedEvent=Ui,k.FeaturesMarkedEvent=qi,k.GeocodingControl=Vr,k.OptionsVisibilityChangeEvent=ji,k.PickEvent=Vi,k.QueryChangeEvent=Zi,k.ResponseEvent=Qi,k.ReverseToggleEvent=Hi,k.SelectEvent=Bi,k.createOpenLayersMapController=Gi,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
|
23
23
|
//# sourceMappingURL=openlayers.umd.js.map
|