@maptiler/geocoding-control 0.0.31

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.
@@ -0,0 +1,1002 @@
1
+ var Ve = (t, e, n) => {
2
+ if (!e.has(t))
3
+ throw TypeError("Cannot " + n);
4
+ };
5
+ var Z = (t, e, n) => (Ve(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Be = (t, e, n) => {
6
+ if (e.has(t))
7
+ throw TypeError("Cannot add the same private member more than once");
8
+ e instanceof WeakSet ? e.add(t) : e.set(t, n);
9
+ }, Ce = (t, e, n, l) => (Ve(t, e, "write to private field"), l ? l.call(t, n) : e.set(t, n), n);
10
+ import * as se from "leaflet";
11
+ function w() {
12
+ }
13
+ function vt(t, e) {
14
+ for (const n in e)
15
+ t[n] = e[n];
16
+ return t;
17
+ }
18
+ function $e(t) {
19
+ return t();
20
+ }
21
+ function Ue() {
22
+ return /* @__PURE__ */ Object.create(null);
23
+ }
24
+ function te(t) {
25
+ t.forEach($e);
26
+ }
27
+ function et(t) {
28
+ return typeof t == "function";
29
+ }
30
+ function he(t, e) {
31
+ return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
32
+ }
33
+ function wt(t) {
34
+ return Object.keys(t).length === 0;
35
+ }
36
+ function kt(t, e, n, l) {
37
+ if (t) {
38
+ const r = tt(t, e, n, l);
39
+ return t[0](r);
40
+ }
41
+ }
42
+ function tt(t, e, n, l) {
43
+ return t[1] && l ? vt(n.ctx.slice(), t[1](l(e))) : n.ctx;
44
+ }
45
+ function Ct(t, e, n, l) {
46
+ if (t[2] && l) {
47
+ const r = t[2](l(n));
48
+ if (e.dirty === void 0)
49
+ return r;
50
+ if (typeof r == "object") {
51
+ const c = [], o = Math.max(e.dirty.length, r.length);
52
+ for (let i = 0; i < o; i += 1)
53
+ c[i] = e.dirty[i] | r[i];
54
+ return c;
55
+ }
56
+ return e.dirty | r;
57
+ }
58
+ return e.dirty;
59
+ }
60
+ function Mt(t, e, n, l, r, c) {
61
+ if (r) {
62
+ const o = tt(e, n, l, c);
63
+ t.p(o, r);
64
+ }
65
+ }
66
+ function Tt(t) {
67
+ if (t.ctx.length > 32) {
68
+ const e = [], n = t.ctx.length / 32;
69
+ for (let l = 0; l < n; l++)
70
+ e[l] = -1;
71
+ return e;
72
+ }
73
+ return -1;
74
+ }
75
+ function We(t) {
76
+ return t == null ? "" : t;
77
+ }
78
+ function y(t, e) {
79
+ t.appendChild(e);
80
+ }
81
+ function V(t, e, n) {
82
+ t.insertBefore(e, n || null);
83
+ }
84
+ function H(t) {
85
+ t.parentNode.removeChild(t);
86
+ }
87
+ function Et(t, e) {
88
+ for (let n = 0; n < t.length; n += 1)
89
+ t[n] && t[n].d(e);
90
+ }
91
+ function A(t) {
92
+ return document.createElement(t);
93
+ }
94
+ function ee(t) {
95
+ return document.createElementNS("http://www.w3.org/2000/svg", t);
96
+ }
97
+ function ce(t) {
98
+ return document.createTextNode(t);
99
+ }
100
+ function x() {
101
+ return ce(" ");
102
+ }
103
+ function Q(t, e, n, l) {
104
+ return t.addEventListener(e, n, l), () => t.removeEventListener(e, n, l);
105
+ }
106
+ function Rt(t) {
107
+ return function(e) {
108
+ return e.preventDefault(), t.call(this, e);
109
+ };
110
+ }
111
+ function f(t, e, n) {
112
+ n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
113
+ }
114
+ function Lt(t) {
115
+ return Array.from(t.childNodes);
116
+ }
117
+ function ve(t, e) {
118
+ e = "" + e, t.wholeText !== e && (t.data = e);
119
+ }
120
+ function Ge(t, e) {
121
+ t.value = e == null ? "" : e;
122
+ }
123
+ function O(t, e, n) {
124
+ t.classList[n ? "add" : "remove"](e);
125
+ }
126
+ function St(t, e, { bubbles: n = !1, cancelable: l = !1 } = {}) {
127
+ const r = document.createEvent("CustomEvent");
128
+ return r.initCustomEvent(t, n, l, e), r;
129
+ }
130
+ let we;
131
+ function pe(t) {
132
+ we = t;
133
+ }
134
+ function nt() {
135
+ if (!we)
136
+ throw new Error("Function called outside component initialization");
137
+ return we;
138
+ }
139
+ function It(t) {
140
+ nt().$$.on_destroy.push(t);
141
+ }
142
+ function Bt() {
143
+ const t = nt();
144
+ return (e, n, { cancelable: l = !1 } = {}) => {
145
+ const r = t.$$.callbacks[e];
146
+ if (r) {
147
+ const c = St(e, n, { cancelable: l });
148
+ return r.slice().forEach((o) => {
149
+ o.call(t, c);
150
+ }), !c.defaultPrevented;
151
+ }
152
+ return !0;
153
+ };
154
+ }
155
+ const be = [], Ae = [], Te = [], Ze = [], Pt = Promise.resolve();
156
+ let ze = !1;
157
+ function At() {
158
+ ze || (ze = !0, Pt.then(lt));
159
+ }
160
+ function je(t) {
161
+ Te.push(t);
162
+ }
163
+ const Pe = /* @__PURE__ */ new Set();
164
+ let Me = 0;
165
+ function lt() {
166
+ const t = we;
167
+ do {
168
+ for (; Me < be.length; ) {
169
+ const e = be[Me];
170
+ Me++, pe(e), zt(e.$$);
171
+ }
172
+ for (pe(null), be.length = 0, Me = 0; Ae.length; )
173
+ Ae.pop()();
174
+ for (let e = 0; e < Te.length; e += 1) {
175
+ const n = Te[e];
176
+ Pe.has(n) || (Pe.add(n), n());
177
+ }
178
+ Te.length = 0;
179
+ } while (be.length);
180
+ for (; Ze.length; )
181
+ Ze.pop()();
182
+ ze = !1, Pe.clear(), pe(t);
183
+ }
184
+ function zt(t) {
185
+ if (t.fragment !== null) {
186
+ t.update(), te(t.before_update);
187
+ const e = t.dirty;
188
+ t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(je);
189
+ }
190
+ }
191
+ const Ee = /* @__PURE__ */ new Set();
192
+ let oe;
193
+ function Re() {
194
+ oe = {
195
+ r: 0,
196
+ c: [],
197
+ p: oe
198
+ };
199
+ }
200
+ function Le() {
201
+ oe.r || te(oe.c), oe = oe.p;
202
+ }
203
+ function P(t, e) {
204
+ t && t.i && (Ee.delete(t), t.i(e));
205
+ }
206
+ function q(t, e, n, l) {
207
+ if (t && t.o) {
208
+ if (Ee.has(t))
209
+ return;
210
+ Ee.add(t), oe.c.push(() => {
211
+ Ee.delete(t), l && (n && t.d(1), l());
212
+ }), t.o(e);
213
+ } else
214
+ l && l();
215
+ }
216
+ function ke(t) {
217
+ t && t.c();
218
+ }
219
+ function ae(t, e, n, l) {
220
+ const { fragment: r, after_update: c } = t.$$;
221
+ r && r.m(e, n), l || je(() => {
222
+ const o = t.$$.on_mount.map($e).filter(et);
223
+ t.$$.on_destroy ? t.$$.on_destroy.push(...o) : te(o), t.$$.on_mount = [];
224
+ }), c.forEach(je);
225
+ }
226
+ function de(t, e) {
227
+ const n = t.$$;
228
+ n.fragment !== null && (te(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
229
+ }
230
+ function jt(t, e) {
231
+ t.$$.dirty[0] === -1 && (be.push(t), At(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
232
+ }
233
+ function _e(t, e, n, l, r, c, o, i = [-1]) {
234
+ const u = we;
235
+ pe(t);
236
+ const a = t.$$ = {
237
+ fragment: null,
238
+ ctx: [],
239
+ props: c,
240
+ update: w,
241
+ not_equal: r,
242
+ bound: Ue(),
243
+ on_mount: [],
244
+ on_destroy: [],
245
+ on_disconnect: [],
246
+ before_update: [],
247
+ after_update: [],
248
+ context: new Map(e.context || (u ? u.$$.context : [])),
249
+ callbacks: Ue(),
250
+ dirty: i,
251
+ skip_bound: !1,
252
+ root: e.target || u.$$.root
253
+ };
254
+ o && o(a.root);
255
+ let h = !1;
256
+ if (a.ctx = n ? n(t, e.props || {}, (p, D, ...d) => {
257
+ const m = d.length ? d[0] : D;
258
+ return a.ctx && r(a.ctx[p], a.ctx[p] = m) && (!a.skip_bound && a.bound[p] && a.bound[p](m), h && jt(t, p)), D;
259
+ }) : [], a.update(), h = !0, te(a.before_update), a.fragment = l ? l(a.ctx) : !1, e.target) {
260
+ if (e.hydrate) {
261
+ const p = Lt(e.target);
262
+ a.fragment && a.fragment.l(p), p.forEach(H);
263
+ } else
264
+ a.fragment && a.fragment.c();
265
+ e.intro && P(t.$$.fragment), ae(t, e.target, e.anchor, e.customElement), lt();
266
+ }
267
+ pe(u);
268
+ }
269
+ class ge {
270
+ $destroy() {
271
+ de(this, 1), this.$destroy = w;
272
+ }
273
+ $on(e, n) {
274
+ if (!et(n))
275
+ return w;
276
+ const l = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
277
+ return l.push(n), () => {
278
+ const r = l.indexOf(n);
279
+ r !== -1 && l.splice(r, 1);
280
+ };
281
+ }
282
+ $set(e) {
283
+ this.$$set && !wt(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
284
+ }
285
+ }
286
+ function Ot(t) {
287
+ let e, n;
288
+ return {
289
+ c() {
290
+ e = ee("svg"), n = ee("path"), f(n, "d", "M500 115.1c212.2 0 384.9 172.6 384.9 384.9 0 212.2-172.7 384.9-384.9 384.9S115.1 712.2 115.1 500c0-212.4 172.5-384.9 384.9-384.9M500 10C229.4 10 10 229.4 10 500s219.4 490 490 490 490-219.4 490-490c-.2-270.6-219.5-490-490-490zm0 315c96.5 0 175 78.4 175 175 0 96.5-78.4 175-175 175-96.5 0-175-78.4-175-175 0-96.5 78.4-175 175-175m0-105c-154.7 0-279.9 125.4-279.9 279.9 0 154.7 125.4 279.9 279.9 279.9 154.5 0 279.9-125.4 279.9-279.9C779.9 345.3 654.5 220 500 220zm70 280c0 38.7-31.3 70-70 70s-70-31.3-70-70 31.3-70 70-70 70 31.3 70 70z"), f(e, "viewBox", "0 0 1000 1000"), f(e, "width", "18px"), f(e, "height", "18px"), f(e, "class", "svelte-en2qvf");
291
+ },
292
+ m(l, r) {
293
+ V(l, e, r), y(e, n);
294
+ },
295
+ p: w,
296
+ i: w,
297
+ o: w,
298
+ d(l) {
299
+ l && H(e);
300
+ }
301
+ };
302
+ }
303
+ class Dt extends ge {
304
+ constructor(e) {
305
+ super(), _e(this, e, null, Ot, he, {});
306
+ }
307
+ }
308
+ function Nt(t) {
309
+ let e, n;
310
+ return {
311
+ c() {
312
+ e = ee("svg"), n = ee("path"), f(n, "d", "M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"), f(e, "viewBox", "0 0 18 18"), f(e, "width", "16"), f(e, "height", "16"), f(e, "class", "svelte-en2qvf");
313
+ },
314
+ m(l, r) {
315
+ V(l, e, r), y(e, n);
316
+ },
317
+ p: w,
318
+ i: w,
319
+ o: w,
320
+ d(l) {
321
+ l && H(e);
322
+ }
323
+ };
324
+ }
325
+ class qt extends ge {
326
+ constructor(e) {
327
+ super(), _e(this, e, null, Nt, he, {});
328
+ }
329
+ }
330
+ function Ht(t) {
331
+ let e;
332
+ return {
333
+ c() {
334
+ e = A("div"), e.innerHTML = '<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>', f(e, "class", "svelte-7cmwmc");
335
+ },
336
+ m(n, l) {
337
+ V(n, e, l);
338
+ },
339
+ p: w,
340
+ i: w,
341
+ o: w,
342
+ d(n) {
343
+ n && H(e);
344
+ }
345
+ };
346
+ }
347
+ class Kt extends ge {
348
+ constructor(e) {
349
+ super(), _e(this, e, null, Ht, he, {});
350
+ }
351
+ }
352
+ function Qt(t) {
353
+ let e, n, l;
354
+ return {
355
+ c() {
356
+ e = ee("svg"), n = ee("path"), f(n, "stroke-width", "4"), f(n, "fill-rule", "evenodd"), f(n, "clip-rule", "evenodd"), f(n, "d", "M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"), f(n, "class", "svelte-656hh2"), f(e, "width", l = t[0] !== "list" ? void 0 : "20"), f(e, "viewBox", "0 0 70 85"), f(e, "fill", "none"), f(e, "class", "svelte-656hh2"), O(e, "in-map", t[0] !== "list"), O(e, "for-maplibre", t[0] === "maplibre"), O(e, "for-leaflet", t[0] === "leaflet"), O(e, "list-icon", t[0] === "list");
357
+ },
358
+ m(r, c) {
359
+ V(r, e, c), y(e, n);
360
+ },
361
+ p(r, [c]) {
362
+ c & 1 && l !== (l = r[0] !== "list" ? void 0 : "20") && f(e, "width", l), c & 1 && O(e, "in-map", r[0] !== "list"), c & 1 && O(e, "for-maplibre", r[0] === "maplibre"), c & 1 && O(e, "for-leaflet", r[0] === "leaflet"), c & 1 && O(e, "list-icon", r[0] === "list");
363
+ },
364
+ i: w,
365
+ o: w,
366
+ d(r) {
367
+ r && H(e);
368
+ }
369
+ };
370
+ }
371
+ function Vt(t, e, n) {
372
+ let { displayIn: l } = e;
373
+ return t.$$set = (r) => {
374
+ "displayIn" in r && n(0, l = r.displayIn);
375
+ }, [l];
376
+ }
377
+ class rt extends ge {
378
+ constructor(e) {
379
+ super(), _e(this, e, Vt, Qt, he, { displayIn: 0 });
380
+ }
381
+ }
382
+ function Ut(t) {
383
+ let e, n;
384
+ return {
385
+ c() {
386
+ e = ee("svg"), n = ee("path"), f(n, "d", "M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"), f(e, "viewBox", "0 0 18 18"), f(e, "xml:space", "preserve"), f(e, "width", "20"), f(e, "class", "svelte-en2qvf");
387
+ },
388
+ m(l, r) {
389
+ V(l, e, r), y(e, n);
390
+ },
391
+ p: w,
392
+ i: w,
393
+ o: w,
394
+ d(l) {
395
+ l && H(e);
396
+ }
397
+ };
398
+ }
399
+ class Wt extends ge {
400
+ constructor(e) {
401
+ super(), _e(this, e, null, Ut, he, {});
402
+ }
403
+ }
404
+ function xe(t, e, n) {
405
+ const l = t.slice();
406
+ return l[59] = e[n], l[61] = n, l;
407
+ }
408
+ function Je(t) {
409
+ let e, n;
410
+ return e = new Kt({}), {
411
+ c() {
412
+ ke(e.$$.fragment);
413
+ },
414
+ m(l, r) {
415
+ ae(e, l, r), n = !0;
416
+ },
417
+ i(l) {
418
+ n || (P(e.$$.fragment, l), n = !0);
419
+ },
420
+ o(l) {
421
+ q(e.$$.fragment, l), n = !1;
422
+ },
423
+ d(l) {
424
+ de(e, l);
425
+ }
426
+ };
427
+ }
428
+ function Xe(t) {
429
+ let e, n, l, r, c, o;
430
+ return n = new Dt({}), {
431
+ c() {
432
+ e = A("button"), ke(n.$$.fragment), f(e, "type", "button"), f(e, "title", l = t[7] === !0 ? "toggle reverse geocoding" : t[7]), f(e, "class", "svelte-16s24r9"), O(e, "active", t[1]);
433
+ },
434
+ m(i, u) {
435
+ V(i, e, u), ae(n, e, null), r = !0, c || (o = Q(e, "click", t[47]), c = !0);
436
+ },
437
+ p(i, u) {
438
+ (!r || u[0] & 128 && l !== (l = i[7] === !0 ? "toggle reverse geocoding" : i[7])) && f(e, "title", l), (!r || u[0] & 2) && O(e, "active", i[1]);
439
+ },
440
+ i(i) {
441
+ r || (P(n.$$.fragment, i), r = !0);
442
+ },
443
+ o(i) {
444
+ q(n.$$.fragment, i), r = !1;
445
+ },
446
+ d(i) {
447
+ i && H(e), de(n), c = !1, o();
448
+ }
449
+ };
450
+ }
451
+ function Gt(t) {
452
+ let e, n, l, r, c = t[10], o = [];
453
+ for (let u = 0; u < c.length; u += 1)
454
+ o[u] = Fe(xe(t, c, u));
455
+ const i = (u) => q(o[u], 1, 1, () => {
456
+ o[u] = null;
457
+ });
458
+ return {
459
+ c() {
460
+ e = A("ul");
461
+ for (let u = 0; u < o.length; u += 1)
462
+ o[u].c();
463
+ f(e, "class", "svelte-16s24r9");
464
+ },
465
+ m(u, a) {
466
+ V(u, e, a);
467
+ for (let h = 0; h < o.length; h += 1)
468
+ o[h].m(e, null);
469
+ n = !0, l || (r = [
470
+ Q(e, "mouseout", t[50]),
471
+ Q(e, "blur", t[51])
472
+ ], l = !0);
473
+ },
474
+ p(u, a) {
475
+ if (a[0] & 7425) {
476
+ c = u[10];
477
+ let h;
478
+ for (h = 0; h < c.length; h += 1) {
479
+ const p = xe(u, c, h);
480
+ o[h] ? (o[h].p(p, a), P(o[h], 1)) : (o[h] = Fe(p), o[h].c(), P(o[h], 1), o[h].m(e, null));
481
+ }
482
+ for (Re(), h = c.length; h < o.length; h += 1)
483
+ i(h);
484
+ Le();
485
+ }
486
+ },
487
+ i(u) {
488
+ if (!n) {
489
+ for (let a = 0; a < c.length; a += 1)
490
+ P(o[a]);
491
+ n = !0;
492
+ }
493
+ },
494
+ o(u) {
495
+ o = o.filter(Boolean);
496
+ for (let a = 0; a < o.length; a += 1)
497
+ q(o[a]);
498
+ n = !1;
499
+ },
500
+ d(u) {
501
+ u && H(e), Et(o, u), l = !1, te(r);
502
+ }
503
+ };
504
+ }
505
+ function Zt(t) {
506
+ let e, n;
507
+ return {
508
+ c() {
509
+ e = A("div"), n = ce(t[5]), f(e, "class", "no-results svelte-16s24r9");
510
+ },
511
+ m(l, r) {
512
+ V(l, e, r), y(e, n);
513
+ },
514
+ p(l, r) {
515
+ r[0] & 32 && ve(n, l[5]);
516
+ },
517
+ i: w,
518
+ o: w,
519
+ d(l) {
520
+ l && H(e);
521
+ }
522
+ };
523
+ }
524
+ function xt(t) {
525
+ let e, n;
526
+ return {
527
+ c() {
528
+ e = A("div"), n = ce(t[4]), f(e, "class", "error svelte-16s24r9");
529
+ },
530
+ m(l, r) {
531
+ V(l, e, r), y(e, n);
532
+ },
533
+ p(l, r) {
534
+ r[0] & 16 && ve(n, l[4]);
535
+ },
536
+ i: w,
537
+ o: w,
538
+ d(l) {
539
+ l && H(e);
540
+ }
541
+ };
542
+ }
543
+ function Jt(t) {
544
+ let e = "", n;
545
+ return {
546
+ c() {
547
+ n = ce(e);
548
+ },
549
+ m(l, r) {
550
+ V(l, n, r);
551
+ },
552
+ p: w,
553
+ i: w,
554
+ o: w,
555
+ d(l) {
556
+ l && H(n);
557
+ }
558
+ };
559
+ }
560
+ function Ye(t) {
561
+ let e, n = t[59].place_type + "", l;
562
+ return {
563
+ c() {
564
+ e = A("span"), l = ce(n), f(e, "class", "svelte-16s24r9");
565
+ },
566
+ m(r, c) {
567
+ V(r, e, c), y(e, l);
568
+ },
569
+ p(r, c) {
570
+ c[0] & 1024 && n !== (n = r[59].place_type + "") && ve(l, n);
571
+ },
572
+ d(r) {
573
+ r && H(e);
574
+ }
575
+ };
576
+ }
577
+ function Fe(t) {
578
+ let e, n, l, r, c, o, i = t[59].place_name.replace(/,.*/, "") + "", u, a, h, p, D, d = t[59].place_name.replace(/[^,]*,?\s*/, "") + "", m, g, b, C, M, U;
579
+ n = new rt({ props: { displayIn: "list" } });
580
+ let T = t[8] && Ye(t);
581
+ function E() {
582
+ return t[48](t[61]);
583
+ }
584
+ function v() {
585
+ return t[49](t[59]);
586
+ }
587
+ return {
588
+ c() {
589
+ e = A("li"), ke(n.$$.fragment), l = x(), r = A("span"), c = A("span"), o = A("span"), u = ce(i), a = x(), T && T.c(), h = x(), p = A("span"), D = A("span"), m = ce(d), g = x(), f(o, "class", "svelte-16s24r9"), f(c, "class", "svelte-16s24r9"), f(r, "class", "svelte-16s24r9"), f(D, "class", "svelte-16s24r9"), f(p, "class", "svelte-16s24r9"), f(e, "tabindex", "0"), f(e, "data-selected", b = t[12] === t[61]), f(e, "class", "svelte-16s24r9"), O(e, "selected", t[12] === t[61]);
590
+ },
591
+ m(j, k) {
592
+ V(j, e, k), ae(n, e, null), y(e, l), y(e, r), y(r, c), y(c, o), y(o, u), y(c, a), T && T.m(c, null), y(e, h), y(e, p), y(p, D), y(D, m), y(e, g), C = !0, M || (U = [
593
+ Q(e, "mouseover", E),
594
+ Q(e, "focus", v)
595
+ ], M = !0);
596
+ },
597
+ p(j, k) {
598
+ t = j, (!C || k[0] & 1024) && i !== (i = t[59].place_name.replace(/,.*/, "") + "") && ve(u, i), t[8] ? T ? T.p(t, k) : (T = Ye(t), T.c(), T.m(c, null)) : T && (T.d(1), T = null), (!C || k[0] & 1024) && d !== (d = t[59].place_name.replace(/[^,]*,?\s*/, "") + "") && ve(m, d), (!C || k[0] & 4096 && b !== (b = t[12] === t[61])) && f(e, "data-selected", b), (!C || k[0] & 4096) && O(e, "selected", t[12] === t[61]);
599
+ },
600
+ i(j) {
601
+ C || (P(n.$$.fragment, j), C = !0);
602
+ },
603
+ o(j) {
604
+ q(n.$$.fragment, j), C = !1;
605
+ },
606
+ d(j) {
607
+ j && H(e), de(n), T && T.d(), M = !1, te(U);
608
+ }
609
+ };
610
+ }
611
+ function Xt(t) {
612
+ let e, n, l, r, c, o, i, u, a, h, p, D, d, m, g, b, C, M, U, T;
613
+ r = new Wt({}), h = new qt({});
614
+ let E = t[16] && Je(), v = t[7] && Xe(t);
615
+ const j = t[39].default, k = kt(j, t, t[38], null), L = [Jt, xt, Zt, Gt], z = [];
616
+ function me(_, S) {
617
+ var J, X;
618
+ return _[13] ? _[15] ? 1 : ((J = _[10]) == null ? void 0 : J.length) === 0 ? 2 : _[13] && ((X = _[10]) == null ? void 0 : X.length) ? 3 : -1 : 0;
619
+ }
620
+ return ~(g = me(t)) && (b = z[g] = L[g](t)), {
621
+ c() {
622
+ e = A("form"), n = A("div"), l = A("button"), ke(r.$$.fragment), c = x(), o = A("input"), i = x(), u = A("div"), a = A("button"), ke(h.$$.fragment), p = x(), E && E.c(), D = x(), v && v.c(), d = x(), k && k.c(), m = x(), b && b.c(), f(l, "type", "button"), f(l, "class", "svelte-16s24r9"), f(o, "placeholder", t[3]), f(o, "aria-label", t[3]), f(o, "class", "svelte-16s24r9"), f(a, "type", "button"), f(a, "class", "svelte-16s24r9"), O(a, "displayable", t[0] !== ""), f(u, "class", "clear-button-container svelte-16s24r9"), f(n, "class", "input-group svelte-16s24r9"), f(e, "tabindex", "0"), f(e, "class", C = We(t[2]) + " svelte-16s24r9"), O(e, "can-collapse", t[6] && t[0] === "");
623
+ },
624
+ m(_, S) {
625
+ V(_, e, S), y(e, n), y(n, l), ae(r, l, null), y(n, c), y(n, o), t[41](o), Ge(o, t[0]), y(n, i), y(n, u), y(u, a), ae(h, a, null), y(u, p), E && E.m(u, null), y(n, D), v && v.m(n, null), y(n, d), k && k.m(n, null), y(e, m), ~g && z[g].m(e, null), M = !0, U || (T = [
626
+ Q(l, "click", t[40]),
627
+ Q(o, "input", t[42]),
628
+ Q(o, "focus", t[43]),
629
+ Q(o, "blur", t[44]),
630
+ Q(o, "keydown", t[18]),
631
+ Q(o, "input", t[45]),
632
+ Q(a, "click", t[46]),
633
+ Q(e, "submit", Rt(t[17]))
634
+ ], U = !0);
635
+ },
636
+ p(_, S) {
637
+ (!M || S[0] & 8) && f(o, "placeholder", _[3]), (!M || S[0] & 8) && f(o, "aria-label", _[3]), S[0] & 1 && o.value !== _[0] && Ge(o, _[0]), (!M || S[0] & 1) && O(a, "displayable", _[0] !== ""), _[16] ? E ? S[0] & 65536 && P(E, 1) : (E = Je(), E.c(), P(E, 1), E.m(u, null)) : E && (Re(), q(E, 1, 1, () => {
638
+ E = null;
639
+ }), Le()), _[7] ? v ? (v.p(_, S), S[0] & 128 && P(v, 1)) : (v = Xe(_), v.c(), P(v, 1), v.m(n, d)) : v && (Re(), q(v, 1, 1, () => {
640
+ v = null;
641
+ }), Le()), k && k.p && (!M || S[1] & 128) && Mt(
642
+ k,
643
+ j,
644
+ _,
645
+ _[38],
646
+ M ? Ct(j, _[38], S, null) : Tt(_[38]),
647
+ null
648
+ );
649
+ let J = g;
650
+ g = me(_), g === J ? ~g && z[g].p(_, S) : (b && (Re(), q(z[J], 1, 1, () => {
651
+ z[J] = null;
652
+ }), Le()), ~g ? (b = z[g], b ? b.p(_, S) : (b = z[g] = L[g](_), b.c()), P(b, 1), b.m(e, null)) : b = null), (!M || S[0] & 4 && C !== (C = We(_[2]) + " svelte-16s24r9")) && f(e, "class", C), (!M || S[0] & 69) && O(e, "can-collapse", _[6] && _[0] === "");
653
+ },
654
+ i(_) {
655
+ M || (P(r.$$.fragment, _), P(h.$$.fragment, _), P(E), P(v), P(k, _), P(b), M = !0);
656
+ },
657
+ o(_) {
658
+ q(r.$$.fragment, _), q(h.$$.fragment, _), q(E), q(v), q(k, _), q(b), M = !1;
659
+ },
660
+ d(_) {
661
+ _ && H(e), de(r), t[41](null), de(h), E && E.d(), v && v.d(), k && k.d(_), ~g && z[g].d(), U = !1, te(T);
662
+ }
663
+ };
664
+ }
665
+ function Yt(t, e, n) {
666
+ let l, { $$slots: r = {}, $$scope: c } = e, { class: o = void 0 } = e, { mapController: i = void 0 } = e, { apiKey: u } = e, { debounceSearch: a = 200 } = e, { placeholder: h = "Search" } = e, { errorMessage: p = "Searching failed" } = e, { noResultsMessage: D = "No results found" } = e, { proximity: d = void 0 } = e, { bbox: m = void 0 } = e, { trackProximity: g = !0 } = e, { minLength: b = 2 } = e, { language: C = void 0 } = e, { showResultsWhileTyping: M = !0 } = e, { zoom: U = 16 } = e, { flyTo: T = !0 } = e, { collapsed: E = !1 } = e, { clearOnBlur: v = !1 } = e, { enableReverse: j = !1 } = e, { filter: k = () => !0 } = e, { searchValue: L = "" } = e, { reverseActive: z = !1 } = e, { showPlaceType: me = !1 } = e;
667
+ function _() {
668
+ Y.focus();
669
+ }
670
+ function S() {
671
+ Y.blur();
672
+ }
673
+ function J(s, K = !0) {
674
+ n(0, L = s), K && (n(12, B = -1), Ne());
675
+ }
676
+ let X = !1, R, N, I, Oe = "", Y, B = -1, ne, De = [], le, Se, Ie;
677
+ const F = Bt();
678
+ It(() => {
679
+ i && (i.setProximityChangeHandler(void 0), i.setMapClickHandler(void 0), i.indicateReverse(!1), i.setSelectedMarker(-1), i.setMarkers(void 0, void 0));
680
+ });
681
+ function Ne() {
682
+ B > -1 && R ? (n(11, I = R[B]), n(0, L = I.place_name.replace(/,.*/, "")), n(15, ne = void 0), n(36, N = void 0), n(12, B = -1)) : L && qe(L).then(() => {
683
+ n(36, N = R), n(11, I = void 0), st();
684
+ }).catch((s) => n(15, ne = s));
685
+ }
686
+ async function qe(s) {
687
+ n(15, ne = void 0);
688
+ const K = /^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(s), G = new URLSearchParams();
689
+ G.set("key", u), C && G.set("language", String(C)), K || (m && G.set("bbox", m.join(",")), d && G.set("proximity", d.join(",")));
690
+ const re = "https://api.maptiler.com/geocoding/" + encodeURIComponent(s) + ".json?" + G.toString();
691
+ if (re === Oe) {
692
+ n(10, R = De);
693
+ return;
694
+ }
695
+ Oe = re, le == null || le.abort(), n(16, le = new AbortController());
696
+ let fe;
697
+ try {
698
+ fe = await fetch(re, { signal: le.signal }).finally(() => {
699
+ n(16, le = void 0);
700
+ });
701
+ } catch (ue) {
702
+ if (ue && typeof ue == "object" && ue.name === "AbortError")
703
+ return;
704
+ throw new Error();
705
+ }
706
+ if (!fe.ok)
707
+ throw new Error();
708
+ const ye = await fe.json();
709
+ F("response", { url: re, featureCollection: ye }), n(10, R = ye.features.filter(k)), De = R, K && Y.focus();
710
+ }
711
+ function st() {
712
+ var K, G, re, fe, ye, ue, Ke, Qe;
713
+ if (!(N != null && N.length) || !T)
714
+ return;
715
+ const s = [180, 90, -180, -90];
716
+ for (const $ of N)
717
+ s[0] = Math.min(s[0], (G = (K = $.bbox) == null ? void 0 : K[0]) != null ? G : $.center[0]), s[1] = Math.min(s[1], (fe = (re = $.bbox) == null ? void 0 : re[1]) != null ? fe : $.center[1]), s[2] = Math.max(s[2], (ue = (ye = $.bbox) == null ? void 0 : ye[2]) != null ? ue : $.center[0]), s[3] = Math.max(s[3], (Qe = (Ke = $.bbox) == null ? void 0 : Ke[3]) != null ? Qe : $.center[1]);
718
+ i && N.length > 0 && (I && s[0] === s[2] && s[1] === s[3] ? i.flyTo(I.center, U) : i.fitBounds(s, 50));
719
+ }
720
+ function ot(s) {
721
+ n(1, z = !1), J(s[0].toFixed(6) + "," + s[1].toFixed(6));
722
+ }
723
+ function it(s) {
724
+ if (!R)
725
+ return;
726
+ let K = s.key === "ArrowDown" ? 1 : s.key === "ArrowUp" ? -1 : 0;
727
+ K ? (B === -1 && K === -1 && n(12, B = R.length), n(12, B += K), B >= R.length && n(12, B = -1), s.preventDefault()) : ["ArrowLeft", "ArrowRight", "Home", "End"].includes(s.key) && n(12, B = -1);
728
+ }
729
+ function He(s = !0) {
730
+ if (M && L.length > b) {
731
+ Se && clearTimeout(Se);
732
+ const K = L;
733
+ Se = window.setTimeout(
734
+ () => {
735
+ qe(K).catch((G) => n(15, ne = G));
736
+ },
737
+ s ? a : 0
738
+ );
739
+ } else
740
+ n(10, R = void 0), n(15, ne = void 0);
741
+ }
742
+ const ct = () => Y.focus();
743
+ function ft(s) {
744
+ Ae[s ? "unshift" : "push"](() => {
745
+ Y = s, n(14, Y);
746
+ });
747
+ }
748
+ function ut() {
749
+ L = this.value, n(0, L), n(9, X), n(31, v);
750
+ }
751
+ const at = () => n(9, X = !0), dt = () => n(9, X = !1), ht = () => He(), _t = () => {
752
+ n(0, L = ""), Y.focus();
753
+ }, gt = () => n(1, z = !z), mt = (s) => n(12, B = s), yt = (s) => {
754
+ n(11, I = s), n(0, L = s.place_name.replace(/,.*/, "")), n(12, B = -1);
755
+ }, bt = () => n(12, B = -1), pt = () => {
756
+ };
757
+ return t.$$set = (s) => {
758
+ "class" in s && n(2, o = s.class), "mapController" in s && n(21, i = s.mapController), "apiKey" in s && n(22, u = s.apiKey), "debounceSearch" in s && n(23, a = s.debounceSearch), "placeholder" in s && n(3, h = s.placeholder), "errorMessage" in s && n(4, p = s.errorMessage), "noResultsMessage" in s && n(5, D = s.noResultsMessage), "proximity" in s && n(20, d = s.proximity), "bbox" in s && n(24, m = s.bbox), "trackProximity" in s && n(25, g = s.trackProximity), "minLength" in s && n(26, b = s.minLength), "language" in s && n(27, C = s.language), "showResultsWhileTyping" in s && n(28, M = s.showResultsWhileTyping), "zoom" in s && n(29, U = s.zoom), "flyTo" in s && n(30, T = s.flyTo), "collapsed" in s && n(6, E = s.collapsed), "clearOnBlur" in s && n(31, v = s.clearOnBlur), "enableReverse" in s && n(7, j = s.enableReverse), "filter" in s && n(32, k = s.filter), "searchValue" in s && n(0, L = s.searchValue), "reverseActive" in s && n(1, z = s.reverseActive), "showPlaceType" in s && n(8, me = s.showPlaceType), "$$scope" in s && n(38, c = s.$$scope);
759
+ }, t.$$.update = () => {
760
+ t.$$.dirty[0] & 35651584 && i && i.setProximityChangeHandler(g ? (s) => {
761
+ n(20, d = s);
762
+ } : void 0), t.$$.dirty[0] & 33554432 && (g || n(20, d = void 0)), t.$$.dirty[0] & 512 | t.$$.dirty[1] & 1 && setTimeout(() => {
763
+ n(13, Ie = X), v && !X && n(0, L = "");
764
+ }), t.$$.dirty[0] & 1025 && (L || (n(11, I = void 0), n(10, R = void 0), n(15, ne = void 0), n(36, N = R))), t.$$.dirty[0] & 1612711936 && i && I && T && (!I.bbox || I.bbox[0] === I.bbox[2] && I.bbox[1] === I.bbox[3] ? i.flyTo(I.center, U) : i.fitBounds(I.bbox, 0), n(10, R = void 0), n(36, N = void 0), n(12, B = -1)), t.$$.dirty[0] & 1024 | t.$$.dirty[1] & 32 && N !== R && n(36, N = void 0), t.$$.dirty[0] & 2099200 | t.$$.dirty[1] & 32 && i && i.setMarkers(N, I), t.$$.dirty[0] & 1 && n(12, B = -1), t.$$.dirty[0] & 2101248 && (i == null || i.setSelectedMarker(B)), t.$$.dirty[0] & 5120 && n(37, l = R == null ? void 0 : R[B]), t.$$.dirty[1] & 64 && F("select", l), t.$$.dirty[0] & 2048 && F("pick", I), t.$$.dirty[0] & 9216 && F("optionsVisibilityChange", Ie && !!R), t.$$.dirty[0] & 1024 && F("featuresListed", R), t.$$.dirty[1] & 32 && F("featuresMarked", N), t.$$.dirty[0] & 2 && F("reverseToggle", z), t.$$.dirty[0] & 1 && F("queryChange", L), t.$$.dirty[0] & 2097154 && i && i.indicateReverse(z), t.$$.dirty[0] & 2097154 && i && i.setMapClickHandler(z ? ot : void 0);
765
+ }, [
766
+ L,
767
+ z,
768
+ o,
769
+ h,
770
+ p,
771
+ D,
772
+ E,
773
+ j,
774
+ me,
775
+ X,
776
+ R,
777
+ I,
778
+ B,
779
+ Ie,
780
+ Y,
781
+ ne,
782
+ le,
783
+ Ne,
784
+ it,
785
+ He,
786
+ d,
787
+ i,
788
+ u,
789
+ a,
790
+ m,
791
+ g,
792
+ b,
793
+ C,
794
+ M,
795
+ U,
796
+ T,
797
+ v,
798
+ k,
799
+ _,
800
+ S,
801
+ J,
802
+ N,
803
+ l,
804
+ c,
805
+ r,
806
+ ct,
807
+ ft,
808
+ ut,
809
+ at,
810
+ dt,
811
+ ht,
812
+ _t,
813
+ gt,
814
+ mt,
815
+ yt,
816
+ bt,
817
+ pt
818
+ ];
819
+ }
820
+ class Ft extends ge {
821
+ constructor(e) {
822
+ super(), _e(
823
+ this,
824
+ e,
825
+ Yt,
826
+ Xt,
827
+ he,
828
+ {
829
+ class: 2,
830
+ mapController: 21,
831
+ apiKey: 22,
832
+ debounceSearch: 23,
833
+ placeholder: 3,
834
+ errorMessage: 4,
835
+ noResultsMessage: 5,
836
+ proximity: 20,
837
+ bbox: 24,
838
+ trackProximity: 25,
839
+ minLength: 26,
840
+ language: 27,
841
+ showResultsWhileTyping: 28,
842
+ zoom: 29,
843
+ flyTo: 30,
844
+ collapsed: 6,
845
+ clearOnBlur: 31,
846
+ enableReverse: 7,
847
+ filter: 32,
848
+ searchValue: 0,
849
+ reverseActive: 1,
850
+ showPlaceType: 8,
851
+ focus: 33,
852
+ blur: 34,
853
+ setQuery: 35
854
+ },
855
+ null,
856
+ [-1, -1]
857
+ );
858
+ }
859
+ get focus() {
860
+ return this.$$.ctx[33];
861
+ }
862
+ get blur() {
863
+ return this.$$.ctx[34];
864
+ }
865
+ get setQuery() {
866
+ return this.$$.ctx[35];
867
+ }
868
+ }
869
+ function $t(t, e = !0, n = !0, l = {}, r = {}) {
870
+ let c, o, i, u = [], a;
871
+ const h = () => {
872
+ if (!c) {
873
+ i = void 0;
874
+ return;
875
+ }
876
+ let d;
877
+ const m = t.getZoom() > 10 ? [(d = t.getCenter().wrap()).lng, d.lat] : void 0;
878
+ i !== m && (i = m, c(m));
879
+ }, p = (d) => {
880
+ o == null || o([d.latlng.lng, d.latlng.lat]);
881
+ };
882
+ return {
883
+ setProximityChangeHandler(d) {
884
+ d ? (c = d, t.on("moveend", h), h()) : (t.off("moveend", h), c == null || c(void 0), c = void 0);
885
+ },
886
+ setMapClickHandler(d) {
887
+ o = d, o ? t.on("click", p) : t.off("click", p);
888
+ },
889
+ flyTo(d, m) {
890
+ t.flyTo(d, m, l);
891
+ },
892
+ fitBounds(d, m) {
893
+ t.flyToBounds(
894
+ [
895
+ [d[1], d[0]],
896
+ [d[3], d[2]]
897
+ ],
898
+ { ...r, padding: [m, m] }
899
+ );
900
+ },
901
+ indicateReverse(d) {
902
+ t.getContainer().style.cursor = d ? "crosshair" : "";
903
+ },
904
+ setMarkers(d, m) {
905
+ for (const g of u)
906
+ g.remove();
907
+ u.length = 0;
908
+ for (const g of m ? [...d != null ? d : [], m] : d != null ? d : []) {
909
+ let b;
910
+ const C = [g.center[1], g.center[0]];
911
+ if (g === m && typeof e == "object")
912
+ b = new se.Marker(C, e);
913
+ else if (g !== m && typeof n == "object")
914
+ b = new se.Marker(C, n);
915
+ else {
916
+ const M = document.createElement("div");
917
+ new rt({ props: { displayIn: "leaflet" }, target: M }), b = new se.Marker(C, {
918
+ icon: new se.DivIcon({ html: M, className: "" })
919
+ });
920
+ }
921
+ u.push(b.addTo(t));
922
+ }
923
+ },
924
+ setSelectedMarker(d) {
925
+ var m, g;
926
+ a && ((m = a.getElement()) == null || m.classList.toggle("marker-selected", !1)), a = d > -1 ? u[d] : void 0, (g = a == null ? void 0 : a.getElement()) == null || g.classList.toggle("marker-selected", !0);
927
+ }
928
+ };
929
+ }
930
+ var W, ie;
931
+ class tn extends se.Control {
932
+ constructor(n) {
933
+ super();
934
+ Be(this, W, void 0);
935
+ Be(this, ie, void 0);
936
+ Ce(this, ie, n);
937
+ }
938
+ onAdd(n) {
939
+ const l = document.createElement("div");
940
+ l.className = "leaflet-ctrl-geocoder", se.DomEvent.disableClickPropagation(l), se.DomEvent.disableScrollPropagation(l);
941
+ const { marker: r, showResultMarkers: c, flyTo: o, ...i } = Z(this, ie), u = typeof o == "boolean" ? {} : o, a = $t(
942
+ n,
943
+ r,
944
+ c,
945
+ u,
946
+ u
947
+ );
948
+ Ce(this, W, new Ft({
949
+ target: l,
950
+ props: {
951
+ mapController: a,
952
+ flyTo: o === void 0 ? !0 : !!o,
953
+ ...i
954
+ }
955
+ }));
956
+ for (const h of [
957
+ "select",
958
+ "pick",
959
+ "featuresListed",
960
+ "featuresMarked",
961
+ "response",
962
+ "optionsVisibilityChange",
963
+ "reverseToggle",
964
+ "queryChange"
965
+ ])
966
+ Z(this, W).$on(
967
+ h,
968
+ (p) => n.fire(h.toLowerCase(), p.detail)
969
+ );
970
+ return l;
971
+ }
972
+ setOptions(n) {
973
+ var i;
974
+ Ce(this, ie, n);
975
+ const { marker: l, showResultMarkers: r, flyTo: c, ...o } = Z(this, ie);
976
+ (i = Z(this, W)) == null || i.$set(o);
977
+ }
978
+ setQuery(n, l = !0) {
979
+ var r;
980
+ (r = Z(this, W)) == null || r.setQuery(n, l);
981
+ }
982
+ setReverseMode(n) {
983
+ var l;
984
+ (l = Z(this, W)) == null || l.$set({ reverseActive: n });
985
+ }
986
+ focus() {
987
+ var n;
988
+ (n = Z(this, W)) == null || n.focus();
989
+ }
990
+ blur() {
991
+ var n;
992
+ (n = Z(this, W)) == null || n.blur();
993
+ }
994
+ onRemove() {
995
+ var n;
996
+ (n = Z(this, W)) == null || n.$destroy();
997
+ }
998
+ }
999
+ W = new WeakMap(), ie = new WeakMap();
1000
+ export {
1001
+ tn as GeocodingControl
1002
+ };