@ogc-maps/storybook-components 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,18 +1,18 @@
1
- import { B as He } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
- import { C as Ze } from "./CollapsibleControl-VFUTWb_5.js";
3
- import { C as Xe, f as ea, a as aa } from "./CoordinateDisplay-PxPmVjpm.js";
4
- import { E as ta } from "./ExportButton-CLsWoW4m.js";
5
- import { F as ra } from "./FeatureDetailPanel-CkFpdEKW.js";
6
- import { F as ua } from "./FeatureTooltip-Db1LgLQV.js";
7
- import { L as na } from "./LayerPanel-SCdJ8948.js";
1
+ import { B as Ke } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
+ import { C as Ye } from "./CollapsibleControl-VFUTWb_5.js";
3
+ import { C as ea, f as aa, a as ia } from "./CoordinateDisplay-PxPmVjpm.js";
4
+ import { E as pa } from "./ExportButton-CLsWoW4m.js";
5
+ import { F as la } from "./FeatureDetailPanel-CkFpdEKW.js";
6
+ import { F as ma } from "./FeatureTooltip-Db1LgLQV.js";
7
+ import { L as oa } from "./LayerPanel-SCdJ8948.js";
8
8
  import { L as sa } from "./Legend-BMrkY-rw.js";
9
- import { S as da } from "./SearchPanel-DCY01Wa-.js";
9
+ import { S as ha } from "./SearchPanel-DCY01Wa-.js";
10
10
  import { jsxs as t, jsx as e, Fragment as E } from "react/jsx-runtime";
11
- import { useState as w, useRef as X, useEffect as ee } from "react";
12
- import { I as le, j as he, i as ue, K as be } from "./cql2-Dhe6Ny6v.js";
13
- import { a as ba, b as ga, L as xa, e as fa, M as ya, f as Na, c as va, d as wa, g as Ca, h as ka, k as Sa, l as La, m as Fa, n as Da, o as Ea, p as Ta, q as Ma, r as Ia, s as ja, t as Aa, u as Oa, v as Pa, w as $a, x as Ba, y as qa, z as Ra, A as Ua, B as Va, C as Ga, D as _a, E as Qa, F as za, G as Wa, H as Ja, J as Ha } from "./cql2-Dhe6Ny6v.js";
14
- import { s as ge } from "./index-Bw9lUiuL.js";
15
- import { B as Za, C as Ya, a as Xa, D as ei, F as ai, b as ii, c as ti, L as pi, d as ri, e as li, f as ui, g as mi, M as ni, N as oi, O as si, P as ci, h as di, S as hi, i as bi, j as gi, k as xi, T as fi, U as yi, V as Ni, v as vi } from "./index-Bw9lUiuL.js";
11
+ import { useState as w, useEffect as J, useRef as ee } from "react";
12
+ import { I as ue, j as be, i as me, K as ge } from "./cql2-Dhe6Ny6v.js";
13
+ import { a as ga, b as xa, L as fa, e as ya, M as Na, f as va, c as wa, d as Ca, g as ka, h as Sa, k as La, l as Fa, m as Da, n as Ea, o as Ta, p as Ma, q as Ia, r as ja, s as Aa, t as Oa, u as Pa, v as $a, w as Ba, x as Ra, y as qa, z as Ua, A as Va, B as Ga, C as _a, D as Qa, E as za, F as Wa, G as Ja, H as Ha, J as Ka } from "./cql2-Dhe6Ny6v.js";
14
+ import { s as xe } from "./index-Bw9lUiuL.js";
15
+ import { B as Ya, C as Xa, a as ei, D as ai, F as ii, b as ti, c as pi, L as ri, d as li, e as ui, f as mi, g as ni, M as oi, N as ci, O as si, P as di, h as hi, S as bi, i as gi, j as xi, k as fi, T as yi, U as Ni, V as vi, v as wi } from "./index-Bw9lUiuL.js";
16
16
  import './style.css';function x({ label: a, error: i, required: p, htmlFor: r, children: m }) {
17
17
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
18
18
  /* @__PURE__ */ t("label", { htmlFor: r, className: "mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
@@ -38,7 +38,7 @@ function A({ value: a, onChange: i, label: p }) {
38
38
  /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-600", children: a })
39
39
  ] });
40
40
  }
41
- function H({
41
+ function K({
42
42
  open: a,
43
43
  title: i,
44
44
  description: p,
@@ -102,14 +102,14 @@ function ae({
102
102
  testStatus: r = "idle",
103
103
  testError: m
104
104
  }) {
105
- const u = (g) => i({ ...a, ...g });
105
+ const u = (l) => i({ ...a, ...l });
106
106
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
107
107
  /* @__PURE__ */ e(x, { label: "ID", required: !0, children: /* @__PURE__ */ e(
108
108
  "input",
109
109
  {
110
110
  type: "text",
111
111
  value: a.id,
112
- onChange: (g) => u({ id: g.target.value }),
112
+ onChange: (l) => u({ id: l.target.value }),
113
113
  placeholder: "my-source",
114
114
  className: U
115
115
  }
@@ -121,7 +121,7 @@ function ae({
121
121
  {
122
122
  type: "url",
123
123
  value: a.url,
124
- onChange: (g) => u({ url: g.target.value }),
124
+ onChange: (l) => u({ url: l.target.value }),
125
125
  placeholder: "https://example.com/ogcapi",
126
126
  className: `${U} mapui:flex-1`
127
127
  }
@@ -145,7 +145,7 @@ function ae({
145
145
  {
146
146
  type: "text",
147
147
  value: a.label ?? "",
148
- onChange: (g) => u({ label: g.target.value || void 0 }),
148
+ onChange: (l) => u({ label: l.target.value || void 0 }),
149
149
  placeholder: "My OGC API Source",
150
150
  className: U
151
151
  }
@@ -155,7 +155,7 @@ function ae({
155
155
  {
156
156
  type: "text",
157
157
  value: a.tileMatrixSetId ?? "WebMercatorQuad",
158
- onChange: (g) => u({ tileMatrixSetId: g.target.value || void 0 }),
158
+ onChange: (l) => u({ tileMatrixSetId: l.target.value || void 0 }),
159
159
  placeholder: "WebMercatorQuad",
160
160
  className: U
161
161
  }
@@ -168,19 +168,19 @@ const _ = () => ({
168
168
  label: void 0,
169
169
  tileMatrixSetId: "WebMercatorQuad"
170
170
  });
171
- function Be({ sources: a, onChange: i }) {
172
- const [p, r] = w(null), [m, u] = w(null), [g, n] = w(!1), [l, N] = w(_()), [h, c] = w({}), [C, o] = w({}), [b, y] = w(null), D = async (f, S) => {
173
- c((L) => ({ ...L, [f]: "loading" }));
171
+ function Re({ sources: a, onChange: i }) {
172
+ const [p, r] = w(null), [m, u] = w(null), [l, n] = w(!1), [d, v] = w(_()), [g, b] = w({}), [C, o] = w({}), [h, y] = w(null), D = async (f, S) => {
173
+ b((L) => ({ ...L, [f]: "loading" }));
174
174
  try {
175
175
  const L = await fetch(`${S}/conformance`);
176
- L.ok ? c((k) => ({ ...k, [f]: "success" })) : (c((k) => ({ ...k, [f]: "error" })), o((k) => ({ ...k, [f]: `HTTP ${L.status}` })));
176
+ L.ok ? b((k) => ({ ...k, [f]: "success" })) : (b((k) => ({ ...k, [f]: "error" })), o((k) => ({ ...k, [f]: `HTTP ${L.status}` })));
177
177
  } catch (L) {
178
- c((k) => ({ ...k, [f]: "error" })), o((k) => ({ ...k, [f]: L instanceof Error ? L.message : "Network error" }));
178
+ b((k) => ({ ...k, [f]: "error" })), o((k) => ({ ...k, [f]: L instanceof Error ? L.message : "Network error" }));
179
179
  }
180
- }, s = () => {
180
+ }, c = () => {
181
181
  m && (i(a.map((f) => f.id === p ? m : f)), r(null), u(null));
182
182
  }, T = () => {
183
- i([...a, l]), n(!1), N(_());
183
+ i([...a, d]), n(!1), v(_());
184
184
  }, M = (f) => {
185
185
  i(a.filter((S) => S.id !== f)), y(null);
186
186
  };
@@ -192,14 +192,14 @@ function Be({ sources: a, onChange: i }) {
192
192
  {
193
193
  type: "button",
194
194
  onClick: () => {
195
- n(!0), N(_());
195
+ n(!0), v(_());
196
196
  },
197
197
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
198
198
  children: "+ Add Source"
199
199
  }
200
200
  )
201
201
  ] }),
202
- a.length === 0 && !g && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
202
+ a.length === 0 && !l && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
203
203
  /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((f) => /* @__PURE__ */ e(
204
204
  "li",
205
205
  {
@@ -211,7 +211,7 @@ function Be({ sources: a, onChange: i }) {
211
211
  value: m ?? f,
212
212
  onChange: u,
213
213
  onTestConnection: (S) => D(`edit-${f.id}`, S),
214
- testStatus: h[`edit-${f.id}`],
214
+ testStatus: g[`edit-${f.id}`],
215
215
  testError: C[`edit-${f.id}`]
216
216
  }
217
217
  ),
@@ -220,7 +220,7 @@ function Be({ sources: a, onChange: i }) {
220
220
  "button",
221
221
  {
222
222
  type: "button",
223
- onClick: s,
223
+ onClick: c,
224
224
  disabled: !(m != null && m.id) || !(m != null && m.url),
225
225
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
226
226
  children: "Save"
@@ -273,15 +273,15 @@ function Be({ sources: a, onChange: i }) {
273
273
  },
274
274
  f.id
275
275
  )) }),
276
- g && /* @__PURE__ */ t("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
276
+ l && /* @__PURE__ */ t("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
277
277
  /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
278
278
  /* @__PURE__ */ e(
279
279
  ae,
280
280
  {
281
- value: l,
282
- onChange: N,
281
+ value: d,
282
+ onChange: v,
283
283
  onTestConnection: (f) => D("new", f),
284
- testStatus: h.new,
284
+ testStatus: g.new,
285
285
  testError: C.new
286
286
  }
287
287
  ),
@@ -291,7 +291,7 @@ function Be({ sources: a, onChange: i }) {
291
291
  {
292
292
  type: "button",
293
293
  onClick: T,
294
- disabled: !l.id || !l.url,
294
+ disabled: !d.id || !d.url,
295
295
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
296
296
  children: "Save"
297
297
  }
@@ -308,12 +308,12 @@ function Be({ sources: a, onChange: i }) {
308
308
  ] })
309
309
  ] }),
310
310
  /* @__PURE__ */ e(
311
- H,
311
+ K,
312
312
  {
313
- open: b !== null,
313
+ open: h !== null,
314
314
  title: "Remove Source",
315
315
  description: "Are you sure you want to remove this source? Any layers using it will be affected.",
316
- onConfirm: () => b && M(b),
316
+ onConfirm: () => h && M(h),
317
317
  onCancel: () => y(null)
318
318
  }
319
319
  )
@@ -325,15 +325,15 @@ function qe({
325
325
  onSelect: p,
326
326
  onDeselect: r
327
327
  }) {
328
- const { collections: m, loading: u, error: g } = le(a || null);
328
+ const { collections: m, loading: u, error: l } = ue(a || null);
329
329
  return u ? /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
330
330
  /* @__PURE__ */ e("span", { className: "mapui:inline-block mapui:h-4 mapui:w-4 mapui:animate-spin mapui:rounded-full mapui:border-2 mapui:border-gray-300 mapui:border-t-blue-600" }),
331
331
  "Loading collections…"
332
- ] }) : g ? /* @__PURE__ */ t("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
332
+ ] }) : l ? /* @__PURE__ */ t("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
333
333
  "Failed to load collections: ",
334
- g.message
334
+ l.message
335
335
  ] }) : m.length === 0 ? /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: m.map((n) => {
336
- const l = i.includes(n.id);
336
+ const d = i.includes(n.id);
337
337
  return /* @__PURE__ */ t(
338
338
  "li",
339
339
  {
@@ -344,8 +344,8 @@ function qe({
344
344
  {
345
345
  type: "checkbox",
346
346
  id: `collection-${n.id}`,
347
- checked: l,
348
- onChange: () => l ? r(n.id) : p(n.id),
347
+ checked: d,
348
+ onChange: () => d ? r(n.id) : p(n.id),
349
349
  className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
350
350
  }
351
351
  ),
@@ -367,17 +367,17 @@ function qe({
367
367
  );
368
368
  }) });
369
369
  }
370
- const J = {
370
+ const H = {
371
371
  type: "fill",
372
372
  paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent" }
373
- }, me = {
373
+ }, ne = {
374
374
  type: "line",
375
375
  paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
376
- }, ne = {
376
+ }, oe = {
377
377
  type: "circle",
378
378
  paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
379
- }, q = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
380
- function xe({ style: a }) {
379
+ }, R = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
380
+ function fe({ style: a }) {
381
381
  return a.type === "fill" ? /* @__PURE__ */ e(
382
382
  "div",
383
383
  {
@@ -427,10 +427,10 @@ function xe({ style: a }) {
427
427
  }
428
428
  );
429
429
  }
430
- function fe({ value: a, onChange: i, suggestedType: p }) {
430
+ function ye({ value: a, onChange: i, suggestedType: p }) {
431
431
  var m;
432
432
  const r = (u) => {
433
- i(u === "fill" ? J : u === "line" ? me : ne);
433
+ i(u === "fill" ? H : u === "line" ? ne : oe);
434
434
  };
435
435
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
436
436
  p && p !== a.type && /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-blue-800", children: [
@@ -454,7 +454,7 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
454
454
  {
455
455
  value: a.type,
456
456
  onChange: (u) => r(u.target.value),
457
- className: q,
457
+ className: R,
458
458
  children: [
459
459
  /* @__PURE__ */ e("option", { value: "fill", children: "Fill" }),
460
460
  /* @__PURE__ */ e("option", { value: "line", children: "Line" }),
@@ -464,7 +464,7 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
464
464
  ) }),
465
465
  /* @__PURE__ */ t("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
466
466
  /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
467
- /* @__PURE__ */ e(xe, { style: a })
467
+ /* @__PURE__ */ e(fe, { style: a })
468
468
  ] }),
469
469
  a.type === "fill" && /* @__PURE__ */ t(E, { children: [
470
470
  /* @__PURE__ */ e(x, { label: "Fill Color", children: /* @__PURE__ */ e(
@@ -542,7 +542,7 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
542
542
  ...a,
543
543
  paint: { ...a.paint, "line-width": parseFloat(u.target.value) || 0 }
544
544
  }),
545
- className: q
545
+ className: R
546
546
  }
547
547
  ) }),
548
548
  /* @__PURE__ */ e(x, { label: "Line Opacity", children: /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
@@ -569,14 +569,14 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
569
569
  type: "text",
570
570
  value: ((m = a.paint["line-dasharray"]) == null ? void 0 : m.join(", ")) ?? "",
571
571
  onChange: (u) => {
572
- const g = u.target.value.trim(), n = g ? g.split(",").map((l) => parseFloat(l.trim())).filter((l) => !isNaN(l)) : void 0;
572
+ const l = u.target.value.trim(), n = l ? l.split(",").map((d) => parseFloat(d.trim())).filter((d) => !isNaN(d)) : void 0;
573
573
  i({
574
574
  ...a,
575
575
  paint: { ...a.paint, "line-dasharray": n }
576
576
  });
577
577
  },
578
578
  placeholder: "e.g. 2, 4",
579
- className: q
579
+ className: R
580
580
  }
581
581
  ) })
582
582
  ] }),
@@ -603,7 +603,7 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
603
603
  "circle-radius": parseFloat(u.target.value) || 0
604
604
  }
605
605
  }),
606
- className: q
606
+ className: R
607
607
  }
608
608
  ) }),
609
609
  /* @__PURE__ */ e(x, { label: "Circle Opacity", children: /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
@@ -670,14 +670,14 @@ function fe({ value: a, onChange: i, suggestedType: p }) {
670
670
  "circle-stroke-width": parseFloat(u.target.value) || 0
671
671
  }
672
672
  }),
673
- className: q
673
+ className: R
674
674
  }
675
675
  ) })
676
676
  ] })
677
677
  ] });
678
678
  }
679
679
  const ie = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
680
- function ye({ value: a, onChange: i }) {
680
+ function Ne({ value: a, onChange: i }) {
681
681
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
682
682
  /* @__PURE__ */ e(x, { label: "Label", children: /* @__PURE__ */ e(
683
683
  "input",
@@ -713,16 +713,16 @@ function ye({ value: a, onChange: i }) {
713
713
  ] });
714
714
  }
715
715
  const te = () => ({ label: "", color: "#4a90d9", shape: "square" });
716
- function Ne({ value: a, onChange: i }) {
716
+ function ve({ value: a, onChange: i }) {
717
717
  const p = (a == null ? void 0 : a.entries) ?? [], r = () => {
718
718
  i({ entries: [...p, te()] });
719
- }, m = (n, l) => {
720
- const N = p.map((h, c) => c === n ? l : h);
721
- i({ entries: N });
719
+ }, m = (n, d) => {
720
+ const v = p.map((g, b) => b === n ? d : g);
721
+ i({ entries: v });
722
722
  }, u = (n) => {
723
- const l = p.filter((N, h) => h !== n);
724
- i(l.length > 0 ? { entries: l } : void 0);
725
- }, g = (n) => {
723
+ const d = p.filter((v, g) => g !== n);
724
+ i(d.length > 0 ? { entries: d } : void 0);
725
+ }, l = (n) => {
726
726
  i(n ? { entries: [te()] } : void 0);
727
727
  };
728
728
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
@@ -733,14 +733,14 @@ function Ne({ value: a, onChange: i }) {
733
733
  type: "checkbox",
734
734
  id: "legend-enabled",
735
735
  checked: a !== void 0,
736
- onChange: (n) => g(n.target.checked),
736
+ onChange: (n) => l(n.target.checked),
737
737
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
738
738
  }
739
739
  ),
740
740
  /* @__PURE__ */ e("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
741
741
  ] }),
742
742
  a !== void 0 && /* @__PURE__ */ t(E, { children: [
743
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: p.map((n, l) => /* @__PURE__ */ t(
743
+ /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: p.map((n, d) => /* @__PURE__ */ t(
744
744
  "li",
745
745
  {
746
746
  className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:p-3",
@@ -748,28 +748,28 @@ function Ne({ value: a, onChange: i }) {
748
748
  /* @__PURE__ */ t("div", { className: "mapui:mb-2 mapui:flex mapui:items-center mapui:justify-between", children: [
749
749
  /* @__PURE__ */ t("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: [
750
750
  "Entry ",
751
- l + 1
751
+ d + 1
752
752
  ] }),
753
753
  /* @__PURE__ */ e(
754
754
  "button",
755
755
  {
756
756
  type: "button",
757
- onClick: () => u(l),
757
+ onClick: () => u(d),
758
758
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
759
759
  children: "Remove"
760
760
  }
761
761
  )
762
762
  ] }),
763
763
  /* @__PURE__ */ e(
764
- ye,
764
+ Ne,
765
765
  {
766
766
  value: n,
767
- onChange: (N) => m(l, N)
767
+ onChange: (v) => m(d, v)
768
768
  }
769
769
  )
770
770
  ]
771
771
  },
772
- l
772
+ d
773
773
  )) }),
774
774
  /* @__PURE__ */ e(
775
775
  "button",
@@ -783,16 +783,39 @@ function Ne({ value: a, onChange: i }) {
783
783
  ] })
784
784
  ] });
785
785
  }
786
- const F = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", ve = {
786
+ function pe({
787
+ options: a,
788
+ onChange: i,
789
+ placeholder: p,
790
+ className: r
791
+ }) {
792
+ const [m, u] = w(() => (a == null ? void 0 : a.join(", ")) ?? "");
793
+ return J(() => {
794
+ u((a == null ? void 0 : a.join(", ")) ?? "");
795
+ }, [a == null ? void 0 : a.join(",")]), /* @__PURE__ */ e(
796
+ "input",
797
+ {
798
+ type: "text",
799
+ value: m,
800
+ onChange: (n) => u(n.target.value),
801
+ onBlur: () => {
802
+ const n = m.trim(), d = n ? n.split(",").map((v) => v.trim()).filter(Boolean) : void 0;
803
+ i(d), u((d == null ? void 0 : d.join(", ")) ?? "");
804
+ },
805
+ placeholder: p,
806
+ className: r
807
+ }
808
+ );
809
+ }
810
+ const F = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", we = {
787
811
  text: { type: "text", property: "", label: "", autocomplete: !1 },
788
812
  number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
789
813
  datetime: { type: "datetime", property: "", label: "", range: !1 },
790
814
  select: { type: "select", property: "", label: "" }
791
815
  };
792
- function we({ value: a, onChange: i, availableProperties: p }) {
793
- var g, n;
816
+ function Ce({ value: a, onChange: i, availableProperties: p }) {
794
817
  const r = (l) => {
795
- i({ ...ve[l], property: a.property, label: a.label });
818
+ i({ ...we[l], property: a.property, label: a.label });
796
819
  }, m = (l) => i({ ...a, ...l }), u = p && p.length > 0;
797
820
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
798
821
  /* @__PURE__ */ e(x, { label: "Field Type", children: /* @__PURE__ */ t(
@@ -878,14 +901,10 @@ function we({ value: a, onChange: i, availableProperties: p }) {
878
901
  /* @__PURE__ */ e("label", { htmlFor: "text-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
879
902
  ] }),
880
903
  /* @__PURE__ */ e(x, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ e(
881
- "input",
904
+ pe,
882
905
  {
883
- type: "text",
884
- value: ((g = a.options) == null ? void 0 : g.join(", ")) ?? "",
885
- onChange: (l) => {
886
- const N = l.target.value.trim(), h = N ? N.split(",").map((c) => c.trim()).filter(Boolean) : void 0;
887
- i({ ...a, options: h });
888
- },
906
+ options: a.options,
907
+ onChange: (l) => i({ ...a, options: l }),
889
908
  placeholder: "option1, option2",
890
909
  className: F
891
910
  }
@@ -993,14 +1012,10 @@ function we({ value: a, onChange: i, availableProperties: p }) {
993
1012
  /* @__PURE__ */ e("label", { htmlFor: "select-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
994
1013
  ] }),
995
1014
  /* @__PURE__ */ e(x, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ e(
996
- "input",
1015
+ pe,
997
1016
  {
998
- type: "text",
999
- value: ((n = a.options) == null ? void 0 : n.join(", ")) ?? "",
1000
- onChange: (l) => {
1001
- const N = l.target.value.trim(), h = N ? N.split(",").map((c) => c.trim()).filter(Boolean) : void 0;
1002
- i({ ...a, options: h });
1003
- },
1017
+ options: a.options,
1018
+ onChange: (l) => i({ ...a, options: l }),
1004
1019
  placeholder: "option1, option2",
1005
1020
  className: F
1006
1021
  }
@@ -1008,40 +1023,40 @@ function we({ value: a, onChange: i, availableProperties: p }) {
1008
1023
  ] })
1009
1024
  ] });
1010
1025
  }
1011
- const Ce = () => ({
1026
+ const ke = () => ({
1012
1027
  type: "text",
1013
1028
  property: "",
1014
1029
  label: "",
1015
1030
  autocomplete: !1
1016
1031
  });
1017
- function ke({ fields: a, onChange: i, availableProperties: p }) {
1032
+ function Se({ fields: a, onChange: i, availableProperties: p }) {
1018
1033
  const [r, m] = w(null), u = () => {
1019
- const h = [...a, Ce()];
1020
- i(h), m(h.length - 1);
1021
- }, g = (h, c) => {
1022
- i(a.map((C, o) => o === h ? c : C));
1023
- }, n = (h) => {
1024
- i(a.filter((c, C) => C !== h)), m(null);
1025
- }, l = (h) => {
1026
- if (h === 0) return;
1027
- const c = [...a];
1028
- [c[h - 1], c[h]] = [c[h], c[h - 1]], i(c), m(h - 1);
1029
- }, N = (h) => {
1030
- if (h === a.length - 1) return;
1031
- const c = [...a];
1032
- [c[h], c[h + 1]] = [c[h + 1], c[h]], i(c), m(h + 1);
1034
+ const g = [...a, ke()];
1035
+ i(g), m(g.length - 1);
1036
+ }, l = (g, b) => {
1037
+ i(a.map((C, o) => o === g ? b : C));
1038
+ }, n = (g) => {
1039
+ i(a.filter((b, C) => C !== g)), m(null);
1040
+ }, d = (g) => {
1041
+ if (g === 0) return;
1042
+ const b = [...a];
1043
+ [b[g - 1], b[g]] = [b[g], b[g - 1]], i(b), m(g - 1);
1044
+ }, v = (g) => {
1045
+ if (g === a.length - 1) return;
1046
+ const b = [...a];
1047
+ [b[g], b[g + 1]] = [b[g + 1], b[g]], i(b), m(g + 1);
1033
1048
  };
1034
1049
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1035
1050
  a.length === 0 && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
1036
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((h, c) => /* @__PURE__ */ t("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
1051
+ /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((g, b) => /* @__PURE__ */ t("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
1037
1052
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
1038
1053
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
1039
1054
  /* @__PURE__ */ e(
1040
1055
  "button",
1041
1056
  {
1042
1057
  type: "button",
1043
- onClick: () => l(c),
1044
- disabled: c === 0,
1058
+ onClick: () => d(b),
1059
+ disabled: b === 0,
1045
1060
  "aria-label": "Move up",
1046
1061
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1047
1062
  children: "▲"
@@ -1051,8 +1066,8 @@ function ke({ fields: a, onChange: i, availableProperties: p }) {
1051
1066
  "button",
1052
1067
  {
1053
1068
  type: "button",
1054
- onClick: () => N(c),
1055
- disabled: c === a.length - 1,
1069
+ onClick: () => v(b),
1070
+ disabled: b === a.length - 1,
1056
1071
  "aria-label": "Move down",
1057
1072
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1058
1073
  children: "▼"
@@ -1063,11 +1078,11 @@ function ke({ fields: a, onChange: i, availableProperties: p }) {
1063
1078
  "button",
1064
1079
  {
1065
1080
  type: "button",
1066
- onClick: () => m(r === c ? null : c),
1081
+ onClick: () => m(r === b ? null : b),
1067
1082
  className: "mapui:flex-1 mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:text-left mapui:text-sm mapui:font-medium mapui:text-gray-800",
1068
1083
  children: [
1069
- /* @__PURE__ */ e("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: h.type }),
1070
- h.label || h.property || "Untitled field"
1084
+ /* @__PURE__ */ e("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: g.type }),
1085
+ g.label || g.property || "Untitled field"
1071
1086
  ]
1072
1087
  }
1073
1088
  ),
@@ -1075,22 +1090,22 @@ function ke({ fields: a, onChange: i, availableProperties: p }) {
1075
1090
  "button",
1076
1091
  {
1077
1092
  type: "button",
1078
- onClick: () => n(c),
1093
+ onClick: () => n(b),
1079
1094
  "aria-label": "Remove field",
1080
1095
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1081
1096
  children: "Remove"
1082
1097
  }
1083
1098
  )
1084
1099
  ] }),
1085
- r === c && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1086
- we,
1100
+ r === b && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1101
+ Ce,
1087
1102
  {
1088
- value: h,
1089
- onChange: (C) => g(c, C),
1103
+ value: g,
1104
+ onChange: (C) => l(b, C),
1090
1105
  availableProperties: p
1091
1106
  }
1092
1107
  ) })
1093
- ] }, c)) }),
1108
+ ] }, b)) }),
1094
1109
  /* @__PURE__ */ e(
1095
1110
  "button",
1096
1111
  {
@@ -1102,14 +1117,14 @@ function ke({ fields: a, onChange: i, availableProperties: p }) {
1102
1117
  )
1103
1118
  ] });
1104
1119
  }
1105
- function Se(a) {
1120
+ function Le(a) {
1106
1121
  return Object.entries(a).map(([i, p]) => ({
1107
1122
  key: i,
1108
1123
  label: p.label ?? "",
1109
1124
  visible: p.visible ?? !0
1110
1125
  }));
1111
1126
  }
1112
- function Le(a) {
1127
+ function Fe(a) {
1113
1128
  const i = {};
1114
1129
  for (const p of a)
1115
1130
  i[p.key] = {
@@ -1119,29 +1134,29 @@ function Le(a) {
1119
1134
  return i;
1120
1135
  }
1121
1136
  const Q = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1122
- function Fe({ value: a, onChange: i, availableProperties: p }) {
1123
- const r = Se(a), m = p && p.length > 0, u = (o) => i(Le(o)), g = () => {
1137
+ function De({ value: a, onChange: i, availableProperties: p }) {
1138
+ const r = Le(a), m = p && p.length > 0, u = (o) => i(Fe(o)), l = () => {
1124
1139
  u([...r, { key: "", label: "", visible: !0 }]);
1125
1140
  }, n = (o) => {
1126
- u(r.filter((b, y) => y !== o));
1127
- }, l = (o, b) => {
1128
- u(r.map((y, D) => D === o ? { ...y, ...b } : y));
1129
- }, N = (o, b) => {
1130
- const y = p == null ? void 0 : p.find((s) => s.name === b), D = (y == null ? void 0 : y.title) ?? r[o].label;
1131
- u(r.map((s, T) => T === o ? { ...s, key: b, label: D } : s));
1132
- }, h = (o) => {
1141
+ u(r.filter((h, y) => y !== o));
1142
+ }, d = (o, h) => {
1143
+ u(r.map((y, D) => D === o ? { ...y, ...h } : y));
1144
+ }, v = (o, h) => {
1145
+ const y = p == null ? void 0 : p.find((c) => c.name === h), D = (y == null ? void 0 : y.title) ?? r[o].label;
1146
+ u(r.map((c, T) => T === o ? { ...c, key: h, label: D } : c));
1147
+ }, g = (o) => {
1133
1148
  if (o === 0) return;
1134
- const b = [...r];
1135
- [b[o - 1], b[o]] = [b[o], b[o - 1]], u(b);
1136
- }, c = (o) => {
1149
+ const h = [...r];
1150
+ [h[o - 1], h[o]] = [h[o], h[o - 1]], u(h);
1151
+ }, b = (o) => {
1137
1152
  if (o === r.length - 1) return;
1138
- const b = [...r];
1139
- [b[o], b[o + 1]] = [b[o + 1], b[o]], u(b);
1153
+ const h = [...r];
1154
+ [h[o], h[o + 1]] = [h[o + 1], h[o]], u(h);
1140
1155
  }, C = () => {
1141
1156
  if (!p) return;
1142
- const o = p.map((b) => ({
1143
- key: b.name,
1144
- label: b.title ?? "",
1157
+ const o = p.map((h) => ({
1158
+ key: h.name,
1159
+ label: h.title ?? "",
1145
1160
  visible: !0
1146
1161
  }));
1147
1162
  u(o);
@@ -1164,14 +1179,14 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1164
1179
  /* @__PURE__ */ e(x, { label: "Display Label", children: /* @__PURE__ */ e("span", {}) }),
1165
1180
  /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
1166
1181
  ] }),
1167
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((o, b) => /* @__PURE__ */ t("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
1182
+ /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((o, h) => /* @__PURE__ */ t("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
1168
1183
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
1169
1184
  /* @__PURE__ */ e(
1170
1185
  "button",
1171
1186
  {
1172
1187
  type: "button",
1173
- onClick: () => h(b),
1174
- disabled: b === 0,
1188
+ onClick: () => g(h),
1189
+ disabled: h === 0,
1175
1190
  "aria-label": "Move up",
1176
1191
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1177
1192
  children: "▲"
@@ -1181,8 +1196,8 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1181
1196
  "button",
1182
1197
  {
1183
1198
  type: "button",
1184
- onClick: () => c(b),
1185
- disabled: b === r.length - 1,
1199
+ onClick: () => b(h),
1200
+ disabled: h === r.length - 1,
1186
1201
  "aria-label": "Move down",
1187
1202
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1188
1203
  children: "▼"
@@ -1194,7 +1209,7 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1194
1209
  "select",
1195
1210
  {
1196
1211
  value: o.key,
1197
- onChange: (y) => N(b, y.target.value),
1212
+ onChange: (y) => v(h, y.target.value),
1198
1213
  "aria-label": "Property key",
1199
1214
  className: Q,
1200
1215
  children: [
@@ -1207,7 +1222,7 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1207
1222
  {
1208
1223
  type: "text",
1209
1224
  value: o.key,
1210
- onChange: (y) => l(b, { key: y.target.value }),
1225
+ onChange: (y) => d(h, { key: y.target.value }),
1211
1226
  placeholder: "property_name",
1212
1227
  "aria-label": "Property key",
1213
1228
  className: Q
@@ -1218,7 +1233,7 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1218
1233
  {
1219
1234
  type: "text",
1220
1235
  value: o.label,
1221
- onChange: (y) => l(b, { label: y.target.value }),
1236
+ onChange: (y) => d(h, { label: y.target.value }),
1222
1237
  placeholder: "Friendly name",
1223
1238
  "aria-label": "Display label",
1224
1239
  className: Q
@@ -1229,7 +1244,7 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1229
1244
  {
1230
1245
  type: "checkbox",
1231
1246
  checked: o.visible,
1232
- onChange: (y) => l(b, { visible: y.target.checked }),
1247
+ onChange: (y) => d(h, { visible: y.target.checked }),
1233
1248
  "aria-label": "Visible",
1234
1249
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1235
1250
  }
@@ -1238,48 +1253,48 @@ function Fe({ value: a, onChange: i, availableProperties: p }) {
1238
1253
  "button",
1239
1254
  {
1240
1255
  type: "button",
1241
- onClick: () => n(b),
1256
+ onClick: () => n(h),
1242
1257
  "aria-label": "Remove property",
1243
1258
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1244
1259
  children: "Remove"
1245
1260
  }
1246
1261
  )
1247
1262
  ] })
1248
- ] }, b)) })
1263
+ ] }, h)) })
1249
1264
  ] }),
1250
1265
  /* @__PURE__ */ e(
1251
1266
  "button",
1252
1267
  {
1253
1268
  type: "button",
1254
- onClick: g,
1269
+ onClick: l,
1255
1270
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
1256
1271
  children: "+ Add Property"
1257
1272
  }
1258
1273
  )
1259
1274
  ] });
1260
1275
  }
1261
- const oe = /geojson\.org\/schema\/(\w+)\.json/;
1262
- function De(a) {
1263
- return !!a.$ref && oe.test(a.$ref);
1264
- }
1276
+ const ce = /geojson\.org\/schema\/(\w+)\.json/;
1265
1277
  function Ee(a) {
1266
- const i = oe.exec(a);
1278
+ return !!a.$ref && ce.test(a.$ref);
1279
+ }
1280
+ function Te(a) {
1281
+ const i = ce.exec(a);
1267
1282
  return i ? i[1] : null;
1268
1283
  }
1269
- function K(a) {
1284
+ function Z(a) {
1270
1285
  const i = a.toLowerCase();
1271
1286
  return i.includes("polygon") ? "fill" : i.includes("linestring") ? "line" : i.includes("point") ? "circle" : null;
1272
1287
  }
1273
1288
  function se(a) {
1274
1289
  for (const i of Object.values(a.properties))
1275
1290
  if (i.$ref) {
1276
- const p = Ee(i.$ref);
1277
- if (p) return K(p);
1291
+ const p = Te(i.$ref);
1292
+ if (p) return Z(p);
1278
1293
  }
1279
1294
  return null;
1280
1295
  }
1281
- function Te(a) {
1282
- return Object.entries(a.properties).filter(([, i]) => !De(i)).map(([i, p]) => ({
1296
+ function Me(a) {
1297
+ return Object.entries(a.properties).filter(([, i]) => !Ee(i)).map(([i, p]) => ({
1283
1298
  name: i,
1284
1299
  title: p.title,
1285
1300
  type: p.type,
@@ -1289,24 +1304,24 @@ function Te(a) {
1289
1304
  maximum: p.maximum
1290
1305
  }));
1291
1306
  }
1292
- async function Re(a, i) {
1307
+ async function Ue(a, i) {
1293
1308
  var p, r;
1294
1309
  try {
1295
- const m = await he(a, i), u = se(m);
1310
+ const m = await be(a, i), u = se(m);
1296
1311
  if (u) return u;
1297
1312
  } catch {
1298
1313
  }
1299
1314
  try {
1300
- const u = (r = (p = (await ue(a, i, { limit: 1 })).features[0]) == null ? void 0 : p.geometry) == null ? void 0 : r.type;
1301
- if (typeof u == "string") return K(u);
1315
+ const u = (r = (p = (await me(a, i, { limit: 1 })).features[0]) == null ? void 0 : p.geometry) == null ? void 0 : r.type;
1316
+ if (typeof u == "string") return Z(u);
1302
1317
  } catch {
1303
1318
  }
1304
1319
  return null;
1305
1320
  }
1306
- function Ue(a) {
1321
+ function Ve(a) {
1307
1322
  return a.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (i) => i.toUpperCase());
1308
1323
  }
1309
- const R = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1324
+ const q = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1310
1325
  function V({
1311
1326
  title: a,
1312
1327
  children: i
@@ -1328,57 +1343,57 @@ function V({
1328
1343
  p && /* @__PURE__ */ e("div", { className: "mapui:p-3", children: i })
1329
1344
  ] });
1330
1345
  }
1331
- function pe({ value: a, onChange: i, availableSources: p }) {
1346
+ function re({ value: a, onChange: i, availableSources: p }) {
1332
1347
  var D;
1333
- const r = (s) => i({ ...a, ...s }), m = X(a);
1348
+ const r = (c) => i({ ...a, ...c }), m = ee(a);
1334
1349
  m.current = a;
1335
- const u = X(i);
1350
+ const u = ee(i);
1336
1351
  u.current = i;
1337
- const g = p.find((s) => s.id === a.sourceId), n = (g == null ? void 0 : g.url) ?? null, l = a.collection || null, { collections: N, loading: h } = le(n), { queryables: c, loading: C } = be(n, l), o = c ? Te(c) : [], [b, y] = w(
1352
+ const l = p.find((c) => c.id === a.sourceId), n = (l == null ? void 0 : l.url) ?? null, d = a.collection || null, { collections: v, loading: g } = ue(n), { queryables: b, loading: C } = ge(n, d), o = b ? Me(b) : [], [h, y] = w(
1338
1353
  null
1339
1354
  );
1340
- return ee(() => {
1341
- if (!c) {
1355
+ return J(() => {
1356
+ if (!b) {
1342
1357
  y(null);
1343
1358
  return;
1344
1359
  }
1345
- const s = (f) => {
1360
+ const c = (f) => {
1346
1361
  if (y(f), f && !m.current.style) {
1347
- const S = f === "fill" ? J : f === "line" ? me : ne;
1362
+ const S = f === "fill" ? H : f === "line" ? ne : oe;
1348
1363
  u.current({ ...m.current, style: S });
1349
1364
  }
1350
- }, T = se(c);
1365
+ }, T = se(b);
1351
1366
  if (T) {
1352
- s(T);
1367
+ c(T);
1353
1368
  return;
1354
1369
  }
1355
- if (!n || !l) {
1370
+ if (!n || !d) {
1356
1371
  y(null);
1357
1372
  return;
1358
1373
  }
1359
1374
  let M = !1;
1360
- return ue(n, l, { limit: 1 }).then((f) => {
1375
+ return me(n, d, { limit: 1 }).then((f) => {
1361
1376
  var L, k;
1362
1377
  if (M) return;
1363
1378
  const S = (k = (L = f.features[0]) == null ? void 0 : L.geometry) == null ? void 0 : k.type;
1364
- s(typeof S == "string" ? K(S) : null);
1379
+ c(typeof S == "string" ? Z(S) : null);
1365
1380
  }).catch(() => {
1366
1381
  M || y(null);
1367
1382
  }), () => {
1368
1383
  M = !0;
1369
1384
  };
1370
- }, [c, n, l]), ee(() => {
1385
+ }, [b, n, d]), J(() => {
1371
1386
  y(null);
1372
- }, [n, l]), /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1387
+ }, [n, d]), /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1373
1388
  /* @__PURE__ */ t("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
1374
1389
  /* @__PURE__ */ e(x, { label: "Layer ID", required: !0, children: /* @__PURE__ */ e(
1375
1390
  "input",
1376
1391
  {
1377
1392
  type: "text",
1378
1393
  value: a.id,
1379
- onChange: (s) => r({ id: s.target.value }),
1394
+ onChange: (c) => r({ id: c.target.value }),
1380
1395
  placeholder: "my-layer",
1381
- className: R
1396
+ className: q
1382
1397
  }
1383
1398
  ) }),
1384
1399
  /* @__PURE__ */ e(x, { label: "Label", children: /* @__PURE__ */ e(
@@ -1386,9 +1401,9 @@ function pe({ value: a, onChange: i, availableSources: p }) {
1386
1401
  {
1387
1402
  type: "text",
1388
1403
  value: a.label,
1389
- onChange: (s) => r({ label: s.target.value }),
1404
+ onChange: (c) => r({ label: c.target.value }),
1390
1405
  placeholder: "My Layer",
1391
- className: R
1406
+ className: q
1392
1407
  }
1393
1408
  ) })
1394
1409
  ] }),
@@ -1396,24 +1411,24 @@ function pe({ value: a, onChange: i, availableSources: p }) {
1396
1411
  "select",
1397
1412
  {
1398
1413
  value: a.sourceId,
1399
- onChange: (s) => r({ sourceId: s.target.value }),
1400
- className: R,
1414
+ onChange: (c) => r({ sourceId: c.target.value }),
1415
+ className: q,
1401
1416
  children: [
1402
1417
  /* @__PURE__ */ e("option", { value: "", children: "Select a source…" }),
1403
- p.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.label ?? s.id }, s.id))
1418
+ p.map((c) => /* @__PURE__ */ e("option", { value: c.id, children: c.label ?? c.id }, c.id))
1404
1419
  ]
1405
1420
  }
1406
1421
  ) }),
1407
1422
  /* @__PURE__ */ t(x, { label: "Collection", required: !0, children: [
1408
- N.length > 0 ? /* @__PURE__ */ t(
1423
+ v.length > 0 ? /* @__PURE__ */ t(
1409
1424
  "select",
1410
1425
  {
1411
1426
  value: a.collection,
1412
- onChange: (s) => r({ collection: s.target.value }),
1413
- className: R,
1427
+ onChange: (c) => r({ collection: c.target.value }),
1428
+ className: q,
1414
1429
  children: [
1415
1430
  /* @__PURE__ */ e("option", { value: "", children: "Select a collection…" }),
1416
- N.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.title ?? s.id }, s.id))
1431
+ v.map((c) => /* @__PURE__ */ e("option", { value: c.id, children: c.title ?? c.id }, c.id))
1417
1432
  ]
1418
1433
  }
1419
1434
  ) : /* @__PURE__ */ e(
@@ -1421,27 +1436,27 @@ function pe({ value: a, onChange: i, availableSources: p }) {
1421
1436
  {
1422
1437
  type: "text",
1423
1438
  value: a.collection,
1424
- onChange: (s) => r({ collection: s.target.value }),
1425
- placeholder: h ? "Loading collections…" : "collection-id",
1426
- className: R
1439
+ onChange: (c) => r({ collection: c.target.value }),
1440
+ placeholder: g ? "Loading collections…" : "collection-id",
1441
+ className: q
1427
1442
  }
1428
1443
  ),
1429
1444
  C && /* @__PURE__ */ e("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
1430
1445
  ] }),
1431
- /* @__PURE__ */ e(x, { label: "Data Mode", children: /* @__PURE__ */ e("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((s) => /* @__PURE__ */ t("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
1446
+ /* @__PURE__ */ e(x, { label: "Data Mode", children: /* @__PURE__ */ e("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((c) => /* @__PURE__ */ t("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
1432
1447
  /* @__PURE__ */ e(
1433
1448
  "input",
1434
1449
  {
1435
1450
  type: "radio",
1436
1451
  name: `data-mode-${a.id}`,
1437
- value: s,
1438
- checked: a.dataMode === s,
1439
- onChange: () => r({ dataMode: s }),
1452
+ value: c,
1453
+ checked: a.dataMode === c,
1454
+ onChange: () => r({ dataMode: c }),
1440
1455
  className: "mapui:accent-blue-600"
1441
1456
  }
1442
1457
  ),
1443
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:text-gray-700", children: s })
1444
- ] }, s)) }) }),
1458
+ /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:text-gray-700", children: c })
1459
+ ] }, c)) }) }),
1445
1460
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1446
1461
  /* @__PURE__ */ e(
1447
1462
  "input",
@@ -1449,40 +1464,40 @@ function pe({ value: a, onChange: i, availableSources: p }) {
1449
1464
  type: "checkbox",
1450
1465
  id: "layer-visible",
1451
1466
  checked: a.visible,
1452
- onChange: (s) => r({ visible: s.target.checked }),
1467
+ onChange: (c) => r({ visible: c.target.checked }),
1453
1468
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1454
1469
  }
1455
1470
  ),
1456
1471
  /* @__PURE__ */ e("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
1457
1472
  ] }),
1458
1473
  /* @__PURE__ */ e(V, { title: "Style", children: /* @__PURE__ */ e(
1459
- fe,
1474
+ ye,
1460
1475
  {
1461
- value: a.style ?? J,
1462
- onChange: (s) => r({ style: s }),
1463
- suggestedType: b
1476
+ value: a.style ?? H,
1477
+ onChange: (c) => r({ style: c }),
1478
+ suggestedType: h
1464
1479
  }
1465
1480
  ) }),
1466
1481
  /* @__PURE__ */ e(V, { title: "Legend", children: /* @__PURE__ */ e(
1467
- Ne,
1482
+ ve,
1468
1483
  {
1469
1484
  value: a.legend,
1470
- onChange: (s) => r({ legend: s })
1485
+ onChange: (c) => r({ legend: c })
1471
1486
  }
1472
1487
  ) }),
1473
1488
  /* @__PURE__ */ e(V, { title: "Search Fields", children: /* @__PURE__ */ e(
1474
- ke,
1489
+ Se,
1475
1490
  {
1476
1491
  fields: ((D = a.search) == null ? void 0 : D.fields) ?? [],
1477
- onChange: (s) => r({ search: s.length > 0 ? { fields: s } : void 0 }),
1492
+ onChange: (c) => r({ search: c.length > 0 ? { fields: c } : void 0 }),
1478
1493
  availableProperties: o
1479
1494
  }
1480
1495
  ) }),
1481
1496
  /* @__PURE__ */ e(V, { title: "Property Display", children: /* @__PURE__ */ e(
1482
- Fe,
1497
+ De,
1483
1498
  {
1484
1499
  value: a.propertyDisplay ?? {},
1485
- onChange: (s) => r({ propertyDisplay: Object.keys(s).length > 0 ? s : void 0 }),
1500
+ onChange: (c) => r({ propertyDisplay: Object.keys(c).length > 0 ? c : void 0 }),
1486
1501
  availableProperties: o
1487
1502
  }
1488
1503
  ) })
@@ -1496,37 +1511,37 @@ const z = () => ({
1496
1511
  visible: !0,
1497
1512
  dataMode: "vector-tiles"
1498
1513
  });
1499
- function Ve({ layers: a, onChange: i, availableSources: p }) {
1500
- const [r, m] = w(null), [u, g] = w(!1), [n, l] = w(z()), [N, h] = w(null), [c, C] = w(null), [o, b] = w(null), y = () => {
1501
- i([...a, n]), g(!1), l(z());
1502
- }, D = (d) => {
1503
- i(a.map((v) => v.id === r ? d : v));
1504
- }, s = (d) => {
1505
- i(a.filter((v) => v.id !== d)), h(null), r === d && m(null);
1506
- }, T = (d) => {
1507
- if (d === 0) return;
1508
- const v = [...a];
1509
- [v[d - 1], v[d]] = [v[d], v[d - 1]], i(v);
1510
- }, M = (d) => {
1511
- if (d === a.length - 1) return;
1512
- const v = [...a];
1513
- [v[d], v[d + 1]] = [v[d + 1], v[d]], i(v);
1514
- }, f = (d, v) => {
1515
- C(v), d.dataTransfer.effectAllowed = "move", d.dataTransfer.setData("text/plain", v);
1516
- }, S = (d, v) => {
1517
- d.preventDefault(), d.dataTransfer.dropEffect = "move", b(v);
1514
+ function Ge({ layers: a, onChange: i, availableSources: p }) {
1515
+ const [r, m] = w(null), [u, l] = w(!1), [n, d] = w(z()), [v, g] = w(null), [b, C] = w(null), [o, h] = w(null), y = () => {
1516
+ i([...a, n]), l(!1), d(z());
1517
+ }, D = (s) => {
1518
+ i(a.map((N) => N.id === r ? s : N));
1519
+ }, c = (s) => {
1520
+ i(a.filter((N) => N.id !== s)), g(null), r === s && m(null);
1521
+ }, T = (s) => {
1522
+ if (s === 0) return;
1523
+ const N = [...a];
1524
+ [N[s - 1], N[s]] = [N[s], N[s - 1]], i(N);
1525
+ }, M = (s) => {
1526
+ if (s === a.length - 1) return;
1527
+ const N = [...a];
1528
+ [N[s], N[s + 1]] = [N[s + 1], N[s]], i(N);
1529
+ }, f = (s, N) => {
1530
+ C(N), s.dataTransfer.effectAllowed = "move", s.dataTransfer.setData("text/plain", N);
1531
+ }, S = (s, N) => {
1532
+ s.preventDefault(), s.dataTransfer.dropEffect = "move", h(N);
1518
1533
  }, L = () => {
1519
- b(null);
1520
- }, k = (d, v) => {
1521
- d.preventDefault(), b(null);
1522
- const O = c;
1523
- if (C(null), !O || O === v) return;
1524
- const P = a.findIndex((j) => j.id === O), $ = a.findIndex((j) => j.id === v);
1534
+ h(null);
1535
+ }, k = (s, N) => {
1536
+ s.preventDefault(), h(null);
1537
+ const O = b;
1538
+ if (C(null), !O || O === N) return;
1539
+ const P = a.findIndex((j) => j.id === O), $ = a.findIndex((j) => j.id === N);
1525
1540
  if (P === -1 || $ === -1) return;
1526
1541
  const I = [...a];
1527
1542
  I.splice(P, 1), I.splice($, 0, a[P]), i(I);
1528
- }, de = () => {
1529
- C(null), b(null);
1543
+ }, he = () => {
1544
+ C(null), h(null);
1530
1545
  };
1531
1546
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1532
1547
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -1536,7 +1551,7 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1536
1551
  {
1537
1552
  type: "button",
1538
1553
  onClick: () => {
1539
- g(!0), l(z());
1554
+ l(!0), d(z());
1540
1555
  },
1541
1556
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
1542
1557
  children: "+ Add Layer"
@@ -1544,18 +1559,18 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1544
1559
  )
1545
1560
  ] }),
1546
1561
  a.length === 0 && !u && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
1547
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((d, v) => {
1548
- var I, j, Z, Y;
1549
- const O = c === d.id, P = o === d.id, $ = r === d.id;
1562
+ /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((s, N) => {
1563
+ var I, j, Y, X;
1564
+ const O = b === s.id, P = o === s.id, $ = r === s.id;
1550
1565
  return /* @__PURE__ */ t(
1551
1566
  "li",
1552
1567
  {
1553
1568
  draggable: !$,
1554
- onDragStart: $ ? void 0 : (B) => f(B, d.id),
1555
- onDragOver: (B) => S(B, d.id),
1569
+ onDragStart: $ ? void 0 : (B) => f(B, s.id),
1570
+ onDragOver: (B) => S(B, s.id),
1556
1571
  onDragLeave: L,
1557
- onDrop: (B) => k(B, d.id),
1558
- onDragEnd: de,
1572
+ onDrop: (B) => k(B, s.id),
1573
+ onDragEnd: he,
1559
1574
  className: [
1560
1575
  "mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
1561
1576
  P ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
@@ -1569,8 +1584,8 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1569
1584
  "button",
1570
1585
  {
1571
1586
  type: "button",
1572
- onClick: () => T(v),
1573
- disabled: v === 0,
1587
+ onClick: () => T(N),
1588
+ disabled: N === 0,
1574
1589
  "aria-label": "Move layer up",
1575
1590
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1576
1591
  children: "▲"
@@ -1580,8 +1595,8 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1580
1595
  "button",
1581
1596
  {
1582
1597
  type: "button",
1583
- onClick: () => M(v),
1584
- disabled: v === a.length - 1,
1598
+ onClick: () => M(N),
1599
+ disabled: N === a.length - 1,
1585
1600
  "aria-label": "Move layer down",
1586
1601
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1587
1602
  children: "▼"
@@ -1597,18 +1612,18 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1597
1612
  }
1598
1613
  ),
1599
1614
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
1600
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: d.label || d.id }),
1601
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: d.collection }),
1615
+ /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: s.label || s.id }),
1616
+ /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: s.collection }),
1602
1617
  /* @__PURE__ */ t("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
1603
- /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: d.dataMode }),
1604
- d.style && /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: d.style.type }),
1605
- d.visible === !1 && /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
1606
- (((j = (I = d.search) == null ? void 0 : I.fields) == null ? void 0 : j.length) ?? 0) > 0 && /* @__PURE__ */ t("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
1607
- d.search.fields.length,
1618
+ /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: s.dataMode }),
1619
+ s.style && /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: s.style.type }),
1620
+ s.visible === !1 && /* @__PURE__ */ e("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
1621
+ (((j = (I = s.search) == null ? void 0 : I.fields) == null ? void 0 : j.length) ?? 0) > 0 && /* @__PURE__ */ t("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
1622
+ s.search.fields.length,
1608
1623
  " search fields"
1609
1624
  ] }),
1610
- (((Y = (Z = d.legend) == null ? void 0 : Z.entries) == null ? void 0 : Y.length) ?? 0) > 0 && /* @__PURE__ */ t("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
1611
- d.legend.entries.length,
1625
+ (((X = (Y = s.legend) == null ? void 0 : Y.entries) == null ? void 0 : X.length) ?? 0) > 0 && /* @__PURE__ */ t("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
1626
+ s.legend.entries.length,
1612
1627
  " legend entries"
1613
1628
  ] })
1614
1629
  ] })
@@ -1619,42 +1634,42 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1619
1634
  "button",
1620
1635
  {
1621
1636
  type: "button",
1622
- onClick: () => m(r === d.id ? null : d.id),
1637
+ onClick: () => m(r === s.id ? null : s.id),
1623
1638
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
1624
- children: r === d.id ? "Close" : "Edit"
1639
+ children: r === s.id ? "Close" : "Edit"
1625
1640
  }
1626
1641
  ),
1627
1642
  /* @__PURE__ */ e(
1628
1643
  "button",
1629
1644
  {
1630
1645
  type: "button",
1631
- onClick: () => h(d.id),
1646
+ onClick: () => g(s.id),
1632
1647
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1633
1648
  children: "Remove"
1634
1649
  }
1635
1650
  )
1636
1651
  ] })
1637
1652
  ] }),
1638
- r === d.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1639
- pe,
1653
+ r === s.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1654
+ re,
1640
1655
  {
1641
- value: d,
1656
+ value: s,
1642
1657
  onChange: D,
1643
1658
  availableSources: p
1644
1659
  }
1645
1660
  ) })
1646
1661
  ]
1647
1662
  },
1648
- d.id
1663
+ s.id
1649
1664
  );
1650
1665
  }) }),
1651
1666
  u && /* @__PURE__ */ t("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
1652
1667
  /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
1653
1668
  /* @__PURE__ */ e(
1654
- pe,
1669
+ re,
1655
1670
  {
1656
1671
  value: n,
1657
- onChange: l,
1672
+ onChange: d,
1658
1673
  availableSources: p
1659
1674
  }
1660
1675
  ),
@@ -1673,7 +1688,7 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1673
1688
  "button",
1674
1689
  {
1675
1690
  type: "button",
1676
- onClick: () => g(!1),
1691
+ onClick: () => l(!1),
1677
1692
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
1678
1693
  children: "Cancel"
1679
1694
  }
@@ -1681,19 +1696,19 @@ function Ve({ layers: a, onChange: i, availableSources: p }) {
1681
1696
  ] })
1682
1697
  ] }),
1683
1698
  /* @__PURE__ */ e(
1684
- H,
1699
+ K,
1685
1700
  {
1686
- open: N !== null,
1701
+ open: v !== null,
1687
1702
  title: "Remove Layer",
1688
1703
  description: "Are you sure you want to remove this layer from the configuration?",
1689
- onConfirm: () => N && s(N),
1690
- onCancel: () => h(null)
1704
+ onConfirm: () => v && c(v),
1705
+ onCancel: () => g(null)
1691
1706
  }
1692
1707
  )
1693
1708
  ] });
1694
1709
  }
1695
1710
  const G = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1696
- function re({ value: a, onChange: i }) {
1711
+ function le({ value: a, onChange: i }) {
1697
1712
  const p = (r) => i({ ...a, ...r });
1698
1713
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1699
1714
  /* @__PURE__ */ e(x, { label: "ID", required: !0, children: /* @__PURE__ */ e(
@@ -1749,13 +1764,13 @@ function re({ value: a, onChange: i }) {
1749
1764
  ] });
1750
1765
  }
1751
1766
  const W = () => ({ id: "", label: "", url: "" });
1752
- function Ge({ basemaps: a, onChange: i }) {
1753
- const [p, r] = w(null), [m, u] = w(!1), [g, n] = w(W()), [l, N] = w(null), h = (o) => {
1754
- i(a.map((b) => b.id === p ? o : b));
1755
- }, c = () => {
1756
- i([...a, g]), u(!1), n(W());
1767
+ function _e({ basemaps: a, onChange: i }) {
1768
+ const [p, r] = w(null), [m, u] = w(!1), [l, n] = w(W()), [d, v] = w(null), g = (o) => {
1769
+ i(a.map((h) => h.id === p ? o : h));
1770
+ }, b = () => {
1771
+ i([...a, l]), u(!1), n(W());
1757
1772
  }, C = (o) => {
1758
- i(a.filter((b) => b.id !== o)), N(null);
1773
+ i(a.filter((h) => h.id !== o)), v(null);
1759
1774
  };
1760
1775
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1761
1776
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -1805,28 +1820,28 @@ function Ge({ basemaps: a, onChange: i }) {
1805
1820
  "button",
1806
1821
  {
1807
1822
  type: "button",
1808
- onClick: () => N(o.id),
1823
+ onClick: () => v(o.id),
1809
1824
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1810
1825
  children: "Remove"
1811
1826
  }
1812
1827
  )
1813
1828
  ] })
1814
1829
  ] }),
1815
- p === o.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(re, { value: o, onChange: h }) })
1830
+ p === o.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(le, { value: o, onChange: g }) })
1816
1831
  ]
1817
1832
  },
1818
1833
  o.id
1819
1834
  )) }),
1820
1835
  m && /* @__PURE__ */ t("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
1821
1836
  /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
1822
- /* @__PURE__ */ e(re, { value: g, onChange: n }),
1837
+ /* @__PURE__ */ e(le, { value: l, onChange: n }),
1823
1838
  /* @__PURE__ */ t("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
1824
1839
  /* @__PURE__ */ e(
1825
1840
  "button",
1826
1841
  {
1827
1842
  type: "button",
1828
- onClick: c,
1829
- disabled: !g.id || !g.url,
1843
+ onClick: b,
1844
+ disabled: !l.id || !l.url,
1830
1845
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
1831
1846
  children: "Save"
1832
1847
  }
@@ -1843,18 +1858,18 @@ function Ge({ basemaps: a, onChange: i }) {
1843
1858
  ] })
1844
1859
  ] }),
1845
1860
  /* @__PURE__ */ e(
1846
- H,
1861
+ K,
1847
1862
  {
1848
- open: l !== null,
1863
+ open: d !== null,
1849
1864
  title: "Remove Basemap",
1850
1865
  description: "Are you sure you want to remove this basemap from the configuration?",
1851
- onConfirm: () => l && C(l),
1852
- onCancel: () => N(null)
1866
+ onConfirm: () => d && C(d),
1867
+ onCancel: () => v(null)
1853
1868
  }
1854
1869
  )
1855
1870
  ] });
1856
1871
  }
1857
- const Me = [
1872
+ const Ie = [
1858
1873
  { key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
1859
1874
  { key: "showLegend", label: "Legend", description: "Map legend" },
1860
1875
  { key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
@@ -1864,14 +1879,14 @@ const Me = [
1864
1879
  { key: "showFeatureTooltip", label: "Feature Tooltip", description: "Hover tooltip on features" },
1865
1880
  { key: "showExportButton", label: "Export Button", description: "Export data as CSV" }
1866
1881
  ];
1867
- function _e({ value: a, onChange: i }) {
1882
+ function Qe({ value: a, onChange: i }) {
1868
1883
  const p = (r, m) => {
1869
1884
  i({ ...a, [r]: m });
1870
1885
  };
1871
1886
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
1872
1887
  /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-2 mapui:text-xs mapui:text-gray-500", children: "Enable or disable UI panels and controls." }),
1873
- /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: Me.map(({ key: r, label: m, description: u }) => {
1874
- const g = a[r];
1888
+ /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: Ie.map(({ key: r, label: m, description: u }) => {
1889
+ const l = a[r];
1875
1890
  return /* @__PURE__ */ t(
1876
1891
  "label",
1877
1892
  {
@@ -1886,7 +1901,7 @@ function _e({ value: a, onChange: i }) {
1886
1901
  "input",
1887
1902
  {
1888
1903
  type: "checkbox",
1889
- checked: g,
1904
+ checked: l,
1890
1905
  onChange: (n) => p(r, n.target.checked),
1891
1906
  className: "mapui:sr-only",
1892
1907
  "aria-label": m
@@ -1897,14 +1912,14 @@ function _e({ value: a, onChange: i }) {
1897
1912
  {
1898
1913
  className: [
1899
1914
  "mapui:relative mapui:h-5 mapui:w-9 mapui:rounded-full mapui:transition-colors",
1900
- g ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
1915
+ l ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
1901
1916
  ].join(" "),
1902
1917
  children: /* @__PURE__ */ e(
1903
1918
  "div",
1904
1919
  {
1905
1920
  className: [
1906
1921
  "mapui:absolute mapui:top-0.5 mapui:h-4 mapui:w-4 mapui:rounded-full mapui:bg-white mapui:shadow mapui:transition-transform",
1907
- g ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
1922
+ l ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
1908
1923
  ].join(" ")
1909
1924
  }
1910
1925
  )
@@ -1918,46 +1933,46 @@ function _e({ value: a, onChange: i }) {
1918
1933
  }) })
1919
1934
  ] });
1920
1935
  }
1921
- const ce = [
1936
+ const de = [
1922
1937
  { key: "latitude", label: "Latitude", min: -90, max: 90, step: 1e-6, placeholder: "0" },
1923
1938
  { key: "longitude", label: "Longitude", min: -180, max: 180, step: 1e-6, placeholder: "0" },
1924
1939
  { key: "zoom", label: "Zoom", min: 0, max: 24, step: 0.1, placeholder: "2" },
1925
1940
  { key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
1926
1941
  { key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
1927
1942
  ];
1928
- function Ie(a, i) {
1929
- const p = ce.find((r) => r.key === a);
1943
+ function je(a, i) {
1944
+ const p = de.find((r) => r.key === a);
1930
1945
  if (p) {
1931
1946
  if (isNaN(i)) return "Must be a number";
1932
1947
  if (i < p.min) return `Must be at least ${p.min}`;
1933
1948
  if (i > p.max) return `Must be at most ${p.max}`;
1934
1949
  }
1935
1950
  }
1936
- const je = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1937
- function Qe({ value: a, onChange: i }) {
1951
+ const Ae = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1952
+ function ze({ value: a, onChange: i }) {
1938
1953
  const p = (r, m) => {
1939
1954
  const u = parseFloat(m);
1940
1955
  i({ ...a, [r]: isNaN(u) ? 0 : u });
1941
1956
  };
1942
- return /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: ce.map(({ key: r, label: m, min: u, max: g, step: n, placeholder: l }) => {
1943
- const N = Ie(r, a[r]);
1944
- return /* @__PURE__ */ e(x, { label: m, error: N, children: /* @__PURE__ */ e(
1957
+ return /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: de.map(({ key: r, label: m, min: u, max: l, step: n, placeholder: d }) => {
1958
+ const v = je(r, a[r]);
1959
+ return /* @__PURE__ */ e(x, { label: m, error: v, children: /* @__PURE__ */ e(
1945
1960
  "input",
1946
1961
  {
1947
1962
  type: "number",
1948
1963
  min: u,
1949
- max: g,
1964
+ max: l,
1950
1965
  step: n,
1951
1966
  value: a[r],
1952
- placeholder: l,
1953
- onChange: (h) => p(r, h.target.value),
1954
- className: `${je} ${N ? "mapui:border-red-400" : ""}`
1967
+ placeholder: d,
1968
+ onChange: (g) => p(r, g.target.value),
1969
+ className: `${Ae} ${v ? "mapui:border-red-400" : ""}`
1955
1970
  }
1956
1971
  ) }, r);
1957
1972
  }) });
1958
1973
  }
1959
- function ze({ config: a }) {
1960
- const i = ge(a);
1974
+ function We({ config: a }) {
1975
+ const i = xe(a);
1961
1976
  return /* @__PURE__ */ t("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1962
1977
  /* @__PURE__ */ t("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1963
1978
  /* @__PURE__ */ e(
@@ -1983,109 +1998,109 @@ function ze({ config: a }) {
1983
1998
  ] });
1984
1999
  }
1985
2000
  export {
1986
- Za as BasemapConfigSchema,
1987
- re as BasemapEditor,
1988
- Ge as BasemapList,
1989
- He as BasemapSwitcher,
1990
- Ya as CirclePaintSchema,
1991
- Xa as CircleStyleSchema,
1992
- Ze as CollapsibleControl,
2001
+ Ya as BasemapConfigSchema,
2002
+ le as BasemapEditor,
2003
+ _e as BasemapList,
2004
+ Ke as BasemapSwitcher,
2005
+ Xa as CirclePaintSchema,
2006
+ ei as CircleStyleSchema,
2007
+ Ye as CollapsibleControl,
1993
2008
  qe as CollectionBrowser,
1994
2009
  A as ColorPicker,
1995
- ze as ConfigPreview,
1996
- H as ConfirmDialog,
1997
- Xe as CoordinateDisplay,
1998
- ei as DatetimeSearchFieldSchema,
1999
- ta as ExportButton,
2000
- ra as FeatureDetailPanel,
2001
- ua as FeatureTooltip,
2002
- ai as FillPaintSchema,
2003
- ii as FillStyleSchema,
2004
- ti as FilterConfigSchema,
2010
+ We as ConfigPreview,
2011
+ K as ConfirmDialog,
2012
+ ea as CoordinateDisplay,
2013
+ ai as DatetimeSearchFieldSchema,
2014
+ pa as ExportButton,
2015
+ la as FeatureDetailPanel,
2016
+ ma as FeatureTooltip,
2017
+ ii as FillPaintSchema,
2018
+ ti as FillStyleSchema,
2019
+ pi as FilterConfigSchema,
2005
2020
  x as FormField,
2006
- pi as LayerConfigSchema,
2007
- pe as LayerEditor,
2008
- Ve as LayerList,
2009
- na as LayerPanel,
2021
+ ri as LayerConfigSchema,
2022
+ re as LayerEditor,
2023
+ Ge as LayerList,
2024
+ oa as LayerPanel,
2010
2025
  sa as Legend,
2011
- ri as LegendConfigSchema,
2012
- Ne as LegendEditor,
2013
- ye as LegendEntryEditor,
2014
- li as LegendEntrySchema,
2015
- ui as LinePaintSchema,
2016
- mi as LineStyleSchema,
2017
- ni as MapConfigSchema,
2018
- oi as NumberSearchFieldSchema,
2026
+ li as LegendConfigSchema,
2027
+ ve as LegendEditor,
2028
+ Ne as LegendEntryEditor,
2029
+ ui as LegendEntrySchema,
2030
+ mi as LinePaintSchema,
2031
+ ni as LineStyleSchema,
2032
+ oi as MapConfigSchema,
2033
+ ci as NumberSearchFieldSchema,
2019
2034
  si as OgcApiSourceSchema,
2020
- ci as PropertyDisplayConfigSchema,
2021
- Fe as PropertyDisplayEditor,
2022
- di as PropertyDisplaySchema,
2023
- hi as SearchConfigSchema,
2024
- we as SearchFieldEditor,
2025
- ke as SearchFieldList,
2026
- bi as SearchFieldSchema,
2027
- da as SearchPanel,
2028
- gi as SelectSearchFieldSchema,
2035
+ di as PropertyDisplayConfigSchema,
2036
+ De as PropertyDisplayEditor,
2037
+ hi as PropertyDisplaySchema,
2038
+ bi as SearchConfigSchema,
2039
+ Ce as SearchFieldEditor,
2040
+ Se as SearchFieldList,
2041
+ gi as SearchFieldSchema,
2042
+ ha as SearchPanel,
2043
+ xi as SelectSearchFieldSchema,
2029
2044
  ae as SourceEditor,
2030
- Be as SourceList,
2031
- xi as StyleConfigSchema,
2032
- fe as StyleEditor,
2033
- fi as TextSearchFieldSchema,
2034
- _e as UIConfigEditor,
2035
- yi as UIConfigSchema,
2036
- Ni as ViewConfigSchema,
2037
- Qe as ViewEditor,
2038
- ba as and,
2039
- ga as between,
2040
- ne as defaultCircle,
2041
- J as defaultFill,
2042
- me as defaultLine,
2045
+ Re as SourceList,
2046
+ fi as StyleConfigSchema,
2047
+ ye as StyleEditor,
2048
+ yi as TextSearchFieldSchema,
2049
+ Qe as UIConfigEditor,
2050
+ Ni as UIConfigSchema,
2051
+ vi as ViewConfigSchema,
2052
+ ze as ViewEditor,
2053
+ ga as and,
2054
+ xa as between,
2055
+ oe as defaultCircle,
2056
+ H as defaultFill,
2057
+ ne as defaultLine,
2043
2058
  se as detectGeometryTypeFromQueryables,
2044
- Re as detectStyleTypeForCollection,
2045
- xa as downloadCsv,
2046
- fa as eq,
2047
- Ee as extractGeometryType,
2048
- ya as featuresToCsv,
2049
- Na as fetchCollectionDetail,
2050
- va as fetchCollections,
2051
- wa as fetchConformance,
2052
- Ca as fetchDistinctValues,
2053
- ka as fetchFeatureCount,
2054
- ue as fetchFeatures,
2055
- he as fetchQueryables,
2056
- Sa as fetchTileJson,
2057
- ea as formatDMS,
2058
- aa as formatDecimal,
2059
- La as fromSimpleFilters,
2060
- Fa as fromStructuredFilters,
2061
- K as geometryTypeToStyleType,
2062
- Da as getCql2FilteredVectorTileUrl,
2063
- Ea as getFilteredVectorTileUrl,
2064
- Ta as getTileJsonUrl,
2065
- Ma as getVectorTileUrl,
2066
- Ia as gt,
2067
- ja as gte,
2068
- Ue as humanizePropertyName,
2069
- Aa as inList,
2070
- De as isGeometryProperty,
2071
- Oa as isNull,
2072
- Pa as like,
2073
- $a as lt,
2074
- Ba as lte,
2059
+ Ue as detectStyleTypeForCollection,
2060
+ fa as downloadCsv,
2061
+ ya as eq,
2062
+ Te as extractGeometryType,
2063
+ Na as featuresToCsv,
2064
+ va as fetchCollectionDetail,
2065
+ wa as fetchCollections,
2066
+ Ca as fetchConformance,
2067
+ ka as fetchDistinctValues,
2068
+ Sa as fetchFeatureCount,
2069
+ me as fetchFeatures,
2070
+ be as fetchQueryables,
2071
+ La as fetchTileJson,
2072
+ aa as formatDMS,
2073
+ ia as formatDecimal,
2074
+ Fa as fromSimpleFilters,
2075
+ Da as fromStructuredFilters,
2076
+ Z as geometryTypeToStyleType,
2077
+ Ea as getCql2FilteredVectorTileUrl,
2078
+ Ta as getFilteredVectorTileUrl,
2079
+ Ma as getTileJsonUrl,
2080
+ Ia as getVectorTileUrl,
2081
+ ja as gt,
2082
+ Aa as gte,
2083
+ Ve as humanizePropertyName,
2084
+ Oa as inList,
2085
+ Ee as isGeometryProperty,
2086
+ Pa as isNull,
2087
+ $a as like,
2088
+ Ba as lt,
2089
+ Ra as lte,
2075
2090
  qa as neq,
2076
- Ra as not,
2077
- Ua as or,
2078
- Va as resolvePropertyDisplay,
2079
- ge as safeValidateMapConfig,
2080
- Ga as serializeCql2,
2081
- _a as tAfter,
2082
- Qa as tBefore,
2083
- za as tDuring,
2084
- Te as toAvailableProperties,
2085
- Wa as useCsvExport,
2086
- Ja as useOgcCollectionDetail,
2087
- le as useOgcCollections,
2088
- Ha as useOgcFeatures,
2089
- be as useOgcQueryables,
2090
- vi as validateMapConfig
2091
+ Ua as not,
2092
+ Va as or,
2093
+ Ga as resolvePropertyDisplay,
2094
+ xe as safeValidateMapConfig,
2095
+ _a as serializeCql2,
2096
+ Qa as tAfter,
2097
+ za as tBefore,
2098
+ Wa as tDuring,
2099
+ Me as toAvailableProperties,
2100
+ Ja as useCsvExport,
2101
+ Ha as useOgcCollectionDetail,
2102
+ ue as useOgcCollections,
2103
+ Ka as useOgcFeatures,
2104
+ ge as useOgcQueryables,
2105
+ wi as validateMapConfig
2091
2106
  };