@maptiler/geocoding-control 3.0.0 → 3.1.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,35 @@
1
- import { css as F, LitElement as O, svg as W, html as m, unsafeCSS as ce, nothing as J } from "lit";
2
- import { customElement as S, property as d, state as b, query as Ze } from "lit/decorators.js";
3
- import { convert as Ne } from "geo-coordinates-parser";
4
- import { classMap as V } from "lit/directives/class-map.js";
5
- import { repeat as Qe } from "lit/directives/repeat.js";
1
+ import { css as S, LitElement as O, svg as q, html as m, unsafeCSS as ue, nothing as ie } from "lit";
2
+ import { customElement as M, property as p, state as x, queryAssignedElements as L } from "lit/decorators.js";
3
+ import { convert as et } from "geo-coordinates-parser";
4
+ import { classMap as Z } from "lit/directives/class-map.js";
5
+ import { repeat as tt } from "lit/directives/repeat.js";
6
6
  import "@turf/clone";
7
- import { styleMap as Ke } from "lit/directives/style-map.js";
7
+ import { styleMap as it } from "lit/directives/style-map.js";
8
8
  import { Feature as $ } from "ol";
9
- import { Control as Ye } from "ol/control";
10
- import He from "ol/events/Event";
11
- import { Point as H, Polygon as be, MultiPolygon as we, GeometryCollection as Je, LineString as ke, MultiLineString as _e } from "ol/geom";
12
- import Xe from "ol/layer/Vector";
13
- import { transformExtent as et, getUserProjection as tt, fromLonLat as it, toLonLat as st } from "ol/proj";
14
- import rt from "ol/source/Vector";
15
- import Le from "@turf/bbox";
16
- import ot from "@turf/difference";
17
- import at from "@turf/flatten";
18
- import { featureCollection as $e, polygon as nt } from "@turf/helpers";
19
- import lt from "@turf/union";
20
- import Ie from "ol/style/Fill";
21
- import ct from "ol/style/Icon";
22
- import Fe from "ol/style/Stroke";
23
- import ht from "ol/style/Style";
24
- import dt from "ol/style/Text";
25
- var pt = Object.getOwnPropertyDescriptor, ut = (t, e, i, o) => {
26
- for (var s = o > 1 ? void 0 : o ? pt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
27
- (a = t[r]) && (s = a(s) || s);
9
+ import { Control as st } from "ol/control";
10
+ import rt from "ol/events/Event";
11
+ import { Point as te, Polygon as Ie, MultiPolygon as $e, GeometryCollection as ot, LineString as Fe, MultiLineString as Ee } from "ol/geom";
12
+ import at from "ol/layer/Vector";
13
+ import { transformExtent as nt, getUserProjection as lt, fromLonLat as ct, toLonLat as ht } from "ol/proj";
14
+ import pt from "ol/source/Vector";
15
+ import Se from "@turf/bbox";
16
+ import dt from "@turf/difference";
17
+ import ut from "@turf/flatten";
18
+ import { featureCollection as Oe, polygon as ft } from "@turf/helpers";
19
+ import mt from "@turf/union";
20
+ import Me from "ol/style/Fill";
21
+ import gt from "ol/style/Icon";
22
+ import Te from "ol/style/Stroke";
23
+ import vt from "ol/style/Style";
24
+ import yt from "ol/style/Text";
25
+ var bt = Object.getOwnPropertyDescriptor, xt = (t, e, i, r) => {
26
+ for (var s = r > 1 ? void 0 : r ? bt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
27
+ (a = t[o]) && (s = a(s) || s);
28
28
  return s;
29
29
  };
30
- let X = class extends O {
30
+ let se = class extends O {
31
31
  render() {
32
- return W`
32
+ return q`
33
33
  <svg viewBox="0 0 14 14" width="13" height="13">
34
34
  <path
35
35
  d="M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"
@@ -38,23 +38,23 @@ let X = class extends O {
38
38
  `;
39
39
  }
40
40
  };
41
- X.styles = F`
41
+ se.styles = S`
42
42
  svg {
43
43
  display: block;
44
- fill: var(--color-icon-button);
44
+ fill: var(--color-icon-button, #444952);
45
45
  }
46
46
  `;
47
- X = ut([
48
- S("maptiler-geocode-clear-icon")
49
- ], X);
50
- var ft = Object.getOwnPropertyDescriptor, mt = (t, e, i, o) => {
51
- for (var s = o > 1 ? void 0 : o ? ft(e, i) : e, r = t.length - 1, a; r >= 0; r--)
52
- (a = t[r]) && (s = a(s) || s);
47
+ se = xt([
48
+ M("maptiler-geocode-clear-icon")
49
+ ], se);
50
+ var wt = Object.getOwnPropertyDescriptor, kt = (t, e, i, r) => {
51
+ for (var s = r > 1 ? void 0 : r ? wt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
52
+ (a = t[o]) && (s = a(s) || s);
53
53
  return s;
54
54
  };
55
- let ee = class extends O {
55
+ let re = class extends O {
56
56
  render() {
57
- return W`
57
+ return q`
58
58
  <svg viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
59
59
  <path
60
60
  d="M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"
@@ -63,21 +63,21 @@ let ee = class extends O {
63
63
  `;
64
64
  }
65
65
  };
66
- ee.styles = F`
66
+ re.styles = S`
67
67
  svg {
68
68
  display: block;
69
- fill: #e15042;
69
+ fill: var(--color-fail-icon, #e15042);
70
70
  }
71
71
  `;
72
- ee = mt([
73
- S("maptiler-geocode-fail-icon")
74
- ], ee);
75
- var gt = Object.getOwnPropertyDescriptor, yt = (t, e, i, o) => {
76
- for (var s = o > 1 ? void 0 : o ? gt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
77
- (a = t[r]) && (s = a(s) || s);
72
+ re = kt([
73
+ M("maptiler-geocode-fail-icon")
74
+ ], re);
75
+ var _t = Object.getOwnPropertyDescriptor, Lt = (t, e, i, r) => {
76
+ for (var s = r > 1 ? void 0 : r ? _t(e, i) : e, o = t.length - 1, a; o >= 0; o--)
77
+ (a = t[o]) && (s = a(s) || s);
78
78
  return s;
79
79
  };
80
- let te = class extends O {
80
+ let oe = class extends O {
81
81
  render() {
82
82
  return m`
83
83
  <div>
@@ -89,7 +89,7 @@ let te = class extends O {
89
89
  `;
90
90
  }
91
91
  };
92
- te.styles = F`
92
+ oe.styles = S`
93
93
  div {
94
94
  position: absolute;
95
95
  left: 50%;
@@ -116,17 +116,17 @@ te.styles = F`
116
116
  }
117
117
  }
118
118
  `;
119
- te = yt([
120
- S("maptiler-geocode-loading-icon")
121
- ], te);
122
- var vt = Object.getOwnPropertyDescriptor, xt = (t, e, i, o) => {
123
- for (var s = o > 1 ? void 0 : o ? vt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
124
- (a = t[r]) && (s = a(s) || s);
119
+ oe = Lt([
120
+ M("maptiler-geocode-loading-icon")
121
+ ], oe);
122
+ var It = Object.getOwnPropertyDescriptor, $t = (t, e, i, r) => {
123
+ for (var s = r > 1 ? void 0 : r ? It(e, i) : e, o = t.length - 1, a; o >= 0; o--)
124
+ (a = t[o]) && (s = a(s) || s);
125
125
  return s;
126
126
  };
127
- let ie = class extends O {
127
+ let ae = class extends O {
128
128
  render() {
129
- return W`
129
+ return q`
130
130
  <svg viewBox="0 0 60.006 21.412" width="14" height="20">
131
131
  <path
132
132
  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"
@@ -135,23 +135,23 @@ let ie = class extends O {
135
135
  `;
136
136
  }
137
137
  };
138
- ie.styles = F`
138
+ ae.styles = S`
139
139
  svg {
140
140
  display: block;
141
- fill: var(--color-icon-button);
141
+ fill: var(--color-icon-button, #444952);
142
142
  }
143
143
  `;
144
- ie = xt([
145
- S("maptiler-geocode-reverse-geocoding-icon")
146
- ], ie);
147
- var bt = Object.getOwnPropertyDescriptor, wt = (t, e, i, o) => {
148
- for (var s = o > 1 ? void 0 : o ? bt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
149
- (a = t[r]) && (s = a(s) || s);
144
+ ae = $t([
145
+ M("maptiler-geocode-reverse-geocoding-icon")
146
+ ], ae);
147
+ var Ft = Object.getOwnPropertyDescriptor, Et = (t, e, i, r) => {
148
+ for (var s = r > 1 ? void 0 : r ? Ft(e, i) : e, o = t.length - 1, a; o >= 0; o--)
149
+ (a = t[o]) && (s = a(s) || s);
150
150
  return s;
151
151
  };
152
- let se = class extends O {
152
+ let ne = class extends O {
153
153
  render() {
154
- return W`
154
+ return q`
155
155
  <svg
156
156
  xmlns="http://www.w3.org/2000/svg"
157
157
  width="13"
@@ -164,7 +164,7 @@ let se = class extends O {
164
164
  `;
165
165
  }
166
166
  };
167
- se.styles = F`
167
+ ne.styles = S`
168
168
  circle {
169
169
  stroke-width: 1.875;
170
170
  fill: none;
@@ -177,49 +177,49 @@ se.styles = F`
177
177
 
178
178
  svg {
179
179
  display: block;
180
- stroke: var(--color-icon-button);
180
+ stroke: var(--color-icon-button, #444952);
181
181
  }
182
182
  `;
183
- se = wt([
184
- S("maptiler-geocode-search-icon")
185
- ], se);
186
- function kt(t, e, i) {
187
- const o = e[1], s = e[0], r = o - s;
188
- return t === o && i ? t : ((t - s) % r + r) % r + s;
183
+ ne = Et([
184
+ M("maptiler-geocode-search-icon")
185
+ ], ne);
186
+ function St(t, e, i) {
187
+ const r = e[1], s = e[0], o = r - s;
188
+ return t === r && i ? t : ((t - s) % o + o) % o + s;
189
189
  }
190
- function D(t) {
190
+ function Q(t) {
191
191
  const e = [...t];
192
192
  return e[2] < e[0] && (Math.abs((e[0] + e[2] + 360) / 2) > Math.abs((e[0] - 360 + e[2]) / 2) ? e[0] -= 360 : e[2] += 360), e;
193
193
  }
194
- let B;
195
- async function _t(t, e, i) {
196
- for (const o of e ?? [])
197
- if (!(t && (o.minZoom != null && o.minZoom > t[0] || o.maxZoom != null && o.maxZoom < t[0]))) {
198
- if (o.type === "fixed")
199
- return o.coordinates.join(",");
200
- if (o.type === "client-geolocation")
201
- if (B && o.cachedLocationExpiry && B.time + o.cachedLocationExpiry > Date.now()) {
202
- if (B.coords)
203
- return B.coords;
194
+ let G;
195
+ async function Ot(t, e, i) {
196
+ for (const r of e ?? [])
197
+ if (!(t && (r.minZoom != null && r.minZoom > t[0] || r.maxZoom != null && r.maxZoom < t[0]))) {
198
+ if (r.type === "fixed")
199
+ return r.coordinates.join(",");
200
+ if (r.type === "client-geolocation")
201
+ if (G && r.cachedLocationExpiry && G.time + r.cachedLocationExpiry > Date.now()) {
202
+ if (G.coords)
203
+ return G.coords;
204
204
  } else {
205
205
  let s;
206
206
  try {
207
- return s = await new Promise((r, a) => {
207
+ return s = await new Promise((o, a) => {
208
208
  i.signal.addEventListener("abort", () => {
209
209
  a(Error("aborted"));
210
210
  }), navigator.geolocation.getCurrentPosition(
211
- (u) => {
212
- r([u.coords.longitude, u.coords.latitude].map((y) => y.toFixed(6)).join(","));
211
+ (f) => {
212
+ o([f.coords.longitude, f.coords.latitude].map((v) => v.toFixed(6)).join(","));
213
213
  },
214
- (u) => {
215
- a(u);
214
+ (f) => {
215
+ a(f);
216
216
  },
217
- o
217
+ r
218
218
  );
219
219
  }), s;
220
220
  } catch {
221
221
  } finally {
222
- o.cachedLocationExpiry && (B = {
222
+ r.cachedLocationExpiry && (G = {
223
223
  time: Date.now(),
224
224
  coords: s
225
225
  });
@@ -227,27 +227,27 @@ async function _t(t, e, i) {
227
227
  if (i.signal.aborted)
228
228
  return;
229
229
  }
230
- if (o.type === "server-geolocation")
230
+ if (r.type === "server-geolocation")
231
231
  return "ip";
232
- if (t && o.type === "map-center")
232
+ if (t && r.type === "map-center")
233
233
  return t[1].toFixed(6) + "," + t[2].toFixed(6);
234
234
  }
235
235
  }
236
- const Lt = ".sprite-icon{align-self:center;justify-self:center;opacity:.75;background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:#e7edff}li.picked .secondary{color:#96a4c7;padding-left:4px}li.picked .line2{color:#96a4c7}li.selected{background-color:#f3f6ff;animation:backAndForth 5s linear infinite}li.selected .primary{color:#2b8bfb}li.selected .secondary{color:#a2adc7;padding-left:4px}li.selected .line2{color:#a2adc7}li>img{align-self:center;justify-self:center;opacity:.75}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:#aeb6c7;padding-left:4px}.line2{color:#aeb6c7}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
237
- var $t = Object.defineProperty, It = Object.getOwnPropertyDescriptor, Oe = (t) => {
236
+ const Mt = ".sprite-icon{align-self:center;justify-self:center;opacity:var(--icon-items-opacity, .75);background-repeat:no-repeat}li{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-items, #444952);padding:8px 0;font-size:var(--font-size-items, 14px);line-height:1.3;min-width:fit-content;outline:0}li:first-child{padding-top:10px}li:last-child{padding-bottom:10px}li.picked{background-color:var(--color-items-picked-bg, #e7edff)}li.picked .secondary,li.picked .line2{color:var(--color-items-picked-secondary, #96a4c7)}li.selected{background-color:var(--color-items-selected-bg, #f3f6ff);animation:backAndForth 5s linear infinite}li.selected .primary{color:var(--color-items-selected, #2b8bfb)}li.selected .secondary,li.selected .line2{color:var(--color-items-selected-secondary, #a2adc7)}li>img{align-self:center;justify-self:center;opacity:var(--icon-opacity, .75)}.texts{padding:0 17px 0 0}.texts>*{white-space:nowrap;display:block;min-width:fit-content}.primary{font-weight:600}.secondary{color:var(--color-items-secondary, #aeb6c7);padding-left:4px}.line2{color:var(--color-items-secondary, #aeb6c7)}@keyframes backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}";
237
+ var Tt = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, Ce = (t) => {
238
238
  throw TypeError(t);
239
- }, L = (t, e, i, o) => {
240
- for (var s = o > 1 ? void 0 : o ? It(e, i) : e, r = t.length - 1, a; r >= 0; r--)
241
- (a = t[r]) && (s = (o ? a(e, i, s) : a(s)) || s);
242
- return o && s && $t(e, i, s), s;
243
- }, Se = (t, e, i) => e.has(t) || Oe("Cannot " + i), f = (t, e, i) => (Se(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Ft = (t, e, i) => e.has(t) ? Oe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), E = (t, e, i) => (Se(t, e, "access private method"), i), p, q, z, g, Me, Te, he, re;
244
- const Ce = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Pe = Ce ? "@2x" : "", P = Ce ? 2 : 1;
245
- let C, Ee, k = class extends O {
239
+ }, I = (t, e, i, r) => {
240
+ for (var s = r > 1 ? void 0 : r ? Ct(e, i) : e, o = t.length - 1, a; o >= 0; o--)
241
+ (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
242
+ return r && s && Tt(e, i, s), s;
243
+ }, Pe = (t, e, i) => e.has(t) || Ce("Cannot " + i), u = (t, e, i) => (Pe(t, e, "read from private field"), i ? i.call(t) : e.get(t)), Pt = (t, e, i) => e.has(t) ? Ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), z = (t, e, i) => (Pe(t, e, "access private method"), i), d, A, j, g, Be, ze, fe, le;
244
+ const Ue = typeof devicePixelRatio > "u" || devicePixelRatio > 1.25, Ge = Ue ? "@2x" : "", B = Ue ? 2 : 1;
245
+ let P, Re, w = class extends O {
246
246
  constructor() {
247
- super(...arguments), Ft(this, p), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
247
+ super(...arguments), Pt(this, d), this.itemStyle = "default", this.showPlaceType = "if-needed", this.missingIconsCache = /* @__PURE__ */ new Set(), this.iconsBaseUrl = "", this.index = 0;
248
248
  }
249
249
  willUpdate(t) {
250
- t.has("feature") && f(this, p, q) && (this.index = f(this, p, q).length, E(this, p, he).call(this));
250
+ t.has("feature") && u(this, d, A) && (this.index = u(this, d, A).length, z(this, d, fe).call(this));
251
251
  }
252
252
  render() {
253
253
  return m`
@@ -259,112 +259,124 @@ let C, Ee, k = class extends O {
259
259
  class=${this.itemStyle}
260
260
  @click=${() => this.dispatchEvent(new CustomEvent("select"))}
261
261
  >
262
- ${C && this.spriteIcon ? m`
262
+ ${P && this.spriteIcon ? m`
263
263
  <div
264
264
  class="sprite-icon"
265
- style=${Ke({
266
- width: `${this.spriteIcon.width / P}px`,
267
- height: `${this.spriteIcon.height / P}px`,
268
- backgroundImage: `url(${this.iconsBaseUrl}sprite${Pe}.png)`,
269
- backgroundPosition: `-${this.spriteIcon.x / P}px -${this.spriteIcon.y / P}px`,
270
- backgroundSize: `${C.width / P}px ${C.height / P}px`
265
+ style=${it({
266
+ width: `${this.spriteIcon.width / B}px`,
267
+ height: `${this.spriteIcon.height / B}px`,
268
+ backgroundImage: `url(${this.iconsBaseUrl}sprite${Ge}.png)`,
269
+ backgroundPosition: `-${this.spriteIcon.x / B}px -${this.spriteIcon.y / B}px`,
270
+ backgroundSize: `${P.width / B}px ${P.height / B}px`
271
271
  })}
272
- title=${f(this, p, g)}
272
+ title=${u(this, d, g)}
273
273
  />
274
- ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${f(this, p, g)} @error=${E(this, p, Te)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : f(this, p, z) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${f(this, p, g)} title=${f(this, p, g)} /> `}
274
+ ` : this.imageUrl ? m` <img src=${this.imageUrl} alt=${this.category} title=${u(this, d, g)} @error=${z(this, d, ze)} />` : this.feature?.address ? m` <img src=${this.iconsBaseUrl + "housenumber.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("road.") ? m` <img src=${this.iconsBaseUrl + "road.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("address.") ? m` <img src=${this.iconsBaseUrl + "street.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("postal_code.") ? m` <img src=${this.iconsBaseUrl + "postal_code.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : this.feature?.id.startsWith("poi.") ? m` <img src=${this.iconsBaseUrl + "poi.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : u(this, d, j) ? m` <img src=${this.iconsBaseUrl + "reverse.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> ` : m` <img src=${this.iconsBaseUrl + "area.svg"} alt=${u(this, d, g)} title=${u(this, d, g)} /> `}
275
275
 
276
276
  <span class="texts">
277
277
  <span>
278
- <span class="primary"> ${f(this, p, z) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
278
+ <span class="primary"> ${u(this, d, j) ? this.feature?.place_name : this.feature?.place_name.replace(/,.*/, "")} </span>
279
279
 
280
- ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !f(this, p, z) ? m` <span class="secondary"> ${f(this, p, g)} </span> ` : J}
280
+ ${this.showPlaceType === "always" || this.showPlaceType !== "never" && !this.feature?.address && !this.feature?.id.startsWith("road.") && !this.feature?.id.startsWith("address.") && !this.feature?.id.startsWith("postal_code.") && (!this.feature?.id.startsWith("poi.") || !this.imageUrl) && !u(this, d, j) ? m` <span class="secondary"> ${u(this, d, g)} </span> ` : ie}
281
281
  </span>
282
282
 
283
- <span class="line2"> ${f(this, p, z) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
283
+ <span class="line2"> ${u(this, d, j) ? this.feature?.text : this.feature?.place_name.replace(/[^,]*,?s*/, "")} </span>
284
284
  </span>
285
285
  </li>
286
286
  `;
287
287
  }
288
288
  };
289
- p = /* @__PURE__ */ new WeakSet();
290
- q = function() {
289
+ d = /* @__PURE__ */ new WeakSet();
290
+ A = function() {
291
291
  return this.feature?.properties?.categories;
292
292
  };
293
- z = function() {
293
+ j = function() {
294
294
  return this.feature?.place_type[0] === "reverse";
295
295
  };
296
296
  g = function() {
297
- return this.feature?.properties?.categories?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
297
+ return u(this, d, A)?.join(", ") ?? this.feature?.place_type_name?.[0] ?? this.feature?.place_type[0];
298
298
  };
299
- Me = function() {
300
- Ee ??= fetch(`${this.iconsBaseUrl}sprite${Pe}.json`).then((t) => t.json()).then((t) => {
301
- C = t;
299
+ Be = function() {
300
+ Re ??= fetch(`${this.iconsBaseUrl}sprite${Ge}.json`).then((t) => t.json()).then((t) => {
301
+ P = t;
302
302
  }).catch(() => {
303
- C = null;
303
+ P = null;
304
304
  });
305
305
  };
306
- Te = function() {
307
- this.imageUrl && this.missingIconsCache.add(this.imageUrl), E(this, p, he).call(this);
306
+ ze = function() {
307
+ this.imageUrl && this.missingIconsCache.add(this.imageUrl), z(this, d, fe).call(this);
308
308
  };
309
- he = function() {
310
- C !== void 0 ? E(this, p, re).call(this) : (E(this, p, Me).call(this), Ee?.then(() => {
311
- E(this, p, re).call(this);
309
+ fe = function() {
310
+ P !== void 0 ? z(this, d, le).call(this) : (z(this, d, Be).call(this), Re?.then(() => {
311
+ z(this, d, le).call(this);
312
312
  }));
313
313
  };
314
- re = function() {
314
+ le = function() {
315
315
  do {
316
- if (this.index--, this.category = f(this, p, q)?.[this.index], this.spriteIcon = this.category ? C?.icons[this.category] : void 0, this.spriteIcon)
316
+ if (this.index--, this.category = u(this, d, A)?.[this.index], this.spriteIcon = this.category ? P?.icons[this.category] : void 0, this.spriteIcon)
317
317
  break;
318
318
  this.imageUrl = this.category ? this.iconsBaseUrl + this.category.replace(/ /g, "_") + ".svg" : void 0;
319
319
  } while (this.index > -1 && (!this.imageUrl || this.missingIconsCache.has(this.imageUrl)));
320
320
  };
321
- k.styles = F`
322
- ${ce(Lt)}
321
+ w.styles = S`
322
+ ${ue(Mt)}
323
323
  `;
324
- L([
325
- d({ type: Object })
326
- ], k.prototype, "feature", 2);
327
- L([
328
- d({ type: String })
329
- ], k.prototype, "itemStyle", 2);
330
- L([
331
- d({ type: String })
332
- ], k.prototype, "showPlaceType", 2);
333
- L([
334
- d({ attribute: !1 })
335
- ], k.prototype, "missingIconsCache", 2);
336
- L([
337
- d({ type: String })
338
- ], k.prototype, "iconsBaseUrl", 2);
339
- L([
340
- b()
341
- ], k.prototype, "category", 2);
342
- L([
343
- b()
344
- ], k.prototype, "imageUrl", 2);
345
- L([
346
- b()
347
- ], k.prototype, "spriteIcon", 2);
348
- L([
349
- b()
350
- ], k.prototype, "index", 2);
351
- k = L([
352
- S("maptiler-geocoder-feature-item")
353
- ], k);
354
- const Ot = "form{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text: #444952;--color-icon-button: #444952;pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:29px}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form{width:270px;max-width:270px}form:focus-within,form:hover{width:270px;max-width:270px}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul,div.error,div.no-results{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error,div.no-results{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: #e25041}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: #2b8bfb}.input-group{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group:focus-within{outline:#2b8bfb solid 2px}.search-button{flex-shrink:0}.clear-button-container{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:white solid 2px}:host(.maptiler-geocoder) .input-group:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}:host(.maptiler-geocoder) form.can-collapse{max-width:33px}:host(.maptiler-geocoder) form,:host(.maptiler-geocoder) form:focus-within,:host(.maptiler-geocoder) form:hover{width:270px;max-width:270px}:host(.leaflet-geocoder) .input-group{border:white solid 1px}:host(.leaflet-geocoder) form.can-collapse{max-width:30px}";
355
- var St = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, Ue = (t) => {
324
+ I([
325
+ p({ type: Object })
326
+ ], w.prototype, "feature", 2);
327
+ I([
328
+ p({ type: String })
329
+ ], w.prototype, "itemStyle", 2);
330
+ I([
331
+ p({ type: String })
332
+ ], w.prototype, "showPlaceType", 2);
333
+ I([
334
+ p({ attribute: !1 })
335
+ ], w.prototype, "missingIconsCache", 2);
336
+ I([
337
+ p({ type: String })
338
+ ], w.prototype, "iconsBaseUrl", 2);
339
+ I([
340
+ x()
341
+ ], w.prototype, "category", 2);
342
+ I([
343
+ x()
344
+ ], w.prototype, "imageUrl", 2);
345
+ I([
346
+ x()
347
+ ], w.prototype, "spriteIcon", 2);
348
+ I([
349
+ x()
350
+ ], w.prototype, "index", 2);
351
+ w = I([
352
+ M("maptiler-geocoder-feature-item")
353
+ ], w);
354
+ const Bt = 'form{font-family:var(--font-family, "Open Sans", "Ubuntu", "Helvetica Neue", Arial, Helvetica, sans-serif);position:relative;background-color:var(--color-bg, #fff);z-index:10;border-radius:var(--radius, 4px);margin:0;transition:max-width .25s;box-shadow:var(--shadow, 0px 2px 5px rgba(51, 51, 89, .15));pointer-events:all}form,form *,form *:after,form *:before{box-sizing:border-box}form.can-collapse{max-width:var(--size-collapse-width, 29px)}form.can-collapse input::placeholder{transition:opacity .25s;opacity:0}form,form.can-collapse:focus-within,form.can-collapse:hover{width:var(--size-width, 270px);max-width:var(--size-width, 270px)}form input::placeholder,form:focus-within input::placeholder,form:hover input::placeholder{opacity:1}input{font:inherit;font-size:var(--font-size-input, 14px);flex-grow:1;min-height:var(--size-input-min-height, 29px);background-color:transparent;color:var(--color-input, #444952);white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input:focus{color:var(--color-input-focus, #444952);outline:0;box-shadow:none}ul,div.error,div.no-results{background-color:var(--color-bg-dropdown, #fff);border-radius:var(--radius-dropdown, 4px);left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul{font-size:var(--font-size-items, 14px);line-height:16px;box-shadow:var(--shadow-dropdown, 0px 5px 10px rgba(51, 51, 89, .15))}div.error,div.no-results{font:inherit;line-height:18px;font-size:var(--font-size-error, 12px);display:flex;gap:16px}div.error{padding:16px;font-weight:600;color:var(--color-error-text, #e25041);background-color:var(--color-error-bg, #fbeae8)}div.error div{flex-grow:1}div.error maptiler-geocode-fail-icon{flex-shrink:0;width:20px;height:20px}div.error button{flex-shrink:0}div.error button maptiler-geocode-clear-icon{--color-icon-button: var(--color-error-icon, #e25041)}div.error button:hover maptiler-geocode-clear-icon,div.error button:active maptiler-geocode-clear-icon{--color-icon-button: inherit}div.no-results{padding:14px 24px 14px 16px;font-weight:400;color:var(--color-no-results-text, #6b7c93);box-shadow:var(--shadow-dropdown, 0px 5px 10px rgba(51, 51, 89, .15))}div.no-results maptiler-geocode-fail-icon{margin-top:4px;flex-shrink:0;width:20px;height:20px}ul.options.open-on-top{top:auto;bottom:calc(100% + 6px)}button{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button:hover{background-color:transparent}button:hover,button:active{--color-icon-button: var(--color-icon-button-hover, #2b8bfb)}.input-group{display:flex;align-items:stretch;gap:var(--input-group-gap, 7px);padding:var(--input-group-padding, 0 8px);border-radius:var(--radius-input-group, 4px);overflow:hidden}.input-group:focus-within{outline:var(--color-focus-outline, #2b8bfb) solid var(--size-focus-outline, 2px)}.search-button{flex-shrink:0}.clear-button-container{display:none;position:relative;align-items:stretch}.clear-button-container.displayable{display:flex;flex-shrink:0}:host(.maptiler-geocoder):not(:empty){box-shadow:none}:host(.maptiler-geocoder) .input-group{border:var(--color-input-group-border, white solid 2px)}:host(.maptiler-geocoder) .input-group:focus-within{border:var(--color-input-group-border-focused, #2b8bfb solid 2px);outline:0}:host(.maptiler-geocoder) form.can-collapse{max-width:var(--size-collapse-width, 33px)}:host(.maptiler-geocoder) form,:host(.leaflet-geocoder) form,:host(.maptiler-geocoder) form.can-collapse:focus-within,:host(.leaflet-geocoder) form.can-collapse:focus-within,:host(.maptiler-geocoder) form.can-collapse:hover,:host(.leaflet-geocoder) form.can-collapse:hover{width:var(--size-width, 270px);max-width:var(--size-width, 270px)}:host(.leaflet-geocoder) .input-group{border:var(--color-input-group-border, white solid 1px)}:host(.leaflet-geocoder) form.can-collapse{max-width:var(--size-collapse-width, 30px)}';
355
+ var zt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, je = (t) => {
356
356
  throw TypeError(t);
357
- }, c = (t, e, i, o) => {
358
- for (var s = o > 1 ? void 0 : o ? Mt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
359
- (a = t[r]) && (s = (o ? a(e, i, s) : a(s)) || s);
360
- return o && s && St(e, i, s), s;
361
- }, de = (t, e, i) => e.has(t) || Ue("Cannot " + i), w = (t, e, i) => (de(t, e, "read from private field"), i ? i.call(t) : e.get(t)), G = (t, e, i) => e.has(t) ? Ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), oe = (t, e, i, o) => (de(t, e, "write to private field"), e.set(t, i), i), h = (t, e, i) => (de(t, e, "access private method"), i), Z, j, ae, R, n, N, Be, pe, x, ue, Q, fe, me, I, ge, K, Ge, ne, ze, je, Re, We, Ae, Ve, De;
357
+ }, h = (t, e, i, r) => {
358
+ for (var s = r > 1 ? void 0 : r ? Ut(e, i) : e, o = t.length - 1, a; o >= 0; o--)
359
+ (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
360
+ return r && s && zt(e, i, s), s;
361
+ }, me = (t, e, i) => e.has(t) || je("Cannot " + i), k = (t, e, i) => (me(t, e, "read from private field"), i ? i.call(t) : e.get(t)), R = (t, e, i) => e.has(t) ? je("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), ce = (t, e, i, r) => (me(t, e, "write to private field"), e.set(t, i), i), c = (t, e, i) => (me(t, e, "access private method"), i), H, V, he, D, n, K, ge, b, ve, Y, ye, be, F, xe, J, We, Ae, pe, Ve, De, qe, Ne, Ze, Qe, He, Ke, Ye, Je, E, W;
362
+ const we = "input:not([type]), input[type=text], input[type=search], select, textarea", X = "button, input[type=button]";
362
363
  let l = class extends O {
363
364
  constructor() {
364
- super(...arguments), G(this, n), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.isFeatureListVisible = !1, this.isFeatureListInteractedWith = !1, G(this, Z, !1), G(this, j), G(this, ae, /* @__PURE__ */ new Set()), G(this, R);
365
+ super(...arguments), R(this, n), this.clearListOnPick = !1, this.clearOnBlur = !1, this.collapsed = !1, this.excludeTypes = !1, this.exhaustiveReverseGeocoding = !1, this.fetchFullGeometryOnPick = !1, this.keepListOpen = !1, this.openListOnTop = !1, this.reverseActive = !1, this.searchValue = "", this.selectedItemIndex = -1, this.cachedFeatures = [], this.lastSearchUrl = "", this.focused = !1, this.isFeatureListVisible = !1, this.isFeatureListInteractedWith = !1, R(this, H, !1), R(this, V), R(this, he, /* @__PURE__ */ new Set()), R(this, D);
366
+ }
367
+ get isLoading() {
368
+ return this.abortController !== void 0;
369
+ }
370
+ get input() {
371
+ for (const t of this.contentSlotElements) {
372
+ if (c(this, n, E).call(this, t)) return t;
373
+ const e = t.querySelector(we);
374
+ if (c(this, n, E).call(this, e)) return e;
375
+ }
376
+ return this.inputSlotElements[0];
365
377
  }
366
378
  firstUpdated() {
367
- oe(this, Z, !0);
379
+ ce(this, H, !0), this.input && (this.input.value = this.searchValue);
368
380
  }
369
381
  /**
370
382
  * Set the options of this instance.
@@ -374,7 +386,7 @@ let l = class extends O {
374
386
  setOptions(t) {
375
387
  const e = { ...t };
376
388
  for (const i of Object.keys(e))
377
- Tt.includes(i) || delete e[i];
389
+ Gt.includes(i) || delete e[i];
378
390
  Object.assign(this, e);
379
391
  }
380
392
  /**
@@ -383,7 +395,7 @@ let l = class extends O {
383
395
  * @param value text to set
384
396
  */
385
397
  setQuery(t) {
386
- h(this, n, me).call(this, t, { external: !0 }), h(this, n, fe).call(this);
398
+ c(this, n, be).call(this, t, { external: !0 }), c(this, n, ye).call(this);
387
399
  }
388
400
  /**
389
401
  * Set the content of search input box and immediately submit it.
@@ -391,13 +403,13 @@ let l = class extends O {
391
403
  * @param value text to set and submit
392
404
  */
393
405
  submitQuery(t) {
394
- h(this, n, ge).call(this, t, { external: !0 });
406
+ c(this, n, xe).call(this, t, { external: !0 });
395
407
  }
396
408
  /**
397
409
  * Clear search result list.
398
410
  */
399
411
  clearList() {
400
- h(this, n, I).call(this), this.picked = void 0, this.selectedItemIndex = -1;
412
+ c(this, n, F).call(this), this.picked = void 0, this.selectedItemIndex = -1;
401
413
  }
402
414
  /**
403
415
  * Focus the search input box.
@@ -405,13 +417,13 @@ let l = class extends O {
405
417
  * @param options [FocusOptions](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#options)
406
418
  */
407
419
  focus(t) {
408
- this.input.focus(t);
420
+ this.input?.focus(t);
409
421
  }
410
422
  /**
411
423
  * Blur the search input box.
412
424
  */
413
425
  blur() {
414
- this.input.blur();
426
+ this.input?.blur();
415
427
  }
416
428
  addEventListener(t, e, i) {
417
429
  super.addEventListener(t, e, i);
@@ -421,83 +433,101 @@ let l = class extends O {
421
433
  }
422
434
  /** @internal */
423
435
  handleMapChange(t) {
424
- oe(this, R, t);
436
+ ce(this, D, t);
425
437
  }
426
438
  /** @internal */
427
439
  handleMapClick(t) {
428
- this.reverseActive && h(this, n, Ge).call(this, t);
440
+ this.reverseActive && c(this, n, We).call(this, t);
429
441
  }
430
442
  willUpdate(t) {
431
- t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && h(this, n, I).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && w(this, n, pe) && (h(this, n, I).call(this), this.error = void 0), ["focused", "listIsInteractedWith"].some((e) => t.has(e)) && this.clearOnBlur && !this.focused && !this.isFeatureListInteractedWith && (this.searchValue = ""), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && h(this, n, x).call(this, "select", { feature: w(this, n, N) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? h(this, n, K).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
443
+ t.has("error") && this.error && console.error("[MapTilerGeocodingControl] Error:", this.error), t.has("enableReverse") && (this.reverseActive = this.enableReverse === "always"), ["picked"].some((e) => t.has(e)) && this.picked && (this.clearListOnPick && c(this, n, F).call(this), this.selectedItemIndex = -1), ["searchValue", "minLength"].some((e) => t.has(e)) && k(this, n, ge) && (c(this, n, F).call(this), this.error = void 0), ["focused", "listIsInteractedWith"].some((e) => t.has(e)) && this.clearOnBlur && !this.focused && !this.isFeatureListInteractedWith && (this.searchValue = ""), ["selectFirst", "listFeatures", "selectedItemIndex", "picked"].some((e) => t.has(e)) && this.selectFirst !== !1 && this.listFeatures?.length && this.selectedItemIndex == -1 && !this.picked && (this.selectedItemIndex = 0), ["listFeatures", "selectedItemIndex"].some((e) => t.has(e)) && c(this, n, b).call(this, "select", { feature: k(this, n, K) }), ["picked"].some((e) => t.has(e)) && this.picked && this.picked.id !== t.get("picked")?.id && (this.fetchFullGeometryOnPick && !this.picked.address && this.picked.geometry.type === "Point" && this.picked.place_type[0] !== "reverse" ? c(this, n, J).call(this, this.picked.id, { byId: !0 }) : Promise.resolve()).then(
432
444
  () => {
433
- h(this, n, x).call(this, "pick", { feature: this.picked });
445
+ c(this, n, b).call(this, "pick", { feature: this.picked });
434
446
  },
435
447
  (e) => {
436
- e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, h(this, n, x).call(this, "pick", { feature: this.picked }));
448
+ e && typeof e == "object" && "name" in e && e.name === "AbortError" || (this.error = e, c(this, n, b).call(this, "pick", { feature: this.picked }));
437
449
  }
438
- ), ["listFeatures", "focused", "isFeatureListInteractedWith", "keepListOpen"].some((e) => t.has(e)) && (this.isFeatureListVisible = !!this.listFeatures?.length && (this.focused || this.isFeatureListInteractedWith || this.keepListOpen)), ["isFeatureListVisible"].some((e) => t.has(e)) && (this.isFeatureListVisible ? h(this, n, x).call(this, "featuresshow") : h(this, n, x).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && h(this, n, x).call(this, "reversetoggle", { reverse: this.reverseActive });
450
+ ), ["listFeatures", "focused", "isFeatureListInteractedWith", "keepListOpen"].some((e) => t.has(e)) && (this.isFeatureListVisible = !!this.listFeatures?.length && (this.focused || this.isFeatureListInteractedWith || this.keepListOpen)), ["isFeatureListVisible"].some((e) => t.has(e)) && (this.isFeatureListVisible ? c(this, n, b).call(this, "featuresshow") : c(this, n, b).call(this, "featureshide")), ["reverseActive"].some((e) => t.has(e)) && c(this, n, b).call(this, "reversetoggle", { reverse: this.reverseActive }), ["searchValue"].some((e) => t.has(e)) && this.input && (this.input.value = this.searchValue);
439
451
  }
440
452
  render() {
441
453
  return m`
442
- <form @submit=${h(this, n, ue)} class=${V({ "can-collapse": this.collapsed && this.searchValue === "" })}>
443
- <div class="input-group">
444
- <button
445
- class="search-button"
446
- type="button"
447
- @click=${() => {
448
- this.input.focus();
449
- }}
450
- >
451
- <maptiler-geocode-search-icon></maptiler-geocode-search-icon>
452
- </button>
454
+ <form
455
+ class=${Z({ "can-collapse": this.collapsed && this.searchValue === "" })}
456
+ @submit=${c(this, n, ve)}
457
+ @focusin=${c(this, n, qe)}
458
+ @focusout=${c(this, n, Ne)}
459
+ @click=${c(this, n, Ae)}
460
+ @keydown=${c(this, n, pe)}
461
+ @input=${c(this, n, Ve)}
462
+ @change=${c(this, n, De)}
463
+ >
464
+ <slot name="content">
465
+ <div class="input-group">
466
+ <slot name="start"></slot>
453
467
 
454
- <input
455
- .value=${this.searchValue}
456
- @focus=${() => this.focused = !0}
457
- @blur=${() => this.focused = !1}
458
- @click=${() => this.focused = !0}
459
- @keydown=${h(this, n, ne)}
460
- @input=${h(this, n, ze)}
461
- @change=${() => this.picked = void 0}
462
- placeholder=${this.placeholder ?? "Search"}
463
- aria-label=${this.placeholder ?? "Search"}
464
- />
468
+ <slot name="search-button">
469
+ <button class="search-button" type="button">
470
+ <slot name="search-icon">
471
+ <maptiler-geocode-search-icon></maptiler-geocode-search-icon>
472
+ </slot>
473
+ </button>
474
+ </slot>
465
475
 
466
- <div class="clear-button-container ${V({ displayable: this.searchValue !== "" })}">
467
- ${w(this, n, Be) ? m`<maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>` : m`
468
- <button type="button" @click=${h(this, n, De)} title=${this.clearButtonTitle ?? "clear"}>
469
- <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
470
- </button>
471
- `}
472
- </div>
476
+ <slot name="input">
477
+ <input placeholder=${this.placeholder ?? "Search"} aria-label=${this.placeholder ?? "Search"} />
478
+ </slot>
473
479
 
474
- ${this.enableReverse === "button" ? m`
475
- <button
476
- type="button"
477
- class=${V({ active: this.reverseActive })}
478
- title=${this.reverseButtonTitle ?? "toggle reverse geocoding"}
479
- @click=${() => this.reverseActive = !this.reverseActive}
480
- >
481
- <maptiler-geocode-reverse-geocoding-icon></maptiler-geocode-reverse-geocoding-icon>
482
- </button>
483
- ` : J}
480
+ <div class="clear-button-container ${Z({ displayable: this.searchValue !== "" })}">
481
+ ${this.isLoading ? m`
482
+ <slot name="loading-icon">
483
+ <maptiler-geocode-loading-icon></maptiler-geocode-loading-icon>
484
+ </slot>
485
+ ` : m`
486
+ <slot name="clear-button">
487
+ <button type="button" title=${this.clearButtonTitle ?? "clear"}>
488
+ <slot name="clear-icon">
489
+ <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
490
+ </slot>
491
+ </button>
492
+ </slot>
493
+ `}
494
+ </div>
484
495
 
485
- <!-- <slot /> -->
486
- </div>
496
+ ${this.enableReverse === "button" ? m`
497
+ <slot name="reverse-button">
498
+ <button type="button" class=${Z({ active: this.reverseActive })} title=${this.reverseButtonTitle ?? "toggle reverse geocoding"}>
499
+ <slot name="reverse-icon">
500
+ <maptiler-geocode-reverse-geocoding-icon></maptiler-geocode-reverse-geocoding-icon>
501
+ </slot>
502
+ </button>
503
+ </slot>
504
+ ` : ie}
505
+
506
+ <slot name="end"></slot>
507
+ </div>
508
+ </slot>
487
509
 
488
510
  ${this.error ? m`
489
511
  <div class="error">
490
- <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
512
+ <slot name="error-icon">
513
+ <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
514
+ </slot>
491
515
 
492
516
  <div>${this.errorMessage ?? "Something went wrong…"}</div>
493
517
 
494
- <button @click=${() => this.error = void 0}>
495
- <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
496
- </button>
518
+ <slot name="clear-error-button">
519
+ <button>
520
+ <slot name="clear-error-icon">
521
+ <maptiler-geocode-clear-icon></maptiler-geocode-clear-icon>
522
+ </slot>
523
+ </button>
524
+ </slot>
497
525
  </div>
498
- ` : !this.focused && !this.isFeatureListInteractedWith && !this.keepListOpen || this.listFeatures === void 0 ? J : this.listFeatures.length === 0 ? m`
526
+ ` : !this.focused && !this.isFeatureListInteractedWith && !this.keepListOpen || this.listFeatures === void 0 ? ie : this.listFeatures.length === 0 ? m`
499
527
  <div class="no-results">
500
- <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
528
+ <slot name="no-results-icon">
529
+ <maptiler-geocode-fail-icon></maptiler-geocode-fail-icon>
530
+ </slot>
501
531
 
502
532
  <div>
503
533
  ${this.noResultsMessage ?? "Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}
@@ -505,14 +535,14 @@ let l = class extends O {
505
535
  </div>
506
536
  ` : m`
507
537
  <ul
508
- class="options ${V({ "open-on-top": this.openListOnTop })}"
509
- @pointerleave=${h(this, n, We)}
510
- @pointerdown=${h(this, n, Ae)}
511
- @pointerup=${h(this, n, Ve)}
512
- @keydown=${h(this, n, ne)}
538
+ class="options ${Z({ "open-on-top": this.openListOnTop })}"
539
+ @pointerleave=${c(this, n, He)}
540
+ @pointerdown=${c(this, n, Ke)}
541
+ @pointerup=${c(this, n, Ye)}
542
+ @keydown=${c(this, n, pe)}
513
543
  role="listbox"
514
544
  >
515
- ${Qe(
545
+ ${tt(
516
546
  this.listFeatures,
517
547
  (t) => t.id + (t.address ? "," + t.address : ""),
518
548
  (t, e) => m`
@@ -521,13 +551,13 @@ let l = class extends O {
521
551
  .showPlaceType=${this.showPlaceType ?? "if-needed"}
522
552
  itemStyle=${this.selectedItemIndex === e ? "selected" : this.picked?.id === t.id ? "picked" : "default"}
523
553
  @pointerenter=${() => {
524
- h(this, n, Re).call(this, e);
554
+ c(this, n, Qe).call(this, e);
525
555
  }}
526
556
  @select=${() => {
527
- h(this, n, je).call(this, t);
557
+ c(this, n, Ze).call(this, t);
528
558
  }}
529
- .missingIconsCache=${w(this, ae)}
530
- .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0/icons/"}
559
+ .missingIconsCache=${k(this, he)}
560
+ .iconsBaseUrl=${this.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.1.0-rc.1/icons/"}
531
561
  />
532
562
  `
533
563
  )}
@@ -537,22 +567,19 @@ let l = class extends O {
537
567
  `;
538
568
  }
539
569
  };
540
- Z = /* @__PURE__ */ new WeakMap();
541
- j = /* @__PURE__ */ new WeakMap();
542
- ae = /* @__PURE__ */ new WeakMap();
543
- R = /* @__PURE__ */ new WeakMap();
570
+ H = /* @__PURE__ */ new WeakMap();
571
+ V = /* @__PURE__ */ new WeakMap();
572
+ he = /* @__PURE__ */ new WeakMap();
573
+ D = /* @__PURE__ */ new WeakMap();
544
574
  n = /* @__PURE__ */ new WeakSet();
545
- N = function() {
575
+ K = function() {
546
576
  return this.listFeatures?.[this.selectedItemIndex];
547
577
  };
548
- Be = function() {
549
- return this.abortController !== void 0;
550
- };
551
- pe = function() {
578
+ ge = function() {
552
579
  return this.searchValue.length < (this.minLength ?? 2);
553
580
  };
554
- x = function(t, ...[e]) {
555
- w(this, Z) && this.dispatchEvent(
581
+ b = function(t, ...[e]) {
582
+ k(this, H) && this.dispatchEvent(
556
583
  new CustomEvent(t, {
557
584
  bubbles: !0,
558
585
  composed: !0,
@@ -560,78 +587,78 @@ x = function(t, ...[e]) {
560
587
  })
561
588
  );
562
589
  };
563
- ue = function(t, { external: e = !1 } = {}) {
564
- t?.preventDefault(), this.focused = !1, clearTimeout(w(this, j)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && h(this, n, K).call(this, this.searchValue, { exact: !0, external: e }).then(() => {
590
+ ve = function(t, { external: e = !1 } = {}) {
591
+ t?.preventDefault(), this.focused = !1, clearTimeout(k(this, V)), this.selectedItemIndex > -1 && this.listFeatures ? (this.picked = this.listFeatures[this.selectedItemIndex], this.searchValue = this.picked.place_type[0] === "reverse" ? this.picked.place_name : this.picked.place_name.replace(/,.*/, ""), this.error = void 0, this.selectedItemIndex = -1) : this.searchValue && c(this, n, J).call(this, this.searchValue, { exact: !0, external: e }).then(() => {
565
592
  this.picked = void 0;
566
593
  }).catch((i) => this.error = i);
567
594
  };
568
- Q = function(t) {
595
+ Y = function(t) {
569
596
  try {
570
- return Ne(t, 6);
597
+ return et(t, 6);
571
598
  } catch {
572
599
  return !1;
573
600
  }
574
601
  };
575
- fe = function() {
602
+ ye = function() {
576
603
  setTimeout(() => {
577
- this.input.focus(), this.focused = !0, this.input.select();
604
+ this.input?.focus(), this.focused = !0, this.input instanceof HTMLSelectElement ? this.input.showPicker() : this.input?.select();
578
605
  });
579
606
  };
580
- me = function(t, { external: e = !1 } = {}) {
581
- if (this.searchValue = t, h(this, n, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, n, Q).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
582
- if (clearTimeout(w(this, j)), w(this, n, pe))
607
+ be = function(t, { external: e = !1 } = {}) {
608
+ if (this.searchValue = t, c(this, n, b).call(this, "querychange", { query: this.searchValue, reverseCoords: c(this, n, Y).call(this, t) }), this.error = void 0, this.picked = void 0, this.showResultsWhileTyping !== !1) {
609
+ if (clearTimeout(k(this, V)), k(this, n, ge))
583
610
  return;
584
611
  const i = this.searchValue;
585
- oe(this, j, window.setTimeout(() => {
586
- h(this, n, K).call(this, i, { external: e }).catch((o) => this.error = o);
612
+ ce(this, V, window.setTimeout(() => {
613
+ c(this, n, J).call(this, i, { external: e }).catch((r) => this.error = r);
587
614
  }, this.debounceSearch ?? 200));
588
615
  } else
589
- h(this, n, I).call(this);
616
+ c(this, n, F).call(this);
590
617
  };
591
- I = function() {
592
- this.listFeatures !== void 0 && (this.listFeatures = void 0, h(this, n, x).call(this, "featuresclear"));
618
+ F = function() {
619
+ this.listFeatures !== void 0 && (this.listFeatures = void 0, c(this, n, b).call(this, "featuresclear"));
593
620
  };
594
- ge = function(t, { external: e = !1 } = {}) {
595
- this.searchValue = t, h(this, n, x).call(this, "querychange", { query: this.searchValue, reverseCoords: h(this, n, Q).call(this, t) }), this.selectedItemIndex = -1, h(this, n, ue).call(this, void 0, { external: e });
621
+ xe = function(t, { external: e = !1 } = {}) {
622
+ this.searchValue = t, c(this, n, b).call(this, "querychange", { query: this.searchValue, reverseCoords: c(this, n, Y).call(this, t) }), this.selectedItemIndex = -1, c(this, n, ve).call(this, void 0, { external: e });
596
623
  };
597
- K = async function(t, { byId: e = !1, exact: i = !1, external: o = !1 } = {}) {
624
+ J = async function(t, { byId: e = !1, exact: i = !1, external: r = !1 } = {}) {
598
625
  this.error = void 0, this.abortController?.abort();
599
626
  const s = new AbortController();
600
627
  this.abortController = s;
601
628
  try {
602
- const r = this.apiUrl ?? "https://api.maptiler.com/geocoding", a = h(this, n, Q).call(this, t), u = new URL(r + "/" + encodeURIComponent(a ? `${a.decimalLongitude},${a.decimalLatitude}` : t) + ".json"), y = u.searchParams;
603
- this.language !== void 0 && y.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
604
- const [M] = w(this, R) ?? [void 0];
629
+ const o = this.apiUrl ?? "https://api.maptiler.com/geocoding", a = c(this, n, Y).call(this, t), f = new URL(o + "/" + encodeURIComponent(a ? `${a.decimalLongitude},${a.decimalLatitude}` : t) + ".json"), v = f.searchParams;
630
+ this.language !== void 0 && v.set("language", Array.isArray(this.language) ? this.language.join(",") : this.language ?? "");
631
+ const [T] = k(this, D) ?? [void 0];
605
632
  let _ = (!a || this.reverseGeocodingTypes === void 0 ? this.types : this.reverseGeocodingTypes)?.map(
606
- (v) => typeof v == "string" ? v : M === void 0 || (v[0] ?? 0) <= M && M < (v[1] ?? 1 / 0) ? v[2] : void 0
607
- ).filter((v) => v !== void 0);
608
- _ && (_ = [...new Set(_)], y.set("types", _.join(",")));
609
- const ye = !a || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
610
- if (ye && y.set("excludeTypes", String(ye)), this.bbox && y.set("bbox", this.bbox.map((v) => v.toFixed(6)).join(",")), this.country && y.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && y.set("worldview", this.worldview), !e && !a) {
611
- const v = this.proximity ?? [{ type: "server-geolocation" }], xe = await _t(w(this, R), v, s);
612
- xe && y.set("proximity", xe), (i || this.showResultsWhileTyping === !1) && y.set("autocomplete", "false"), y.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
633
+ (y) => typeof y == "string" ? y : T === void 0 || (y[0] ?? 0) <= T && T < (y[1] ?? 1 / 0) ? y[2] : void 0
634
+ ).filter((y) => y !== void 0);
635
+ _ && (_ = [...new Set(_)], v.set("types", _.join(",")));
636
+ const ke = !a || this.reverseGeocodingExcludeTypes === void 0 ? this.excludeTypes : this.reverseGeocodingExcludeTypes;
637
+ if (ke && v.set("excludeTypes", String(ke)), this.bbox && v.set("bbox", this.bbox.map((y) => y.toFixed(6)).join(",")), this.country && v.set("country", Array.isArray(this.country) ? this.country.join(",") : this.country), this.worldview && v.set("worldview", this.worldview), !e && !a) {
638
+ const y = this.proximity ?? [{ type: "server-geolocation" }], Le = await Ot(k(this, D), y, s);
639
+ Le && v.set("proximity", Le), (i || this.showResultsWhileTyping === !1) && v.set("autocomplete", "false"), v.set("fuzzyMatch", String(this.fuzzyMatch !== !1));
613
640
  }
614
- const ve = this.limit ?? 5, Y = this.reverseGeocodingLimit ?? ve;
615
- Y > 1 && _?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), a ? (Y === 1 || this.exhaustiveReverseGeocoding || _?.length === 1) && y.set("limit", String(Y)) : y.set("limit", String(ve)), this.apiKey && y.set("key", this.apiKey), this.adjustUrl?.(u);
616
- const qe = u.searchParams.get("types") === "" && u.searchParams.get("excludeTypes") !== "true", A = u.toString();
617
- if (A === this.lastSearchUrl) {
618
- e ? (this.clearListOnPick && h(this, n, I).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, h(this, n, x).call(this, "featureslisted", { features: this.listFeatures, external: o }), this.listFeatures[this.selectedItemIndex]?.id !== w(this, n, N)?.id && (this.selectedItemIndex = -1));
641
+ const _e = this.limit ?? 5, ee = this.reverseGeocodingLimit ?? _e;
642
+ ee > 1 && _?.length !== 1 && console.warn("[MapTilerGeocodingControl] Warning: For reverse geocoding when limit > 1 then types must contain single value."), a ? (ee === 1 || this.exhaustiveReverseGeocoding || _?.length === 1) && v.set("limit", String(ee)) : v.set("limit", String(_e)), this.apiKey && v.set("key", this.apiKey), this.adjustUrl?.(f);
643
+ const Xe = f.searchParams.get("types") === "" && f.searchParams.get("excludeTypes") !== "true", N = f.toString();
644
+ if (N === this.lastSearchUrl) {
645
+ e ? (this.clearListOnPick && c(this, n, F).call(this), this.picked = this.cachedFeatures[0]) : (this.listFeatures = this.cachedFeatures, c(this, n, b).call(this, "featureslisted", { features: this.listFeatures, external: r }), this.listFeatures[this.selectedItemIndex]?.id !== k(this, n, K)?.id && (this.selectedItemIndex = -1));
619
646
  return;
620
647
  }
621
- h(this, n, x).call(this, "request", { urlObj: u }), this.lastSearchUrl = A;
648
+ c(this, n, b).call(this, "request", { urlObj: f }), this.lastSearchUrl = N;
622
649
  let U;
623
- if (qe)
650
+ if (Xe)
624
651
  U = { type: "FeatureCollection", features: [] };
625
652
  else {
626
- const v = await fetch(A, {
653
+ const y = await fetch(N, {
627
654
  signal: s.signal,
628
655
  ...this.fetchParameters
629
656
  });
630
- if (!v.ok)
631
- throw new Error(await v.text());
632
- U = await v.json();
657
+ if (!y.ok)
658
+ throw new Error(await y.text());
659
+ U = await y.json();
633
660
  }
634
- h(this, n, x).call(this, "response", { url: A, featureCollection: U }), e ? (this.clearListOnPick && h(this, n, I).call(this), this.picked = U.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = U.features.filter(this.filter ?? (() => !0)), a && this.listFeatures.unshift({
661
+ c(this, n, b).call(this, "response", { url: N, featureCollection: U }), e ? (this.clearListOnPick && c(this, n, F).call(this), this.picked = U.features[0], this.cachedFeatures = [this.picked]) : (this.listFeatures = U.features.filter(this.filter ?? (() => !0)), a && this.listFeatures.unshift({
635
662
  type: "Feature",
636
663
  properties: {},
637
664
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
@@ -647,201 +674,246 @@ K = async function(t, { byId: e = !1, exact: i = !1, external: o = !1 } = {}) {
647
674
  type: "Point",
648
675
  coordinates: [a.decimalLongitude, a.decimalLatitude]
649
676
  }
650
- }), h(this, n, x).call(this, "featureslisted", { features: this.listFeatures, external: o }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== w(this, n, N)?.id && (this.selectedItemIndex = -1), a && this.input.focus());
651
- } catch (r) {
652
- if (r && typeof r == "object" && "name" in r && r.name === "AbortError")
677
+ }), c(this, n, b).call(this, "featureslisted", { features: this.listFeatures, external: r }), this.cachedFeatures = this.listFeatures, this.listFeatures[this.selectedItemIndex]?.id !== k(this, n, K)?.id && (this.selectedItemIndex = -1), a && this.input?.focus());
678
+ } catch (o) {
679
+ if (o && typeof o == "object" && "name" in o && o.name === "AbortError")
653
680
  return;
654
- throw r;
681
+ throw o;
655
682
  } finally {
656
683
  s === this.abortController && (this.abortController = void 0);
657
684
  }
658
685
  };
659
- Ge = function(t) {
660
- this.reverseActive = this.enableReverse === "always", h(this, n, I).call(this), this.picked = void 0, h(this, n, ge).call(this, `${t[1].toFixed(6)}, ${kt(t[0], [-180, 180], !0).toFixed(6)}`), h(this, n, fe).call(this);
686
+ We = function(t) {
687
+ this.reverseActive = this.enableReverse === "always", c(this, n, F).call(this), this.picked = void 0, c(this, n, xe).call(this, `${t[1].toFixed(6)}, ${St(t[0], [-180, 180], !0).toFixed(6)}`), c(this, n, ye).call(this);
661
688
  };
662
- ne = function(t) {
689
+ Ae = function(t) {
690
+ c(this, n, E).call(this, t.target) ? this.focused = !0 : c(this, n, W).call(this, t.target, this.searchButtonElements, this.searchIconElements, "search-button") ? this.input?.focus() : c(this, n, W).call(this, t.target, this.clearButtonElements, this.clearIconElements, "clear-button") ? c(this, n, Je).call(this) : c(this, n, W).call(this, t.target, this.reverseButtonElements, this.reverseIconElements, "reverse-button") ? this.reverseActive = !this.reverseActive : c(this, n, W).call(this, t.target, this.clearErrorButtonElements, this.clearErrorIconElements, "clear-error-button") && (this.error = void 0);
691
+ };
692
+ pe = function(t) {
663
693
  if (!this.listFeatures)
664
694
  return;
665
695
  const e = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
666
- e && (this.input.focus(), this.focused = !0, t.preventDefault(), this.picked && this.selectedItemIndex === -1 && (this.selectedItemIndex = this.listFeatures.findIndex((i) => i.id === this.picked?.id)), this.selectedItemIndex === (this.picked || this.selectFirst !== !1 ? 0 : -1) && e === -1 && (this.selectedItemIndex = this.listFeatures.length), this.selectedItemIndex += e, this.selectedItemIndex >= this.listFeatures.length && (this.selectedItemIndex = -1), this.selectedItemIndex < 0 && (this.picked || this.selectFirst !== !1) && (this.selectedItemIndex = 0));
696
+ e && (this.input?.focus(), this.focused = !0, t.preventDefault(), this.picked && this.selectedItemIndex === -1 && (this.selectedItemIndex = this.listFeatures.findIndex((i) => i.id === this.picked?.id)), this.selectedItemIndex === (this.picked || this.selectFirst !== !1 ? 0 : -1) && e === -1 && (this.selectedItemIndex = this.listFeatures.length), this.selectedItemIndex += e, this.selectedItemIndex >= this.listFeatures.length && (this.selectedItemIndex = -1), this.selectedItemIndex < 0 && (this.picked || this.selectFirst !== !1) && (this.selectedItemIndex = 0));
697
+ };
698
+ Ve = function(t) {
699
+ c(this, n, E).call(this, t.target) && c(this, n, be).call(this, t.target.value);
667
700
  };
668
- ze = function(t) {
669
- h(this, n, me).call(this, t.target.value);
701
+ De = function(t) {
702
+ c(this, n, E).call(this, t.target) && (this.picked = void 0);
670
703
  };
671
- je = function(t) {
704
+ qe = function(t) {
705
+ c(this, n, E).call(this, t.target) && (this.focused = !0);
706
+ };
707
+ Ne = function(t) {
708
+ c(this, n, E).call(this, t.target) && (this.focused = !1);
709
+ };
710
+ Ze = function(t) {
672
711
  (!this.picked || this.picked.id !== t.id) && (this.picked = t, this.searchValue = t.place_name);
673
712
  };
674
- Re = function(t) {
713
+ Qe = function(t) {
675
714
  this.selectedItemIndex = t;
676
715
  };
677
- We = function() {
716
+ He = function() {
678
717
  (!this.selectFirst || this.picked) && (this.selectedItemIndex = -1), this.isFeatureListInteractedWith && (this.isFeatureListInteractedWith = !1);
679
718
  };
680
- Ae = function() {
719
+ Ke = function() {
681
720
  this.isFeatureListInteractedWith = !0;
682
721
  };
683
- Ve = function() {
722
+ Ye = function() {
684
723
  setTimeout(() => {
685
724
  this.isFeatureListInteractedWith = !1;
686
725
  });
687
726
  };
688
- De = function() {
689
- this.searchValue = "", h(this, n, x).call(this, "queryclear"), this.picked = void 0, this.input.focus();
727
+ Je = function() {
728
+ this.searchValue = "", c(this, n, b).call(this, "queryclear"), this.picked = void 0, this.input?.focus();
729
+ };
730
+ E = function(t) {
731
+ return t instanceof HTMLElement && t.matches(we);
732
+ };
733
+ W = function(t, e, i, r) {
734
+ return t instanceof HTMLElement && ([...e, ...i].some((s) => s.contains(t)) || t.closest(`[data-${r}]`) !== null);
690
735
  };
691
- l.styles = F`
692
- ${ce(Ot)}
736
+ l.styles = S`
737
+ ${ue(Bt)}
693
738
  `;
694
- c([
695
- d({ attribute: !1 })
739
+ h([
740
+ p({ attribute: !1 })
696
741
  ], l.prototype, "adjustUrl", 2);
697
- c([
698
- d({ type: String })
742
+ h([
743
+ p({ type: String })
699
744
  ], l.prototype, "apiKey", 2);
700
- c([
701
- d({ type: String })
745
+ h([
746
+ p({ type: String })
702
747
  ], l.prototype, "apiUrl", 2);
703
- c([
704
- d({ type: Array })
748
+ h([
749
+ p({ type: Array })
705
750
  ], l.prototype, "bbox", 2);
706
- c([
707
- d({ type: String })
751
+ h([
752
+ p({ type: String })
708
753
  ], l.prototype, "clearButtonTitle", 2);
709
- c([
710
- d({ type: Boolean })
754
+ h([
755
+ p({ type: Boolean })
711
756
  ], l.prototype, "clearListOnPick", 2);
712
- c([
713
- d({ type: Boolean })
757
+ h([
758
+ p({ type: Boolean })
714
759
  ], l.prototype, "clearOnBlur", 2);
715
- c([
716
- d({ type: Boolean })
760
+ h([
761
+ p({ type: Boolean })
717
762
  ], l.prototype, "collapsed", 2);
718
- c([
719
- d({ attribute: !1 })
763
+ h([
764
+ p({ attribute: !1 })
720
765
  ], l.prototype, "country", 2);
721
- c([
722
- d({ type: Number })
766
+ h([
767
+ p({ type: Number })
723
768
  ], l.prototype, "debounceSearch", 2);
724
- c([
725
- d({ type: String })
769
+ h([
770
+ p({ type: String })
726
771
  ], l.prototype, "enableReverse", 2);
727
- c([
728
- d({ type: String })
772
+ h([
773
+ p({ type: String })
729
774
  ], l.prototype, "errorMessage", 2);
730
- c([
731
- d({ type: Boolean })
775
+ h([
776
+ p({ type: Boolean })
732
777
  ], l.prototype, "excludeTypes", 2);
733
- c([
734
- d({ type: Boolean })
778
+ h([
779
+ p({ type: Boolean })
735
780
  ], l.prototype, "exhaustiveReverseGeocoding", 2);
736
- c([
737
- d({ type: Boolean })
781
+ h([
782
+ p({ type: Boolean })
738
783
  ], l.prototype, "fetchFullGeometryOnPick", 2);
739
- c([
740
- d({ type: Object })
784
+ h([
785
+ p({ type: Object })
741
786
  ], l.prototype, "fetchParameters", 2);
742
- c([
743
- d({ attribute: !1 })
787
+ h([
788
+ p({ attribute: !1 })
744
789
  ], l.prototype, "filter", 2);
745
- c([
746
- d({ type: Object })
790
+ h([
791
+ p({ type: Object })
747
792
  ], l.prototype, "fuzzyMatch", 2);
748
- c([
749
- d({ type: String })
793
+ h([
794
+ p({ type: String })
750
795
  ], l.prototype, "iconsBaseUrl", 2);
751
- c([
752
- d({ type: Boolean })
796
+ h([
797
+ p({ type: Boolean })
753
798
  ], l.prototype, "keepListOpen", 2);
754
- c([
755
- d({ attribute: !1 })
799
+ h([
800
+ p({ attribute: !1 })
756
801
  ], l.prototype, "language", 2);
757
- c([
758
- d({ type: Number })
802
+ h([
803
+ p({ type: Number })
759
804
  ], l.prototype, "limit", 2);
760
- c([
761
- d({ type: Number })
805
+ h([
806
+ p({ type: Number })
762
807
  ], l.prototype, "minLength", 2);
763
- c([
764
- d({ type: String })
808
+ h([
809
+ p({ type: String })
765
810
  ], l.prototype, "noResultsMessage", 2);
766
- c([
767
- d({ type: Boolean })
811
+ h([
812
+ p({ type: Boolean })
768
813
  ], l.prototype, "openListOnTop", 2);
769
- c([
770
- d({ type: String })
814
+ h([
815
+ p({ type: String })
771
816
  ], l.prototype, "placeholder", 2);
772
- c([
773
- d({ type: Array })
817
+ h([
818
+ p({ type: Array })
774
819
  ], l.prototype, "proximity", 2);
775
- c([
776
- d({ type: Boolean })
820
+ h([
821
+ p({ type: Boolean })
777
822
  ], l.prototype, "reverseActive", 2);
778
- c([
779
- d({ type: String })
823
+ h([
824
+ p({ type: String })
780
825
  ], l.prototype, "reverseButtonTitle", 2);
781
- c([
782
- d({ type: Object })
826
+ h([
827
+ p({ type: Object })
783
828
  ], l.prototype, "reverseGeocodingExcludeTypes", 2);
784
- c([
785
- d({ type: Number })
829
+ h([
830
+ p({ type: Number })
786
831
  ], l.prototype, "reverseGeocodingLimit", 2);
787
- c([
788
- d({ type: Array })
832
+ h([
833
+ p({ type: Array })
789
834
  ], l.prototype, "reverseGeocodingTypes", 2);
790
- c([
791
- d({ type: Object })
835
+ h([
836
+ p({ type: Object })
792
837
  ], l.prototype, "selectFirst", 2);
793
- c([
794
- d({ type: String })
838
+ h([
839
+ p({ type: String })
795
840
  ], l.prototype, "showPlaceType", 2);
796
- c([
797
- d({ type: Object })
841
+ h([
842
+ p({ type: Object })
798
843
  ], l.prototype, "showResultsWhileTyping", 2);
799
- c([
800
- d({ type: Array })
844
+ h([
845
+ p({ type: Array })
801
846
  ], l.prototype, "types", 2);
802
- c([
803
- d({ type: String })
847
+ h([
848
+ p({ type: String })
804
849
  ], l.prototype, "worldview", 2);
805
- c([
806
- Ze("input")
807
- ], l.prototype, "input", 2);
808
- c([
809
- b()
850
+ h([
851
+ L({ slot: "content", flatten: !1 })
852
+ ], l.prototype, "contentSlotElements", 2);
853
+ h([
854
+ L({ slot: "input", flatten: !0, selector: we })
855
+ ], l.prototype, "inputSlotElements", 2);
856
+ h([
857
+ L({ slot: "search-button", flatten: !0, selector: X })
858
+ ], l.prototype, "searchButtonElements", 2);
859
+ h([
860
+ L({ slot: "clear-button", flatten: !0, selector: X })
861
+ ], l.prototype, "clearButtonElements", 2);
862
+ h([
863
+ L({ slot: "reverse-button", flatten: !0, selector: X })
864
+ ], l.prototype, "reverseButtonElements", 2);
865
+ h([
866
+ L({ slot: "clear-error-button", flatten: !0, selector: X })
867
+ ], l.prototype, "clearErrorButtonElements", 2);
868
+ h([
869
+ L({ slot: "search-icon", flatten: !0 })
870
+ ], l.prototype, "searchIconElements", 2);
871
+ h([
872
+ L({ slot: "clear-icon", flatten: !0 })
873
+ ], l.prototype, "clearIconElements", 2);
874
+ h([
875
+ L({ slot: "reverse-icon", flatten: !0 })
876
+ ], l.prototype, "reverseIconElements", 2);
877
+ h([
878
+ L({ slot: "clear-error-icon", flatten: !0 })
879
+ ], l.prototype, "clearErrorIconElements", 2);
880
+ h([
881
+ x()
810
882
  ], l.prototype, "searchValue", 2);
811
- c([
812
- b()
883
+ h([
884
+ x()
813
885
  ], l.prototype, "listFeatures", 2);
814
- c([
815
- b()
886
+ h([
887
+ x()
816
888
  ], l.prototype, "selectedItemIndex", 2);
817
- c([
818
- b()
889
+ h([
890
+ x()
819
891
  ], l.prototype, "picked", 2);
820
- c([
821
- b()
892
+ h([
893
+ x()
822
894
  ], l.prototype, "cachedFeatures", 2);
823
- c([
824
- b()
895
+ h([
896
+ x()
825
897
  ], l.prototype, "lastSearchUrl", 2);
826
- c([
827
- b()
898
+ h([
899
+ x()
828
900
  ], l.prototype, "error", 2);
829
- c([
830
- b()
901
+ h([
902
+ x()
831
903
  ], l.prototype, "abortController", 2);
832
- c([
833
- b()
904
+ h([
905
+ x()
834
906
  ], l.prototype, "focused", 2);
835
- c([
836
- b()
907
+ h([
908
+ x()
837
909
  ], l.prototype, "isFeatureListVisible", 2);
838
- c([
839
- b()
910
+ h([
911
+ x()
840
912
  ], l.prototype, "isFeatureListInteractedWith", 2);
841
- l = c([
842
- S("maptiler-geocoder")
913
+ l = h([
914
+ M("maptiler-geocoder")
843
915
  ], l);
844
- const Tt = [
916
+ const Gt = [
845
917
  "adjustUrl",
846
918
  "apiKey",
847
919
  "apiUrl",
@@ -879,15 +951,15 @@ const Tt = [
879
951
  "types",
880
952
  "reverseGeocodingTypes",
881
953
  "worldview"
882
- ], Ct = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
883
- var Pt = Object.getOwnPropertyDescriptor, Et = (t, e, i, o) => {
884
- for (var s = o > 1 ? void 0 : o ? Pt(e, i) : e, r = t.length - 1, a; r >= 0; r--)
885
- (a = t[r]) && (s = a(s) || s);
954
+ ], Rt = "svg{display:block;fill:var(--maptiler-geocode-marker-fill, #3170fe);stroke:var(--maptiler-geocode-marker-stroke, #3170fe);height:30px}:host(.marker-selected){z-index:2}:host(.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fill, #98b7ff);stroke:var(--maptiler-geocode-marker-selected-stroke, #3170fe)}:host(.marker-reverse) svg path{fill:var(--maptiler-geocode-marker-reverse-fill, silver);stroke:var(--maptiler-geocode-marker-reverse-stroke, gray)}:host(.marker-interactive){cursor:pointer!important}:host(.marker-fuzzy) svg path{fill:var(--maptiler-geocode-marker-fuzzy-fill, silver);stroke:var(--maptiler-geocode-marker-fuzzy-stroke, gray)}:host(.marker-fuzzy.marker-selected) svg path{fill:var(--maptiler-geocode-marker-selected-fuzzy-fill, #ddd);stroke:var(--maptiler-geocode-marker-selected-fuzzy-stroke, silver)}";
955
+ var jt = Object.getOwnPropertyDescriptor, Wt = (t, e, i, r) => {
956
+ for (var s = r > 1 ? void 0 : r ? jt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
957
+ (a = t[o]) && (s = a(s) || s);
886
958
  return s;
887
959
  };
888
- let le = class extends O {
960
+ let de = class extends O {
889
961
  render() {
890
- return W`
962
+ return q`
891
963
  <svg
892
964
  viewBox="0 0 70 85"
893
965
  fill="none"
@@ -901,16 +973,16 @@ let le = class extends O {
901
973
  `;
902
974
  }
903
975
  };
904
- le.styles = F`
905
- ${ce(Ct)}
976
+ de.styles = S`
977
+ ${ue(Rt)}
906
978
  `;
907
- le = Et([
908
- S("maptiler-geocode-marker")
909
- ], le);
910
- function Ut(t) {
911
- const e = ot(
912
- $e([
913
- nt([
979
+ de = Wt([
980
+ M("maptiler-geocode-marker")
981
+ ], de);
982
+ function At(t) {
983
+ const e = dt(
984
+ Oe([
985
+ ft([
914
986
  [
915
987
  [180, 90],
916
988
  [-180, 90],
@@ -925,22 +997,22 @@ function Ut(t) {
925
997
  if (!e)
926
998
  return;
927
999
  e.properties = { isMask: !0 };
928
- const i = D(Le(t)), o = (i[2] - i[0]) / 360 / 1e3, s = i[0] < -180, r = i[2] > 180, a = at(t);
929
- if (a.features.length > 1 && (s || r))
930
- for (const u of a.features) {
931
- const y = D(Le(u));
932
- if (r && y[0] < -180 + o)
933
- for (const M of u.geometry.coordinates)
934
- for (const _ of M)
935
- _[0] += 360 - o;
936
- if (s && y[2] > 180 - o)
937
- for (const M of u.geometry.coordinates)
938
- for (const _ of M)
939
- _[0] -= 360 - o;
1000
+ const i = Q(Se(t)), r = (i[2] - i[0]) / 360 / 1e3, s = i[0] < -180, o = i[2] > 180, a = ut(t);
1001
+ if (a.features.length > 1 && (s || o))
1002
+ for (const f of a.features) {
1003
+ const v = Q(Se(f));
1004
+ if (o && v[0] < -180 + r)
1005
+ for (const T of f.geometry.coordinates)
1006
+ for (const _ of T)
1007
+ _[0] += 360 - r;
1008
+ if (s && v[2] > 180 - r)
1009
+ for (const T of f.geometry.coordinates)
1010
+ for (const _ of T)
1011
+ _[0] -= 360 - r;
940
1012
  }
941
- return $e([a.features.length < 2 ? t : lt(a) ?? t, e]);
1013
+ return Oe([a.features.length < 2 ? t : mt(a) ?? t, e]);
942
1014
  }
943
- const Bt = {
1015
+ const Vt = {
944
1016
  continental_marine: 4,
945
1017
  country: 4,
946
1018
  major_landform: 8,
@@ -964,28 +1036,28 @@ const Bt = {
964
1036
  "poi.restaurant": 18,
965
1037
  "poi.aerodrome": 13
966
1038
  // TODO add many more
967
- }, Gt = (t) => (e) => {
968
- const i = t.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.0.0/icons/", o = e.getProperties(), s = e.getGeometry()?.getType(), r = o.isMask ? 0 : s === "LineString" || s === "MultiLineString" ? 3 : 2;
969
- return new ht({
970
- stroke: o.isMask ? void 0 : new Fe({
1039
+ }, Dt = (t) => (e) => {
1040
+ const i = t.iconsBaseUrl ?? "https://cdn.maptiler.com/maptiler-geocoding-control/v3.1.0-rc.1/icons/", r = e.getProperties(), s = e.getGeometry()?.getType(), o = r.isMask ? 0 : s === "LineString" || s === "MultiLineString" ? 3 : 2;
1041
+ return new vt({
1042
+ stroke: r.isMask ? void 0 : new Te({
971
1043
  color: "#3170fe",
972
- lineDash: [r, r],
973
- width: r,
1044
+ lineDash: [o, o],
1045
+ width: o,
974
1046
  lineCap: "butt"
975
1047
  }),
976
- fill: o.isMask ? new Ie({
1048
+ fill: r.isMask ? new Me({
977
1049
  color: "#00000020"
978
1050
  }) : void 0,
979
- image: new ct({
980
- src: `${i}marker_${o.isReverse ? "reverse" : o.isSelected ? "selected" : "unselected"}.svg`,
1051
+ image: new gt({
1052
+ src: `${i}marker_${r.isReverse ? "reverse" : r.isSelected ? "selected" : "unselected"}.svg`,
981
1053
  anchor: [0.5, 1]
982
1054
  }),
983
- zIndex: o.isSelected ? 2 : o.isReverse ? 0 : 1,
984
- text: (o.isSelected || o.isMouseOver) && o.tooltip ? new dt({
985
- backgroundFill: new Ie({ color: "white" }),
986
- text: o.tooltip,
1055
+ zIndex: r.isSelected ? 2 : r.isReverse ? 0 : 1,
1056
+ text: (r.isSelected || r.isMouseOver) && r.tooltip ? new yt({
1057
+ backgroundFill: new Me({ color: "white" }),
1058
+ text: r.tooltip,
987
1059
  offsetY: -40,
988
- backgroundStroke: new Fe({
1060
+ backgroundStroke: new Te({
989
1061
  color: "white",
990
1062
  lineJoin: "round",
991
1063
  width: 3
@@ -993,8 +1065,8 @@ const Bt = {
993
1065
  padding: [2, 0, 0, 2]
994
1066
  }) : void 0
995
1067
  });
996
- }, T = "EPSG:4326";
997
- class li extends Ye {
1068
+ }, C = "EPSG:4326";
1069
+ class mi extends st {
998
1070
  #e;
999
1071
  #t;
1000
1072
  #r;
@@ -1003,17 +1075,17 @@ class li extends Ye {
1003
1075
  super({
1004
1076
  element: i,
1005
1077
  ...e
1006
- }), this.#e = e, this.#r = document.createElement("maptiler-geocoder"), this.#r.classList.add("openlayers-geocoder"), this.#b(), i.classList.add("openlayers-ctrl-geocoder"), i.style.zIndex = "3", i.appendChild(this.#r);
1078
+ }), this.#e = e, this.#r = document.createElement("maptiler-geocoder"), this.#r.classList.add("openlayers-geocoder"), this.#x(), i.classList.add("openlayers-ctrl-geocoder"), i.style.zIndex = "3", i.appendChild(this.#r);
1007
1079
  }
1008
1080
  /** @internal Not to be called directly */
1009
1081
  setMap(e) {
1010
- super.setMap(e), this.#t && this.#t !== e && (this.#I(), this.#P(), this.#t = void 0), e && (this.#t = e, this.#$(), this.#C());
1082
+ super.setMap(e), this.#t && this.#t !== e && (this.#$(), this.#C(), this.#t = void 0), e && (this.#t = e, this.#I(), this.#T());
1011
1083
  }
1012
1084
  getOptions() {
1013
1085
  return { ...this.#e };
1014
1086
  }
1015
1087
  setOptions(e) {
1016
- Object.assign(this.#e, e), this.#b();
1088
+ Object.assign(this.#e, e), this.#x();
1017
1089
  }
1018
1090
  setQuery(e) {
1019
1091
  this.#r.setQuery(e);
@@ -1052,12 +1124,12 @@ class li extends Ye {
1052
1124
  /** Source connected to layer used for showing results */
1053
1125
  #s;
1054
1126
  /** Last marker the mouse was over, used to detech mouseover and mouseleave events on markers */
1055
- #d;
1127
+ #p;
1056
1128
  /** Flag whether to show reverse geocoding cursor */
1057
- #y = !1;
1058
- #v = {
1129
+ #v = !1;
1130
+ #y = {
1059
1131
  reversetoggle: (e) => {
1060
- this.#y = e.detail.reverse, this.#i("reversetoggle", e.detail);
1132
+ this.#v = e.detail.reverse, this.#i("reversetoggle", e.detail);
1061
1133
  },
1062
1134
  querychange: (e) => {
1063
1135
  const i = e.detail.reverseCoords;
@@ -1074,7 +1146,7 @@ class li extends Ye {
1074
1146
  },
1075
1147
  select: (e) => {
1076
1148
  const i = e.detail.feature;
1077
- i && this.#m && this.#e.flyToSelected && this.#w(i.center, this.#p(i)), this.#a && i && this.#T(i), this.#i("select", e.detail);
1149
+ i && this.#m && this.#e.flyToSelected && this.#w(i.center, this.#d(i)), this.#a && i && this.#M(i), this.#i("select", e.detail);
1078
1150
  },
1079
1151
  pick: (e) => {
1080
1152
  const i = e.detail.feature;
@@ -1088,7 +1160,7 @@ class li extends Ye {
1088
1160
  },
1089
1161
  featureslisted: (e) => {
1090
1162
  const i = e.detail.features;
1091
- this.#a = i, this.#u(this.#a, void 0), this.#O(e), this.#i("featureslisted", e.detail);
1163
+ this.#a = i, this.#u(this.#a, void 0), this.#E(e), this.#i("featureslisted", e.detail);
1092
1164
  },
1093
1165
  featuresclear: () => {
1094
1166
  this.#a = void 0, this.#u(void 0, void 0), this.#i("featuresclear");
@@ -1100,78 +1172,78 @@ class li extends Ye {
1100
1172
  this.#i("focusout");
1101
1173
  }
1102
1174
  };
1103
- #x = {
1175
+ #b = {
1104
1176
  postrender: () => {
1105
1177
  const e = this.#t?.getView().getZoom(), i = this.#t?.getView().getCenter();
1106
1178
  this.#r.handleMapChange(e && i ? [e, ...this.#L(i)] : void 0);
1107
1179
  },
1108
1180
  click: (e) => {
1109
1181
  this.#r.handleMapClick(this.#L(e.coordinate)), this.#t?.forEachFeatureAtPixel(e.pixel, (i) => {
1110
- const o = i.getId(), s = this.#a?.find((r) => r.id === o);
1111
- if (!(!o || !s))
1182
+ const r = i.getId(), s = this.#a?.find((o) => o.id === r);
1183
+ if (!(!r || !s))
1112
1184
  return e.stopPropagation(), this.#i("markerclick", { feature: s, marker: i }), !0;
1113
1185
  });
1114
1186
  },
1115
1187
  pointermove: (e) => {
1116
1188
  if (!this.#t) return;
1117
1189
  const i = this.#t.forEachFeatureAtPixel(e.pixel, (s) => s.getId() ? s : void 0);
1118
- this.#t.getTargetElement().style.cursor = i ? "pointer" : this.#y ? "crosshair" : "";
1119
- const o = i?.getId();
1120
- if (this.#d !== o) {
1121
- if (this.#d) {
1122
- const s = this.#a?.find((a) => a.id === this.#d), r = this.#c.get(s);
1123
- r?.set("isMouseOver", !1), s && r && this.#i("markermouseleave", { feature: s, marker: r });
1190
+ this.#t.getTargetElement().style.cursor = i ? "pointer" : this.#v ? "crosshair" : "";
1191
+ const r = i?.getId();
1192
+ if (this.#p !== r) {
1193
+ if (this.#p) {
1194
+ const s = this.#a?.find((a) => a.id === this.#p), o = this.#c.get(s);
1195
+ o?.set("isMouseOver", !1), s && o && this.#i("markermouseleave", { feature: s, marker: o });
1124
1196
  }
1125
1197
  if (i) {
1126
- const s = this.#a?.find((r) => r.id === o);
1198
+ const s = this.#a?.find((o) => o.id === r);
1127
1199
  this.#i("markermouseenter", { feature: s, marker: i }), i.set("isMouseOver", !0);
1128
1200
  }
1129
- this.#d = o;
1201
+ this.#p = r;
1130
1202
  }
1131
1203
  }
1132
1204
  };
1133
- #b() {
1205
+ #x() {
1134
1206
  this.#r.setOptions(this.#e), this.#r.fetchFullGeometryOnPick = this.#e.pickedResultStyle !== "marker-only";
1135
1207
  }
1136
- #$() {
1208
+ #I() {
1137
1209
  if (this.#t) {
1138
- for (const [e, i] of Object.entries(this.#v))
1210
+ for (const [e, i] of Object.entries(this.#y))
1139
1211
  this.#r.addEventListener(e, i);
1140
- for (const [e, i] of Object.entries(this.#x))
1212
+ for (const [e, i] of Object.entries(this.#b))
1141
1213
  this.#t.on([e], i);
1142
1214
  }
1143
1215
  }
1144
- #I() {
1216
+ #$() {
1145
1217
  if (this.#t) {
1146
- for (const [e, i] of Object.entries(this.#v))
1218
+ for (const [e, i] of Object.entries(this.#y))
1147
1219
  this.#r.removeEventListener(e, i);
1148
- for (const [e, i] of Object.entries(this.#x))
1220
+ for (const [e, i] of Object.entries(this.#b))
1149
1221
  this.#t.un([e], i);
1150
1222
  }
1151
1223
  }
1152
1224
  #i(e, i) {
1153
- this.dispatchEvent(Object.assign(new He(e), i));
1225
+ this.dispatchEvent(Object.assign(new rt(e), i));
1154
1226
  }
1155
1227
  #F(e) {
1156
- e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#w(e.center, this.#p(e)) : this.#k(D(e.bbox), 50, this.#p(e));
1228
+ e.bbox[0] === e.bbox[2] && e.bbox[1] === e.bbox[3] ? this.#w(e.center, this.#d(e)) : this.#k(Q(e.bbox), 50, this.#d(e));
1157
1229
  }
1158
- #O({ detail: { features: e, external: i } }) {
1230
+ #E({ detail: { features: e, external: i } }) {
1159
1231
  if (!e || e.length === 0 || !this.#m || this.#e.flyToFeatures === !1 || this.#e.flyToFeatures === "never" || !i && (this.#e.flyToFeatures === void 0 || this.#e.flyToFeatures === "external"))
1160
1232
  return;
1161
- const o = e.every((a) => a.matching_text), s = e.reduce(
1162
- (a, u) => o || !u.matching_text ? [Math.min(a[0], u.bbox[0]), Math.min(a[1], u.bbox[1]), Math.max(a[2], u.bbox[2]), Math.max(a[3], u.bbox[3])] : a,
1233
+ const r = e.every((a) => a.matching_text), s = e.reduce(
1234
+ (a, f) => r || !f.matching_text ? [Math.min(a[0], f.bbox[0]), Math.min(a[1], f.bbox[1]), Math.max(a[2], f.bbox[2]), Math.max(a[3], f.bbox[3])] : a,
1163
1235
  [180, 90, -180, -90]
1164
- ), r = e.map((a) => this.#p(a)).filter((a) => a !== void 0).reduce((a, u) => a === void 0 ? u : Math.max(a, u), void 0);
1165
- this.#k(D(s), 50, r);
1236
+ ), o = e.map((a) => this.#d(a)).filter((a) => a !== void 0).reduce((a, f) => a === void 0 ? f : Math.max(a, f), void 0);
1237
+ this.#k(Q(s), 50, o);
1166
1238
  }
1167
- #p(e) {
1239
+ #d(e) {
1168
1240
  if (e.bbox[0] !== e.bbox[2] || e.bbox[1] !== e.bbox[3])
1169
1241
  return;
1170
- const i = e.id.replace(/\..*/, ""), o = this.#e.zoom ?? Bt;
1171
- return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((s, r) => {
1172
- const a = o[i + "." + r];
1242
+ const i = e.id.replace(/\..*/, ""), r = this.#e.zoom ?? Vt;
1243
+ return (Array.isArray(e.properties?.categories) ? e.properties.categories.reduce((s, o) => {
1244
+ const a = r[i + "." + o];
1173
1245
  return s === void 0 ? a : a === void 0 ? s : Math.max(s, a);
1174
- }, void 0) : void 0) ?? o[i];
1246
+ }, void 0) : void 0) ?? r[i];
1175
1247
  }
1176
1248
  get #m() {
1177
1249
  return !!this.#e.flyTo || this.#e.flyTo === void 0;
@@ -1179,7 +1251,7 @@ class li extends Ye {
1179
1251
  get #S() {
1180
1252
  return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
1181
1253
  }
1182
- get #M() {
1254
+ get #O() {
1183
1255
  return typeof this.#e.flyTo == "boolean" ? {} : this.#e.flyTo;
1184
1256
  }
1185
1257
  #w(e, i) {
@@ -1190,12 +1262,12 @@ class li extends Ye {
1190
1262
  ...this.#S
1191
1263
  });
1192
1264
  }
1193
- #k(e, i, o) {
1194
- this.#t?.getView().fit(et(e, T, this.#n()), {
1265
+ #k(e, i, r) {
1266
+ this.#t?.getView().fit(nt(e, C, this.#n()), {
1195
1267
  padding: [i, i, i, i],
1196
- ...o ? { maxZoom: o } : {},
1268
+ ...r ? { maxZoom: r } : {},
1197
1269
  duration: 2e3,
1198
- ...this.#M
1270
+ ...this.#O
1199
1271
  });
1200
1272
  }
1201
1273
  #_(e) {
@@ -1207,7 +1279,7 @@ class li extends Ye {
1207
1279
  }
1208
1280
  const i = this.#f(e);
1209
1281
  if (!this.#o) {
1210
- this.#o = new $(new H(i)), this.#o.set("isReverse", !0), this.#s.addFeature(this.#o);
1282
+ this.#o = new $(new te(i)), this.#o.set("isReverse", !0), this.#s.addFeature(this.#o);
1211
1283
  return;
1212
1284
  }
1213
1285
  this.#o.getGeometry().setCoordinates(i);
@@ -1216,81 +1288,81 @@ class li extends Ye {
1216
1288
  if (!this.#t || !this.#s)
1217
1289
  return;
1218
1290
  this.#s.removeFeatures([...this.#c.values()]), this.#c = /* @__PURE__ */ new Map();
1219
- const o = () => {
1291
+ const r = () => {
1220
1292
  if (!i || !this.#t || this.#e.marker === !1) return;
1221
- const s = new $(new H(this.#f(i.center)));
1293
+ const s = new $(new te(this.#f(i.center)));
1222
1294
  s.setId(i.id), this.#c.set(i, s), this.#s?.addFeature(s);
1223
1295
  };
1224
1296
  if (i?.geometry.type === "GeometryCollection") {
1225
- const s = i.geometry.geometries.map((r) => r.type === "Polygon" ? new be(r.coordinates) : r.type === "MultiPolygon" ? new we(r.coordinates) : null).filter((r) => !!r);
1297
+ const s = i.geometry.geometries.map((o) => o.type === "Polygon" ? new Ie(o.coordinates) : o.type === "MultiPolygon" ? new $e(o.coordinates) : null).filter((o) => !!o);
1226
1298
  if (s.length > 0)
1227
- this.#s.addFeature(new $(new Je(s).transform(T, this.#n())));
1299
+ this.#s.addFeature(new $(new ot(s).transform(C, this.#n())));
1228
1300
  else
1229
- for (const r of i.geometry.geometries)
1230
- r.type === "LineString" ? this.#s.addFeature(new $(new ke(r.coordinates).transform(T, this.#n()))) : r.type === "MultiLineString" && this.#s.addFeature(new $(new _e(r.coordinates).transform(T, this.#n())));
1301
+ for (const o of i.geometry.geometries)
1302
+ o.type === "LineString" ? this.#s.addFeature(new $(new Fe(o.coordinates).transform(C, this.#n()))) : o.type === "MultiLineString" && this.#s.addFeature(new $(new Ee(o.coordinates).transform(C, this.#n())));
1231
1303
  } else if (i?.geometry.type.endsWith("Polygon")) {
1232
- const s = Ut(i);
1304
+ const s = At(i);
1233
1305
  if (s)
1234
- for (const r of s.features) {
1235
- const a = r.geometry.type === "Polygon" ? new be(r.geometry.coordinates) : new we(r.geometry.coordinates);
1306
+ for (const o of s.features) {
1307
+ const a = o.geometry.type === "Polygon" ? new Ie(o.geometry.coordinates) : new $e(o.geometry.coordinates);
1236
1308
  this.#s.addFeature(
1237
1309
  new $({
1238
- isMask: !!r.properties?.isMask,
1239
- geometry: a.transform(T, this.#n())
1310
+ isMask: !!o.properties?.isMask,
1311
+ geometry: a.transform(C, this.#n())
1240
1312
  })
1241
1313
  );
1242
1314
  }
1243
- this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && o();
1244
- } else i?.geometry.type === "LineString" ? this.#s.addFeature(new $(new ke(i.geometry.coordinates).transform(T, this.#n()))) : i?.geometry.type === "MultiLineString" ? this.#s.addFeature(new $(new _e(i.geometry.coordinates).transform(T, this.#n()))) : i?.geometry.type.endsWith("Point") && o();
1315
+ this.#e.pickedResultStyle === "full-geometry-including-polygon-center-marker" && r();
1316
+ } else i?.geometry.type === "LineString" ? this.#s.addFeature(new $(new Fe(i.geometry.coordinates).transform(C, this.#n()))) : i?.geometry.type === "MultiLineString" ? this.#s.addFeature(new $(new Ee(i.geometry.coordinates).transform(C, this.#n()))) : i?.geometry.type.endsWith("Point") && r();
1245
1317
  if (this.#e.showResultMarkers !== !1)
1246
1318
  for (const s of e ?? []) {
1247
1319
  if (s.id === i?.id || s.place_type.includes("reverse"))
1248
1320
  continue;
1249
- const r = new $(new H(this.#f(s.center)));
1250
- r.setId(s.id), r.setProperties({
1321
+ const o = new $(new te(this.#f(s.center)));
1322
+ o.setId(s.id), o.setProperties({
1251
1323
  fuzzy: !!s.matching_text,
1252
1324
  tooltip: s.place_type[0] === "reverse" ? s.place_name : s.place_name.replace(/,.*/, "")
1253
- }), this.#s.addFeature(r), this.#c.set(s, r);
1325
+ }), this.#s.addFeature(o), this.#c.set(s, o);
1254
1326
  }
1255
1327
  }
1256
- #T(e) {
1328
+ #M(e) {
1257
1329
  this.#h?.set("isSelected", !1), this.#h = void 0, this.#e.markerOnSelected !== !1 && (this.#h = this.#c.get(e), this.#h?.setProperties({ isSelected: !0 }));
1258
1330
  }
1259
- #C() {
1260
- this.#t && (this.#s = new rt({}), this.#l = new Xe({
1331
+ #T() {
1332
+ this.#t && (this.#s = new pt({}), this.#l = new at({
1261
1333
  updateWhileAnimating: !0
1262
- }), this.#l.setSource(this.#s), this.#l.setStyle(this.#E()), this.#t.addLayer(this.#l));
1334
+ }), this.#l.setSource(this.#s), this.#l.setStyle(this.#P()), this.#t.addLayer(this.#l));
1263
1335
  }
1264
- #P() {
1336
+ #C() {
1265
1337
  !this.#t || !this.#l || (this.#t.removeLayer(this.#l), this.#l = void 0);
1266
1338
  }
1267
1339
  #n() {
1268
- return tt() ?? this.#t?.getView().getProjection();
1340
+ return lt() ?? this.#t?.getView().getProjection();
1269
1341
  }
1270
1342
  #f(e) {
1271
- return it(e, this.#n());
1343
+ return ct(e, this.#n());
1272
1344
  }
1273
1345
  #L(e) {
1274
- return st(e, this.#n());
1346
+ return ht(e, this.#n());
1275
1347
  }
1276
- #E() {
1348
+ #P() {
1277
1349
  const { fullGeometryStyle: e } = this.#e;
1278
- if (e === !0 || e === void 0) return Gt(this.#e);
1350
+ if (e === !0 || e === void 0) return Dt(this.#e);
1279
1351
  if (!(e === !1 || e === null))
1280
1352
  return e;
1281
1353
  }
1282
1354
  }
1283
1355
  export {
1284
- Gt as DEFAULT_GEOMETRY_STYLE,
1285
- li as GeocodingControl,
1286
- X as MaptilerGeocodeClearIconElement,
1287
- ee as MaptilerGeocodeFailIconElement,
1288
- te as MaptilerGeocodeLoadingIconElement,
1289
- le as MaptilerGeocodeMarkerElement,
1290
- ie as MaptilerGeocodeReverseGeocodingIconElement,
1291
- se as MaptilerGeocodeSearchIconElement,
1356
+ Dt as DEFAULT_GEOMETRY_STYLE,
1357
+ mi as GeocodingControl,
1358
+ se as MaptilerGeocodeClearIconElement,
1359
+ re as MaptilerGeocodeFailIconElement,
1360
+ oe as MaptilerGeocodeLoadingIconElement,
1361
+ de as MaptilerGeocodeMarkerElement,
1362
+ ae as MaptilerGeocodeReverseGeocodingIconElement,
1363
+ ne as MaptilerGeocodeSearchIconElement,
1292
1364
  l as MaptilerGeocoderElement,
1293
- li as OpenLayersGeocodingControl,
1294
- Bt as ZOOM_DEFAULTS
1365
+ mi as OpenLayersGeocodingControl,
1366
+ Vt as ZOOM_DEFAULTS
1295
1367
  };
1296
1368
  //# sourceMappingURL=openlayers.js.map