@maptiler/geocoding-control 0.0.37 → 0.0.42

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/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "@maptiler/geocoding-control",
3
- "version": "0.0.37",
3
+ "version": "0.0.42",
4
4
  "type": "module",
5
+ "author": {
6
+ "name": "Martin Ždila",
7
+ "email": "martin.zdila@maptiler.com"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/maptiler/maptiler-geocoding-control"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/maptiler/maptiler-geocoding-control/issues"
15
+ },
5
16
  "scripts": {
6
17
  "dev": "vite",
7
- "build": "vite build && FLAVOUR=leaflet vite build && tsc --outDir dist --declaration --emitDeclarationOnly",
18
+ "build": "vite build && mv dist/maplibregl.umd.cjs dist/maplibregl.umd.js && FLAVOUR=leaflet vite build && mv dist/leaflet.umd.cjs dist/leaflet.umd.js && tsc --outDir dist --declaration --emitDeclarationOnly",
8
19
  "preview": "vite preview",
9
20
  "check": "svelte-check --tsconfig ./tsconfig.json"
10
21
  },
@@ -15,11 +26,11 @@
15
26
  "exports": {
16
27
  "./leaflet": {
17
28
  "import": "./dist/leaflet.js",
18
- "require": "./dist/leaflet.umd.cjs"
29
+ "require": "./dist/leaflet.umd.js"
19
30
  },
20
31
  "./maplibregl": {
21
32
  "import": "./dist/maplibregl.js",
22
- "require": "./dist/maplibregl.umd.cjs"
33
+ "require": "./dist/maplibregl.umd.js"
23
34
  },
24
35
  "./dist/style.css": {
25
36
  "import": "./dist/style.css",
@@ -34,7 +45,8 @@
34
45
  "devDependencies": {
35
46
  "@sveltejs/vite-plugin-svelte": "^1.1.0",
36
47
  "@tsconfig/svelte": "^3.0.0",
37
- "@turf/mask": "^6.5.0",
48
+ "@turf/buffer": "^6.5.0",
49
+ "@turf/difference": "^6.5.0",
38
50
  "@turf/union": "^6.5.0",
39
51
  "@types/leaflet": "^1.9.0",
40
52
  "prettier": "^2.7.1",
@@ -272,19 +272,17 @@
272
272
 
273
273
  const sp = new URLSearchParams();
274
274
 
275
- sp.set("key", apiKey);
276
-
277
275
  if (language) {
278
276
  sp.set("language", String(language));
279
277
  }
280
278
 
281
279
  if (!isReverse) {
282
280
  if (bbox) {
283
- sp.set("bbox", bbox.join(","));
281
+ sp.set("bbox", bbox.map((c) => c.toFixed(6)).join(","));
284
282
  }
285
283
 
286
284
  if (proximity) {
287
- sp.set("proximity", proximity.join(","));
285
+ sp.set("proximity", proximity.map((c) => c.toFixed(6)).join(","));
288
286
  }
289
287
 
290
288
  // sp.set("autocomplete", String(autocomplete));
@@ -294,6 +292,8 @@
294
292
 
295
293
  // sp.set("limit", String(limit));
296
294
 
295
+ sp.set("key", apiKey);
296
+
297
297
  const url =
298
298
  import.meta.env.VITE_API_URL +
299
299
  "/" +
@@ -381,10 +381,27 @@
381
381
  }
382
382
  }
383
383
 
384
+ // taken from Leaflet
385
+ export function wrapNum(
386
+ x: number,
387
+ range: [number, number],
388
+ includeMax: boolean
389
+ ) {
390
+ const max = range[1],
391
+ min = range[0],
392
+ d = max - min;
393
+
394
+ return x === max && includeMax ? x : ((((x - min) % d) + d) % d) + min;
395
+ }
396
+
384
397
  function handleReverse(coordinates: [lng: number, lat: number]) {
385
398
  reverseActive = enableReverse === "always";
386
399
 
387
- setQuery(coordinates[0].toFixed(6) + "," + coordinates[1].toFixed(6));
400
+ setQuery(
401
+ wrapNum(coordinates[0], [-180, 180], true).toFixed(6) +
402
+ "," +
403
+ coordinates[1].toFixed(6)
404
+ );
388
405
  }
389
406
 
390
407
  function handleKeyDown(e: KeyboardEvent) {
@@ -6,9 +6,13 @@ import type {
6
6
  MultiPolygon,
7
7
  LineString,
8
8
  MultiLineString,
9
+ Feature as TurfFeature,
10
+ Position,
9
11
  } from "@turf/helpers";
10
- import mask from "@turf/mask";
12
+ import difference from "@turf/difference";
11
13
  import union from "@turf/union";
14
+ import buffer from "@turf/buffer";
15
+ import { setMask } from "./mask";
12
16
 
13
17
  export function createLeafletMapController(
14
18
  map: L.Map,
@@ -19,12 +23,16 @@ export function createLeafletMapController(
19
23
  fullGeometryStyle: L.PathOptions | L.StyleFunction = (feature) => {
20
24
  const type = feature?.geometry?.type;
21
25
 
22
- const weight = type === "LineString" || type === "MultiLineString" ? 3 : 2;
26
+ const weight = feature?.properties?.isMask
27
+ ? 0
28
+ : type === "LineString" || type === "MultiLineString"
29
+ ? 3
30
+ : 2;
23
31
 
24
32
  return {
25
33
  color: "#3170fe",
26
34
  fillColor: "#000",
27
- fillOpacity: 0.1,
35
+ fillOpacity: feature?.properties?.isMask ? 0.1 : 0,
28
36
  weight,
29
37
  dashArray: [weight, weight],
30
38
  lineCap: "butt",
@@ -167,7 +175,7 @@ export function createLeafletMapController(
167
175
  | MultiPolygon; // union actually returns geometry
168
176
  }
169
177
 
170
- setData(mask({ ...picked, geometry }));
178
+ setMask({ ...picked, geometry }, setData);
171
179
 
172
180
  handled = true;
173
181
  } else {
@@ -194,7 +202,7 @@ export function createLeafletMapController(
194
202
  picked.geometry.type === "Polygon" ||
195
203
  picked.geometry.type === "MultiPolygon"
196
204
  ) {
197
- setData(mask(picked as any));
205
+ setMask(picked as any, setData);
198
206
  } else if (
199
207
  picked.geometry.type === "LineString" ||
200
208
  picked.geometry.type === "MultiLineString"
@@ -12,14 +12,18 @@ import type {
12
12
  } from "maplibre-gl";
13
13
  import MarkerIcon from "./MarkerIcon.svelte";
14
14
  import type { Feature, MapController, Proximity } from "./types";
15
- import mask from "@turf/mask";
16
15
  import union from "@turf/union";
16
+ import buffer from "@turf/buffer";
17
+ import difference from "@turf/difference";
17
18
  import type {
18
19
  Polygon,
19
20
  MultiPolygon,
20
21
  LineString,
21
22
  MultiLineString,
23
+ Feature as TurfFeature,
24
+ Position,
22
25
  } from "@turf/helpers";
26
+ import { setMask } from "./mask";
23
27
 
24
28
  let emptyGeojson: GeoJSON.FeatureCollection = {
25
29
  type: "FeatureCollection",
@@ -38,11 +42,11 @@ export function createMaplibreglMapController(
38
42
  line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
39
43
  } = {
40
44
  fill: {
41
- layout: {},
42
45
  paint: {
43
46
  "fill-color": "#000",
44
47
  "fill-opacity": 0.1,
45
48
  },
49
+ filter: ["all", ["==", ["geometry-type"], "Polygon"], ["has", "isMask"]],
46
50
  },
47
51
  line: {
48
52
  layout: {
@@ -53,6 +57,7 @@ export function createMaplibreglMapController(
53
57
  "line-dasharray": [1, 1],
54
58
  "line-color": "#3170fe",
55
59
  },
60
+ filter: ["!", ["has", "isMask"]],
56
61
  },
57
62
  }
58
63
  ) {
@@ -77,7 +82,6 @@ export function createMaplibreglMapController(
77
82
  id: "full-geom-fill",
78
83
  type: "fill",
79
84
  source: "full-geom",
80
- filter: ["==", ["geometry-type"], "Polygon"],
81
85
  });
82
86
 
83
87
  map.addLayer({
@@ -213,7 +217,7 @@ export function createMaplibreglMapController(
213
217
  | MultiPolygon; // union actually returns geometry
214
218
  }
215
219
 
216
- setData(mask({ ...picked, geometry }));
220
+ setMask({ ...picked, geometry }, setData);
217
221
 
218
222
  handled = true;
219
223
  } else {
@@ -240,7 +244,7 @@ export function createMaplibreglMapController(
240
244
  picked.geometry.type === "Polygon" ||
241
245
  picked.geometry.type === "MultiPolygon"
242
246
  ) {
243
- setData(mask(picked as any));
247
+ setMask(picked as any, setData);
244
248
  } else if (
245
249
  picked.geometry.type === "LineString" ||
246
250
  picked.geometry.type === "MultiLineString"
@@ -0,0 +1,69 @@
1
+ import type {
2
+ Polygon,
3
+ MultiPolygon,
4
+ Feature as TurfFeature,
5
+ Position,
6
+ } from "@turf/helpers";
7
+ import difference from "@turf/difference";
8
+ import buffer from "@turf/buffer";
9
+
10
+ // see https://maplibre.org/maplibre-gl-js-docs/example/line-across-180th-meridian/
11
+ function fixRing(ring: Position[]) {
12
+ let prev: Position | undefined = undefined;
13
+
14
+ for (const c of ring) {
15
+ if (prev && c[0] - prev[0] >= 180) {
16
+ c[0] -= 360;
17
+ } else if (prev && c[0] - prev[0] < -180) {
18
+ c[0] += 360;
19
+ }
20
+
21
+ prev = c;
22
+ }
23
+ }
24
+
25
+ export function setMask(
26
+ picked: TurfFeature<Polygon | MultiPolygon>,
27
+ setData: (data: GeoJSON.GeoJSON) => void
28
+ ) {
29
+ const diff = difference(
30
+ {
31
+ type: "Polygon",
32
+ coordinates: [
33
+ [
34
+ [180, 90],
35
+ [-180, 90],
36
+ [-180, -90],
37
+ [180, -90],
38
+ [180, 90],
39
+ ],
40
+ ],
41
+ },
42
+ picked
43
+ );
44
+
45
+ if (!diff) {
46
+ return;
47
+ }
48
+
49
+ diff.properties = { isMask: "y" };
50
+
51
+ const fixed = buffer(picked, 0);
52
+
53
+ if (fixed.geometry.type === "Polygon") {
54
+ for (const ring of fixed.geometry.coordinates) {
55
+ fixRing(ring);
56
+ }
57
+ } else {
58
+ for (const poly of fixed.geometry.coordinates) {
59
+ for (const ring of poly) {
60
+ fixRing(ring);
61
+ }
62
+ }
63
+ }
64
+
65
+ setData({
66
+ type: "FeatureCollection",
67
+ features: [fixed, diff],
68
+ });
69
+ }
@@ -1,22 +0,0 @@
1
- var Ht=(C,A,H)=>{if(!A.has(C))throw TypeError("Cannot "+H)};var ie=(C,A,H)=>(Ht(C,A,"read from private field"),H?H.call(C):A.get(C)),at=(C,A,H)=>{if(A.has(C))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(C):A.set(C,H)},Ze=(C,A,H,J)=>(Ht(C,A,"write to private field"),J?J.call(C,H):A.set(C,H),H);(function(C,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],A):(C=typeof globalThis<"u"?globalThis:C||self,A(C.leafletMaptilerGeocoder={},C.leaflet))})(this,function(C,A){var ee,pe;"use strict";function H(n){if(n&&n.__esModule)return n;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const J=H(A);function T(){}function Kt(n,t){for(const e in t)n[e]=t[e];return n}function ct(n){return n()}function ht(){return Object.create(null)}function le(n){n.forEach(ct)}function gt(n){return typeof n=="function"}function xe(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function Jt(n){return Object.keys(n).length===0}function $t(n,t,e,r){if(n){const i=vt(n,t,e,r);return n[0](i)}}function vt(n,t,e,r){return n[1]&&r?Kt(e.ctx.slice(),n[1](r(t))):e.ctx}function er(n,t,e,r){if(n[2]&&r){const i=n[2](r(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],l=Math.max(t.dirty.length,i.length);for(let s=0;s<l;s+=1)o[s]=t.dirty[s]|i[s];return o}return t.dirty|i}return t.dirty}function tr(n,t,e,r,i,o){if(i){const l=vt(t,e,r,o);n.p(l,i)}}function rr(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function yt(n){return n==null?"":n}function I(n,t){n.appendChild(t)}function X(n,t,e){n.insertBefore(t,e||null)}function Y(n){n.parentNode.removeChild(n)}function nr(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function N(n){return document.createElement(n)}function se(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function de(n){return document.createTextNode(n)}function te(){return de(" ")}function W(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function ir(n){return function(t){return t.preventDefault(),n.call(this,t)}}function y(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function or(n){return Array.from(n.childNodes)}function Le(n,t){t=""+t,n.wholeText!==t&&(n.data=t)}function dt(n,t){n.value=t==null?"":t}function F(n,t,e){n.classList[e?"add":"remove"](t)}function lr(n,t,{bubbles:e=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(n,e,r,t),i}let Me;function Te(n){Me=n}function mt(){if(!Me)throw new Error("Function called outside component initialization");return Me}function sr(n){mt().$$.on_destroy.push(n)}function ur(){const n=mt();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=lr(t,e,{cancelable:r});return i.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}const Ce=[],Xe=[],qe=[],pt=[],fr=Promise.resolve();let We=!1;function ar(){We||(We=!0,fr.then(_t))}function He(n){qe.push(n)}const Ke=new Set;let De=0;function _t(){const n=Me;do{for(;De<Ce.length;){const t=Ce[De];De++,Te(t),cr(t.$$)}for(Te(null),Ce.length=0,De=0;Xe.length;)Xe.pop()();for(let t=0;t<qe.length;t+=1){const e=qe[t];Ke.has(e)||(Ke.add(e),e())}qe.length=0}while(Ce.length);for(;pt.length;)pt.pop()();We=!1,Ke.clear(),Te(n)}function cr(n){if(n.fragment!==null){n.update(),le(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(He)}}const Fe=new Set;let me;function Qe(){me={r:0,c:[],p:me}}function Ue(){me.r||le(me.c),me=me.p}function B(n,t){n&&n.i&&(Fe.delete(n),n.i(t))}function j(n,t,e,r){if(n&&n.o){if(Fe.has(n))return;Fe.add(n),me.c.push(()=>{Fe.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function ze(n){n&&n.c()}function we(n,t,e,r){const{fragment:i,after_update:o}=n.$$;i&&i.m(t,e),r||He(()=>{const l=n.$$.on_mount.map(ct).filter(gt);n.$$.on_destroy?n.$$.on_destroy.push(...l):le(l),n.$$.on_mount=[]}),o.forEach(He)}function Ee(n,t){const e=n.$$;e.fragment!==null&&(le(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function hr(n,t){n.$$.dirty[0]===-1&&(Ce.push(n),ar(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function Se(n,t,e,r,i,o,l,s=[-1]){const u=Me;Te(n);const f=n.$$={fragment:null,ctx:[],props:o,update:T,not_equal:i,bound:ht(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ht(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};l&&l(f.root);let a=!1;if(f.ctx=e?e(n,t.props||{},(v,m,...d)=>{const w=d.length?d[0]:m;return f.ctx&&i(f.ctx[v],f.ctx[v]=w)&&(!f.skip_bound&&f.bound[v]&&f.bound[v](w),a&&hr(n,v)),m}):[],f.update(),a=!0,le(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const v=or(t.target);f.fragment&&f.fragment.l(v),v.forEach(Y)}else f.fragment&&f.fragment.c();t.intro&&B(n.$$.fragment),we(n,t.target,t.anchor,t.customElement),_t()}Te(u)}class ke{$destroy(){Ee(this,1),this.$destroy=T}$on(t,e){if(!gt(e))return T;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Jt(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const _n="";function gr(n){let t,e;return{c(){t=se("svg"),e=se("path"),y(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),y(t,"viewBox","0 0 60.006 21.412"),y(t,"width","14"),y(t,"height","20"),y(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),I(t,e)},p:T,i:T,o:T,d(r){r&&Y(t)}}}class vr extends ke{constructor(t){super(),Se(this,t,null,gr,xe,{})}}const bn="";function yr(n){let t,e;return{c(){t=se("svg"),e=se("path"),y(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),y(t,"viewBox","0 0 18 18"),y(t,"width","16"),y(t,"height","16"),y(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),I(t,e)},p:T,i:T,o:T,d(r){r&&Y(t)}}}class dr extends ke{constructor(t){super(),Se(this,t,null,yr,xe,{})}}const xn="";function mr(n){let t;return{c(){t=N("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',y(t,"class","svelte-7cmwmc")},m(e,r){X(e,t,r)},p:T,i:T,o:T,d(e){e&&Y(t)}}}class pr extends ke{constructor(t){super(),Se(this,t,null,mr,xe,{})}}const wn="";function _r(n){let t,e,r;return{c(){t=se("svg"),e=se("path"),y(e,"stroke-width","4"),y(e,"fill-rule","evenodd"),y(e,"clip-rule","evenodd"),y(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),y(e,"class","svelte-656hh2"),y(t,"width",r=n[0]!=="list"?void 0:"20"),y(t,"viewBox","0 0 70 85"),y(t,"fill","none"),y(t,"class","svelte-656hh2"),F(t,"in-map",n[0]!=="list"),F(t,"for-maplibre",n[0]==="maplibre"),F(t,"for-leaflet",n[0]==="leaflet"),F(t,"list-icon",n[0]==="list")},m(i,o){X(i,t,o),I(t,e)},p(i,[o]){o&1&&r!==(r=i[0]!=="list"?void 0:"20")&&y(t,"width",r),o&1&&F(t,"in-map",i[0]!=="list"),o&1&&F(t,"for-maplibre",i[0]==="maplibre"),o&1&&F(t,"for-leaflet",i[0]==="leaflet"),o&1&&F(t,"list-icon",i[0]==="list")},i:T,o:T,d(i){i&&Y(t)}}}function br(n,t,e){let{displayIn:r}=t;return n.$$set=i=>{"displayIn"in i&&e(0,r=i.displayIn)},[r]}class bt extends ke{constructor(t){super(),Se(this,t,br,_r,xe,{displayIn:0})}}const En="";function xr(n){let t,e;return{c(){t=se("svg"),e=se("path"),y(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),y(t,"viewBox","0 0 18 18"),y(t,"xml:space","preserve"),y(t,"width","20"),y(t,"class","svelte-en2qvf")},m(r,i){X(r,t,i),I(t,e)},p:T,i:T,o:T,d(r){r&&Y(t)}}}class wr extends ke{constructor(t){super(),Se(this,t,null,xr,xe,{})}}const Sn="";function xt(n,t,e){const r=n.slice();return r[63]=t[e],r[65]=e,r}function wt(n){let t,e;return t=new pr({}),{c(){ze(t.$$.fragment)},m(r,i){we(t,r,i),e=!0},i(r){e||(B(t.$$.fragment,r),e=!0)},o(r){j(t.$$.fragment,r),e=!1},d(r){Ee(t,r)}}}function Et(n){let t,e,r,i,o;return e=new vr({}),{c(){t=N("button"),ze(e.$$.fragment),y(t,"type","button"),y(t,"title",n[8]),y(t,"class","svelte-1h1zm6d"),F(t,"active",n[1])},m(l,s){X(l,t,s),we(e,t,null),r=!0,i||(o=W(t,"click",n[50]),i=!0)},p(l,s){(!r||s[0]&256)&&y(t,"title",l[8]),(!r||s[0]&2)&&F(t,"active",l[1])},i(l){r||(B(e.$$.fragment,l),r=!0)},o(l){j(e.$$.fragment,l),r=!1},d(l){l&&Y(t),Ee(e),i=!1,o()}}}function Er(n){let t,e,r,i,o=n[12],l=[];for(let u=0;u<o.length;u+=1)l[u]=kt(xt(n,o,u));const s=u=>j(l[u],1,1,()=>{l[u]=null});return{c(){t=N("ul");for(let u=0;u<l.length;u+=1)l[u].c();y(t,"class","svelte-1h1zm6d")},m(u,f){X(u,t,f);for(let a=0;a<l.length;a+=1)l[a].m(t,null);e=!0,r||(i=[W(t,"mouseout",n[53]),W(t,"blur",n[54])],r=!0)},p(u,f){if(f[0]&29697){o=u[12];let a;for(a=0;a<o.length;a+=1){const v=xt(u,o,a);l[a]?(l[a].p(v,f),B(l[a],1)):(l[a]=kt(v),l[a].c(),B(l[a],1),l[a].m(t,null))}for(Qe(),a=o.length;a<l.length;a+=1)s(a);Ue()}},i(u){if(!e){for(let f=0;f<o.length;f+=1)B(l[f]);e=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)j(l[f]);e=!1},d(u){u&&Y(t),nr(l,u),r=!1,le(i)}}}function Sr(n){let t,e;return{c(){t=N("div"),e=de(n[5]),y(t,"class","no-results svelte-1h1zm6d")},m(r,i){X(r,t,i),I(t,e)},p(r,i){i[0]&32&&Le(e,r[5])},i:T,o:T,d(r){r&&Y(t)}}}function kr(n){let t,e;return{c(){t=N("div"),e=de(n[4]),y(t,"class","error svelte-1h1zm6d")},m(r,i){X(r,t,i),I(t,e)},p(r,i){i[0]&16&&Le(e,r[4])},i:T,o:T,d(r){r&&Y(t)}}}function Pr(n){let t="",e;return{c(){e=de(t)},m(r,i){X(r,e,i)},p:T,i:T,o:T,d(r){r&&Y(e)}}}function St(n){let t,e=n[63].place_type+"",r;return{c(){t=N("span"),r=de(e),y(t,"class","svelte-1h1zm6d")},m(i,o){X(i,t,o),I(t,r)},p(i,o){o[0]&4096&&e!==(e=i[63].place_type+"")&&Le(r,e)},d(i){i&&Y(t)}}}function kt(n){let t,e,r,i,o,l,s=n[63].place_name.replace(/,.*/,"")+"",u,f,a,v,m,d=n[63].place_name.replace(/[^,]*,?\s*/,"")+"",w,h,g,b,E,S;e=new bt({props:{displayIn:"list"}});let _=n[10]&&St(n);function k(){return n[51](n[65])}function x(){return n[52](n[63])}return{c(){t=N("li"),ze(e.$$.fragment),r=te(),i=N("span"),o=N("span"),l=N("span"),u=de(s),f=te(),_&&_.c(),a=te(),v=N("span"),m=N("span"),w=de(d),h=te(),y(l,"class","svelte-1h1zm6d"),y(o,"class","svelte-1h1zm6d"),y(i,"class","svelte-1h1zm6d"),y(m,"class","svelte-1h1zm6d"),y(v,"class","svelte-1h1zm6d"),y(t,"tabindex","0"),y(t,"data-selected",g=n[14]===n[65]),y(t,"class","svelte-1h1zm6d"),F(t,"selected",n[14]===n[65])},m(P,R){X(P,t,R),we(e,t,null),I(t,r),I(t,i),I(i,o),I(o,l),I(l,u),I(o,f),_&&_.m(o,null),I(t,a),I(t,v),I(v,m),I(m,w),I(t,h),b=!0,E||(S=[W(t,"mouseover",k),W(t,"focus",x)],E=!0)},p(P,R){n=P,(!b||R[0]&4096)&&s!==(s=n[63].place_name.replace(/,.*/,"")+"")&&Le(u,s),n[10]?_?_.p(n,R):(_=St(n),_.c(),_.m(o,null)):_&&(_.d(1),_=null),(!b||R[0]&4096)&&d!==(d=n[63].place_name.replace(/[^,]*,?\s*/,"")+"")&&Le(w,d),(!b||R[0]&16384&&g!==(g=n[14]===n[65]))&&y(t,"data-selected",g),(!b||R[0]&16384)&&F(t,"selected",n[14]===n[65])},i(P){b||(B(e.$$.fragment,P),b=!0)},o(P){j(e.$$.fragment,P),b=!1},d(P){P&&Y(t),Ee(e),_&&_.d(),E=!1,le(S)}}}function Rr(n){let t,e,r,i,o,l,s,u,f,a,v,m,d,w,h,g,b,E,S,_;i=new wr({}),a=new dr({});let k=n[18]&&wt(),x=n[7]===!0&&Et(n);const P=n[42].default,R=$t(P,n,n[41],null),D=[Pr,kr,Sr,Er],G=[];function O(p,L){var Q,ce;return p[15]?p[17]?1:((Q=p[12])==null?void 0:Q.length)===0?2:p[15]&&((ce=p[12])==null?void 0:ce.length)?3:-1:0}return~(h=O(n))&&(g=G[h]=D[h](n)),{c(){t=N("form"),e=N("div"),r=N("button"),ze(i.$$.fragment),o=te(),l=N("input"),s=te(),u=N("div"),f=N("button"),ze(a.$$.fragment),v=te(),k&&k.c(),m=te(),x&&x.c(),d=te(),R&&R.c(),w=te(),g&&g.c(),y(r,"type","button"),y(r,"class","svelte-1h1zm6d"),y(l,"placeholder",n[3]),y(l,"aria-label",n[3]),y(l,"class","svelte-1h1zm6d"),y(f,"type","button"),y(f,"title",n[9]),y(f,"class","svelte-1h1zm6d"),F(f,"displayable",n[0]!==""),y(u,"class","clear-button-container svelte-1h1zm6d"),y(e,"class","input-group svelte-1h1zm6d"),y(t,"tabindex","0"),y(t,"class",b=yt(n[2])+" svelte-1h1zm6d"),F(t,"can-collapse",n[6]&&n[0]==="")},m(p,L){X(p,t,L),I(t,e),I(e,r),we(i,r,null),I(e,o),I(e,l),n[44](l),dt(l,n[0]),I(e,s),I(e,u),I(u,f),we(a,f,null),I(u,v),k&&k.m(u,null),I(e,m),x&&x.m(e,null),I(e,d),R&&R.m(e,null),I(t,w),~h&&G[h].m(t,null),E=!0,S||(_=[W(r,"click",n[43]),W(l,"input",n[45]),W(l,"focus",n[46]),W(l,"blur",n[47]),W(l,"keydown",n[20]),W(l,"input",n[48]),W(f,"click",n[49]),W(t,"submit",ir(n[19]))],S=!0)},p(p,L){(!E||L[0]&8)&&y(l,"placeholder",p[3]),(!E||L[0]&8)&&y(l,"aria-label",p[3]),L[0]&1&&l.value!==p[0]&&dt(l,p[0]),(!E||L[0]&512)&&y(f,"title",p[9]),(!E||L[0]&1)&&F(f,"displayable",p[0]!==""),p[18]?k?L[0]&262144&&B(k,1):(k=wt(),k.c(),B(k,1),k.m(u,null)):k&&(Qe(),j(k,1,1,()=>{k=null}),Ue()),p[7]===!0?x?(x.p(p,L),L[0]&128&&B(x,1)):(x=Et(p),x.c(),B(x,1),x.m(e,d)):x&&(Qe(),j(x,1,1,()=>{x=null}),Ue()),R&&R.p&&(!E||L[1]&1024)&&tr(R,P,p,p[41],E?er(P,p[41],L,null):rr(p[41]),null);let Q=h;h=O(p),h===Q?~h&&G[h].p(p,L):(g&&(Qe(),j(G[Q],1,1,()=>{G[Q]=null}),Ue()),~h?(g=G[h],g?g.p(p,L):(g=G[h]=D[h](p),g.c()),B(g,1),g.m(t,null)):g=null),(!E||L[0]&4&&b!==(b=yt(p[2])+" svelte-1h1zm6d"))&&y(t,"class",b),(!E||L[0]&69)&&F(t,"can-collapse",p[6]&&p[0]==="")},i(p){E||(B(i.$$.fragment,p),B(a.$$.fragment,p),B(k),B(x),B(R,p),B(g),E=!0)},o(p){j(i.$$.fragment,p),j(a.$$.fragment,p),j(k),j(x),j(R,p),j(g),E=!1},d(p){p&&Y(t),Ee(i),n[44](null),Ee(a),k&&k.d(),x&&x.d(),R&&R.d(p),~h&&G[h].d(),S=!1,le(_)}}}function Ir(n,t,e){let r,{$$slots:i={},$$scope:o}=t,{class:l=void 0}=t,{mapController:s=void 0}=t,{apiKey:u}=t,{debounceSearch:f=200}=t,{placeholder:a="Search"}=t,{errorMessage:v="Searching failed"}=t,{noResultsMessage:m="No results found"}=t,{proximity:d=void 0}=t,{bbox:w=void 0}=t,{trackProximity:h=!0}=t,{minLength:g=2}=t,{language:b=void 0}=t,{showResultsWhileTyping:E=!0}=t,{zoom:S=16}=t,{flyTo:_=!0}=t,{collapsed:k=!1}=t,{clearOnBlur:x=!1}=t,{enableReverse:P=!1}=t,{reverseButtonTitle:R="toggle reverse geocoding"}=t,{clearButtonTitle:D="clear"}=t,{filter:G=()=>!0}=t,{searchValue:O=""}=t,{reverseActive:p=P==="always"}=t,{showPlaceType:L=!1}=t,{showFullGeometry:Q=!0}=t;function ce(){ne.focus()}function rn(){ne.blur()}function Yt(c,V=!0){e(0,O=c),V?(e(14,q=-1),Zt()):(ft(),setTimeout(()=>{ne.focus(),ne.select()}))}let Pe=!1,z,Z,M,jt="",ne,q=-1,he,je=[],_e,lt,st;const ge=ur();sr(()=>{s&&(s.setProximityChangeHandler(void 0),s.setMapClickHandler(void 0),s.indicateReverse(!1),s.setSelectedMarker(-1),s.setMarkers(void 0,void 0))});function Zt(c){if(q>-1&&z)e(13,M=z[q]),e(0,O=M.place_name.replace(/,.*/,"")),e(17,he=void 0),e(39,Z=void 0),e(14,q=-1);else if(O){const V=c||!Xt();ut(O).then(()=>{e(39,Z=z),e(13,M=void 0),V&&nn()}).catch(oe=>e(17,he=oe))}}function Xt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(O)}async function ut(c,V=!1){e(17,he=void 0);const oe=Xt(),ve=new URLSearchParams;ve.set("key",u),b&&ve.set("language",String(b)),oe||(w&&ve.set("bbox",w.join(",")),d&&ve.set("proximity",d.join(",")));const be="https://api.maptiler.com/geocoding/"+encodeURIComponent(c)+".json?"+ve.toString();if(be===jt){V?(e(12,z=void 0),e(13,M=je[0])):e(12,z=je);return}jt=be,_e==null||_e.abort(),e(18,_e=new AbortController);let Re;try{Re=await fetch(be,{signal:_e.signal}).finally(()=>{e(18,_e=void 0)})}catch(Oe){if(Oe&&typeof Oe=="object"&&Oe.name==="AbortError")return;throw new Error}if(!Re.ok)throw new Error;const Ie=await Re.json();ge("response",{url:be,featureCollection:Ie}),V?(e(12,z=void 0),e(13,M=Ie.features[0]),je=[M]):(e(12,z=Ie.features.filter(G)),je=z,oe&&ne.focus())}function nn(){var V,oe,ve,be,Re,Ie,Oe,Wt;if(!(Z!=null&&Z.length)||!_)return;const c=[180,90,-180,-90];for(const ye of Z)c[0]=Math.min(c[0],(oe=(V=ye.bbox)==null?void 0:V[0])!=null?oe:ye.center[0]),c[1]=Math.min(c[1],(be=(ve=ye.bbox)==null?void 0:ve[1])!=null?be:ye.center[1]),c[2]=Math.max(c[2],(Ie=(Re=ye.bbox)==null?void 0:Re[2])!=null?Ie:ye.center[0]),c[3]=Math.max(c[3],(Wt=(Oe=ye.bbox)==null?void 0:Oe[3])!=null?Wt:ye.center[1]);s&&Z.length>0&&(M&&c[0]===c[2]&&c[1]===c[3]?s.flyTo(M.center,S):s.fitBounds(c,50))}function on(c){e(1,p=P==="always"),Yt(c[0].toFixed(6)+","+c[1].toFixed(6))}function ln(c){if(!z)return;let V=c.key==="ArrowDown"?1:c.key==="ArrowUp"?-1:0;V?(q===-1&&V===-1&&e(14,q=z.length),e(14,q+=V),q>=z.length&&e(14,q=-1),c.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(c.key)&&e(14,q=-1)}function ft(c=!0){if(E&&O.length>g){lt&&clearTimeout(lt);const V=O;lt=window.setTimeout(()=>{ut(V).catch(oe=>e(17,he=oe))},c?f:0)}else e(12,z=void 0),e(17,he=void 0)}const sn=()=>ne.focus();function un(c){Xe[c?"unshift":"push"](()=>{ne=c,e(16,ne)})}function fn(){O=this.value,e(0,O),e(11,Pe),e(33,x)}const an=()=>e(11,Pe=!0),cn=()=>e(11,Pe=!1),hn=()=>ft(),gn=()=>{e(0,O=""),ne.focus()},vn=()=>e(1,p=!p),yn=c=>e(14,q=c),dn=c=>{e(13,M=c),e(0,O=c.place_name.replace(/,.*/,"")),e(14,q=-1)},mn=()=>e(14,q=-1),pn=()=>{};return n.$$set=c=>{"class"in c&&e(2,l=c.class),"mapController"in c&&e(23,s=c.mapController),"apiKey"in c&&e(24,u=c.apiKey),"debounceSearch"in c&&e(25,f=c.debounceSearch),"placeholder"in c&&e(3,a=c.placeholder),"errorMessage"in c&&e(4,v=c.errorMessage),"noResultsMessage"in c&&e(5,m=c.noResultsMessage),"proximity"in c&&e(22,d=c.proximity),"bbox"in c&&e(26,w=c.bbox),"trackProximity"in c&&e(27,h=c.trackProximity),"minLength"in c&&e(28,g=c.minLength),"language"in c&&e(29,b=c.language),"showResultsWhileTyping"in c&&e(30,E=c.showResultsWhileTyping),"zoom"in c&&e(31,S=c.zoom),"flyTo"in c&&e(32,_=c.flyTo),"collapsed"in c&&e(6,k=c.collapsed),"clearOnBlur"in c&&e(33,x=c.clearOnBlur),"enableReverse"in c&&e(7,P=c.enableReverse),"reverseButtonTitle"in c&&e(8,R=c.reverseButtonTitle),"clearButtonTitle"in c&&e(9,D=c.clearButtonTitle),"filter"in c&&e(34,G=c.filter),"searchValue"in c&&e(0,O=c.searchValue),"reverseActive"in c&&e(1,p=c.reverseActive),"showPlaceType"in c&&e(10,L=c.showPlaceType),"showFullGeometry"in c&&e(35,Q=c.showFullGeometry),"$$scope"in c&&e(41,o=c.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&142606336&&s&&s.setProximityChangeHandler(h?c=>{e(22,d=c)}:void 0),n.$$.dirty[0]&134217728&&(h||e(22,d=void 0)),n.$$.dirty[0]&2048|n.$$.dirty[1]&4&&setTimeout(()=>{e(15,st=Pe),x&&!Pe&&e(0,O="")}),n.$$.dirty[0]&4097&&(O||(e(13,M=void 0),e(12,z=void 0),e(17,he=void 0),e(39,Z=z))),n.$$.dirty[0]&8192|n.$$.dirty[1]&16&&Q&&M&&!M.address&&M.geometry.type==="Point"&&ut(M.id,!0).catch(c=>e(17,he=c)),n.$$.dirty[0]&8396800|n.$$.dirty[1]&3&&s&&M&&_&&(!M.bbox||M.bbox[0]===M.bbox[2]&&M.bbox[1]===M.bbox[3]?s.flyTo(M.center,S):s.fitBounds(M.bbox,50),e(12,z=void 0),e(39,Z=void 0),e(14,q=-1)),n.$$.dirty[0]&4096|n.$$.dirty[1]&256&&Z!==z&&e(39,Z=void 0),n.$$.dirty[0]&8396800|n.$$.dirty[1]&256&&s&&s.setMarkers(Z,M),n.$$.dirty[0]&1&&e(14,q=-1),n.$$.dirty[0]&8404992&&(s==null||s.setSelectedMarker(q)),n.$$.dirty[0]&20480&&e(40,r=z==null?void 0:z[q]),n.$$.dirty[1]&512&&ge("select",r),n.$$.dirty[0]&8192&&ge("pick",M),n.$$.dirty[0]&36864&&ge("optionsVisibilityChange",st&&!!z),n.$$.dirty[0]&4096&&ge("featuresListed",z),n.$$.dirty[1]&256&&ge("featuresMarked",Z),n.$$.dirty[0]&2&&ge("reverseToggle",p),n.$$.dirty[0]&1&&ge("queryChange",O),n.$$.dirty[0]&8388610&&s&&s.indicateReverse(p),n.$$.dirty[0]&8388610&&s&&s.setMapClickHandler(p?on:void 0)},[O,p,l,a,v,m,k,P,R,D,L,Pe,z,M,q,st,ne,he,_e,Zt,ln,ft,d,s,u,f,w,h,g,b,E,S,_,x,G,Q,ce,rn,Yt,Z,r,o,i,sn,un,fn,an,cn,hn,gn,vn,yn,dn,mn,pn]}class Or extends ke{constructor(t){super(),Se(this,t,Ir,Rr,xe,{class:2,mapController:23,apiKey:24,debounceSearch:25,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:22,bbox:26,trackProximity:27,minLength:28,language:29,showResultsWhileTyping:30,zoom:31,flyTo:32,collapsed:6,clearOnBlur:33,enableReverse:7,reverseButtonTitle:8,clearButtonTitle:9,filter:34,searchValue:0,reverseActive:1,showPlaceType:10,showFullGeometry:35,focus:36,blur:37,setQuery:38},null,[-1,-1,-1])}get focus(){return this.$$.ctx[36]}get blur(){return this.$$.ctx[37]}get setQuery(){return this.$$.ctx[38]}}function Pt(n,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=n,r}function Rt(n,t,e){e===void 0&&(e={});for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<o[o.length-1].length;l++)if(o[o.length-1][l]!==o[0][l])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:n};return Pt(s,t,e)}function It(n,t,e){e===void 0&&(e={});var r={type:"MultiPolygon",coordinates:n};return Pt(r,t,e)}/**
2
- * splaytree v3.1.1
3
- * Fast Splay tree for Node and browser
4
- *
5
- * @author Alexander Milevski <info@w8r.name>
6
- * @license MIT
7
- * @preserve
8
- *//*! *****************************************************************************
9
- Copyright (c) Microsoft Corporation. All rights reserved.
10
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
11
- this file except in compliance with the License. You may obtain a copy of the
12
- License at http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17
- MERCHANTABLITY OR NON-INFRINGEMENT.
18
-
19
- See the Apache Version 2.0 License for specific language governing permissions
20
- and limitations under the License.
21
- ***************************************************************************** */function Lr(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,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(f){return function(a){return u([f,a])}}function u(f){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(n,e)}catch(a){f=[6,a],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var ue=function(){function n(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return n}();function Mr(n,t){return n>t?1:n<t?-1:0}function fe(n,t,e){for(var r=new ue(null,null),i=r,o=r;;){var l=e(n,t.key);if(l<0){if(t.left===null)break;if(e(n,t.left.key)<0){var s=t.left;if(t.left=s.right,s.right=t,t=s,t.left===null)break}o.left=t,o=t,t=t.left}else if(l>0){if(t.right===null)break;if(e(n,t.right.key)>0){var s=t.right;if(t.right=s.left,s.left=t,t=s,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=r.right,t.right=r.left,t}function Je(n,t,e,r){var i=new ue(n,t);if(e===null)return i.left=i.right=null,i;e=fe(n,e,r);var o=r(n,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function Ot(n,t,e){var r=null,i=null;if(t){t=fe(n,t,e);var o=e(t.key,n);o===0?(r=t.left,i=t.right):o<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function Tr(n,t,e){return t===null?n:(n===null||(t=fe(n.key,t,e),t.left=n),t)}function $e(n,t,e,r,i){if(n){r(""+t+(e?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+i(n)+`
22
- `);var o=t+(e?" ":"\u2502 ");n.left&&$e(n.left,o,!1,r,i),n.right&&$e(n.right,o,!0,r,i)}}var et=function(){function n(t){t===void 0&&(t=Mr),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=Je(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new ue(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=fe(t,this._root,i),l=i(t,o.key);return l===0?this._root=o:(l<0?(r.left=o.left,r.right=o,o.left=null):l>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=fe(t,e,r);var o=r(t,e.key);return o===0?(e.left===null?i=e.right:(i=fe(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=fe(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=fe(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):o=!0;return this},n.prototype.range=function(t,e,r,i){for(var o=[],l=this._comparator,s=this._root,u;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),u=l(s.key,e),u>0)break;if(l(s.key,t)>=0&&r.call(i,s))return this;s=s.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},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(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,o=[];!r;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return zr(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,o=this._comparator;if(r&&nt(t,e,0,i-1,o),this._root===null)this._root=tt(t,e,0,i),this._size=i;else{var l=Ar(this.toList(),Cr(t,e),o);i=this._size+i,this._root=rt({head:l},0,i)}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(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return $e(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,o=Ot(t,this._root,i),l=o.left,s=o.right;i(t,e)<0?s=Je(e,r,s,i):l=Je(e,r,l,i),this._root=Tr(l,s,i)},n.prototype.split=function(t){return Ot(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t;return Lr(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},n}();function tt(n,t,e,r){var i=r-e;if(i>0){var o=e+Math.floor(i/2),l=n[o],s=t[o],u=new ue(l,s);return u.left=tt(n,t,e,o),u.right=tt(n,t,o+1,r),u}return null}function Cr(n,t){for(var e=new ue(null,null),r=e,i=0;i<n.length;i++)r=r.next=new ue(n[i],t[i]);return r.next=null,e.next}function zr(n){for(var t=n,e=[],r=!1,i=new ue(null,null),o=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):r=!0;return o.next=null,i.next}function rt(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),o=rt(n,t,i),l=n.head;return l.left=o,n.head=n.head.next,l.right=rt(n,i+1,e),l}return null}function Ar(n,t,e){for(var r=new ue(null,null),i=r,o=n,l=t;o!==null&&l!==null;)e(o.key,l.key)<0?(i.next=o,o=o.next):(i.next=l,l=l.next),i=i.next;return o!==null?i.next=o:l!==null&&(i.next=l),r.next}function nt(n,t,e,r,i){if(!(e>=r)){for(var o=n[e+r>>1],l=e-1,s=r+1;;){do l++;while(i(n[l],o)<0);do s--;while(i(n[s],o)>0);if(l>=s)break;var u=n[l];n[l]=n[s],n[s]=u,u=t[l],t[l]=t[s],t[s]=u}nt(n,t,e,s,i),nt(n,t,s+1,r,i)}}function K(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Lt(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function U(n,t,e){return t&&Lt(n.prototype,t),e&&Lt(n,e),n}var Ae=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},it=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var r=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,l=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:r,y:o},ur:{x:i,y:l}}},ae=Number.EPSILON;ae===void 0&&(ae=Math.pow(2,-52));var Nr=ae*ae,ot=function(t,e){if(-ae<t&&t<ae&&-ae<e&&e<ae)return 0;var r=t-e;return r*r<Nr*t*e?0:t<e?-1:1},Br=function(){function n(){K(this,n),this.reset()}return U(n,[{key:"reset",value:function(){this.xRounder=new Mt,this.yRounder=new Mt}},{key:"round",value:function(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}]),n}(),Mt=function(){function n(){K(this,n),this.tree=new et,this.round(0)}return U(n,[{key:"round",value:function(e){var r=this.tree.add(e),i=this.tree.prev(r);if(i!==null&&ot(r.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(r);return o!==null&&ot(r.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),n}(),Ne=new Br,Be=function(t,e){return t.x*e.y-t.y*e.x},Tt=function(t,e){return t.x*e.x+t.y*e.y},Ct=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y},l=Be(i,o);return ot(l,0)},Ve=function(t){return Math.sqrt(Tt(t,t))},Gr=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Be(o,i)/Ve(o)/Ve(i)},qr=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Tt(o,i)/Ve(o)/Ve(i)},zt=function(t,e,r){return e.y===0?null:{x:t.x+e.x/e.y*(r-t.y),y:r}},At=function(t,e,r){return e.x===0?null:{x:r,y:t.y+e.y/e.x*(r-t.x)}},Dr=function(t,e,r,i){if(e.x===0)return At(r,i,t.x);if(i.x===0)return At(t,e,r.x);if(e.y===0)return zt(r,i,t.y);if(i.y===0)return zt(t,e,r.y);var o=Be(e,i);if(o==0)return null;var l={x:r.x-t.x,y:r.y-t.y},s=Be(l,e)/o,u=Be(l,i)/o,f=t.x+u*e.x,a=r.x+s*i.x,v=t.y+u*e.y,m=r.y+s*i.y,d=(f+a)/2,w=(v+m)/2;return{x:d,y:w}},re=function(){U(n,null,[{key:"compare",value:function(e,r){var i=n.comparePoints(e.point,r.point);return i!==0?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft?e.isLeft?1:-1:Ye.compare(e.segment,r.segment))}},{key:"comparePoints",value:function(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0}}]);function n(t,e){K(this,n),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return U(n,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var r=e.point.events,i=0,o=r.length;i<o;i++){var l=r[i];this.point.events.push(l),l.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,r=0;r<e;r++){var i=this.point.events[r];if(i.segment.consumedBy===void 0)for(var o=r+1;o<e;o++){var l=this.point.events[o];l.consumedBy===void 0&&i.otherSE.point.events===l.otherSE.point.events&&i.segment.consume(l.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],r=0,i=this.point.events.length;r<i;r++){var o=this.point.events[r];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var r=this,i=new Map,o=function(s){var u=s.otherSE;i.set(s,{sine:Gr(r.point,e.point,u.point),cosine:qr(r.point,e.point,u.point)})};return function(l,s){i.has(l)||o(l),i.has(s)||o(s);var u=i.get(l),f=u.sine,a=u.cosine,v=i.get(s),m=v.sine,d=v.cosine;return f>=0&&m>=0?a<d?1:a>d?-1:0:f<0&&m<0?a<d?-1:a>d?1:0:m<f?-1:m>f?1:0}}}]),n}(),Fr=0,Ye=function(){U(n,null,[{key:"compare",value:function(e,r){var i=e.leftSE.point.x,o=r.leftSE.point.x,l=e.rightSE.point.x,s=r.rightSE.point.x;if(s<i)return 1;if(l<o)return-1;var u=e.leftSE.point.y,f=r.leftSE.point.y,a=e.rightSE.point.y,v=r.rightSE.point.y;if(i<o){if(f<u&&f<a)return 1;if(f>u&&f>a)return-1;var m=e.comparePoint(r.leftSE.point);if(m<0)return 1;if(m>0)return-1;var d=r.comparePoint(e.rightSE.point);return d!==0?d:-1}if(i>o){if(u<f&&u<v)return-1;if(u>f&&u>v)return 1;var w=r.comparePoint(e.leftSE.point);if(w!==0)return w;var h=e.comparePoint(r.rightSE.point);return h<0?1:h>0?-1:1}if(u<f)return-1;if(u>f)return 1;if(l<s){var g=r.comparePoint(e.rightSE.point);if(g!==0)return g}if(l>s){var b=e.comparePoint(r.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(l!==s){var E=a-u,S=l-i,_=v-f,k=s-o;if(E>S&&_<k)return 1;if(E<S&&_>k)return-1}return l>s?1:l<s||a<v?-1:a>v?1:e.id<r.id?-1:e.id>r.id?1:0}}]);function n(t,e,r,i){K(this,n),this.id=++Fr,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}return U(n,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var r=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;var l=(e.y-r.y)/o.y,s=r.x+l*o.x;if(e.x===s)return 0;var u=(e.x-r.x)/o.x,f=r.y+u*o.y;return e.y===f?0:e.y<f?-1:1}},{key:"getIntersection",value:function(e){var r=this.bbox(),i=e.bbox(),o=it(r,i);if(o===null)return null;var l=this.leftSE.point,s=this.rightSE.point,u=e.leftSE.point,f=e.rightSE.point,a=Ae(r,u)&&this.comparePoint(u)===0,v=Ae(i,l)&&e.comparePoint(l)===0,m=Ae(r,f)&&this.comparePoint(f)===0,d=Ae(i,s)&&e.comparePoint(s)===0;if(v&&a)return d&&!m?s:!d&&m?f:null;if(v)return m&&l.x===f.x&&l.y===f.y?null:l;if(a)return d&&s.x===u.x&&s.y===u.y?null:u;if(d&&m)return null;if(d)return s;if(m)return f;var w=Dr(l,this.vector(),u,e.vector());return w===null||!Ae(o,w)?null:Ne.round(w.x,w.y)}},{key:"split",value:function(e){var r=[],i=e.events!==void 0,o=new re(e,!0),l=new re(e,!1),s=this.rightSE;this.replaceRightSE(l),r.push(l),r.push(o);var u=new n(o,s,this.rings.slice(),this.windings.slice());return re.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),l.checkForConsuming()),r}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,i=this.windings.length;r<i;r++)this.windings[r]*=-1}},{key:"consume",value:function(e){for(var r=this,i=e;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=n.compare(r,i);if(o!==0){if(o>0){var l=r;r=i,i=l}if(r.prev===i){var s=r;r=i,i=s}for(var u=0,f=i.rings.length;u<f;u++){var a=i.rings[u],v=i.windings[u],m=r.rings.indexOf(a);m===-1?(r.rings.push(a),r.windings.push(v)):r.windings[m]+=v}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,l=0,s=this.rings.length;l<s;l++){var u=this.rings[l],f=this.windings[l],a=r.indexOf(u);a===-1?(r.push(u),i.push(f)):i[a]+=f}for(var v=[],m=[],d=0,w=r.length;d<w;d++)if(i[d]!==0){var h=r[d],g=h.poly;if(m.indexOf(g)===-1)if(h.isExterior)v.push(g);else{m.indexOf(g)===-1&&m.push(g);var b=v.indexOf(h.poly);b!==-1&&v.splice(b,1)}}for(var E=0,S=v.length;E<S;E++){var _=v[E].multiPoly;o.indexOf(_)===-1&&o.push(_)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch($.type){case"union":{var i=e.length===0,o=r.length===0;this._isInResult=i!==o;break}case"intersection":{var l,s;e.length<r.length?(l=e.length,s=r.length):(l=r.length,s=e.length),this._isInResult=s===$.numMultiPolys&&l<s;break}case"xor":{var u=Math.abs(e.length-r.length);this._isInResult=u%2===1;break}case"difference":{var f=function(v){return v.length===1&&v[0].isSubject};this._isInResult=f(e)!==f(r);break}default:throw new Error("Unrecognized operation type found ".concat($.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,r,i){var o,l,s,u=re.comparePoints(e,r);if(u<0)o=e,l=r,s=1;else if(u>0)o=r,l=e,s=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var f=new re(o,!0),a=new re(l,!1);return new n(f,a,[i],[s])}}]),n}(),Nt=function(){function n(t,e,r){if(K(this,n),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=Ne.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,l=1,s=t.length;l<s;l++){if(typeof t[l][0]!="number"||typeof t[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=Ne.round(t[l][0],t[l][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Ye.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Ye.fromRing(o,i,this))}return U(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.segments.length;r<i;r++){var o=this.segments[r];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),n}(),Qr=function(){function n(t,e){if(K(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Nt(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=t.length;r<i;r++){var o=new Nt(t[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return U(n,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),r=0,i=this.interiorRings.length;r<i;r++)for(var o=this.interiorRings[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),Bt=function(){function n(t,e){if(K(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=t.length;r<i;r++){var o=new Qr(t[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return U(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++)for(var o=this.polys[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),Ur=function(){U(n,null,[{key:"factory",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!(!l.isInResult()||l.ringOut)){for(var s=null,u=l.leftSE,f=l.rightSE,a=[u],v=u.point,m=[];s=u,u=f,a.push(u),u.point!==v;)for(;;){var d=u.getAvailableLinkedEvents();if(d.length===0){var w=a[0].point,h=a[a.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(w.x,",")+" ".concat(w.y,"]. Last matching segment found ends at")+" [".concat(h.x,", ").concat(h.y,"]."))}if(d.length===1){f=d[0].otherSE;break}for(var g=null,b=0,E=m.length;b<E;b++)if(m[b].point===u.point){g=b;break}if(g!==null){var S=m.splice(g)[0],_=a.splice(S.index);_.unshift(_[0].otherSE),r.push(new n(_.reverse()));continue}m.push({index:a.length,point:u.point});var k=u.getLeftmostComparator(s);f=d.sort(k)[0].otherSE;break}r.push(new n(a))}}return r}}]);function n(t){K(this,n),this.events=t;for(var e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}return U(n,[{key:"getGeom",value:function(){for(var e=this.events[0].point,r=[e],i=1,o=this.events.length-1;i<o;i++){var l=this.events[i].point,s=this.events[i+1].point;Ct(l,e,s)!==0&&(r.push(l),e=l)}if(r.length===1)return null;var u=r[0],f=r[1];Ct(u,e,f)===0&&r.shift(),r.push(r[0]);for(var a=this.isExteriorRing()?1:-1,v=this.isExteriorRing()?0:r.length-1,m=this.isExteriorRing()?r.length:-1,d=[],w=v;w!=m;w+=a)d.push([r[w].x,r[w].y]);return d}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],r=1,i=this.events.length;r<i;r++){var o=this.events[r];re.compare(e,o)>0&&(e=o)}for(var l=e.segment.prevInResult(),s=l?l.prevInResult():null;;){if(!l)return null;if(!s)return l.ringOut;if(s.ringOut!==l.ringOut)return s.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=s.prevInResult(),s=l?l.prevInResult():null}}}]),n}(),Gt=function(){function n(t){K(this,n),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return U(n,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var r=0,i=this.interiorRings.length;r<i;r++){var o=this.interiorRings[r].getGeom();o!==null&&e.push(o)}return e}}]),n}(),Vr=function(){function n(t){K(this,n),this.rings=t,this.polys=this._composePolys(t)}return U(n,[{key:"getGeom",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++){var o=this.polys[r].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!l.poly)if(l.isExteriorRing())r.push(new Gt(l));else{var s=l.enclosingRing();s.poly||r.push(new Gt(s)),s.poly.addInterior(l)}}return r}}]),n}(),Yr=function(){function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ye.compare;K(this,n),this.queue=t,this.tree=new et(e),this.segments=[]}return U(n,[{key:"process",value:function(e){var r=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(r),i;var o=e.isLeft?this.tree.insert(r):this.tree.find(r);if(!o)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var l=o,s=o,u=void 0,f=void 0;u===void 0;)l=this.tree.prev(l),l===null?u=null:l.key.consumedBy===void 0&&(u=l.key);for(;f===void 0;)s=this.tree.next(s),s===null?f=null:s.key.consumedBy===void 0&&(f=s.key);if(e.isLeft){var a=null;if(u){var v=u.getIntersection(r);if(v!==null&&(r.isAnEndpoint(v)||(a=v),!u.isAnEndpoint(v)))for(var m=this._splitSafely(u,v),d=0,w=m.length;d<w;d++)i.push(m[d])}var h=null;if(f){var g=f.getIntersection(r);if(g!==null&&(r.isAnEndpoint(g)||(h=g),!f.isAnEndpoint(g)))for(var b=this._splitSafely(f,g),E=0,S=b.length;E<S;E++)i.push(b[E])}if(a!==null||h!==null){var _=null;if(a===null)_=h;else if(h===null)_=a;else{var k=re.comparePoints(a,h);_=k<=0?a:h}this.queue.remove(r.rightSE),i.push(r.rightSE);for(var x=r.split(_),P=0,R=x.length;P<R;P++)i.push(x[P])}i.length>0?(this.tree.remove(r),i.push(e)):(this.segments.push(r),r.prev=u)}else{if(u&&f){var D=u.getIntersection(f);if(D!==null){if(!u.isAnEndpoint(D))for(var G=this._splitSafely(u,D),O=0,p=G.length;O<p;O++)i.push(G[O]);if(!f.isAnEndpoint(D))for(var L=this._splitSafely(f,D),Q=0,ce=L.length;Q<ce;Q++)i.push(L[Q])}}this.tree.remove(r)}return i}},{key:"_splitSafely",value:function(e,r){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(r);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),n}(),qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,jr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Zr=function(){function n(){K(this,n)}return U(n,[{key:"run",value:function(e,r,i){$.type=e,Ne.reset();for(var o=[new Bt(r,!0)],l=0,s=i.length;l<s;l++)o.push(new Bt(i[l],!1));if($.numMultiPolys=o.length,$.type==="difference")for(var u=o[0],f=1;f<o.length;)it(o[f].bbox,u.bbox)!==null?f++:o.splice(f,1);if($.type==="intersection"){for(var a=0,v=o.length;a<v;a++)for(var m=o[a],d=a+1,w=o.length;d<w;d++)if(it(m.bbox,o[d].bbox)===null)return[]}for(var h=new et(re.compare),g=0,b=o.length;g<b;g++)for(var E=o[g].getSweepEvents(),S=0,_=E.length;S<_;S++)if(h.insert(E[S]),h.size>qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var k=new Yr(h),x=h.size,P=h.pop();P;){var R=P.key;if(h.size===x){var D=R.segment;throw new Error("Unable to pop() ".concat(R.isLeft?"left":"right"," SweepEvent ")+"[".concat(R.point.x,", ").concat(R.point.y,"] from segment #").concat(D.id," ")+"[".concat(D.leftSE.point.x,", ").concat(D.leftSE.point.y,"] -> ")+"[".concat(D.rightSE.point.x,", ").concat(D.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(h.size>qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(k.segments.length>jr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var G=k.process(R),O=0,p=G.length;O<p;O++){var L=G[O];L.consumedBy===void 0&&h.insert(L)}x=h.size,P=h.pop()}Ne.reset();var Q=Ur.factory(k.segments),ce=new Vr(Q);return ce.getGeom()}}]),n}(),$=new Zr,Xr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return $.run("union",t,r)},Wr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return $.run("intersection",t,r)},Hr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return $.run("xor",t,r)},Kr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return $.run("difference",t,r)},Ge={union:Xr,intersection:Wr,xor:Hr,difference:Kr};function Dt(n,t){var e=$r(t),r=null;return n.type==="FeatureCollection"?r=Jr(n):r=Ft(Ge.union(n.geometry.coordinates)),r.geometry.coordinates.forEach(function(i){e.geometry.coordinates.push(i[0])}),e}function Jr(n){var t=n.features.length===2?Ge.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):Ge.union.apply(Ge,n.features.map(function(e){return e.geometry.coordinates}));return Ft(t)}function Ft(n){return It(n)}function $r(n){var t=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],e=n&&n.geometry.coordinates||t;return Rt(e)}function Qt(n){return n.type==="Feature"?n.geometry:n}function en(n,t,e){e===void 0&&(e={});var r=Qt(n),i=Qt(t),o=Ge.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?Rt(o[0],e.properties):It(o,e.properties)}function Ut(n,t=!0,e=!0,r={},i={},o=l=>{var f;const s=(f=l==null?void 0:l.geometry)==null?void 0:f.type,u=s==="LineString"||s==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:.1,weight:u,dashArray:[u,u],lineCap:"butt"}}){let l,s,u,f=[],a,v=J.geoJSON(void 0,{style:o}).addTo(n);const m=()=>{if(!l){u=void 0;return}let h;const g=n.getZoom()>10?[(h=n.getCenter().wrap()).lng,h.lat]:void 0;u!==g&&(u=g,l(g))},d=h=>{s==null||s([h.latlng.lng,h.latlng.lat])};return{setProximityChangeHandler(h){h?(l=h,n.on("moveend",m),m()):(n.off("moveend",m),l==null||l(void 0),l=void 0)},setMapClickHandler(h){s=h,s?n.on("click",d):n.off("click",d)},flyTo(h,g){n.flyTo(h,g,{duration:2,...r})},fitBounds(h,g){n.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...i})},indicateReverse(h){n.getContainer().style.cursor=h?"crosshair":""},setMarkers(h,g){function b(S){v.clearLayers(),S&&v.addData(S)}for(const S of f)S.remove();f.length=0,b();const E=S=>{const _=document.createElement("div");return new bt({props:{displayIn:"leaflet"},target:_}),new J.Marker(S,{icon:new J.DivIcon({html:_,className:""})})};if(g){let S=!1;if(g.geometry.type==="GeometryCollection"){const k=g.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");if(k.length>0){let x=k.pop();for(const P of k)x=en(x,P);b(Dt({...g,geometry:x})),S=!0}else{const x=g.geometry.geometries.filter(P=>P.type==="LineString"||P.type==="MultiLineString");x.length>0&&(b({...g,geometry:{type:"GeometryCollection",geometries:x}}),S=!0)}}if(!S){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")b(Dt(g));else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){b(g);return}}const _=[g.center[1],g.center[0]];f.push((typeof t=="object"?new J.Marker(_,t):E(_)).addTo(n))}for(const S of h!=null?h:[]){if(S===g)continue;const _=[S.center[1],S.center[0]];f.push((typeof e=="object"?new J.Marker(_,e):E(_)).addTo(n))}},setSelectedMarker(h){var g,b;a&&((g=a.getElement())==null||g.classList.toggle("marker-selected",!1)),a=h>-1?f[h]:void 0,(b=a==null?void 0:a.getElement())==null||b.classList.toggle("marker-selected",!0)}}}class Vt extends J.Control{constructor(e){super();at(this,ee,void 0);at(this,pe,void 0);Ze(this,pe,e)}onAdd(e){const r=document.createElement("div");r.className="leaflet-ctrl-geocoder",J.DomEvent.disableClickPropagation(r),J.DomEvent.disableScrollPropagation(r);const{marker:i,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,...u}=ie(this,pe),f=typeof l=="boolean"?{}:l,a=Ut(e,i,o,f,f,s);Ze(this,ee,new Or({target:r,props:{mapController:a,flyTo:l===void 0?!0:!!l,...u}}));for(const v of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])ie(this,ee).$on(v,m=>e.fire(v.toLowerCase(),m.detail));return r}setOptions(e){var u;Ze(this,pe,e);const{marker:r,showResultMarkers:i,flyTo:o,fullGeometryStyle:l,...s}=ie(this,pe);(u=ie(this,ee))==null||u.$set(s)}setQuery(e,r=!0){var i;(i=ie(this,ee))==null||i.setQuery(e,r)}setReverseMode(e){var r;(r=ie(this,ee))==null||r.$set({reverseActive:e})}focus(){var e;(e=ie(this,ee))==null||e.focus()}blur(){var e;(e=ie(this,ee))==null||e.blur()}onRemove(){var e;(e=ie(this,ee))==null||e.$destroy()}}ee=new WeakMap,pe=new WeakMap;function tn(...n){return new Vt(...n)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=tn),C.GeocodingControl=Vt,C.createLeafletMapController=Ut,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,22 +0,0 @@
1
- var jt=(C,A,k)=>{if(!A.has(C))throw TypeError("Cannot "+k)};var re=(C,A,k)=>(jt(C,A,"read from private field"),k?k.call(C):A.get(C)),ft=(C,A,k)=>{if(A.has(C))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(C):A.set(C,k)},Ze=(C,A,k,Be)=>(jt(C,A,"write to private field"),Be?Be.call(C,k):A.set(C,k),k);(function(C,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","maplibre-gl"],A):(C=typeof globalThis<"u"?globalThis:C||self,A(C.maplibreglMaptilerGeocoder={},C.maplibregl))})(this,function(C,A){var J,de;"use strict";function k(){}function Be(n,t){for(const e in t)n[e]=t[e];return n}function at(n){return n()}function ct(){return Object.create(null)}function ie(n){n.forEach(at)}function ht(n){return typeof n=="function"}function _e(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function Ht(n){return Object.keys(n).length===0}function Kt(n,t,e,r){if(n){const i=gt(n,t,e,r);return n[0](i)}}function gt(n,t,e,r){return n[1]&&r?Be(e.ctx.slice(),n[1](r(t))):e.ctx}function Jt(n,t,e,r){if(n[2]&&r){const i=n[2](r(e));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],l=Math.max(t.dirty.length,i.length);for(let s=0;s<l;s+=1)o[s]=t.dirty[s]|i[s];return o}return t.dirty|i}return t.dirty}function $t(n,t,e,r,i,o){if(i){const l=gt(t,e,r,o);n.p(l,i)}}function er(n){if(n.ctx.length>32){const t=[],e=n.ctx.length/32;for(let r=0;r<e;r++)t[r]=-1;return t}return-1}function vt(n){return n==null?"":n}function I(n,t){n.appendChild(t)}function W(n,t,e){n.insertBefore(t,e||null)}function Y(n){n.parentNode.removeChild(n)}function tr(n,t){for(let e=0;e<n.length;e+=1)n[e]&&n[e].d(t)}function N(n){return document.createElement(n)}function oe(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ve(n){return document.createTextNode(n)}function $(){return ve(" ")}function j(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function rr(n){return function(t){return t.preventDefault(),n.call(this,t)}}function y(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function nr(n){return Array.from(n.childNodes)}function Ie(n,t){t=""+t,n.wholeText!==t&&(n.data=t)}function yt(n,t){n.value=t==null?"":t}function Q(n,t,e){n.classList[e?"add":"remove"](t)}function ir(n,t,{bubbles:e=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(n,e,r,t),i}let Le;function Me(n){Le=n}function dt(){if(!Le)throw new Error("Function called outside component initialization");return Le}function or(n){dt().$$.on_destroy.push(n)}function lr(){const n=dt();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=ir(t,e,{cancelable:r});return i.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}const Oe=[],Xe=[],Ge=[],mt=[],sr=Promise.resolve();let We=!1;function ur(){We||(We=!0,sr.then(pt))}function je(n){Ge.push(n)}const He=new Set;let qe=0;function pt(){const n=Le;do{for(;qe<Oe.length;){const t=Oe[qe];qe++,Me(t),fr(t.$$)}for(Me(null),Oe.length=0,qe=0;Xe.length;)Xe.pop()();for(let t=0;t<Ge.length;t+=1){const e=Ge[t];He.has(e)||(He.add(e),e())}Ge.length=0}while(Oe.length);for(;mt.length;)mt.pop()();We=!1,He.clear(),Me(n)}function fr(n){if(n.fragment!==null){n.update(),ie(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(je)}}const Fe=new Set;let ye;function Qe(){ye={r:0,c:[],p:ye}}function De(){ye.r||ie(ye.c),ye=ye.p}function B(n,t){n&&n.i&&(Fe.delete(n),n.i(t))}function Z(n,t,e,r){if(n&&n.o){if(Fe.has(n))return;Fe.add(n),ye.c.push(()=>{Fe.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function Te(n){n&&n.c()}function be(n,t,e,r){const{fragment:i,after_update:o}=n.$$;i&&i.m(t,e),r||je(()=>{const l=n.$$.on_mount.map(at).filter(ht);n.$$.on_destroy?n.$$.on_destroy.push(...l):ie(l),n.$$.on_mount=[]}),o.forEach(je)}function xe(n,t){const e=n.$$;e.fragment!==null&&(ie(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function ar(n,t){n.$$.dirty[0]===-1&&(Oe.push(n),ur(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function we(n,t,e,r,i,o,l,s=[-1]){const u=Le;Me(n);const f=n.$$={fragment:null,ctx:[],props:o,update:k,not_equal:i,bound:ct(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ct(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};l&&l(f.root);let a=!1;if(f.ctx=e?e(n,t.props||{},(g,m,...v)=>{const x=v.length?v[0]:m;return f.ctx&&i(f.ctx[g],f.ctx[g]=x)&&(!f.skip_bound&&f.bound[g]&&f.bound[g](x),a&&ar(n,g)),m}):[],f.update(),a=!0,ie(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const g=nr(t.target);f.fragment&&f.fragment.l(g),g.forEach(Y)}else f.fragment&&f.fragment.c();t.intro&&B(n.$$.fragment),be(n,t.target,t.anchor,t.customElement),pt()}Me(u)}class Ee{$destroy(){xe(this,1),this.$destroy=k}$on(t,e){if(!ht(e))return k;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Ht(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const mn="";function cr(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),y(e,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),y(t,"viewBox","0 0 60.006 21.412"),y(t,"width","14"),y(t,"height","20"),y(t,"class","svelte-en2qvf")},m(r,i){W(r,t,i),I(t,e)},p:k,i:k,o:k,d(r){r&&Y(t)}}}class hr extends Ee{constructor(t){super(),we(this,t,null,cr,_e,{})}}const pn="";function gr(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),y(e,"d","M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"),y(t,"viewBox","0 0 18 18"),y(t,"width","16"),y(t,"height","16"),y(t,"class","svelte-en2qvf")},m(r,i){W(r,t,i),I(t,e)},p:k,i:k,o:k,d(r){r&&Y(t)}}}class vr extends Ee{constructor(t){super(),we(this,t,null,gr,_e,{})}}const _n="";function yr(n){let t;return{c(){t=N("div"),t.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',y(t,"class","svelte-7cmwmc")},m(e,r){W(e,t,r)},p:k,i:k,o:k,d(e){e&&Y(t)}}}class dr extends Ee{constructor(t){super(),we(this,t,null,yr,_e,{})}}const bn="";function mr(n){let t,e,r;return{c(){t=oe("svg"),e=oe("path"),y(e,"stroke-width","4"),y(e,"fill-rule","evenodd"),y(e,"clip-rule","evenodd"),y(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),y(e,"class","svelte-656hh2"),y(t,"width",r=n[0]!=="list"?void 0:"20"),y(t,"viewBox","0 0 70 85"),y(t,"fill","none"),y(t,"class","svelte-656hh2"),Q(t,"in-map",n[0]!=="list"),Q(t,"for-maplibre",n[0]==="maplibre"),Q(t,"for-leaflet",n[0]==="leaflet"),Q(t,"list-icon",n[0]==="list")},m(i,o){W(i,t,o),I(t,e)},p(i,[o]){o&1&&r!==(r=i[0]!=="list"?void 0:"20")&&y(t,"width",r),o&1&&Q(t,"in-map",i[0]!=="list"),o&1&&Q(t,"for-maplibre",i[0]==="maplibre"),o&1&&Q(t,"for-leaflet",i[0]==="leaflet"),o&1&&Q(t,"list-icon",i[0]==="list")},i:k,o:k,d(i){i&&Y(t)}}}function pr(n,t,e){let{displayIn:r}=t;return n.$$set=i=>{"displayIn"in i&&e(0,r=i.displayIn)},[r]}class _t extends Ee{constructor(t){super(),we(this,t,pr,mr,_e,{displayIn:0})}}const xn="";function _r(n){let t,e;return{c(){t=oe("svg"),e=oe("path"),y(e,"d","M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"),y(t,"viewBox","0 0 18 18"),y(t,"xml:space","preserve"),y(t,"width","20"),y(t,"class","svelte-en2qvf")},m(r,i){W(r,t,i),I(t,e)},p:k,i:k,o:k,d(r){r&&Y(t)}}}class br extends Ee{constructor(t){super(),we(this,t,null,_r,_e,{})}}const wn="";function bt(n,t,e){const r=n.slice();return r[63]=t[e],r[65]=e,r}function xt(n){let t,e;return t=new dr({}),{c(){Te(t.$$.fragment)},m(r,i){be(t,r,i),e=!0},i(r){e||(B(t.$$.fragment,r),e=!0)},o(r){Z(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function wt(n){let t,e,r,i,o;return e=new hr({}),{c(){t=N("button"),Te(e.$$.fragment),y(t,"type","button"),y(t,"title",n[8]),y(t,"class","svelte-1h1zm6d"),Q(t,"active",n[1])},m(l,s){W(l,t,s),be(e,t,null),r=!0,i||(o=j(t,"click",n[50]),i=!0)},p(l,s){(!r||s[0]&256)&&y(t,"title",l[8]),(!r||s[0]&2)&&Q(t,"active",l[1])},i(l){r||(B(e.$$.fragment,l),r=!0)},o(l){Z(e.$$.fragment,l),r=!1},d(l){l&&Y(t),xe(e),i=!1,o()}}}function xr(n){let t,e,r,i,o=n[12],l=[];for(let u=0;u<o.length;u+=1)l[u]=St(bt(n,o,u));const s=u=>Z(l[u],1,1,()=>{l[u]=null});return{c(){t=N("ul");for(let u=0;u<l.length;u+=1)l[u].c();y(t,"class","svelte-1h1zm6d")},m(u,f){W(u,t,f);for(let a=0;a<l.length;a+=1)l[a].m(t,null);e=!0,r||(i=[j(t,"mouseout",n[53]),j(t,"blur",n[54])],r=!0)},p(u,f){if(f[0]&29697){o=u[12];let a;for(a=0;a<o.length;a+=1){const g=bt(u,o,a);l[a]?(l[a].p(g,f),B(l[a],1)):(l[a]=St(g),l[a].c(),B(l[a],1),l[a].m(t,null))}for(Qe(),a=o.length;a<l.length;a+=1)s(a);De()}},i(u){if(!e){for(let f=0;f<o.length;f+=1)B(l[f]);e=!0}},o(u){l=l.filter(Boolean);for(let f=0;f<l.length;f+=1)Z(l[f]);e=!1},d(u){u&&Y(t),tr(l,u),r=!1,ie(i)}}}function wr(n){let t,e;return{c(){t=N("div"),e=ve(n[5]),y(t,"class","no-results svelte-1h1zm6d")},m(r,i){W(r,t,i),I(t,e)},p(r,i){i[0]&32&&Ie(e,r[5])},i:k,o:k,d(r){r&&Y(t)}}}function Er(n){let t,e;return{c(){t=N("div"),e=ve(n[4]),y(t,"class","error svelte-1h1zm6d")},m(r,i){W(r,t,i),I(t,e)},p(r,i){i[0]&16&&Ie(e,r[4])},i:k,o:k,d(r){r&&Y(t)}}}function Sr(n){let t="",e;return{c(){e=ve(t)},m(r,i){W(r,e,i)},p:k,i:k,o:k,d(r){r&&Y(e)}}}function Et(n){let t,e=n[63].place_type+"",r;return{c(){t=N("span"),r=ve(e),y(t,"class","svelte-1h1zm6d")},m(i,o){W(i,t,o),I(t,r)},p(i,o){o[0]&4096&&e!==(e=i[63].place_type+"")&&Ie(r,e)},d(i){i&&Y(t)}}}function St(n){let t,e,r,i,o,l,s=n[63].place_name.replace(/,.*/,"")+"",u,f,a,g,m,v=n[63].place_name.replace(/[^,]*,?\s*/,"")+"",x,p,h,d,w,L;e=new _t({props:{displayIn:"list"}});let _=n[10]&&Et(n);function S(){return n[51](n[65])}function E(){return n[52](n[63])}return{c(){t=N("li"),Te(e.$$.fragment),r=$(),i=N("span"),o=N("span"),l=N("span"),u=ve(s),f=$(),_&&_.c(),a=$(),g=N("span"),m=N("span"),x=ve(v),p=$(),y(l,"class","svelte-1h1zm6d"),y(o,"class","svelte-1h1zm6d"),y(i,"class","svelte-1h1zm6d"),y(m,"class","svelte-1h1zm6d"),y(g,"class","svelte-1h1zm6d"),y(t,"tabindex","0"),y(t,"data-selected",h=n[14]===n[65]),y(t,"class","svelte-1h1zm6d"),Q(t,"selected",n[14]===n[65])},m(P,R){W(P,t,R),be(e,t,null),I(t,r),I(t,i),I(i,o),I(o,l),I(l,u),I(o,f),_&&_.m(o,null),I(t,a),I(t,g),I(g,m),I(m,x),I(t,p),d=!0,w||(L=[j(t,"mouseover",S),j(t,"focus",E)],w=!0)},p(P,R){n=P,(!d||R[0]&4096)&&s!==(s=n[63].place_name.replace(/,.*/,"")+"")&&Ie(u,s),n[10]?_?_.p(n,R):(_=Et(n),_.c(),_.m(o,null)):_&&(_.d(1),_=null),(!d||R[0]&4096)&&v!==(v=n[63].place_name.replace(/[^,]*,?\s*/,"")+"")&&Ie(x,v),(!d||R[0]&16384&&h!==(h=n[14]===n[65]))&&y(t,"data-selected",h),(!d||R[0]&16384)&&Q(t,"selected",n[14]===n[65])},i(P){d||(B(e.$$.fragment,P),d=!0)},o(P){Z(e.$$.fragment,P),d=!1},d(P){P&&Y(t),xe(e),_&&_.d(),w=!1,ie(L)}}}function kr(n){let t,e,r,i,o,l,s,u,f,a,g,m,v,x,p,h,d,w,L,_;i=new br({}),a=new vr({});let S=n[18]&&xt(),E=n[7]===!0&&wt(n);const P=n[42].default,R=Kt(P,n,n[41],null),F=[Sr,Er,wr,xr],G=[];function M(b,O){var D,fe;return b[15]?b[17]?1:((D=b[12])==null?void 0:D.length)===0?2:b[15]&&((fe=b[12])==null?void 0:fe.length)?3:-1:0}return~(p=M(n))&&(h=G[p]=F[p](n)),{c(){t=N("form"),e=N("div"),r=N("button"),Te(i.$$.fragment),o=$(),l=N("input"),s=$(),u=N("div"),f=N("button"),Te(a.$$.fragment),g=$(),S&&S.c(),m=$(),E&&E.c(),v=$(),R&&R.c(),x=$(),h&&h.c(),y(r,"type","button"),y(r,"class","svelte-1h1zm6d"),y(l,"placeholder",n[3]),y(l,"aria-label",n[3]),y(l,"class","svelte-1h1zm6d"),y(f,"type","button"),y(f,"title",n[9]),y(f,"class","svelte-1h1zm6d"),Q(f,"displayable",n[0]!==""),y(u,"class","clear-button-container svelte-1h1zm6d"),y(e,"class","input-group svelte-1h1zm6d"),y(t,"tabindex","0"),y(t,"class",d=vt(n[2])+" svelte-1h1zm6d"),Q(t,"can-collapse",n[6]&&n[0]==="")},m(b,O){W(b,t,O),I(t,e),I(e,r),be(i,r,null),I(e,o),I(e,l),n[44](l),yt(l,n[0]),I(e,s),I(e,u),I(u,f),be(a,f,null),I(u,g),S&&S.m(u,null),I(e,m),E&&E.m(e,null),I(e,v),R&&R.m(e,null),I(t,x),~p&&G[p].m(t,null),w=!0,L||(_=[j(r,"click",n[43]),j(l,"input",n[45]),j(l,"focus",n[46]),j(l,"blur",n[47]),j(l,"keydown",n[20]),j(l,"input",n[48]),j(f,"click",n[49]),j(t,"submit",rr(n[19]))],L=!0)},p(b,O){(!w||O[0]&8)&&y(l,"placeholder",b[3]),(!w||O[0]&8)&&y(l,"aria-label",b[3]),O[0]&1&&l.value!==b[0]&&yt(l,b[0]),(!w||O[0]&512)&&y(f,"title",b[9]),(!w||O[0]&1)&&Q(f,"displayable",b[0]!==""),b[18]?S?O[0]&262144&&B(S,1):(S=xt(),S.c(),B(S,1),S.m(u,null)):S&&(Qe(),Z(S,1,1,()=>{S=null}),De()),b[7]===!0?E?(E.p(b,O),O[0]&128&&B(E,1)):(E=wt(b),E.c(),B(E,1),E.m(e,v)):E&&(Qe(),Z(E,1,1,()=>{E=null}),De()),R&&R.p&&(!w||O[1]&1024)&&$t(R,P,b,b[41],w?Jt(P,b[41],O,null):er(b[41]),null);let D=p;p=M(b),p===D?~p&&G[p].p(b,O):(h&&(Qe(),Z(G[D],1,1,()=>{G[D]=null}),De()),~p?(h=G[p],h?h.p(b,O):(h=G[p]=F[p](b),h.c()),B(h,1),h.m(t,null)):h=null),(!w||O[0]&4&&d!==(d=vt(b[2])+" svelte-1h1zm6d"))&&y(t,"class",d),(!w||O[0]&69)&&Q(t,"can-collapse",b[6]&&b[0]==="")},i(b){w||(B(i.$$.fragment,b),B(a.$$.fragment,b),B(S),B(E),B(R,b),B(h),w=!0)},o(b){Z(i.$$.fragment,b),Z(a.$$.fragment,b),Z(S),Z(E),Z(R,b),Z(h),w=!1},d(b){b&&Y(t),xe(i),n[44](null),xe(a),S&&S.d(),E&&E.d(),R&&R.d(b),~p&&G[p].d(),L=!1,ie(_)}}}function Pr(n,t,e){let r,{$$slots:i={},$$scope:o}=t,{class:l=void 0}=t,{mapController:s=void 0}=t,{apiKey:u}=t,{debounceSearch:f=200}=t,{placeholder:a="Search"}=t,{errorMessage:g="Searching failed"}=t,{noResultsMessage:m="No results found"}=t,{proximity:v=void 0}=t,{bbox:x=void 0}=t,{trackProximity:p=!0}=t,{minLength:h=2}=t,{language:d=void 0}=t,{showResultsWhileTyping:w=!0}=t,{zoom:L=16}=t,{flyTo:_=!0}=t,{collapsed:S=!1}=t,{clearOnBlur:E=!1}=t,{enableReverse:P=!1}=t,{reverseButtonTitle:R="toggle reverse geocoding"}=t,{clearButtonTitle:F="clear"}=t,{filter:G=()=>!0}=t,{searchValue:M=""}=t,{reverseActive:b=P==="always"}=t,{showPlaceType:O=!1}=t,{showFullGeometry:D=!0}=t;function fe(){te.focus()}function en(){te.blur()}function Vt(c,V=!0){e(0,M=c),V?(e(14,q=-1),Zt()):(ut(),setTimeout(()=>{te.focus(),te.select()}))}let Se=!1,z,X,T,Yt="",te,q=-1,ae,Ye=[],me,ot,lt;const ce=lr();or(()=>{s&&(s.setProximityChangeHandler(void 0),s.setMapClickHandler(void 0),s.indicateReverse(!1),s.setSelectedMarker(-1),s.setMarkers(void 0,void 0))});function Zt(c){if(q>-1&&z)e(13,T=z[q]),e(0,M=T.place_name.replace(/,.*/,"")),e(17,ae=void 0),e(39,X=void 0),e(14,q=-1);else if(M){const V=c||!Xt();st(M).then(()=>{e(39,X=z),e(13,T=void 0),V&&tn()}).catch(ne=>e(17,ae=ne))}}function Xt(){return/^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(M)}async function st(c,V=!1){e(17,ae=void 0);const ne=Xt(),he=new URLSearchParams;he.set("key",u),d&&he.set("language",String(d)),ne||(x&&he.set("bbox",x.join(",")),v&&he.set("proximity",v.join(",")));const pe="https://api.maptiler.com/geocoding/"+encodeURIComponent(c)+".json?"+he.toString();if(pe===Yt){V?(e(12,z=void 0),e(13,T=Ye[0])):e(12,z=Ye);return}Yt=pe,me==null||me.abort(),e(18,me=new AbortController);let ke;try{ke=await fetch(pe,{signal:me.signal}).finally(()=>{e(18,me=void 0)})}catch(Re){if(Re&&typeof Re=="object"&&Re.name==="AbortError")return;throw new Error}if(!ke.ok)throw new Error;const Pe=await ke.json();ce("response",{url:pe,featureCollection:Pe}),V?(e(12,z=void 0),e(13,T=Pe.features[0]),Ye=[T]):(e(12,z=Pe.features.filter(G)),Ye=z,ne&&te.focus())}function tn(){var V,ne,he,pe,ke,Pe,Re,Wt;if(!(X!=null&&X.length)||!_)return;const c=[180,90,-180,-90];for(const ge of X)c[0]=Math.min(c[0],(ne=(V=ge.bbox)==null?void 0:V[0])!=null?ne:ge.center[0]),c[1]=Math.min(c[1],(pe=(he=ge.bbox)==null?void 0:he[1])!=null?pe:ge.center[1]),c[2]=Math.max(c[2],(Pe=(ke=ge.bbox)==null?void 0:ke[2])!=null?Pe:ge.center[0]),c[3]=Math.max(c[3],(Wt=(Re=ge.bbox)==null?void 0:Re[3])!=null?Wt:ge.center[1]);s&&X.length>0&&(T&&c[0]===c[2]&&c[1]===c[3]?s.flyTo(T.center,L):s.fitBounds(c,50))}function rn(c){e(1,b=P==="always"),Vt(c[0].toFixed(6)+","+c[1].toFixed(6))}function nn(c){if(!z)return;let V=c.key==="ArrowDown"?1:c.key==="ArrowUp"?-1:0;V?(q===-1&&V===-1&&e(14,q=z.length),e(14,q+=V),q>=z.length&&e(14,q=-1),c.preventDefault()):["ArrowLeft","ArrowRight","Home","End"].includes(c.key)&&e(14,q=-1)}function ut(c=!0){if(w&&M.length>h){ot&&clearTimeout(ot);const V=M;ot=window.setTimeout(()=>{st(V).catch(ne=>e(17,ae=ne))},c?f:0)}else e(12,z=void 0),e(17,ae=void 0)}const on=()=>te.focus();function ln(c){Xe[c?"unshift":"push"](()=>{te=c,e(16,te)})}function sn(){M=this.value,e(0,M),e(11,Se),e(33,E)}const un=()=>e(11,Se=!0),fn=()=>e(11,Se=!1),an=()=>ut(),cn=()=>{e(0,M=""),te.focus()},hn=()=>e(1,b=!b),gn=c=>e(14,q=c),vn=c=>{e(13,T=c),e(0,M=c.place_name.replace(/,.*/,"")),e(14,q=-1)},yn=()=>e(14,q=-1),dn=()=>{};return n.$$set=c=>{"class"in c&&e(2,l=c.class),"mapController"in c&&e(23,s=c.mapController),"apiKey"in c&&e(24,u=c.apiKey),"debounceSearch"in c&&e(25,f=c.debounceSearch),"placeholder"in c&&e(3,a=c.placeholder),"errorMessage"in c&&e(4,g=c.errorMessage),"noResultsMessage"in c&&e(5,m=c.noResultsMessage),"proximity"in c&&e(22,v=c.proximity),"bbox"in c&&e(26,x=c.bbox),"trackProximity"in c&&e(27,p=c.trackProximity),"minLength"in c&&e(28,h=c.minLength),"language"in c&&e(29,d=c.language),"showResultsWhileTyping"in c&&e(30,w=c.showResultsWhileTyping),"zoom"in c&&e(31,L=c.zoom),"flyTo"in c&&e(32,_=c.flyTo),"collapsed"in c&&e(6,S=c.collapsed),"clearOnBlur"in c&&e(33,E=c.clearOnBlur),"enableReverse"in c&&e(7,P=c.enableReverse),"reverseButtonTitle"in c&&e(8,R=c.reverseButtonTitle),"clearButtonTitle"in c&&e(9,F=c.clearButtonTitle),"filter"in c&&e(34,G=c.filter),"searchValue"in c&&e(0,M=c.searchValue),"reverseActive"in c&&e(1,b=c.reverseActive),"showPlaceType"in c&&e(10,O=c.showPlaceType),"showFullGeometry"in c&&e(35,D=c.showFullGeometry),"$$scope"in c&&e(41,o=c.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&142606336&&s&&s.setProximityChangeHandler(p?c=>{e(22,v=c)}:void 0),n.$$.dirty[0]&134217728&&(p||e(22,v=void 0)),n.$$.dirty[0]&2048|n.$$.dirty[1]&4&&setTimeout(()=>{e(15,lt=Se),E&&!Se&&e(0,M="")}),n.$$.dirty[0]&4097&&(M||(e(13,T=void 0),e(12,z=void 0),e(17,ae=void 0),e(39,X=z))),n.$$.dirty[0]&8192|n.$$.dirty[1]&16&&D&&T&&!T.address&&T.geometry.type==="Point"&&st(T.id,!0).catch(c=>e(17,ae=c)),n.$$.dirty[0]&8396800|n.$$.dirty[1]&3&&s&&T&&_&&(!T.bbox||T.bbox[0]===T.bbox[2]&&T.bbox[1]===T.bbox[3]?s.flyTo(T.center,L):s.fitBounds(T.bbox,50),e(12,z=void 0),e(39,X=void 0),e(14,q=-1)),n.$$.dirty[0]&4096|n.$$.dirty[1]&256&&X!==z&&e(39,X=void 0),n.$$.dirty[0]&8396800|n.$$.dirty[1]&256&&s&&s.setMarkers(X,T),n.$$.dirty[0]&1&&e(14,q=-1),n.$$.dirty[0]&8404992&&(s==null||s.setSelectedMarker(q)),n.$$.dirty[0]&20480&&e(40,r=z==null?void 0:z[q]),n.$$.dirty[1]&512&&ce("select",r),n.$$.dirty[0]&8192&&ce("pick",T),n.$$.dirty[0]&36864&&ce("optionsVisibilityChange",lt&&!!z),n.$$.dirty[0]&4096&&ce("featuresListed",z),n.$$.dirty[1]&256&&ce("featuresMarked",X),n.$$.dirty[0]&2&&ce("reverseToggle",b),n.$$.dirty[0]&1&&ce("queryChange",M),n.$$.dirty[0]&8388610&&s&&s.indicateReverse(b),n.$$.dirty[0]&8388610&&s&&s.setMapClickHandler(b?rn:void 0)},[M,b,l,a,g,m,S,P,R,F,O,Se,z,T,q,lt,te,ae,me,Zt,nn,ut,v,s,u,f,x,p,h,d,w,L,_,E,G,D,fe,en,Vt,X,r,o,i,on,ln,sn,un,fn,an,cn,hn,gn,vn,yn,dn]}class Rr extends Ee{constructor(t){super(),we(this,t,Pr,kr,_e,{class:2,mapController:23,apiKey:24,debounceSearch:25,placeholder:3,errorMessage:4,noResultsMessage:5,proximity:22,bbox:26,trackProximity:27,minLength:28,language:29,showResultsWhileTyping:30,zoom:31,flyTo:32,collapsed:6,clearOnBlur:33,enableReverse:7,reverseButtonTitle:8,clearButtonTitle:9,filter:34,searchValue:0,reverseActive:1,showPlaceType:10,showFullGeometry:35,focus:36,blur:37,setQuery:38},null,[-1,-1,-1])}get focus(){return this.$$.ctx[36]}get blur(){return this.$$.ctx[37]}get setQuery(){return this.$$.ctx[38]}}function kt(n,t,e){e===void 0&&(e={});var r={type:"Feature"};return(e.id===0||e.id)&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.properties=t||{},r.geometry=n,r}function Pt(n,t,e){e===void 0&&(e={});for(var r=0,i=n;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<o[o.length-1].length;l++)if(o[o.length-1][l]!==o[0][l])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:n};return kt(s,t,e)}function Rt(n,t,e){e===void 0&&(e={});var r={type:"MultiPolygon",coordinates:n};return kt(r,t,e)}/**
2
- * splaytree v3.1.1
3
- * Fast Splay tree for Node and browser
4
- *
5
- * @author Alexander Milevski <info@w8r.name>
6
- * @license MIT
7
- * @preserve
8
- *//*! *****************************************************************************
9
- Copyright (c) Microsoft Corporation. All rights reserved.
10
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
11
- this file except in compliance with the License. You may obtain a copy of the
12
- License at http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17
- MERCHANTABLITY OR NON-INFRINGEMENT.
18
-
19
- See the Apache Version 2.0 License for specific language governing permissions
20
- and limitations under the License.
21
- ***************************************************************************** */function Ir(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,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(f){return function(a){return u([f,a])}}function u(f){if(r)throw new TypeError("Generator is already executing.");for(;e;)try{if(r=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(n,e)}catch(a){f=[6,a],i=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var le=function(){function n(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return n}();function Lr(n,t){return n>t?1:n<t?-1:0}function se(n,t,e){for(var r=new le(null,null),i=r,o=r;;){var l=e(n,t.key);if(l<0){if(t.left===null)break;if(e(n,t.left.key)<0){var s=t.left;if(t.left=s.right,s.right=t,t=s,t.left===null)break}o.left=t,o=t,t=t.left}else if(l>0){if(t.right===null)break;if(e(n,t.right.key)>0){var s=t.right;if(t.right=s.left,s.left=t,t=s,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=r.right,t.right=r.left,t}function Ke(n,t,e,r){var i=new le(n,t);if(e===null)return i.left=i.right=null,i;e=se(n,e,r);var o=r(n,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function It(n,t,e){var r=null,i=null;if(t){t=se(n,t,e);var o=e(t.key,n);o===0?(r=t.left,i=t.right):o<0?(i=t.right,t.right=null,r=t):(r=t.left,t.left=null,i=t)}return{left:r,right:i}}function Mr(n,t,e){return t===null?n:(n===null||(t=se(n.key,t,e),t.left=n),t)}function Je(n,t,e,r,i){if(n){r(""+t+(e?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+i(n)+`
22
- `);var o=t+(e?" ":"\u2502 ");n.left&&Je(n.left,o,!1,r,i),n.right&&Je(n.right,o,!0,r,i)}}var $e=function(){function n(t){t===void 0&&(t=Lr),this._root=null,this._size=0,this._comparator=t}return n.prototype.insert=function(t,e){return this._size++,this._root=Ke(t,e,this._root,this._comparator)},n.prototype.add=function(t,e){var r=new le(t,e);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=se(t,this._root,i),l=i(t,o.key);return l===0?this._root=o:(l<0?(r.left=o.left,r.right=o,o.left=null):l>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},n.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},n.prototype._remove=function(t,e,r){var i;if(e===null)return null;e=se(t,e,r);var o=r(t,e.key);return o===0?(e.left===null?i=e.right:(i=se(t,e.left,r),i.right=e.right),this._size--,i):e},n.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=se(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},n.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},n.prototype.find=function(t){return this._root&&(this._root=se(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},n.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var i=r(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},n.prototype.forEach=function(t,e){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),t.call(e,r),r=r.right):o=!0;return this},n.prototype.range=function(t,e,r,i){for(var o=[],l=this._comparator,s=this._root,u;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),u=l(s.key,e),u>0)break;if(l(s.key,t)>=0&&r.call(i,s))return this;s=s.right}return this},n.prototype.keys=function(){var t=[];return this.forEach(function(e){var r=e.key;return t.push(r)}),t},n.prototype.values=function(){var t=[];return this.forEach(function(e){var r=e.data;return t.push(r)}),t},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(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},n.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},n.prototype.at=function(t){for(var e=this._root,r=!1,i=0,o=[];!r;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(r=e,e=e.left):e=e.right}return r},n.prototype.prev=function(t){var e=this._root,r=null;if(t.left!==null){for(r=t.left;r.right;)r=r.right;return r}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(r=e,e=e.right)}return r},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return Tr(this._root)},n.prototype.load=function(t,e,r){e===void 0&&(e=[]),r===void 0&&(r=!1);var i=t.length,o=this._comparator;if(r&&rt(t,e,0,i-1,o),this._root===null)this._root=et(t,e,0,i),this._size=i;else{var l=Cr(this.toList(),Or(t,e),o);i=this._size+i,this._root=tt({head:l},0,i)}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(t){t===void 0&&(t=function(r){return String(r.key)});var e=[];return Je(this._root,"",!0,function(r){return e.push(r)},t),e.join("")},n.prototype.update=function(t,e,r){var i=this._comparator,o=It(t,this._root,i),l=o.left,s=o.right;i(t,e)<0?s=Ke(e,r,s,i):l=Ke(e,r,l,i),this._root=Mr(l,s,i)},n.prototype.split=function(t){return It(t,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var t;return Ir(this,function(e){switch(e.label){case 0:t=this.minNode(),e.label=1;case 1:return t?[4,t]:[3,3];case 2:return e.sent(),t=this.next(t),[3,1];case 3:return[2]}})},n}();function et(n,t,e,r){var i=r-e;if(i>0){var o=e+Math.floor(i/2),l=n[o],s=t[o],u=new le(l,s);return u.left=et(n,t,e,o),u.right=et(n,t,o+1,r),u}return null}function Or(n,t){for(var e=new le(null,null),r=e,i=0;i<n.length;i++)r=r.next=new le(n[i],t[i]);return r.next=null,e.next}function Tr(n){for(var t=n,e=[],r=!1,i=new le(null,null),o=i;!r;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):r=!0;return o.next=null,i.next}function tt(n,t,e){var r=e-t;if(r>0){var i=t+Math.floor(r/2),o=tt(n,t,i),l=n.head;return l.left=o,n.head=n.head.next,l.right=tt(n,i+1,e),l}return null}function Cr(n,t,e){for(var r=new le(null,null),i=r,o=n,l=t;o!==null&&l!==null;)e(o.key,l.key)<0?(i.next=o,o=o.next):(i.next=l,l=l.next),i=i.next;return o!==null?i.next=o:l!==null&&(i.next=l),r.next}function rt(n,t,e,r,i){if(!(e>=r)){for(var o=n[e+r>>1],l=e-1,s=r+1;;){do l++;while(i(n[l],o)<0);do s--;while(i(n[s],o)>0);if(l>=s)break;var u=n[l];n[l]=n[s],n[s]=u,u=t[l],t[l]=t[s],t[s]=u}rt(n,t,e,s,i),rt(n,t,s+1,r,i)}}function H(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Lt(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function U(n,t,e){return t&&Lt(n.prototype,t),e&&Lt(n,e),n}var Ce=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},nt=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var r=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x,o=t.ll.y<e.ll.y?e.ll.y:t.ll.y,l=t.ur.y<e.ur.y?t.ur.y:e.ur.y;return{ll:{x:r,y:o},ur:{x:i,y:l}}},ue=Number.EPSILON;ue===void 0&&(ue=Math.pow(2,-52));var zr=ue*ue,it=function(t,e){if(-ue<t&&t<ue&&-ue<e&&e<ue)return 0;var r=t-e;return r*r<zr*t*e?0:t<e?-1:1},Ar=function(){function n(){H(this,n),this.reset()}return U(n,[{key:"reset",value:function(){this.xRounder=new Mt,this.yRounder=new Mt}},{key:"round",value:function(e,r){return{x:this.xRounder.round(e),y:this.yRounder.round(r)}}}]),n}(),Mt=function(){function n(){H(this,n),this.tree=new $e,this.round(0)}return U(n,[{key:"round",value:function(e){var r=this.tree.add(e),i=this.tree.prev(r);if(i!==null&&it(r.key,i.key)===0)return this.tree.remove(e),i.key;var o=this.tree.next(r);return o!==null&&it(r.key,o.key)===0?(this.tree.remove(e),o.key):e}}]),n}(),ze=new Ar,Ae=function(t,e){return t.x*e.y-t.y*e.x},Ot=function(t,e){return t.x*e.x+t.y*e.y},Tt=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y},l=Ae(i,o);return it(l,0)},Ue=function(t){return Math.sqrt(Ot(t,t))},Nr=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Ae(o,i)/Ue(o)/Ue(i)},Br=function(t,e,r){var i={x:e.x-t.x,y:e.y-t.y},o={x:r.x-t.x,y:r.y-t.y};return Ot(o,i)/Ue(o)/Ue(i)},Ct=function(t,e,r){return e.y===0?null:{x:t.x+e.x/e.y*(r-t.y),y:r}},zt=function(t,e,r){return e.x===0?null:{x:r,y:t.y+e.y/e.x*(r-t.x)}},Gr=function(t,e,r,i){if(e.x===0)return zt(r,i,t.x);if(i.x===0)return zt(t,e,r.x);if(e.y===0)return Ct(r,i,t.y);if(i.y===0)return Ct(t,e,r.y);var o=Ae(e,i);if(o==0)return null;var l={x:r.x-t.x,y:r.y-t.y},s=Ae(l,e)/o,u=Ae(l,i)/o,f=t.x+u*e.x,a=r.x+s*i.x,g=t.y+u*e.y,m=r.y+s*i.y,v=(f+a)/2,x=(g+m)/2;return{x:v,y:x}},ee=function(){U(n,null,[{key:"compare",value:function(e,r){var i=n.comparePoints(e.point,r.point);return i!==0?i:(e.point!==r.point&&e.link(r),e.isLeft!==r.isLeft?e.isLeft?1:-1:Ve.compare(e.segment,r.segment))}},{key:"comparePoints",value:function(e,r){return e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0}}]);function n(t,e){H(this,n),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}return U(n,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var r=e.point.events,i=0,o=r.length;i<o;i++){var l=r[i];this.point.events.push(l),l.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,r=0;r<e;r++){var i=this.point.events[r];if(i.segment.consumedBy===void 0)for(var o=r+1;o<e;o++){var l=this.point.events[o];l.consumedBy===void 0&&i.otherSE.point.events===l.otherSE.point.events&&i.segment.consume(l.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],r=0,i=this.point.events.length;r<i;r++){var o=this.point.events[r];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&e.push(o)}return e}},{key:"getLeftmostComparator",value:function(e){var r=this,i=new Map,o=function(s){var u=s.otherSE;i.set(s,{sine:Nr(r.point,e.point,u.point),cosine:Br(r.point,e.point,u.point)})};return function(l,s){i.has(l)||o(l),i.has(s)||o(s);var u=i.get(l),f=u.sine,a=u.cosine,g=i.get(s),m=g.sine,v=g.cosine;return f>=0&&m>=0?a<v?1:a>v?-1:0:f<0&&m<0?a<v?-1:a>v?1:0:m<f?-1:m>f?1:0}}}]),n}(),qr=0,Ve=function(){U(n,null,[{key:"compare",value:function(e,r){var i=e.leftSE.point.x,o=r.leftSE.point.x,l=e.rightSE.point.x,s=r.rightSE.point.x;if(s<i)return 1;if(l<o)return-1;var u=e.leftSE.point.y,f=r.leftSE.point.y,a=e.rightSE.point.y,g=r.rightSE.point.y;if(i<o){if(f<u&&f<a)return 1;if(f>u&&f>a)return-1;var m=e.comparePoint(r.leftSE.point);if(m<0)return 1;if(m>0)return-1;var v=r.comparePoint(e.rightSE.point);return v!==0?v:-1}if(i>o){if(u<f&&u<g)return-1;if(u>f&&u>g)return 1;var x=r.comparePoint(e.leftSE.point);if(x!==0)return x;var p=e.comparePoint(r.rightSE.point);return p<0?1:p>0?-1:1}if(u<f)return-1;if(u>f)return 1;if(l<s){var h=r.comparePoint(e.rightSE.point);if(h!==0)return h}if(l>s){var d=e.comparePoint(r.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(l!==s){var w=a-u,L=l-i,_=g-f,S=s-o;if(w>L&&_<S)return 1;if(w<L&&_>S)return-1}return l>s?1:l<s||a<g?-1:a>g?1:e.id<r.id?-1:e.id>r.id?1:0}}]);function n(t,e,r,i){H(this,n),this.id=++qr,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=r,this.windings=i}return U(n,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<r?e:r},ur:{x:this.rightSE.point.x,y:e>r?e:r}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var r=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(r.x===i.x)return e.x===r.x?0:e.x<r.x?1:-1;var l=(e.y-r.y)/o.y,s=r.x+l*o.x;if(e.x===s)return 0;var u=(e.x-r.x)/o.x,f=r.y+u*o.y;return e.y===f?0:e.y<f?-1:1}},{key:"getIntersection",value:function(e){var r=this.bbox(),i=e.bbox(),o=nt(r,i);if(o===null)return null;var l=this.leftSE.point,s=this.rightSE.point,u=e.leftSE.point,f=e.rightSE.point,a=Ce(r,u)&&this.comparePoint(u)===0,g=Ce(i,l)&&e.comparePoint(l)===0,m=Ce(r,f)&&this.comparePoint(f)===0,v=Ce(i,s)&&e.comparePoint(s)===0;if(g&&a)return v&&!m?s:!v&&m?f:null;if(g)return m&&l.x===f.x&&l.y===f.y?null:l;if(a)return v&&s.x===u.x&&s.y===u.y?null:u;if(v&&m)return null;if(v)return s;if(m)return f;var x=Gr(l,this.vector(),u,e.vector());return x===null||!Ce(o,x)?null:ze.round(x.x,x.y)}},{key:"split",value:function(e){var r=[],i=e.events!==void 0,o=new ee(e,!0),l=new ee(e,!1),s=this.rightSE;this.replaceRightSE(l),r.push(l),r.push(o);var u=new n(o,s,this.rings.slice(),this.windings.slice());return ee.comparePoints(u.leftSE.point,u.rightSE.point)>0&&u.swapEvents(),ee.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),l.checkForConsuming()),r}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,i=this.windings.length;r<i;r++)this.windings[r]*=-1}},{key:"consume",value:function(e){for(var r=this,i=e;r.consumedBy;)r=r.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var o=n.compare(r,i);if(o!==0){if(o>0){var l=r;r=i,i=l}if(r.prev===i){var s=r;r=i,i=s}for(var u=0,f=i.rings.length;u<f;u++){var a=i.rings[u],g=i.windings[u],m=r.rings.indexOf(a);m===-1?(r.rings.push(a),r.windings.push(g)):r.windings[m]+=g}i.rings=null,i.windings=null,i.consumedBy=r,i.leftSE.consumedBy=r.leftSE,i.rightSE.consumedBy=r.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,l=0,s=this.rings.length;l<s;l++){var u=this.rings[l],f=this.windings[l],a=r.indexOf(u);a===-1?(r.push(u),i.push(f)):i[a]+=f}for(var g=[],m=[],v=0,x=r.length;v<x;v++)if(i[v]!==0){var p=r[v],h=p.poly;if(m.indexOf(h)===-1)if(p.isExterior)g.push(h);else{m.indexOf(h)===-1&&m.push(h);var d=g.indexOf(p.poly);d!==-1&&g.splice(d,1)}}for(var w=0,L=g.length;w<L;w++){var _=g[w].multiPoly;o.indexOf(_)===-1&&o.push(_)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var e=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(K.type){case"union":{var i=e.length===0,o=r.length===0;this._isInResult=i!==o;break}case"intersection":{var l,s;e.length<r.length?(l=e.length,s=r.length):(l=r.length,s=e.length),this._isInResult=s===K.numMultiPolys&&l<s;break}case"xor":{var u=Math.abs(e.length-r.length);this._isInResult=u%2===1;break}case"difference":{var f=function(g){return g.length===1&&g[0].isSubject};this._isInResult=f(e)!==f(r);break}default:throw new Error("Unrecognized operation type found ".concat(K.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,r,i){var o,l,s,u=ee.comparePoints(e,r);if(u<0)o=e,l=r,s=1;else if(u>0)o=r,l=e,s=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var f=new ee(o,!0),a=new ee(l,!1);return new n(f,a,[i],[s])}}]),n}(),At=function(){function n(t,e,r){if(H(this,n),!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=r,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=ze.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,l=1,s=t.length;l<s;l++){if(typeof t[l][0]!="number"||typeof t[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var u=ze.round(t[l][0],t[l][1]);u.x===o.x&&u.y===o.y||(this.segments.push(Ve.fromRing(o,u,this)),u.x<this.bbox.ll.x&&(this.bbox.ll.x=u.x),u.y<this.bbox.ll.y&&(this.bbox.ll.y=u.y),u.x>this.bbox.ur.x&&(this.bbox.ur.x=u.x),u.y>this.bbox.ur.y&&(this.bbox.ur.y=u.y),o=u)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(Ve.fromRing(o,i,this))}return U(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.segments.length;r<i;r++){var o=this.segments[r];e.push(o.leftSE),e.push(o.rightSE)}return e}}]),n}(),Fr=function(){function n(t,e){if(H(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new At(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var r=1,i=t.length;r<i;r++){var o=new At(t[r],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}return U(n,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),r=0,i=this.interiorRings.length;r<i;r++)for(var o=this.interiorRings[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),Nt=function(){function n(t,e){if(H(this,n),!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var r=0,i=t.length;r<i;r++){var o=new Fr(t[r],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}return U(n,[{key:"getSweepEvents",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++)for(var o=this.polys[r].getSweepEvents(),l=0,s=o.length;l<s;l++)e.push(o[l]);return e}}]),n}(),Qr=function(){U(n,null,[{key:"factory",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!(!l.isInResult()||l.ringOut)){for(var s=null,u=l.leftSE,f=l.rightSE,a=[u],g=u.point,m=[];s=u,u=f,a.push(u),u.point!==g;)for(;;){var v=u.getAvailableLinkedEvents();if(v.length===0){var x=a[0].point,p=a[a.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(x.x,",")+" ".concat(x.y,"]. Last matching segment found ends at")+" [".concat(p.x,", ").concat(p.y,"]."))}if(v.length===1){f=v[0].otherSE;break}for(var h=null,d=0,w=m.length;d<w;d++)if(m[d].point===u.point){h=d;break}if(h!==null){var L=m.splice(h)[0],_=a.splice(L.index);_.unshift(_[0].otherSE),r.push(new n(_.reverse()));continue}m.push({index:a.length,point:u.point});var S=u.getLeftmostComparator(s);f=v.sort(S)[0].otherSE;break}r.push(new n(a))}}return r}}]);function n(t){H(this,n),this.events=t;for(var e=0,r=t.length;e<r;e++)t[e].segment.ringOut=this;this.poly=null}return U(n,[{key:"getGeom",value:function(){for(var e=this.events[0].point,r=[e],i=1,o=this.events.length-1;i<o;i++){var l=this.events[i].point,s=this.events[i+1].point;Tt(l,e,s)!==0&&(r.push(l),e=l)}if(r.length===1)return null;var u=r[0],f=r[1];Tt(u,e,f)===0&&r.shift(),r.push(r[0]);for(var a=this.isExteriorRing()?1:-1,g=this.isExteriorRing()?0:r.length-1,m=this.isExteriorRing()?r.length:-1,v=[],x=g;x!=m;x+=a)v.push([r[x].x,r[x].y]);return v}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],r=1,i=this.events.length;r<i;r++){var o=this.events[r];ee.compare(e,o)>0&&(e=o)}for(var l=e.segment.prevInResult(),s=l?l.prevInResult():null;;){if(!l)return null;if(!s)return l.ringOut;if(s.ringOut!==l.ringOut)return s.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=s.prevInResult(),s=l?l.prevInResult():null}}}]),n}(),Bt=function(){function n(t){H(this,n),this.exteriorRing=t,t.poly=this,this.interiorRings=[]}return U(n,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var r=0,i=this.interiorRings.length;r<i;r++){var o=this.interiorRings[r].getGeom();o!==null&&e.push(o)}return e}}]),n}(),Dr=function(){function n(t){H(this,n),this.rings=t,this.polys=this._composePolys(t)}return U(n,[{key:"getGeom",value:function(){for(var e=[],r=0,i=this.polys.length;r<i;r++){var o=this.polys[r].getGeom();o!==null&&e.push(o)}return e}},{key:"_composePolys",value:function(e){for(var r=[],i=0,o=e.length;i<o;i++){var l=e[i];if(!l.poly)if(l.isExteriorRing())r.push(new Bt(l));else{var s=l.enclosingRing();s.poly||r.push(new Bt(s)),s.poly.addInterior(l)}}return r}}]),n}(),Ur=function(){function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ve.compare;H(this,n),this.queue=t,this.tree=new $e(e),this.segments=[]}return U(n,[{key:"process",value:function(e){var r=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(r),i;var o=e.isLeft?this.tree.insert(r):this.tree.find(r);if(!o)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var l=o,s=o,u=void 0,f=void 0;u===void 0;)l=this.tree.prev(l),l===null?u=null:l.key.consumedBy===void 0&&(u=l.key);for(;f===void 0;)s=this.tree.next(s),s===null?f=null:s.key.consumedBy===void 0&&(f=s.key);if(e.isLeft){var a=null;if(u){var g=u.getIntersection(r);if(g!==null&&(r.isAnEndpoint(g)||(a=g),!u.isAnEndpoint(g)))for(var m=this._splitSafely(u,g),v=0,x=m.length;v<x;v++)i.push(m[v])}var p=null;if(f){var h=f.getIntersection(r);if(h!==null&&(r.isAnEndpoint(h)||(p=h),!f.isAnEndpoint(h)))for(var d=this._splitSafely(f,h),w=0,L=d.length;w<L;w++)i.push(d[w])}if(a!==null||p!==null){var _=null;if(a===null)_=p;else if(p===null)_=a;else{var S=ee.comparePoints(a,p);_=S<=0?a:p}this.queue.remove(r.rightSE),i.push(r.rightSE);for(var E=r.split(_),P=0,R=E.length;P<R;P++)i.push(E[P])}i.length>0?(this.tree.remove(r),i.push(e)):(this.segments.push(r),r.prev=u)}else{if(u&&f){var F=u.getIntersection(f);if(F!==null){if(!u.isAnEndpoint(F))for(var G=this._splitSafely(u,F),M=0,b=G.length;M<b;M++)i.push(G[M]);if(!f.isAnEndpoint(F))for(var O=this._splitSafely(f,F),D=0,fe=O.length;D<fe;D++)i.push(O[D])}}this.tree.remove(r)}return i}},{key:"_splitSafely",value:function(e,r){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var o=e.split(r);return o.push(i),e.consumedBy===void 0&&this.tree.insert(e),o}}]),n}(),Gt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Vr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Yr=function(){function n(){H(this,n)}return U(n,[{key:"run",value:function(e,r,i){K.type=e,ze.reset();for(var o=[new Nt(r,!0)],l=0,s=i.length;l<s;l++)o.push(new Nt(i[l],!1));if(K.numMultiPolys=o.length,K.type==="difference")for(var u=o[0],f=1;f<o.length;)nt(o[f].bbox,u.bbox)!==null?f++:o.splice(f,1);if(K.type==="intersection"){for(var a=0,g=o.length;a<g;a++)for(var m=o[a],v=a+1,x=o.length;v<x;v++)if(nt(m.bbox,o[v].bbox)===null)return[]}for(var p=new $e(ee.compare),h=0,d=o.length;h<d;h++)for(var w=o[h].getSweepEvents(),L=0,_=w.length;L<_;L++)if(p.insert(w[L]),p.size>Gt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var S=new Ur(p),E=p.size,P=p.pop();P;){var R=P.key;if(p.size===E){var F=R.segment;throw new Error("Unable to pop() ".concat(R.isLeft?"left":"right"," SweepEvent ")+"[".concat(R.point.x,", ").concat(R.point.y,"] from segment #").concat(F.id," ")+"[".concat(F.leftSE.point.x,", ").concat(F.leftSE.point.y,"] -> ")+"[".concat(F.rightSE.point.x,", ").concat(F.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>Gt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(S.segments.length>Vr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var G=S.process(R),M=0,b=G.length;M<b;M++){var O=G[M];O.consumedBy===void 0&&p.insert(O)}E=p.size,P=p.pop()}ze.reset();var D=Qr.factory(S.segments),fe=new Dr(D);return fe.getGeom()}}]),n}(),K=new Yr,Zr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return K.run("union",t,r)},Xr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return K.run("intersection",t,r)},Wr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return K.run("xor",t,r)},jr=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return K.run("difference",t,r)},Ne={union:Zr,intersection:Xr,xor:Wr,difference:jr};function qt(n,t){var e=Kr(t),r=null;return n.type==="FeatureCollection"?r=Hr(n):r=Ft(Ne.union(n.geometry.coordinates)),r.geometry.coordinates.forEach(function(i){e.geometry.coordinates.push(i[0])}),e}function Hr(n){var t=n.features.length===2?Ne.union(n.features[0].geometry.coordinates,n.features[1].geometry.coordinates):Ne.union.apply(Ne,n.features.map(function(e){return e.geometry.coordinates}));return Ft(t)}function Ft(n){return Rt(n)}function Kr(n){var t=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]],e=n&&n.geometry.coordinates||t;return Pt(e)}function Qt(n){return n.type==="Feature"?n.geometry:n}function Jr(n,t,e){e===void 0&&(e={});var r=Qt(n),i=Qt(t),o=Ne.union(r.coordinates,i.coordinates);return o.length===0?null:o.length===1?Pt(o[0],e.properties):Rt(o,e.properties)}let Dt={type:"FeatureCollection",features:[]};function Ut(n,t,e=!0,r=!0,i={},o={},l={fill:{layout:{},paint:{"fill-color":"#000","fill-opacity":.1}},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"}}}){let s,u,f,a=[],g;function m(){n.addSource("full-geom",{type:"geojson",data:Dt}),n.addLayer({...l.fill,id:"full-geom-fill",type:"fill",source:"full-geom",filter:["==",["geometry-type"],"Polygon"]}),n.addLayer({...l.line,id:"full-geom-line",type:"line",source:"full-geom"})}n.loaded()?m():n.once("load",()=>{m()});const v=h=>{u==null||u([h.lngLat.lng,h.lngLat.lat])},x=()=>{let h;const d=n.getZoom()>9?[(h=n.getCenter().wrap()).lng,h.lat]:void 0;f!==d&&(f=d,s==null||s(d))};return{setProximityChangeHandler(h){h?(s=h,n.on("moveend",x),x()):(n.off("moveend",x),s==null||s(void 0),s=void 0)},setMapClickHandler(h){u=h,u?n.on("click",v):n.off("click",v)},flyTo(h,d){n.flyTo({center:h,zoom:d,...i})},fitBounds(h,d){n.fitBounds([[h[0],h[1]],[h[2],h[3]]],{padding:d,...o})},indicateReverse(h){n.getCanvas().style.cursor=h?"crosshair":""},setMarkers(h,d){function w(_){var S;(S=n.getSource("full-geom"))==null||S.setData(_)}for(const _ of a)_.remove();if(a.length=0,w(Dt),!t)return;const L=()=>{const _=document.createElement("div");return new _t({props:{displayIn:"maplibre"},target:_}),new t.Marker({element:_})};if(d){let _=!1;if(d.geometry.type==="GeometryCollection"){const S=d.geometry.geometries.filter(E=>E.type==="Polygon"||E.type==="MultiPolygon");if(S.length>0){let E=S.pop();for(const P of S)E=Jr(E,P);w(qt({...d,geometry:E})),_=!0}else{const E=d.geometry.geometries.filter(P=>P.type==="LineString"||P.type==="MultiLineString");E.length>0&&(w({...d,geometry:{type:"GeometryCollection",geometries:E}}),_=!0)}}if(!_){if(d.geometry.type==="Polygon"||d.geometry.type==="MultiPolygon")w(qt(d));else if(d.geometry.type==="LineString"||d.geometry.type==="MultiLineString"){w(d);return}}a.push((typeof e=="object"?new t.Marker(e):L()).setLngLat(d.center).addTo(n))}for(const _ of h!=null?h:[])_!==d&&a.push((typeof r=="object"?new t.Marker(r):L()).setLngLat(_.center).addTo(n))},setSelectedMarker(h){g&&g.getElement().classList.toggle("marker-selected",!1),g=h>-1?a[h]:void 0,g==null||g.getElement().classList.toggle("marker-selected",!0)}}}class $r extends A.Evented{constructor(e){super();ft(this,J,void 0);ft(this,de,void 0);Ze(this,de,e)}onAdd(e){const r=document.createElement("div");r.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";const{maplibregl:i,marker:o,showResultMarkers:l,flyTo:s,fullGeometryStyle:u,...f}=re(this,de),a=typeof s=="boolean"?{}:s,g=Ut(e,i,o,l,a,a,u);Ze(this,J,new Rr({target:r,props:{mapController:g,flyTo:s===void 0?!0:!!s,...f}}));for(const m of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])re(this,J).$on(m,v=>this.fire(m.toLowerCase(),v.detail));return r}setOptions(e){var f;Ze(this,de,e);const{maplibregl:r,marker:i,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,...u}=re(this,de);(f=re(this,J))==null||f.$set(u)}setQuery(e,r=!0){var i;(i=re(this,J))==null||i.setQuery(e,r)}setReverseMode(e){var r;(r=re(this,J))==null||r.$set({reverseActive:e})}focus(){var e;(e=re(this,J))==null||e.focus()}blur(){var e;(e=re(this,J))==null||e.blur()}onRemove(){var e;(e=re(this,J))==null||e.$destroy()}}J=new WeakMap,de=new WeakMap,C.GeocodingControl=$r,C.createMaplibreglMapController=Ut,Object.defineProperties(C,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});