@phila/layerboard 3.0.0-beta.1 → 3.0.0-beta.10

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/index.mjs CHANGED
@@ -1,115 +1,115 @@
1
- import { defineComponent as we, ref as $, watch as xe, computed as R, onMounted as Ze, onUnmounted as Lt, createElementBlock as L, openBlock as f, createVNode as ee, unref as _, withCtx as Ne, createBlock as X, createCommentVNode as I, Fragment as ie, renderList as re, useAttrs as Ft, toRef as Mt, normalizeClass as ne, createElementVNode as F, toDisplayString as j, withDirectives as St, mergeProps as ot, vModelDynamic as Et, createTextVNode as he, normalizeProps as dt, guardReactiveProps as ft, renderSlot as se, withModifiers as zt, normalizeStyle as Y, readonly as V, provide as U, resolveComponent as _t, vShow as It } from "vue";
2
- import { Map as Ot, DrawTool as Rt, RasterLayer as pt, CircleLayer as yt, FillLayer as Dt, LineLayer as et, MapMarker as At, MapPopup as Nt } from "@phila/phila-ui-map-core";
3
- import { cn as nt, Icon as me, BaseLink as Zt, ActionContent as gt } from "@phila/phila-ui-core";
4
- function Ue(e, n, o = {}) {
5
- const t = { type: "Feature" };
6
- return (o.id === 0 || o.id) && (t.id = o.id), o.bbox && (t.bbox = o.bbox), t.properties = n || {}, t.geometry = e, t;
1
+ import { defineComponent as Se, ref as C, watch as Me, computed as I, onMounted as He, onUnmounted as Pt, createElementBlock as m, openBlock as d, createVNode as K, unref as O, withCtx as Be, createBlock as X, createCommentVNode as z, Fragment as ee, renderList as le, useAttrs as Tt, toRef as zt, normalizeClass as te, createElementVNode as x, toDisplayString as W, renderSlot as ce, withDirectives as _t, mergeProps as ut, vModelDynamic as Ft, createTextVNode as me, normalizeProps as ht, guardReactiveProps as mt, withModifiers as Ot, normalizeStyle as H, readonly as j, provide as U, onBeforeUnmount as It, nextTick as Ze, useId as vt, resolveComponent as Rt, vShow as Dt } from "vue";
2
+ import { Map as Zt, DrawTool as Bt, RasterLayer as bt, CircleLayer as wt, FillLayer as Nt, LineLayer as st, MapMarker as At, MapPopup as Vt } from "@phila/phila-ui-map-core";
3
+ import { cn as dt, Icon as ge, BaseLink as Ut, ActionContent as Lt } from "@phila/phila-ui-core";
4
+ function Ke(e, n, t = {}) {
5
+ const o = { type: "Feature" };
6
+ return (t.id === 0 || t.id) && (o.id = t.id), t.bbox && (o.bbox = t.bbox), o.properties = n || {}, o.geometry = e, o;
7
7
  }
8
- function Bt(e, n, o = {}) {
9
- for (const l of e) {
10
- if (l.length < 4)
8
+ function Wt(e, n, t = {}) {
9
+ for (const a of e) {
10
+ if (a.length < 4)
11
11
  throw new Error(
12
12
  "Each LinearRing of a Polygon must have 4 or more Positions."
13
13
  );
14
- if (l[l.length - 1].length !== l[0].length)
14
+ if (a[a.length - 1].length !== a[0].length)
15
15
  throw new Error("First and last Position are not equivalent.");
16
- for (let a = 0; a < l[l.length - 1].length; a++)
17
- if (l[l.length - 1][a] !== l[0][a])
16
+ for (let l = 0; l < a[a.length - 1].length; l++)
17
+ if (a[a.length - 1][l] !== a[0][l])
18
18
  throw new Error("First and last Position are not equivalent.");
19
19
  }
20
- return Ue({
20
+ return Ke({
21
21
  type: "Polygon",
22
22
  coordinates: e
23
- }, n, o);
23
+ }, n, t);
24
24
  }
25
- function Wt(e, n, o = {}) {
25
+ function jt(e, n, t = {}) {
26
26
  if (e.length < 2)
27
27
  throw new Error("coordinates must be an array of two or more positions");
28
- return Ue({
28
+ return Ke({
29
29
  type: "LineString",
30
30
  coordinates: e
31
- }, n, o);
31
+ }, n, t);
32
32
  }
33
- function Ut(e, n, o = {}) {
34
- return Ue({
33
+ function qt(e, n, t = {}) {
34
+ return Ke({
35
35
  type: "MultiLineString",
36
36
  coordinates: e
37
- }, n, o);
37
+ }, n, t);
38
38
  }
39
- function Vt(e, n, o = {}) {
40
- return Ue({
39
+ function Gt(e, n, t = {}) {
40
+ return Ke({
41
41
  type: "MultiPolygon",
42
42
  coordinates: e
43
- }, n, o);
43
+ }, n, t);
44
44
  }
45
- function jt(e) {
45
+ function Ht(e) {
46
46
  return e.type === "Feature" ? e.geometry : e;
47
47
  }
48
- function qt(e, n, o) {
49
- var t = e.length, l = Te(e[0], n), a = [], c, p, d;
50
- let S, y;
51
- for (o || (o = []), c = 1; c < t; c++) {
52
- for (S = e[c - 1], y = e[c], p = d = Te(y, n); ; )
53
- if (l | p) {
54
- if (l & p)
48
+ function Jt(e, n, t) {
49
+ var o = e.length, a = Te(e[0], n), l = [], u, b, y;
50
+ let P, v;
51
+ for (t || (t = []), u = 1; u < o; u++) {
52
+ for (P = e[u - 1], v = e[u], b = y = Te(v, n); ; )
53
+ if (a | b) {
54
+ if (a & b)
55
55
  break;
56
- l ? (S = it(S, y, l, n), l = Te(S, n)) : (y = it(S, y, p, n), p = Te(y, n));
56
+ a ? (P = ft(P, v, a, n), a = Te(P, n)) : (v = ft(P, v, b, n), b = Te(v, n));
57
57
  } else {
58
- a.push(S), p !== d ? (a.push(y), c < t - 1 && (o.push(a), a = [])) : c === t - 1 && a.push(y);
58
+ l.push(P), b !== y ? (l.push(v), u < o - 1 && (t.push(l), l = [])) : u === o - 1 && l.push(v);
59
59
  break;
60
60
  }
61
- l = d;
61
+ a = y;
62
62
  }
63
- return a.length && o.push(a), o;
63
+ return l.length && t.push(l), t;
64
64
  }
65
- function Gt(e, n) {
66
- var o, t, l, a, c, p, d;
67
- for (t = 1; t <= 8; t *= 2) {
68
- for (o = [], l = e[e.length - 1], a = !(Te(l, n) & t), c = 0; c < e.length; c++)
69
- p = e[c], d = !(Te(p, n) & t), d !== a && o.push(it(l, p, t, n)), d && o.push(p), l = p, a = d;
70
- if (e = o, !e.length) break;
65
+ function Kt(e, n) {
66
+ var t, o, a, l, u, b, y;
67
+ for (o = 1; o <= 8; o *= 2) {
68
+ for (t = [], a = e[e.length - 1], l = !(Te(a, n) & o), u = 0; u < e.length; u++)
69
+ b = e[u], y = !(Te(b, n) & o), y !== l && t.push(ft(a, b, o, n)), y && t.push(b), a = b, l = y;
70
+ if (e = t, !e.length) break;
71
71
  }
72
- return o;
72
+ return t;
73
73
  }
74
- function it(e, n, o, t) {
75
- return o & 8 ? [e[0] + (n[0] - e[0]) * (t[3] - e[1]) / (n[1] - e[1]), t[3]] : o & 4 ? [e[0] + (n[0] - e[0]) * (t[1] - e[1]) / (n[1] - e[1]), t[1]] : o & 2 ? [t[2], e[1] + (n[1] - e[1]) * (t[2] - e[0]) / (n[0] - e[0])] : o & 1 ? [t[0], e[1] + (n[1] - e[1]) * (t[0] - e[0]) / (n[0] - e[0])] : null;
74
+ function ft(e, n, t, o) {
75
+ return t & 8 ? [e[0] + (n[0] - e[0]) * (o[3] - e[1]) / (n[1] - e[1]), o[3]] : t & 4 ? [e[0] + (n[0] - e[0]) * (o[1] - e[1]) / (n[1] - e[1]), o[1]] : t & 2 ? [o[2], e[1] + (n[1] - e[1]) * (o[2] - e[0]) / (n[0] - e[0])] : t & 1 ? [o[0], e[1] + (n[1] - e[1]) * (o[0] - e[0]) / (n[0] - e[0])] : null;
76
76
  }
77
77
  function Te(e, n) {
78
- var o = 0;
79
- return e[0] < n[0] ? o |= 1 : e[0] > n[2] && (o |= 2), e[1] < n[1] ? o |= 4 : e[1] > n[3] && (o |= 8), o;
78
+ var t = 0;
79
+ return e[0] < n[0] ? t |= 1 : e[0] > n[2] && (t |= 2), e[1] < n[1] ? t |= 4 : e[1] > n[3] && (t |= 8), t;
80
80
  }
81
- function Ht(e, n) {
82
- const o = jt(e), t = o.type, l = e.type === "Feature" ? e.properties : {};
83
- let a = o.coordinates;
84
- switch (t) {
81
+ function Qt(e, n) {
82
+ const t = Ht(e), o = t.type, a = e.type === "Feature" ? e.properties : {};
83
+ let l = t.coordinates;
84
+ switch (o) {
85
85
  case "LineString":
86
86
  case "MultiLineString": {
87
- const c = [];
88
- return t === "LineString" && (a = [a]), a.forEach((p) => {
89
- qt(p, n, c);
90
- }), c.length === 1 ? Wt(c[0], l) : Ut(c, l);
87
+ const u = [];
88
+ return o === "LineString" && (l = [l]), l.forEach((b) => {
89
+ Jt(b, n, u);
90
+ }), u.length === 1 ? jt(u[0], a) : qt(u, a);
91
91
  }
92
92
  case "Polygon":
93
- return Bt(mt(a, n), l);
93
+ return Wt(St(l, n), a);
94
94
  case "MultiPolygon":
95
- return Vt(
96
- a.map((c) => mt(c, n)),
97
- l
95
+ return Gt(
96
+ l.map((u) => St(u, n)),
97
+ a
98
98
  );
99
99
  default:
100
- throw new Error("geometry " + t + " not supported");
100
+ throw new Error("geometry " + o + " not supported");
101
101
  }
102
102
  }
103
- function mt(e, n) {
104
- const o = [];
105
- for (const t of e) {
106
- const l = Gt(t, n);
107
- l.length > 0 && ((l[0][0] !== l[l.length - 1][0] || l[0][1] !== l[l.length - 1][1]) && l.push(l[0]), l.length >= 4 && o.push(l));
103
+ function St(e, n) {
104
+ const t = [];
105
+ for (const o of e) {
106
+ const a = Kt(o, n);
107
+ a.length > 0 && ((a[0][0] !== a[a.length - 1][0] || a[0][1] !== a[a.length - 1][1]) && a.push(a[0]), a.length >= 4 && t.push(a));
108
108
  }
109
- return o;
109
+ return t;
110
110
  }
111
- var Jt = Ht;
112
- const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
111
+ var Xt = Qt;
112
+ const Yt = { class: "map-panel" }, eo = /* @__PURE__ */ Se({
113
113
  __name: "MapPanel",
114
114
  props: {
115
115
  visibleLayers: {},
@@ -132,168 +132,165 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
132
132
  },
133
133
  emits: ["zoom", "layerLoading", "layerError"],
134
134
  setup(e, { emit: n }) {
135
- const o = e, t = n, l = $(null), a = $(null), c = $(0);
136
- function p(i) {
137
- t("zoom", i), a.value && (c.value = d(a.value));
138
- }
139
- function d(i) {
140
- const u = i.getZoom(), x = i.getCenter().lat, k = 559082264028e-3, T = x * Math.PI / 180;
141
- return k * Math.cos(T) / Math.pow(2, u);
142
- }
143
- const S = $({}), y = $(null), h = $(/* @__PURE__ */ new Set()), s = ["fema-100-year-floodplain", "fema-500-year-floodplain"];
144
- async function v(i, u, r, x) {
145
- const k = encodeURIComponent(x || "1=1"), T = JSON.stringify({
146
- xmin: u.west,
147
- ymin: u.south,
148
- xmax: u.east,
149
- ymax: u.north,
135
+ const t = e, o = n, a = C(null), l = C(null), u = C(0);
136
+ function b(i) {
137
+ o("zoom", i), l.value && (u.value = y(l.value));
138
+ }
139
+ function y(i) {
140
+ const p = i.getZoom(), E = i.getCenter().lat, _ = 559082264028e-3, M = E * Math.PI / 180;
141
+ return _ * Math.cos(M) / Math.pow(2, p);
142
+ }
143
+ const P = C({}), v = C(null), S = C(/* @__PURE__ */ new Set()), r = ["fema-100-year-floodplain", "fema-500-year-floodplain"];
144
+ async function h(i, p, s, E) {
145
+ const _ = encodeURIComponent(E || "1=1"), M = JSON.stringify({
146
+ xmin: p.west,
147
+ ymin: p.south,
148
+ xmax: p.east,
149
+ ymax: p.north,
150
150
  spatialReference: { wkid: 4326 }
151
- }), O = 2e3;
152
- let B = 0, W = [], K = !0;
153
- for (; K; ) {
154
- const G = `${i}/query?where=${k}&geometry=${encodeURIComponent(T)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${O}&resultOffset=${B}&f=geojson`, A = await fetch(G);
155
- if (!A.ok)
156
- throw new Error(`HTTP ${A.status}: ${A.statusText}`);
157
- const H = await A.json();
158
- H.features && H.features.length > 0 ? (W = W.concat(H.features), B += H.features.length, K = H.features.length === O) : K = !1;
151
+ }), R = 2e3;
152
+ let N = 0, V = [], Q = !0;
153
+ for (; Q; ) {
154
+ const G = `${i}/query?where=${_}&geometry=${encodeURIComponent(M)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&resultRecordCount=${R}&resultOffset=${N}&f=geojson`, Z = await fetch(G);
155
+ if (!Z.ok)
156
+ throw new Error(`HTTP ${Z.status}: ${Z.statusText}`);
157
+ const J = await Z.json();
158
+ J.features && J.features.length > 0 ? (V = V.concat(J.features), N += J.features.length, Q = J.features.length === R) : Q = !1;
159
159
  }
160
- if (s.includes(r)) {
161
- const G = [u.west, u.south, u.east, u.north];
162
- W = W.map((A) => {
163
- if (A.geometry && (A.geometry.type === "Polygon" || A.geometry.type === "MultiPolygon"))
160
+ if (r.includes(s)) {
161
+ const G = [p.west, p.south, p.east, p.north];
162
+ V = V.map((Z) => {
163
+ if (Z.geometry && (Z.geometry.type === "Polygon" || Z.geometry.type === "MultiPolygon"))
164
164
  try {
165
- return Jt(A, G);
166
- } catch (H) {
167
- return console.warn(`Failed to clip feature in ${r}:`, H), A;
165
+ return Xt(Z, G);
166
+ } catch {
167
+ return Z;
168
168
  }
169
- return A;
169
+ return Z;
170
170
  });
171
171
  }
172
172
  return {
173
173
  type: "FeatureCollection",
174
- features: W
174
+ features: V
175
175
  };
176
176
  }
177
- async function E(i, u) {
178
- const r = u.map(async (x) => {
179
- const k = o.layerList.find((T) => T.config.id === x)?.config;
180
- if (k) {
181
- t("layerLoading", x, !0);
177
+ async function w(i, p) {
178
+ const s = p.map(async (E) => {
179
+ const _ = t.layerList.find((M) => M.config.id === E)?.config;
180
+ if (_) {
181
+ o("layerLoading", E, !0);
182
182
  try {
183
- const T = await v(k.url, i, x, k.where);
184
- S.value = { ...S.value, [x]: T }, t("layerError", x, null);
185
- } catch (T) {
186
- const O = T instanceof Error ? T.message : "Failed to load";
187
- t("layerError", x, O), console.error(`Error loading ${x}:`, T);
183
+ const M = await h(_.url, i, E, _.where);
184
+ P.value = { ...P.value, [E]: M }, o("layerError", E, null);
185
+ } catch (M) {
186
+ const R = M instanceof Error ? M.message : "Failed to load";
187
+ o("layerError", E, R);
188
188
  } finally {
189
- t("layerLoading", x, !1);
189
+ o("layerLoading", E, !1);
190
190
  }
191
191
  }
192
192
  });
193
- await Promise.all(r);
194
- }
195
- async function m(i) {
196
- const u = [...o.visibleLayers];
197
- await E(i, u);
198
- }
199
- function C(i) {
200
- y.value = i.bounds, m(i.bounds);
201
- }
202
- function g(i) {
203
- a.value = i;
204
- const u = i.getBounds();
205
- y.value = {
206
- west: u.getWest(),
207
- south: u.getSouth(),
208
- east: u.getEast(),
209
- north: u.getNorth()
193
+ await Promise.all(s);
194
+ }
195
+ async function g(i) {
196
+ const p = [...t.visibleLayers];
197
+ await w(i, p);
198
+ }
199
+ function f(i) {
200
+ v.value = i.bounds, g(i.bounds);
201
+ }
202
+ function c(i) {
203
+ l.value = i;
204
+ const p = i.getBounds();
205
+ v.value = {
206
+ west: p.getWest(),
207
+ south: p.getSouth(),
208
+ east: p.getEast(),
209
+ north: p.getNorth()
210
210
  };
211
- const r = i.getZoom();
212
- t("zoom", r), c.value = d(i), m(y.value);
211
+ const s = i.getZoom();
212
+ o("zoom", s), u.value = y(i), g(v.value);
213
213
  }
214
- xe(
215
- () => o.visibleLayers.size,
214
+ Me(
215
+ () => t.visibleLayers.size,
216
216
  async () => {
217
- if (oe.value.length > 0 && te(), y.value) {
218
- const i = new Set(o.visibleLayers), u = [...i].filter(
219
- (r) => !h.value.has(r)
217
+ if (oe.value.length > 0 && Ce(), v.value) {
218
+ const i = new Set(t.visibleLayers), p = [...i].filter(
219
+ (s) => !S.value.has(s)
220
220
  );
221
- h.value = new Set(i), u.length > 0 && await E(y.value, u);
221
+ S.value = new Set(i), p.length > 0 && await w(v.value, p);
222
222
  }
223
223
  }
224
224
  );
225
- function w(i) {
226
- return o.visibleLayers.has(i);
227
- }
228
- function z(i) {
229
- return !!S.value[i.id];
230
- }
231
- const M = R(
232
- () => o.layerList.filter((i) => i.config.type === "circle" && w(i.config.id) && z(i.config)).map((i) => i.config)
233
- ), N = R(
234
- () => o.layerList.filter((i) => i.config.type === "fill" && w(i.config.id) && z(i.config)).map((i) => i.config)
235
- ), q = R(
236
- () => o.layerList.filter((i) => i.config.type === "fill" && i.config.outlinePaint && w(i.config.id) && z(i.config)).map((i) => i.config)
237
- ), ce = R(
238
- () => o.layerList.filter((i) => i.config.type === "line" && w(i.config.id) && z(i.config)).map((i) => i.config)
225
+ function L(i) {
226
+ return t.visibleLayers.has(i);
227
+ }
228
+ function F(i) {
229
+ return !!P.value[i.id];
230
+ }
231
+ const T = I(
232
+ () => t.layerList.filter((i) => i.config.type === "circle" && L(i.config.id) && F(i.config)).map((i) => i.config)
233
+ ), B = I(
234
+ () => t.layerList.filter((i) => i.config.type === "fill" && L(i.config.id) && F(i.config)).map((i) => i.config)
235
+ ), q = I(
236
+ () => t.layerList.filter((i) => i.config.type === "fill" && i.config.outlinePaint && L(i.config.id) && F(i.config)).map((i) => i.config)
237
+ ), fe = I(
238
+ () => t.layerList.filter((i) => i.config.type === "line" && L(i.config.id) && F(i.config)).map((i) => i.config)
239
239
  );
240
- function Le(i) {
241
- return o.visibleTiledLayers?.has(i) ?? !1;
240
+ function $e(i) {
241
+ return t.visibleTiledLayers?.has(i) ?? !1;
242
242
  }
243
- function Se(i) {
244
- return o.tiledLayerOpacities?.[i] ?? 1;
243
+ function xe(i) {
244
+ return t.tiledLayerOpacities?.[i] ?? 1;
245
245
  }
246
- function je(i) {
246
+ function Xe(i) {
247
247
  return `${i.replace(/\/$/, "")}/tile/{z}/{y}/{x}`;
248
248
  }
249
- function qe(i) {
249
+ function Ye(i) {
250
250
  return {
251
251
  type: "raster",
252
- tiles: [je(i.url)],
252
+ tiles: [Xe(i.url)],
253
253
  tileSize: 256,
254
254
  attribution: i.attribution || ""
255
255
  };
256
256
  }
257
- const Me = $({}), Ie = $(/* @__PURE__ */ new Set());
258
- async function Ee(i) {
259
- if (!Ie.value.has(i.id)) {
260
- Ie.value.add(i.id);
257
+ const Oe = C({}), Ae = C(/* @__PURE__ */ new Set());
258
+ async function Ie(i) {
259
+ if (!Ae.value.has(i.id)) {
260
+ Ae.value.add(i.id);
261
261
  try {
262
- const u = i.url.replace(/\/$/, ""), r = await fetch(`${u}?f=json`);
263
- if (!r.ok) {
264
- console.warn(`[MapPanel] Failed to fetch metadata for ${i.id}: ${r.status}`);
262
+ const p = i.url.replace(/\/$/, ""), s = await fetch(`${p}?f=json`);
263
+ if (!s.ok)
265
264
  return;
266
- }
267
- const x = await r.json();
268
- let k = x.minScale || 0, T = x.maxScale || 0;
269
- if (x.layers && x.layers.length > 0)
270
- for (const O of x.layers)
271
- O.maxScale && O.maxScale > 0 && (T === 0 || O.maxScale < T) && (T = O.maxScale);
272
- T === 0 && (T = 72e3), Me.value = {
273
- ...Me.value,
274
- [i.id]: { minScale: k, maxScale: T }
275
- }, console.log(`[MapPanel] Fetched scale metadata for ${i.id}: minScale=${k}, maxScale=${T}`);
276
- } catch (u) {
277
- console.warn(`[MapPanel] Error fetching metadata for ${i.id}:`, u);
265
+ const E = await s.json();
266
+ let _ = E.minScale || 0, M = E.maxScale || 0;
267
+ if (E.layers && E.layers.length > 0)
268
+ for (const R of E.layers)
269
+ R.maxScale && R.maxScale > 0 && (M === 0 || R.maxScale < M) && (M = R.maxScale);
270
+ M === 0 && (M = 72e3), Oe.value = {
271
+ ...Oe.value,
272
+ [i.id]: { minScale: _, maxScale: M }
273
+ };
274
+ } catch {
278
275
  }
279
276
  }
280
277
  }
281
- Ze(() => {
282
- if (o.tiledLayers)
283
- for (const i of o.tiledLayers)
284
- i.scaleBasedRendering && Ee(i);
278
+ He(() => {
279
+ if (t.tiledLayers)
280
+ for (const i of t.tiledLayers)
281
+ i.scaleBasedRendering && Ie(i);
285
282
  });
286
- function Oe(i) {
283
+ function Ve(i) {
287
284
  if (!i.scaleBasedRendering)
288
285
  return "tiled";
289
- const u = Me.value[i.id];
290
- if (!u)
286
+ const p = Oe.value[i.id];
287
+ if (!p)
291
288
  return "tiled";
292
- const r = c.value;
293
- return r === 0 || r > u.maxScale ? "tiled" : "dynamic";
289
+ const s = u.value;
290
+ return s === 0 || s > p.maxScale ? "tiled" : "dynamic";
294
291
  }
295
- const Ge = R(() => o.tiledLayers ? o.tiledLayers.filter((i) => Le(i.id) ? i.scaleBasedRendering ? Oe(i) === "tiled" : !0 : !1) : []), He = R(() => o.tiledLayers ? o.tiledLayers.filter((i) => Le(i.id) && i.scaleBasedRendering ? Oe(i) === "dynamic" : !1) : []);
296
- function Ce(i) {
292
+ const et = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => $e(i.id) ? i.scaleBasedRendering ? Ve(i) === "tiled" : !0 : !1) : []), tt = I(() => t.tiledLayers ? t.tiledLayers.filter((i) => $e(i.id) && i.scaleBasedRendering ? Ve(i) === "dynamic" : !1) : []);
293
+ function Pe(i) {
297
294
  return {
298
295
  type: "raster",
299
296
  tiles: [`${i.url.replace(/\/$/, "")}/export?bbox={bbox-epsg-3857}&bboxSR=3857&imageSR=3857&size=256,256&format=png32&transparent=true&f=image`],
@@ -301,291 +298,291 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
301
298
  attribution: i.attribution || ""
302
299
  };
303
300
  }
304
- function de(i) {
305
- return { type: "geojson", data: S.value[i.id] };
301
+ function ve(i) {
302
+ return { type: "geojson", data: P.value[i.id] };
306
303
  }
307
- function ke(i) {
308
- return o.layerOpacities[i] ?? 1;
304
+ function _e(i) {
305
+ return t.layerOpacities[i] ?? 1;
309
306
  }
310
- function fe(i) {
311
- const u = ke(i.id), r = i.type === "circle" ? "circle-opacity" : i.type === "fill" ? "fill-opacity" : "line-opacity";
307
+ function be(i) {
308
+ const p = _e(i.id), s = i.type === "circle" ? "circle-opacity" : i.type === "fill" ? "fill-opacity" : "line-opacity";
312
309
  if (i.type === "fill" && i.paint["fill-opacity"] === 0)
313
310
  return { ...i.paint, "fill-opacity": 0 };
314
- const x = i.type === "circle" ? "circle-color" : i.type === "fill" ? "fill-color" : "line-color", k = { ...i.paint }, T = k[x], O = k[r] === 1, B = typeof T == "string" && T.startsWith("rgba(");
315
- if (O && B) {
316
- if (u === 1)
317
- return k;
311
+ const E = i.type === "circle" ? "circle-color" : i.type === "fill" ? "fill-color" : "line-color", _ = { ...i.paint }, M = _[E], R = _[s] === 1, N = typeof M == "string" && M.startsWith("rgba(");
312
+ if (R && N) {
313
+ if (p === 1)
314
+ return _;
318
315
  {
319
- const W = T.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
320
- if (W && W[4]) {
321
- const [, K, G, A, H] = W, Ye = parseFloat(H) * u;
322
- k[x] = `rgba(${K}, ${G}, ${A}, ${Ye})`, k[r] = 1;
316
+ const V = M.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
317
+ if (V && V[4]) {
318
+ const [, Q, G, Z, J] = V, rt = parseFloat(J) * p;
319
+ _[E] = `rgba(${Q}, ${G}, ${Z}, ${rt})`, _[s] = 1;
323
320
  }
324
- return k;
321
+ return _;
325
322
  }
326
323
  }
327
- if (B) {
328
- const W = T.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
329
- if (W) {
330
- const [, K, G, A] = W;
331
- k[x] = `rgb(${K}, ${G}, ${A})`;
324
+ if (N) {
325
+ const V = M.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);
326
+ if (V) {
327
+ const [, Q, G, Z] = V;
328
+ _[E] = `rgb(${Q}, ${G}, ${Z})`;
332
329
  }
333
330
  }
334
- return k[r] = u, k;
331
+ return _[s] = p, _;
335
332
  }
336
- function Je(i) {
337
- const u = ke(i.id);
338
- return { ...i.outlinePaint, "line-opacity": u };
333
+ function ot(i) {
334
+ const p = _e(i.id);
335
+ return { ...i.outlinePaint, "line-opacity": p };
339
336
  }
340
- const oe = $([]), pe = $(null), J = $(0);
341
- function $e(i) {
342
- const u = i.replace(/-outline$/, "");
343
- return o.layerList.find((x) => x.config.id === u)?.config;
337
+ const oe = C([]), we = C(null), ne = C(0);
338
+ function ke(i) {
339
+ const p = i.replace(/-outline$/, "");
340
+ return t.layerList.find((E) => E.config.id === p)?.config;
344
341
  }
345
- function ve(i, u) {
346
- return i.replace(/\{([^}]+)\}/g, (r, x) => {
347
- const k = u[x];
348
- return k == null ? "" : String(k);
342
+ function nt(i, p) {
343
+ return i.replace(/\{([^}]+)\}/g, (s, E) => {
344
+ const _ = p[E];
345
+ return _ == null ? "" : String(_);
349
346
  });
350
347
  }
351
- function Qe(i, u) {
348
+ function Ue(i, p) {
352
349
  if (i == null) return "-";
353
- if (u?.dateFormat && typeof i == "number") {
354
- const r = new Date(i);
355
- switch (u.dateFormat) {
350
+ if (p?.dateFormat && typeof i == "number") {
351
+ const s = new Date(i);
352
+ switch (p.dateFormat) {
356
353
  case "shortDateShortTime":
357
- return r.toLocaleString();
354
+ return s.toLocaleString();
358
355
  case "longMonthDayYear":
359
- return r.toLocaleDateString(void 0, { month: "long", day: "numeric", year: "numeric" });
356
+ return s.toLocaleDateString(void 0, { month: "long", day: "numeric", year: "numeric" });
360
357
  case "shortDate":
361
- return r.toLocaleDateString();
358
+ return s.toLocaleDateString();
362
359
  case "longDate":
363
- return r.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric", year: "numeric" });
360
+ return s.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric", year: "numeric" });
364
361
  default:
365
- return r.toLocaleDateString();
362
+ return s.toLocaleDateString();
366
363
  }
367
364
  }
368
365
  if (typeof i == "number") {
369
- if (i > 1e12 && !u)
366
+ if (i > 1e12 && !p)
370
367
  return new Date(i).toLocaleDateString();
371
- const r = u?.places, x = u?.digitSeparator ?? !0;
372
- if (r !== void 0) {
373
- const k = i.toFixed(r);
374
- if (x) {
375
- const T = k.split("."), O = T[0] || "0", B = T[1], W = O.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
376
- return B ? `${W}.${B}` : W;
368
+ const s = p?.places, E = p?.digitSeparator ?? !0;
369
+ if (s !== void 0) {
370
+ const _ = i.toFixed(s);
371
+ if (E) {
372
+ const M = _.split("."), R = M[0] || "0", N = M[1], V = R.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
373
+ return N ? `${V}.${N}` : V;
377
374
  }
378
- return k;
375
+ return _;
379
376
  }
380
- return x ? i.toLocaleString() : String(i);
377
+ return E ? i.toLocaleString() : String(i);
381
378
  }
382
379
  return String(i);
383
380
  }
384
381
  function Re(i) {
385
- const u = /* @__PURE__ */ new Set();
386
- return i.filter((r) => {
387
- const k = `${r.layer.id.replace(/-outline$/, "")}:${JSON.stringify(r.properties)}`;
388
- return u.has(k) ? !1 : (u.add(k), !0);
382
+ const p = /* @__PURE__ */ new Set();
383
+ return i.filter((s) => {
384
+ const _ = `${s.layer.id.replace(/-outline$/, "")}:${JSON.stringify(s.properties)}`;
385
+ return p.has(_) ? !1 : (p.add(_), !0);
389
386
  });
390
387
  }
391
- function ye(i, u) {
392
- const r = /* @__PURE__ */ new Map();
393
- return u.forEach((x, k) => {
394
- r.set(x.id, k);
395
- }), i.sort((x, k) => {
396
- const T = x.layer.id.replace(/-outline$/, ""), O = k.layer.id.replace(/-outline$/, ""), B = r.get(T) ?? -1;
397
- return (r.get(O) ?? -1) - B;
388
+ function We(i, p) {
389
+ const s = /* @__PURE__ */ new Map();
390
+ return p.forEach((E, _) => {
391
+ s.set(E.id, _);
392
+ }), i.sort((E, _) => {
393
+ const M = E.layer.id.replace(/-outline$/, ""), R = _.layer.id.replace(/-outline$/, ""), N = s.get(M) ?? -1;
394
+ return (s.get(R) ?? -1) - N;
398
395
  });
399
396
  }
400
- function Pe(i) {
401
- const u = a.value;
402
- if (!u) return;
403
- const r = [];
404
- o.layerList.forEach((G) => {
405
- const A = G.config;
406
- o.visibleLayers.has(A.id) && (r.push(A.id), A.outlinePaint && r.push(`${A.id}-outline`));
397
+ function re(i) {
398
+ const p = l.value;
399
+ if (!p) return;
400
+ const s = [];
401
+ t.layerList.forEach((G) => {
402
+ const Z = G.config;
403
+ t.visibleLayers.has(Z.id) && (s.push(Z.id), Z.outlinePaint && s.push(`${Z.id}-outline`));
407
404
  });
408
- const x = u.project([i.lngLat.lng, i.lngLat.lat]), k = u.queryRenderedFeatures(x, {
409
- layers: r
405
+ const E = p.project([i.lngLat.lng, i.lngLat.lat]), _ = p.queryRenderedFeatures(E, {
406
+ layers: s
410
407
  });
411
- if (k.length === 0) return;
412
- const T = Re(k), O = o.layerList.map((G) => G.config), B = ye(T, O), W = B.map((G) => {
413
- const A = G.layer.id.replace(/-outline$/, ""), H = $e(A);
414
- return H ? {
415
- layerId: H.id,
416
- layerTitle: H.title,
408
+ if (_.length === 0) return;
409
+ const M = Re(_), R = t.layerList.map((G) => G.config), N = We(M, R), V = N.map((G) => {
410
+ const Z = G.layer.id.replace(/-outline$/, ""), J = ke(Z);
411
+ return J ? {
412
+ layerId: J.id,
413
+ layerTitle: J.title,
417
414
  properties: G.properties || {},
418
- popupConfig: H.popup
415
+ popupConfig: J.popup
419
416
  } : null;
420
417
  }).filter((G) => G !== null);
421
- if (W.length === 0) return;
422
- oe.value = W, J.value = 0, pe.value = [i.lngLat.lng, i.lngLat.lat];
423
- const K = B[0];
424
- if (K && K.geometry) {
425
- const G = K.layer.id.replace(/-outline$/, ""), A = $e(G);
426
- if (A) {
427
- const H = rt(K.geometry), Ye = st(A.id, A.type);
428
- ge.value = {
429
- geometry: K.geometry,
430
- geometryType: H,
431
- layerId: A.id,
432
- properties: K.properties || {},
433
- originalStyle: Ye
418
+ if (V.length === 0) return;
419
+ oe.value = V, ne.value = 0, we.value = [i.lngLat.lng, i.lngLat.lat];
420
+ const Q = N[0];
421
+ if (Q && Q.geometry) {
422
+ const G = Q.layer.id.replace(/-outline$/, ""), Z = ke(G);
423
+ if (Z) {
424
+ const J = De(Q.geometry), rt = k(Z.id, Z.type);
425
+ de.value = {
426
+ geometry: Q.geometry,
427
+ geometryType: J,
428
+ layerId: Z.id,
429
+ properties: Q.properties || {},
430
+ originalStyle: rt
434
431
  };
435
432
  }
436
433
  }
437
434
  }
438
- function te() {
439
- oe.value = [], pe.value = null, J.value = 0, ge.value = null;
435
+ function Ce() {
436
+ oe.value = [], we.value = null, ne.value = 0, de.value = null;
440
437
  }
441
- function be(i) {
438
+ function se(i) {
442
439
  if (oe.value.length === 0) return;
443
- const u = i.target;
444
- if (!(u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.isContentEditable))
440
+ const p = i.target;
441
+ if (!(p.tagName === "INPUT" || p.tagName === "TEXTAREA" || p.isContentEditable))
445
442
  switch (i.key) {
446
443
  case "ArrowLeft":
447
444
  case "ArrowUp":
448
- i.preventDefault(), De();
445
+ i.preventDefault(), Ee();
449
446
  break;
450
447
  case "ArrowRight":
451
448
  case "ArrowDown":
452
- i.preventDefault(), le();
449
+ i.preventDefault(), je();
453
450
  break;
454
451
  case "Escape":
455
- i.preventDefault(), te();
452
+ i.preventDefault(), Ce();
456
453
  break;
457
454
  }
458
455
  }
459
- Ze(() => {
460
- window.addEventListener("keydown", be);
461
- }), Lt(() => {
462
- window.removeEventListener("keydown", be);
456
+ He(() => {
457
+ window.addEventListener("keydown", se);
458
+ }), Pt(() => {
459
+ window.removeEventListener("keydown", se);
463
460
  });
464
- function le() {
461
+ function je() {
465
462
  const i = oe.value.length;
466
- i <= 1 || (J.value = (J.value + 1) % i);
463
+ i <= 1 || (ne.value = (ne.value + 1) % i);
467
464
  }
468
- function De() {
465
+ function Ee() {
469
466
  const i = oe.value.length;
470
- i <= 1 || (J.value = (J.value - 1 + i) % i);
467
+ i <= 1 || (ne.value = (ne.value - 1 + i) % i);
471
468
  }
472
- const b = R(() => oe.value.length === 0 ? null : oe.value[J.value]), P = R(() => {
473
- const i = b.value;
474
- return !i || !i.popupConfig ? i?.layerTitle || "" : ve(i.popupConfig.title, i.properties);
475
- }), ae = R(() => {
476
- const i = b.value;
469
+ const ie = I(() => oe.value.length === 0 ? null : oe.value[ne.value]), it = I(() => {
470
+ const i = ie.value;
471
+ return !i || !i.popupConfig ? i?.layerTitle || "" : nt(i.popupConfig.title, i.properties);
472
+ }), pe = I(() => {
473
+ const i = ie.value;
477
474
  if (!i) return "";
478
- let u = '<div class="popup-content">';
479
- if (u += `<h3 class="popup-title">${P.value}</h3>`, i.popupConfig?.fields?.length) {
480
- u += '<table class="popup-table">';
481
- for (const r of i.popupConfig.fields) {
482
- const x = Qe(i.properties[r.field], r.format);
483
- u += `<tr><th>${r.label}</th><td>${x}</td></tr>`;
475
+ let p = '<div class="popup-content">';
476
+ if (p += `<h3 class="popup-title">${it.value}</h3>`, i.popupConfig?.fields?.length) {
477
+ p += '<table class="popup-table">';
478
+ for (const s of i.popupConfig.fields) {
479
+ const E = Ue(i.properties[s.field], s.format);
480
+ p += `<tr><th>${s.label}</th><td>${E}</td></tr>`;
484
481
  }
485
- u += "</table>";
482
+ p += "</table>";
486
483
  } else
487
- u += '<p class="popup-no-fields">No additional information available.</p>';
488
- return u += "</div>", u;
489
- }), Z = $({
484
+ p += '<p class="popup-no-fields">No additional information available.</p>';
485
+ return p += "</div>", p;
486
+ }), Le = C({
490
487
  type: "FeatureCollection",
491
488
  features: []
492
- }), Q = $({
489
+ }), ye = C({
493
490
  type: "FeatureCollection",
494
491
  features: []
495
- }), Ke = {
492
+ }), ue = {
496
493
  "circle-radius": ["get", "highlightRadius"],
497
494
  "circle-color": "#00FFFF",
498
495
  "circle-opacity": 0.8,
499
496
  "circle-stroke-width": 2,
500
497
  "circle-stroke-color": "#FFFFFF"
501
- }, Xe = {
498
+ }, at = {
502
499
  "line-width": ["get", "highlightWidth"],
503
500
  "line-color": "#00FFFF",
504
501
  "line-opacity": 0.9
505
- }, ge = $(null);
506
- function rt(i) {
502
+ }, de = C(null);
503
+ function De(i) {
507
504
  return i.type;
508
505
  }
509
- function st(i, u) {
510
- const r = $e(i);
511
- if (!r) return { radius: 5, width: 2 };
512
- const x = r.paint || {};
513
- if (u === "circle") {
514
- const k = x["circle-radius"];
515
- return typeof k == "number" ? { radius: k } : { radius: 5 };
506
+ function k(i, p) {
507
+ const s = ke(i);
508
+ if (!s) return { radius: 5, width: 2 };
509
+ const E = s.paint || {};
510
+ if (p === "circle") {
511
+ const _ = E["circle-radius"];
512
+ return typeof _ == "number" ? { radius: _ } : { radius: 5 };
516
513
  }
517
- if (u === "line" || u === "fill") {
518
- const k = x["line-width"];
519
- if (typeof k == "number")
520
- return { width: k };
521
- if (r.outlinePaint && r.outlinePaint["line-width"]) {
522
- const T = r.outlinePaint["line-width"];
523
- if (typeof T == "number")
524
- return { width: T };
514
+ if (p === "line" || p === "fill") {
515
+ const _ = E["line-width"];
516
+ if (typeof _ == "number")
517
+ return { width: _ };
518
+ if (s.outlinePaint && s.outlinePaint["line-width"]) {
519
+ const M = s.outlinePaint["line-width"];
520
+ if (typeof M == "number")
521
+ return { width: M };
525
522
  }
526
523
  return { width: 2 };
527
524
  }
528
525
  return { radius: 5, width: 2 };
529
526
  }
530
- function ct(i) {
527
+ function $(i) {
531
528
  return !i || i.length === 0 ? [] : i[0] ?? [];
532
529
  }
533
- function $t(i) {
534
- const { geometry: u, geometryType: r, originalStyle: x } = i;
535
- if (r === "Point" || r === "MultiPoint") {
536
- const T = (x.radius || 5) + 3;
530
+ function Y(i) {
531
+ const { geometry: p, geometryType: s, originalStyle: E } = i;
532
+ if (s === "Point" || s === "MultiPoint") {
533
+ const M = (E.radius || 5) + 3;
537
534
  return {
538
535
  type: "FeatureCollection",
539
536
  features: [{
540
537
  type: "Feature",
541
- geometry: u,
538
+ geometry: p,
542
539
  properties: {
543
- highlightRadius: T
540
+ highlightRadius: M
544
541
  }
545
542
  }]
546
543
  };
547
544
  }
548
- if (r === "LineString" || r === "MultiLineString") {
549
- const T = (x.width || 2) + 3;
545
+ if (s === "LineString" || s === "MultiLineString") {
546
+ const M = (E.width || 2) + 3;
550
547
  return {
551
548
  type: "FeatureCollection",
552
549
  features: [{
553
550
  type: "Feature",
554
- geometry: u,
551
+ geometry: p,
555
552
  properties: {
556
- highlightWidth: T
553
+ highlightWidth: M
557
554
  }
558
555
  }]
559
556
  };
560
557
  }
561
- if (r === "Polygon") {
562
- const k = u.coordinates, T = ct(k), B = (x.width || 2) + 3;
558
+ if (s === "Polygon") {
559
+ const _ = p.coordinates, M = $(_), N = (E.width || 2) + 3;
563
560
  return {
564
561
  type: "FeatureCollection",
565
562
  features: [{
566
563
  type: "Feature",
567
564
  geometry: {
568
565
  type: "LineString",
569
- coordinates: T
566
+ coordinates: M
570
567
  },
571
568
  properties: {
572
- highlightWidth: B
569
+ highlightWidth: N
573
570
  }
574
571
  }]
575
572
  };
576
573
  }
577
- if (r === "MultiPolygon") {
578
- const k = u.coordinates, O = (x.width || 2) + 3;
574
+ if (s === "MultiPolygon") {
575
+ const _ = p.coordinates, R = (E.width || 2) + 3;
579
576
  return {
580
577
  type: "FeatureCollection",
581
- features: k.map((W) => ({
578
+ features: _.map((V) => ({
582
579
  type: "Feature",
583
580
  geometry: {
584
581
  type: "LineString",
585
- coordinates: ct(W)
582
+ coordinates: $(V)
586
583
  },
587
584
  properties: {
588
- highlightWidth: O
585
+ highlightWidth: R
589
586
  }
590
587
  }))
591
588
  };
@@ -595,185 +592,185 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
595
592
  features: []
596
593
  };
597
594
  }
598
- function Pt(i) {
595
+ function A(i) {
599
596
  if (!i) {
600
- xt();
597
+ ae();
601
598
  return;
602
599
  }
603
- const u = $t(i);
604
- i.geometryType === "Point" || i.geometryType === "MultiPoint" ? (Z.value = u, Q.value = { type: "FeatureCollection", features: [] }) : (Q.value = u, Z.value = { type: "FeatureCollection", features: [] });
600
+ const p = Y(i);
601
+ i.geometryType === "Point" || i.geometryType === "MultiPoint" ? (Le.value = p, ye.value = { type: "FeatureCollection", features: [] }) : (ye.value = p, Le.value = { type: "FeatureCollection", features: [] });
605
602
  }
606
- function xt() {
607
- Z.value = { type: "FeatureCollection", features: [] }, Q.value = { type: "FeatureCollection", features: [] };
603
+ function ae() {
604
+ Le.value = { type: "FeatureCollection", features: [] }, ye.value = { type: "FeatureCollection", features: [] };
608
605
  }
609
- xe(ge, (i) => {
610
- Pt(i);
611
- }), xe(
612
- () => o.visibleLayers,
606
+ Me(de, (i) => {
607
+ A(i);
608
+ }), Me(
609
+ () => t.visibleLayers,
613
610
  (i) => {
614
- ge.value && !i.has(ge.value.layerId) && (ge.value = null, te());
611
+ de.value && !i.has(de.value.layerId) && (de.value = null, Ce());
615
612
  },
616
613
  { deep: !0 }
617
- ), xe(J, () => {
618
- const i = b.value;
614
+ ), Me(ne, () => {
615
+ const i = ie.value;
619
616
  if (!i) {
620
- ge.value = null;
617
+ de.value = null;
621
618
  return;
622
619
  }
623
- const u = a.value;
624
- if (!u || !pe.value) return;
625
- const r = [];
626
- o.layerList.forEach((O) => {
627
- const B = O.config;
628
- o.visibleLayers.has(B.id) && (r.push(B.id), B.outlinePaint && r.push(`${B.id}-outline`));
620
+ const p = l.value;
621
+ if (!p || !we.value) return;
622
+ const s = [];
623
+ t.layerList.forEach((R) => {
624
+ const N = R.config;
625
+ t.visibleLayers.has(N.id) && (s.push(N.id), N.outlinePaint && s.push(`${N.id}-outline`));
629
626
  });
630
- const x = u.project(pe.value), T = u.queryRenderedFeatures(x, {
631
- layers: r
632
- }).find((O) => O.layer.id.replace(/-outline$/, "") === i.layerId && JSON.stringify(O.properties) === JSON.stringify(i.properties));
633
- if (T && T.geometry) {
634
- const O = $e(i.layerId);
635
- if (O) {
636
- const B = rt(T.geometry), W = st(O.id, O.type);
637
- ge.value = {
638
- geometry: T.geometry,
639
- geometryType: B,
640
- layerId: O.id,
641
- properties: T.properties || {},
642
- originalStyle: W
627
+ const E = p.project(we.value), M = p.queryRenderedFeatures(E, {
628
+ layers: s
629
+ }).find((R) => R.layer.id.replace(/-outline$/, "") === i.layerId && JSON.stringify(R.properties) === JSON.stringify(i.properties));
630
+ if (M && M.geometry) {
631
+ const R = ke(i.layerId);
632
+ if (R) {
633
+ const N = De(M.geometry), V = k(R.id, R.type);
634
+ de.value = {
635
+ geometry: M.geometry,
636
+ geometryType: N,
637
+ layerId: R.id,
638
+ properties: M.properties || {},
639
+ originalStyle: V
643
640
  };
644
641
  }
645
642
  }
646
643
  });
647
- const ut = $(null);
648
- function Tt(i) {
649
- const [u, r] = i.geometry.coordinates;
650
- ut.value = [u, r];
644
+ const qe = C(null);
645
+ function lt(i) {
646
+ const [p, s] = i.geometry.coordinates;
647
+ qe.value = [p, s];
651
648
  }
652
- return (i, u) => (f(), L("div", Qt, [
653
- ee(_(Ot), {
649
+ return (i, p) => (d(), m("div", Yt, [
650
+ K(O(Zt), {
654
651
  ref_key: "mapRef",
655
- ref: l,
656
- zoom: o.initialZoom,
657
- center: o.initialCenter,
658
- "navigation-controls": { position: o.navigationControlPosition },
659
- "geolocation-control": { position: o.geolocationControlPosition },
660
- "basemap-change-controls": { toggle: !0, dropdown: !0, position: o.basemapControlPosition },
661
- "map-search-control": { position: o.searchControlPosition },
652
+ ref: a,
653
+ zoom: t.initialZoom,
654
+ center: t.initialCenter,
655
+ "navigation-controls": { position: t.navigationControlPosition },
656
+ "geolocation-control": { position: t.geolocationControlPosition },
657
+ "basemap-change-controls": { toggle: !0, dropdown: !0, position: t.basemapControlPosition },
658
+ "map-search-control": { position: t.searchControlPosition },
662
659
  "enable-cyclomedia": !0,
663
- "cyclomedia-config": o.cyclomediaConfig,
664
- "cyclomedia-button-position": o.cyclomediaButtonPosition,
660
+ "cyclomedia-config": t.cyclomediaConfig,
661
+ "cyclomedia-button-position": t.cyclomediaButtonPosition,
665
662
  "enable-pictometry": !0,
666
- "pictometry-credentials": o.pictometryCredentials,
667
- "pictometry-button-position": o.pictometryButtonPosition,
663
+ "pictometry-credentials": t.pictometryCredentials,
664
+ "pictometry-button-position": t.pictometryButtonPosition,
668
665
  "tool-panel-layout": "vertical",
669
666
  "tool-panel-split-ratio": 50,
670
- onZoom: p,
671
- onClick: te,
672
- onMoveend: C,
673
- onLoad: g,
674
- onSearchResult: Tt
667
+ onZoom: b,
668
+ onClick: Ce,
669
+ onMoveend: f,
670
+ onLoad: c,
671
+ onSearchResult: lt
675
672
  }, {
676
- default: Ne(() => [
677
- o.drawControlPosition !== null ? (f(), X(_(Rt), {
673
+ default: Be(() => [
674
+ t.drawControlPosition !== null ? (d(), X(O(Bt), {
678
675
  key: 0,
679
- position: o.drawControlPosition
680
- }, null, 8, ["position"])) : I("", !0),
681
- (f(!0), L(ie, null, re(Ge.value, (r) => (f(), X(_(pt), {
682
- key: "tiled-" + r.id,
683
- id: "tiled-" + r.id,
684
- source: qe(r),
685
- paint: { "raster-opacity": Se(r.id) },
686
- minzoom: r.minZoom,
687
- maxzoom: r.maxZoom
676
+ position: t.drawControlPosition
677
+ }, null, 8, ["position"])) : z("", !0),
678
+ (d(!0), m(ee, null, le(et.value, (s) => (d(), X(O(bt), {
679
+ key: "tiled-" + s.id,
680
+ id: "tiled-" + s.id,
681
+ source: Ye(s),
682
+ paint: { "raster-opacity": xe(s.id) },
683
+ minzoom: s.minZoom,
684
+ maxzoom: s.maxZoom
688
685
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
689
- (f(!0), L(ie, null, re(He.value, (r) => (f(), X(_(pt), {
690
- key: "dynamic-" + r.id,
691
- id: "dynamic-" + r.id,
692
- source: Ce(r),
693
- paint: { "raster-opacity": Se(r.id) },
694
- minzoom: r.minZoom,
695
- maxzoom: r.maxZoom
686
+ (d(!0), m(ee, null, le(tt.value, (s) => (d(), X(O(bt), {
687
+ key: "dynamic-" + s.id,
688
+ id: "dynamic-" + s.id,
689
+ source: Pe(s),
690
+ paint: { "raster-opacity": xe(s.id) },
691
+ minzoom: s.minZoom,
692
+ maxzoom: s.maxZoom
696
693
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
697
- (f(!0), L(ie, null, re(M.value, (r) => (f(), X(_(yt), {
698
- key: r.id,
699
- id: r.id,
700
- source: de(r),
701
- paint: fe(r),
702
- minzoom: r.minZoom,
703
- maxzoom: r.maxZoom,
694
+ (d(!0), m(ee, null, le(T.value, (s) => (d(), X(O(wt), {
695
+ key: s.id,
696
+ id: s.id,
697
+ source: ve(s),
698
+ paint: be(s),
699
+ minzoom: s.minZoom,
700
+ maxzoom: s.maxZoom,
704
701
  "before-id": "highlight-circles",
705
- onClick: Pe
702
+ onClick: re
706
703
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
707
- (f(!0), L(ie, null, re(N.value, (r) => (f(), X(_(Dt), {
708
- key: r.id,
709
- id: r.id,
710
- source: de(r),
711
- paint: fe(r),
712
- minzoom: r.minZoom,
713
- maxzoom: r.maxZoom,
704
+ (d(!0), m(ee, null, le(B.value, (s) => (d(), X(O(Nt), {
705
+ key: s.id,
706
+ id: s.id,
707
+ source: ve(s),
708
+ paint: be(s),
709
+ minzoom: s.minZoom,
710
+ maxzoom: s.maxZoom,
714
711
  "before-id": "highlight-circles",
715
- onClick: Pe
712
+ onClick: re
716
713
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
717
- (f(!0), L(ie, null, re(q.value, (r) => (f(), X(_(et), {
718
- key: r.id + "-outline",
719
- id: r.id + "-outline",
720
- source: de(r),
721
- paint: Je(r),
722
- minzoom: r.minZoom,
723
- maxzoom: r.maxZoom,
714
+ (d(!0), m(ee, null, le(q.value, (s) => (d(), X(O(st), {
715
+ key: s.id + "-outline",
716
+ id: s.id + "-outline",
717
+ source: ve(s),
718
+ paint: ot(s),
719
+ minzoom: s.minZoom,
720
+ maxzoom: s.maxZoom,
724
721
  "before-id": "highlight-lines",
725
- onClick: Pe
722
+ onClick: re
726
723
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
727
- (f(!0), L(ie, null, re(ce.value, (r) => (f(), X(_(et), {
728
- key: r.id,
729
- id: r.id,
730
- source: de(r),
731
- paint: fe(r),
732
- minzoom: r.minZoom,
733
- maxzoom: r.maxZoom,
724
+ (d(!0), m(ee, null, le(fe.value, (s) => (d(), X(O(st), {
725
+ key: s.id,
726
+ id: s.id,
727
+ source: ve(s),
728
+ paint: be(s),
729
+ minzoom: s.minZoom,
730
+ maxzoom: s.maxZoom,
734
731
  "before-id": "highlight-lines",
735
- onClick: Pe
732
+ onClick: re
736
733
  }, null, 8, ["id", "source", "paint", "minzoom", "maxzoom"]))), 128)),
737
- ee(_(yt), {
734
+ K(O(wt), {
738
735
  key: "highlight-circles-layer",
739
736
  id: "highlight-circles",
740
- source: { type: "geojson", data: Z.value },
741
- paint: Ke
737
+ source: { type: "geojson", data: Le.value },
738
+ paint: ue
742
739
  }, null, 8, ["source"]),
743
- ee(_(et), {
740
+ K(O(st), {
744
741
  key: "highlight-lines-layer",
745
742
  id: "highlight-lines",
746
- source: { type: "geojson", data: Q.value },
747
- paint: Xe
743
+ source: { type: "geojson", data: ye.value },
744
+ paint: at
748
745
  }, null, 8, ["source"]),
749
- ee(_(At), {
750
- "lng-lat": ut.value,
746
+ K(O(At), {
747
+ "lng-lat": qe.value,
751
748
  color: "#2176d2"
752
749
  }, null, 8, ["lng-lat"]),
753
- b.value && pe.value ? (f(), X(_(Nt), {
750
+ ie.value && we.value ? (d(), X(O(Vt), {
754
751
  key: 1,
755
- "lng-lat": pe.value,
756
- html: ae.value,
752
+ "lng-lat": we.value,
753
+ html: pe.value,
757
754
  "close-on-click": !1,
758
755
  "show-navigation": oe.value.length > 1,
759
- "current-feature-index": J.value,
756
+ "current-feature-index": ne.value,
760
757
  "total-features": oe.value.length,
761
- "layer-name": b.value.layerTitle,
762
- onClose: te,
763
- onNext: le,
764
- onPrevious: De
765
- }, null, 8, ["lng-lat", "html", "show-navigation", "current-feature-index", "total-features", "layer-name"])) : I("", !0)
758
+ "layer-name": ie.value.layerTitle,
759
+ onClose: Ce,
760
+ onNext: je,
761
+ onPrevious: Ee
762
+ }, null, 8, ["lng-lat", "html", "show-navigation", "current-feature-index", "total-features", "layer-name"])) : z("", !0)
766
763
  ]),
767
764
  _: 1
768
765
  }, 8, ["zoom", "center", "navigation-controls", "geolocation-control", "basemap-change-controls", "map-search-control", "cyclomedia-config", "cyclomedia-button-position", "pictometry-credentials", "pictometry-button-position"])
769
766
  ]));
770
767
  }
771
- }), _e = (e, n) => {
772
- const o = e.__vccOpts || e;
773
- for (const [t, l] of n)
774
- o[t] = l;
775
- return o;
776
- }, Xt = /* @__PURE__ */ _e(Kt, [["__scopeId", "data-v-38b78874"]]), Yt = ["disabled"], eo = /* @__PURE__ */ we({
768
+ }), Fe = (e, n) => {
769
+ const t = e.__vccOpts || e;
770
+ for (const [o, a] of n)
771
+ t[o] = a;
772
+ return t;
773
+ }, to = /* @__PURE__ */ Fe(eo, [["__scopeId", "data-v-98ba7f8b"]]), oo = ["disabled"], no = /* @__PURE__ */ Se({
777
774
  inheritAttrs: !1,
778
775
  __name: "PhlButton",
779
776
  props: {
@@ -795,24 +792,24 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
795
792
  svgRaw: {}
796
793
  },
797
794
  setup(e) {
798
- const n = e, o = (c) => "href" in c && c.href !== void 0 || "to" in c && c.to !== void 0, t = R(() => nt(
795
+ const n = e, t = (u) => "href" in u && u.href !== void 0 || "to" in u && u.to !== void 0, o = I(() => dt(
799
796
  "phila-button",
800
797
  `phila-button--${n.variant}`,
801
798
  n.size && `is-${n.size}`,
802
799
  n.iconOnly && "icon-button",
803
800
  n.iconOnly && n.variant === "standard" && "icon-button--standard",
804
801
  n.className
805
- )), l = R(() => o(n) ? "to" in n && n.to !== void 0 ? {
802
+ )), a = I(() => t(n) ? "to" in n && n.to !== void 0 ? {
806
803
  to: n.to,
807
804
  disabled: n.disabled,
808
- className: t.value
805
+ className: o.value
809
806
  } : {
810
807
  href: n.href,
811
808
  target: n.target,
812
809
  rel: n.rel,
813
810
  disabled: n.disabled,
814
- className: t.value
815
- } : {}), a = R(
811
+ className: o.value
812
+ } : {}), l = I(
816
813
  () => ({
817
814
  iconDefinition: n.iconDefinition,
818
815
  iconClass: n.iconClass,
@@ -823,54 +820,55 @@ const Qt = { class: "map-panel" }, Kt = /* @__PURE__ */ we({
823
820
  size: n.size
824
821
  })
825
822
  );
826
- return (c, p) => o(n) ? (f(), X(_(Zt), ot({ key: 0 }, { ...l.value, ...c.$attrs }, { role: "button" }), {
827
- default: Ne(() => [
828
- ee(_(gt), dt(ft(a.value)), {
829
- default: Ne(() => [
830
- se(c.$slots, "default", {}, () => [
831
- he(j(n.text), 1)
823
+ return (u, b) => t(n) ? (d(), X(O(Ut), ut({ key: 0 }, { ...a.value, ...u.$attrs }, { role: "button" }), {
824
+ default: Be(() => [
825
+ K(O(Lt), ht(mt(l.value)), {
826
+ default: Be(() => [
827
+ ce(u.$slots, "default", {}, () => [
828
+ me(W(n.text), 1)
832
829
  ])
833
830
  ]),
834
831
  _: 3
835
832
  }, 16)
836
833
  ]),
837
834
  _: 3
838
- }, 16)) : (f(), L("button", ot({
835
+ }, 16)) : (d(), m("button", ut({
839
836
  key: 1,
840
837
  type: "button",
841
838
  disabled: n.disabled,
842
- class: t.value
843
- }, c.$attrs), [
844
- ee(_(gt), dt(ft(a.value)), {
845
- default: Ne(() => [
846
- se(c.$slots, "default", {}, () => [
847
- he(j(n.text), 1)
839
+ class: o.value
840
+ }, u.$attrs), [
841
+ K(O(Lt), ht(mt(l.value)), {
842
+ default: Be(() => [
843
+ ce(u.$slots, "default", {}, () => [
844
+ me(W(n.text), 1)
848
845
  ])
849
846
  ]),
850
847
  _: 3
851
848
  }, 16)
852
- ], 16, Yt));
849
+ ], 16, oo));
853
850
  }
854
851
  });
855
- var to = {
852
+ var io = {
856
853
  prefix: "fas",
857
854
  iconName: "circle-exclamation",
858
855
  icon: [512, 512, ["exclamation-circle"], "f06a", "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]
859
- }, oo = to, no = {
856
+ }, ao = io, lo = {
860
857
  prefix: "fas",
861
858
  iconName: "xmark",
862
859
  icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
863
- }, io = no;
864
- const lo = ["for"], ao = { class: "state-layer" }, ro = { class: "content" }, so = { class: "input-text-container" }, co = ["id", "placeholder"], uo = {
860
+ }, ro = lo;
861
+ const so = ["for"], co = { class: "state-layer" }, uo = { class: "content" }, fo = { class: "input-text-container" }, po = ["id", "placeholder"], yo = {
865
862
  key: 1,
866
863
  class: "has-text-body-small phila-supporting-text"
867
- }, fo = {
864
+ }, go = {
868
865
  key: 2,
869
866
  class: "has-text-body-small phila-error-text"
870
- }, po = /* @__PURE__ */ we({
867
+ }, ho = /* @__PURE__ */ Se({
871
868
  inheritAttrs: !1,
872
869
  __name: "TextField",
873
870
  props: {
871
+ modelValue: { default: void 0 },
874
872
  className: { default: "" },
875
873
  label: { default: "" },
876
874
  id: { default: `phila-text-field-${Math.random().toString(36).substring(2, 9)}` },
@@ -882,116 +880,136 @@ const lo = ["for"], ao = { class: "state-layer" }, ro = { class: "content" }, so
882
880
  return [];
883
881
  } }
884
882
  },
883
+ emits: ["update:modelValue"],
885
884
  setup(e, { emit: n }) {
886
- const o = Ft(), t = e, l = R(() => typeof t.error == "string" ? t.error : t.error[0]), a = Mt(t, "id"), c = R(() => {
887
- const S = ["default-class"];
888
- return o.disabled != null && S.push("phila-input--disabled"), l.value && S.push("phila-input--error"), o.required != null && S.push("phila-input--required"), nt(...S);
889
- }), p = $(""), d = R(() => {
890
- const S = [];
891
- return p.value !== "" && S.push("phila-text-field--filled"), t.className && S.push(t.className), nt(...S);
892
- });
893
- return (S, y) => (f(), L("div", {
894
- class: ne(["phila-input", c.value])
885
+ const t = Tt(), o = e, a = I(() => typeof o.error == "string" ? o.error : o.error[0]), l = zt(o, "id"), u = n, b = C(""), y = I({
886
+ get: () => o.modelValue !== void 0 ? o.modelValue : b.value,
887
+ set: (h) => {
888
+ u("update:modelValue", h), b.value = h;
889
+ }
890
+ }), P = I(() => {
891
+ const h = ["default-class"];
892
+ return t.disabled != null && h.push("phila-input--disabled"), a.value && h.push("phila-input--error"), t.required != null && h.push("phila-input--required"), dt(...h);
893
+ }), v = I(() => {
894
+ const h = [];
895
+ return y.value !== "" && h.push("phila-text-field--filled"), o.className && h.push(o.className), dt(...h);
896
+ }), S = C(null), r = (h) => {
897
+ h.target.closest("button") || S.value?.focus();
898
+ };
899
+ return (h, w) => (d(), m("div", {
900
+ class: te(["phila-input", P.value])
895
901
  }, [
896
- t.label ? (f(), L("label", {
902
+ o.label ? (d(), m("label", {
897
903
  key: 0,
898
- for: a.value,
904
+ for: l.value,
899
905
  class: "has-text-label-small phila-label"
900
- }, j(t.label), 9, lo)) : I("", !0),
901
- F("div", {
902
- class: ne(["phila-text-field", d.value])
906
+ }, W(o.label), 9, so)) : z("", !0),
907
+ x("div", {
908
+ class: te(["phila-text-field", v.value]),
909
+ onClick: r
903
910
  }, [
904
- F("div", ao, [
905
- t.leadingIcon ? (f(), X(_(me), {
911
+ x("div", co, [
912
+ o.leadingIcon ? (d(), X(O(ge), {
906
913
  key: 0,
907
- "icon-class": t.leadingIcon,
908
- inline: ""
909
- }, null, 8, ["icon-class"])) : I("", !0),
910
- F("div", ro, [
911
- F("div", so, [
912
- St(F("input", ot({
913
- id: a.value,
914
- "onUpdate:modelValue": y[0] || (y[0] = (h) => p.value = h),
914
+ "icon-class": o.leadingIcon,
915
+ inline: "",
916
+ decorative: ""
917
+ }, null, 8, ["icon-class"])) : z("", !0),
918
+ x("div", uo, [
919
+ x("div", fo, [
920
+ _t(x("input", ut({
921
+ id: l.value,
922
+ ref_key: "inputRef",
923
+ ref: S,
924
+ "onUpdate:modelValue": w[0] || (w[0] = (g) => y.value = g),
915
925
  class: "phila-text-field-input has-text-body-default",
916
- placeholder: t.placeholder
917
- }, _(o)), null, 16, co), [
918
- [Et, p.value]
926
+ placeholder: o.placeholder
927
+ }, O(t)), null, 16, po), [
928
+ [Ft, y.value]
919
929
  ])
920
930
  ])
921
931
  ]),
922
- p.value != "" ? (f(), X(_(eo), {
932
+ y.value != "" ? (d(), X(O(no), {
923
933
  key: 1,
924
934
  variant: "standard",
925
- size: "extra-small",
935
+ size: "small",
926
936
  "icon-only": "",
927
- icon: _(io),
928
- onClick: y[1] || (y[1] = (h) => p.value = "")
929
- }, null, 8, ["icon"])) : I("", !0),
930
- t.trailingIcon ? (f(), X(_(me), {
937
+ "icon-definition": O(ro),
938
+ onClick: w[1] || (w[1] = (g) => y.value = "")
939
+ }, null, 8, ["icon-definition"])) : z("", !0),
940
+ o.trailingIcon ? (d(), X(O(ge), {
931
941
  key: 2,
932
- "icon-class": t.trailingIcon,
933
- inline: ""
934
- }, null, 8, ["icon-class"])) : I("", !0)
942
+ size: "small",
943
+ "icon-class": o.trailingIcon,
944
+ inline: "",
945
+ decorative: ""
946
+ }, null, 8, ["icon-class"])) : z("", !0),
947
+ ce(h.$slots, "trailing-action")
935
948
  ])
936
949
  ], 2),
937
- t.supportingText ? (f(), L("div", uo, j(t.supportingText), 1)) : I("", !0),
938
- l.value ? (f(), L("div", fo, [
939
- ee(_(me), {
940
- "icon-definition": _(oo),
950
+ o.supportingText ? (d(), m("div", yo, W(o.supportingText), 1)) : z("", !0),
951
+ a.value ? (d(), m("div", go, [
952
+ K(O(ge), {
953
+ "icon-definition": O(ao),
941
954
  size: "small",
942
- inline: ""
955
+ inline: "",
956
+ decorative: ""
943
957
  }, null, 8, ["icon-definition"]),
944
- he(" " + j(l.value), 1)
945
- ])) : I("", !0)
958
+ me(" " + W(a.value), 1)
959
+ ])) : z("", !0)
946
960
  ], 2));
947
961
  }
948
962
  });
949
- var yo = {
963
+ var mo = {
964
+ prefix: "fas",
965
+ iconName: "filter",
966
+ icon: [512, 512, [], "f0b0", "M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z"]
967
+ }, vo = {
950
968
  prefix: "fas",
951
969
  iconName: "caret-right",
952
970
  icon: [256, 512, [], "f0da", "M249.3 235.8c10.2 12.6 9.5 31.1-2.2 42.8l-128 128c-9.2 9.2-22.9 11.9-34.9 6.9S64.5 396.9 64.5 384l0-256c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l128 128 2.2 2.4z"]
953
- }, go = {
971
+ }, bo = {
954
972
  prefix: "fas",
955
973
  iconName: "caret-left",
956
974
  icon: [256, 512, [], "f0d9", "M7.7 235.8c-10.3 12.6-9.5 31.1 2.2 42.8l128 128c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-256c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-128 128-2.2 2.4z"]
957
- }, ht = {
975
+ }, kt = {
958
976
  prefix: "fas",
959
977
  iconName: "xmark",
960
978
  icon: [384, 512, [128473, 10005, 10006, 10060, 215, "close", "multiply", "remove", "times"], "f00d", "M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]
961
- }, mo = {
979
+ }, wo = {
962
980
  prefix: "fas",
963
981
  iconName: "bars",
964
982
  icon: [448, 512, ["navicon"], "f0c9", "M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]
965
- }, ho = {
983
+ }, Lo = {
966
984
  prefix: "fas",
967
985
  iconName: "circle-info",
968
986
  icon: [512, 512, ["info-circle"], "f05a", "M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
969
987
  };
970
- const vo = { class: "layer-panel" }, bo = {
988
+ const So = { class: "layer-panel" }, ko = {
971
989
  key: 0,
972
990
  class: "search-box"
973
- }, wo = {
991
+ }, Co = {
974
992
  key: 1,
975
993
  class: "topics-container"
976
- }, Lo = { class: "layer-row" }, So = ["href"], Co = {
994
+ }, $o = { class: "layer-row" }, xo = ["href"], Po = {
977
995
  key: 1,
978
996
  class: "metadata-placeholder"
979
- }, ko = ["checked", "disabled", "onChange"], $o = { class: "layer-title" }, Po = {
997
+ }, _o = ["checked", "disabled", "onChange"], Eo = { class: "layer-title" }, Mo = {
980
998
  key: 0,
981
999
  class: "loading-indicator"
982
- }, xo = ["title"], To = {
1000
+ }, To = ["aria-label"], zo = {
983
1001
  key: 2,
984
1002
  class: "zoom-indicator"
985
1003
  }, Fo = {
986
1004
  key: 0,
987
1005
  class: "opacity-control"
988
- }, Mo = { class: "opacity-label" }, Eo = ["value", "onInput"], zo = {
1006
+ }, Oo = ["for"], Io = ["id", "value", "aria-label", "onInput"], Ro = {
989
1007
  key: 1,
990
1008
  class: "layer-legend"
991
- }, _o = { class: "legend-label" }, Io = {
1009
+ }, Do = { class: "legend-label" }, Zo = {
992
1010
  key: 0,
993
1011
  class: "no-results"
994
- }, Oo = /* @__PURE__ */ we({
1012
+ }, Bo = /* @__PURE__ */ Se({
995
1013
  __name: "LayerPanel",
996
1014
  props: {
997
1015
  layerList: {},
@@ -1006,184 +1024,202 @@ const vo = { class: "layer-panel" }, bo = {
1006
1024
  showSearch: { type: Boolean, default: !0 },
1007
1025
  showOpacity: { type: Boolean, default: !0 },
1008
1026
  showLegend: { type: Boolean, default: !0 },
1009
- searchPlaceholder: { default: "Search layers..." }
1027
+ searchPlaceholder: { default: "Filter layers..." }
1010
1028
  },
1011
1029
  emits: ["toggleLayer", "setOpacity", "updateSearch"],
1012
1030
  setup(e, { emit: n }) {
1013
- const o = e, t = n, l = R(() => {
1014
- if (!o.searchQuery.trim())
1015
- return o.layerList;
1016
- const C = o.searchQuery.toLowerCase();
1017
- return o.layerList.filter(
1018
- (g) => g.config.title.toLowerCase().includes(C)
1031
+ const t = e, o = n, a = I(() => {
1032
+ if (!t.searchQuery.trim())
1033
+ return t.layerList;
1034
+ const f = t.searchQuery.toLowerCase();
1035
+ return t.layerList.filter(
1036
+ (c) => c.config.title.toLowerCase().includes(f)
1019
1037
  );
1020
1038
  });
1021
- function a(C) {
1022
- let g = C.split("?")[0] || C;
1023
- return g = g.replace(/\/query$/, ""), g = g.replace(/\/$/, ""), g.toLowerCase();
1039
+ function l(f) {
1040
+ let c = f.split("?")[0] || f;
1041
+ return c = c.replace(/\/query$/, ""), c = c.replace(/\/$/, ""), c.toLowerCase();
1024
1042
  }
1025
- function c(C) {
1026
- const g = a(C);
1027
- return o.layerMetadata[g] || null;
1043
+ function u(f) {
1044
+ const c = l(f);
1045
+ return t.layerMetadata[c] || null;
1028
1046
  }
1029
- const p = R(() => o.layerList.some((C) => c(C.config.url)));
1030
- function d(C) {
1031
- return o.visibleLayers.has(C);
1047
+ const b = I(() => t.layerList.some((f) => u(f.config.url)));
1048
+ function y(f) {
1049
+ return t.visibleLayers.has(f);
1032
1050
  }
1033
- function S(C) {
1034
- return o.layerOpacities[C] ?? 1;
1051
+ function P(f) {
1052
+ return t.layerOpacities[f] ?? 1;
1035
1053
  }
1036
- function y(C) {
1037
- return o.loadingLayers.has(C);
1054
+ function v(f) {
1055
+ return t.loadingLayers.has(f);
1038
1056
  }
1039
- function h(C) {
1040
- return o.layerErrors[C] || null;
1057
+ function S(f) {
1058
+ return t.layerErrors[f] || null;
1041
1059
  }
1042
- function s(C) {
1043
- const g = o.currentZoom, w = C.minZoom, z = C.maxZoom;
1044
- return !(w !== void 0 && g < w || z !== void 0 && g > z);
1060
+ function r(f) {
1061
+ const c = t.currentZoom, L = f.minZoom, F = f.maxZoom;
1062
+ return !(L !== void 0 && c < L || F !== void 0 && c > F);
1045
1063
  }
1046
- const v = R({
1047
- get: () => o.searchQuery,
1048
- set: (C) => t("updateSearch", C)
1064
+ const h = I({
1065
+ get: () => t.searchQuery,
1066
+ set: (f) => o("updateSearch", f)
1049
1067
  });
1050
- function E(C) {
1051
- t("toggleLayer", C);
1052
- }
1053
- function m(C, g) {
1054
- const w = g.target, z = parseFloat(w.value);
1055
- t("setOpacity", C, z);
1056
- }
1057
- return (C, g) => (f(), L("aside", vo, [
1058
- e.showSearch ? (f(), L("div", bo, [
1059
- ee(_(po), {
1060
- modelValue: v.value,
1061
- "onUpdate:modelValue": g[0] || (g[0] = (w) => v.value = w),
1068
+ function w(f) {
1069
+ o("toggleLayer", f);
1070
+ }
1071
+ function g(f, c) {
1072
+ const L = c.target, F = parseFloat(L.value);
1073
+ o("setOpacity", f, F);
1074
+ }
1075
+ return (f, c) => (d(), m("aside", So, [
1076
+ e.showSearch ? (d(), m("div", ko, [
1077
+ K(O(ho), {
1078
+ modelValue: h.value,
1079
+ "onUpdate:modelValue": c[0] || (c[0] = (L) => h.value = L),
1062
1080
  placeholder: e.searchPlaceholder,
1063
1081
  "class-name": "layer-search-field"
1064
- }, null, 8, ["modelValue", "placeholder"])
1065
- ])) : I("", !0),
1066
- e.mode === "topics" ? (f(), L("div", wo, [
1067
- se(C.$slots, "topics", {}, () => [
1068
- g[2] || (g[2] = F("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
1082
+ }, {
1083
+ "trailing-action": Be(() => [
1084
+ K(O(ge), {
1085
+ "icon-definition": O(mo),
1086
+ size: "small",
1087
+ inline: "",
1088
+ decorative: ""
1089
+ }, null, 8, ["icon-definition"])
1090
+ ]),
1091
+ _: 1
1092
+ }, 8, ["modelValue", "placeholder"])
1093
+ ])) : z("", !0),
1094
+ e.mode === "topics" ? (d(), m("div", Co, [
1095
+ ce(f.$slots, "topics", {}, () => [
1096
+ c[2] || (c[2] = x("div", { class: "no-topics" }, ' No topic components provided. Use the "topics" slot to add TopicAccordion components. ', -1))
1069
1097
  ], !0)
1070
- ])) : (f(), L("div", {
1098
+ ])) : (d(), m("div", {
1071
1099
  key: 2,
1072
- class: ne(["layer-list", { "has-metadata": p.value }])
1100
+ class: te(["layer-list", { "has-metadata": b.value }])
1073
1101
  }, [
1074
- (f(!0), L(ie, null, re(l.value, (w) => (f(), L("div", {
1075
- key: w.config.id,
1102
+ (d(!0), m(ee, null, le(a.value, (L) => (d(), m("div", {
1103
+ key: L.config.id,
1076
1104
  class: "layer-item"
1077
1105
  }, [
1078
- F("div", Lo, [
1079
- c(w.config.url) ? (f(), L("a", {
1106
+ x("div", $o, [
1107
+ u(L.config.url) ? (d(), m("a", {
1080
1108
  key: 0,
1081
- href: c(w.config.url) || "",
1109
+ href: u(L.config.url) || "",
1082
1110
  target: "_blank",
1083
1111
  rel: "noopener noreferrer",
1084
1112
  class: "metadata-link",
1085
1113
  title: "View metadata",
1086
- onClick: g[1] || (g[1] = zt(() => {
1114
+ onClick: c[1] || (c[1] = Ot(() => {
1087
1115
  }, ["stop"]))
1088
1116
  }, [
1089
- ee(_(me), {
1090
- "icon-definition": _(ho),
1117
+ K(O(ge), {
1118
+ "icon-definition": O(Lo),
1091
1119
  size: "small",
1092
1120
  inline: "",
1093
1121
  decorative: ""
1094
1122
  }, null, 8, ["icon-definition"])
1095
- ], 8, So)) : p.value ? (f(), L("span", Co)) : I("", !0),
1096
- F("label", {
1097
- class: ne(["layer-checkbox", {
1098
- "layer-unavailable": !s(w.config),
1099
- "layer-error": h(w.config.id)
1123
+ ], 8, xo)) : b.value ? (d(), m("span", Po)) : z("", !0),
1124
+ x("label", {
1125
+ class: te(["layer-checkbox", {
1126
+ "layer-unavailable": !r(L.config),
1127
+ "layer-error": S(L.config.id)
1100
1128
  }])
1101
1129
  }, [
1102
- F("input", {
1130
+ x("input", {
1103
1131
  type: "checkbox",
1104
- checked: d(w.config.id),
1105
- disabled: !s(w.config),
1106
- onChange: (z) => E(w.config.id)
1107
- }, null, 40, ko),
1108
- F("span", $o, [
1109
- he(j(w.config.title) + " ", 1),
1110
- y(w.config.id) ? (f(), L("span", Po, " Loading... ")) : I("", !0),
1111
- h(w.config.id) ? (f(), L("span", {
1132
+ checked: y(L.config.id),
1133
+ disabled: !r(L.config),
1134
+ onChange: (F) => w(L.config.id)
1135
+ }, null, 40, _o),
1136
+ x("span", Eo, [
1137
+ me(W(L.config.title) + " ", 1),
1138
+ v(L.config.id) ? (d(), m("span", Mo, " Loading... ")) : z("", !0),
1139
+ S(L.config.id) ? (d(), m("span", {
1112
1140
  key: 1,
1113
1141
  class: "error-indicator",
1114
- title: h(w.config.id) || ""
1115
- }, " Error ", 8, xo)) : I("", !0),
1116
- s(w.config) ? I("", !0) : (f(), L("span", To, " (zoom in) "))
1142
+ "aria-label": S(L.config.id) || "Error"
1143
+ }, " Error ", 8, To)) : z("", !0),
1144
+ r(L.config) ? z("", !0) : (d(), m("span", zo, " (zoom in) "))
1117
1145
  ])
1118
1146
  ], 2)
1119
1147
  ]),
1120
- e.showOpacity && d(w.config.id) ? (f(), L("div", Fo, [
1121
- F("label", Mo, " Opacity: " + j(Math.round(S(w.config.id) * 100)) + "% ", 1),
1122
- F("input", {
1148
+ e.showOpacity && y(L.config.id) ? (d(), m("div", Fo, [
1149
+ x("label", {
1150
+ class: "opacity-label",
1151
+ for: "opacity-" + L.config.id
1152
+ }, " Opacity: " + W(Math.round(P(L.config.id) * 100)) + "% ", 9, Oo),
1153
+ x("input", {
1154
+ id: "opacity-" + L.config.id,
1123
1155
  type: "range",
1124
1156
  min: "0",
1125
1157
  max: "1",
1126
1158
  step: "0.05",
1127
- value: S(w.config.id),
1159
+ value: P(L.config.id),
1160
+ "aria-label": "Opacity for " + L.config.title,
1128
1161
  class: "opacity-slider",
1129
- onInput: (z) => m(w.config.id, z)
1130
- }, null, 40, Eo)
1131
- ])) : I("", !0),
1132
- e.showLegend && d(w.config.id) && w.config.legend?.length ? (f(), L("ul", zo, [
1133
- (f(!0), L(ie, null, re(w.config.legend, (z, M) => (f(), L("li", {
1134
- key: M,
1162
+ onInput: (F) => g(L.config.id, F)
1163
+ }, null, 40, Io)
1164
+ ])) : z("", !0),
1165
+ e.showLegend && y(L.config.id) && L.config.legend?.length ? (d(), m("ul", Ro, [
1166
+ (d(!0), m(ee, null, le(L.config.legend, (F, T) => (d(), m("li", {
1167
+ key: T,
1135
1168
  class: "legend-item"
1136
1169
  }, [
1137
- z.type === "circle" ? (f(), L("span", {
1170
+ F.type === "circle" ? (d(), m("span", {
1138
1171
  key: 0,
1139
1172
  class: "legend-symbol legend-circle",
1140
- style: Y({ backgroundColor: z.color })
1141
- }, null, 4)) : z.type === "line" ? (f(), L("span", {
1173
+ style: H({ backgroundColor: F.color }),
1174
+ "aria-hidden": "true"
1175
+ }, null, 4)) : F.type === "line" ? (d(), m("span", {
1142
1176
  key: 1,
1143
1177
  class: "legend-symbol legend-line",
1144
- style: Y({
1145
- backgroundColor: z.color,
1146
- height: `${z.width || 2}px`
1147
- })
1148
- }, null, 4)) : z.type === "fill" ? (f(), L("span", {
1178
+ style: H({
1179
+ backgroundColor: F.color,
1180
+ height: `${F.width || 2}px`
1181
+ }),
1182
+ "aria-hidden": "true"
1183
+ }, null, 4)) : F.type === "fill" ? (d(), m("span", {
1149
1184
  key: 2,
1150
1185
  class: "legend-symbol legend-fill",
1151
- style: Y({ backgroundColor: z.color })
1152
- }, null, 4)) : I("", !0),
1153
- F("span", _o, j(z.label), 1)
1186
+ style: H({ backgroundColor: F.color }),
1187
+ "aria-hidden": "true"
1188
+ }, null, 4)) : z("", !0),
1189
+ x("span", Do, W(F.label), 1)
1154
1190
  ]))), 128))
1155
- ])) : I("", !0)
1191
+ ])) : z("", !0)
1156
1192
  ]))), 128)),
1157
- l.value.length === 0 ? (f(), L("div", Io, ' No layers match "' + j(e.searchQuery) + '" ', 1)) : I("", !0)
1193
+ a.value.length === 0 ? (d(), m("div", Zo, ' No layers match "' + W(e.searchQuery) + '" ', 1)) : z("", !0)
1158
1194
  ], 2))
1159
1195
  ]));
1160
1196
  }
1161
- }), Ro = /* @__PURE__ */ _e(Oo, [["__scopeId", "data-v-82d84fbe"]]);
1197
+ }), No = /* @__PURE__ */ Fe(Bo, [["__scopeId", "data-v-d8c0326b"]]);
1162
1198
  function D(e) {
1163
1199
  if (!e || !Array.isArray(e) || e.length < 3) return "#888888";
1164
- const n = e[0], o = e[1], t = e[2], a = (e[3] ?? 255) / 255;
1165
- return a === 1 ? `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}` : `rgba(${n}, ${o}, ${t}, ${a.toFixed(2)})`;
1200
+ const n = e[0], t = e[1], o = e[2], l = (e[3] ?? 255) / 255;
1201
+ return l === 1 ? `#${n.toString(16).padStart(2, "0")}${t.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}` : `rgba(${n}, ${t}, ${o}, ${l.toFixed(2)})`;
1166
1202
  }
1167
- function ue(e) {
1203
+ function he(e) {
1168
1204
  return e !== void 0 ? e : 1;
1169
1205
  }
1170
- const Do = 559082264;
1171
- function vt(e) {
1172
- return !e || e <= 0 ? null : Math.round(Math.log2(Do / e) * 100) / 100;
1206
+ const Ao = 559082264;
1207
+ function Ct(e) {
1208
+ return !e || e <= 0 ? null : Math.round(Math.log2(Ao / e) * 100) / 100;
1173
1209
  }
1174
- function Ao(e, n) {
1175
- const o = {};
1210
+ function Vo(e, n) {
1211
+ const t = {};
1176
1212
  if (e && e > 0) {
1177
- const t = vt(e);
1178
- t !== null && (o.minZoom = t);
1213
+ const o = Ct(e);
1214
+ o !== null && (t.minZoom = o);
1179
1215
  }
1180
1216
  if (n && n > 0) {
1181
- const t = vt(n);
1182
- t !== null && (o.maxZoom = t);
1217
+ const o = Ct(n);
1218
+ o !== null && (t.maxZoom = o);
1183
1219
  }
1184
- return o;
1220
+ return t;
1185
1221
  }
1186
- function Ve(e) {
1222
+ function Qe(e) {
1187
1223
  if (!e) return "fill";
1188
1224
  switch (e.type) {
1189
1225
  case "esriSFS":
@@ -1200,359 +1236,330 @@ function Ve(e) {
1200
1236
  return "fill";
1201
1237
  }
1202
1238
  }
1203
- function Fe(e) {
1239
+ function ze(e) {
1204
1240
  return !(!e || e.style === "esriSLSNull" || e.color === null || e.width === 0 || e.color && e.color[3] === 0);
1205
1241
  }
1206
- function tt(e) {
1242
+ function ct(e) {
1207
1243
  return String(e);
1208
1244
  }
1209
- function Ct(e, n, o) {
1210
- const t = e.symbol, l = Ve(t);
1211
- console.log("[Transformer] convertSimpleRenderer - geomType:", l, "symbol:", t);
1212
- let a = {}, c = [], p = null;
1213
- if (l === "fill" && t) {
1214
- const d = t.color === null ? 0 : t.color?.[3] ?? 255, S = d === 0 ? "rgba(0, 0, 0, 0)" : D(t.color), y = d === 0 ? 0 : d < 255 ? 1 : ue(n);
1215
- if (console.log(`[Transformer] Fill layer opacity calculation for "${o}":`, {
1216
- symbolColor: t.color,
1217
- fillAlpha: d,
1218
- layerOpacity: n,
1219
- fillOpacity: y,
1220
- fillColor: S
1221
- }), a = {
1222
- "fill-color": S,
1223
- "fill-opacity": y
1224
- }, Fe(t.outline)) {
1225
- const h = t.outline.width || 1, s = D(t.outline.color);
1226
- console.log("[Transformer] Fill layer with outline:", {
1227
- fillAlpha: d,
1228
- outlineWidth: h,
1229
- outlineColor: s,
1230
- willCreateOutlinePaint: h > 1 || d === 0
1231
- }), d !== 0 && (a["fill-outline-color"] = s), (h > 1 || d === 0) && (p = {
1232
- "line-color": s,
1233
- "line-width": h
1234
- }, console.log("[Transformer] Created outlinePaint:", p));
1235
- } else
1236
- console.log("[Transformer] No visible outline for fill layer, hasVisibleOutline returned false");
1237
- c = [{
1245
+ function Et(e, n, t) {
1246
+ const o = e.symbol, a = Qe(o);
1247
+ let l = {}, u = [], b = null;
1248
+ if (a === "fill" && o) {
1249
+ const y = o.color === null ? 0 : o.color?.[3] ?? 255, P = y === 0 ? "rgba(0, 0, 0, 0)" : D(o.color), v = y === 0 ? 0 : y < 255 ? 1 : he(n);
1250
+ if (l = {
1251
+ "fill-color": P,
1252
+ "fill-opacity": v
1253
+ }, ze(o.outline)) {
1254
+ const S = o.outline.width || 1, r = D(o.outline.color);
1255
+ y !== 0 && (l["fill-outline-color"] = r), (S > 1 || y === 0) && (b = {
1256
+ "line-color": r,
1257
+ "line-width": S
1258
+ });
1259
+ }
1260
+ u = [{
1238
1261
  type: "fill",
1239
- color: D(t.color),
1262
+ color: D(o.color),
1240
1263
  label: e.label || "Feature"
1241
1264
  }];
1242
- } else if (l === "line" && t)
1243
- a = {
1244
- "line-color": D(t.color),
1245
- "line-width": t.width || 1,
1246
- "line-opacity": ue(n)
1247
- }, c = [{
1265
+ } else if (a === "line" && o)
1266
+ l = {
1267
+ "line-color": D(o.color),
1268
+ "line-width": o.width || 1,
1269
+ "line-opacity": he(n)
1270
+ }, u = [{
1248
1271
  type: "line",
1249
- color: D(t.color),
1250
- width: t.width || 1,
1272
+ color: D(o.color),
1273
+ width: o.width || 1,
1251
1274
  label: e.label || "Feature"
1252
1275
  }];
1253
- else if (l === "circle" && t) {
1254
- const d = Math.round((t.size || 6) * 0.71 * 100) / 100;
1255
- a = {
1256
- "circle-color": D(t.color),
1257
- "circle-radius": d,
1258
- "circle-opacity": ue(n)
1259
- }, Fe(t.outline) && (a["circle-stroke-color"] = D(t.outline.color), a["circle-stroke-width"] = t.outline.width || 1), c = [{
1276
+ else if (a === "circle" && o) {
1277
+ const y = Math.round((o.size || 6) * 0.71 * 100) / 100;
1278
+ l = {
1279
+ "circle-color": D(o.color),
1280
+ "circle-radius": y,
1281
+ "circle-opacity": he(n)
1282
+ }, ze(o.outline) && (l["circle-stroke-color"] = D(o.outline.color), l["circle-stroke-width"] = o.outline.width || 1), u = [{
1260
1283
  type: "circle",
1261
- color: D(t.color),
1284
+ color: D(o.color),
1262
1285
  label: e.label || "Feature"
1263
1286
  }];
1264
1287
  }
1265
- return { paint: a, legend: c, geomType: l, outlinePaint: p };
1288
+ return { paint: l, legend: u, geomType: a, outlinePaint: b };
1266
1289
  }
1267
- function No(e, n, o) {
1268
- const t = e.field1, l = e.uniqueValueInfos || [], a = e.defaultSymbol;
1269
- if (l.length === 0)
1270
- return Ct({ ...e, symbol: a }, n);
1271
- const c = l[0]?.symbol || a, p = Ve(c);
1272
- let d = {}, S = [], y = null;
1273
- if (p === "fill") {
1274
- const h = ["match", ["to-string", ["get", t]]];
1275
- for (const s of l) {
1276
- h.push(tt(s.value)), h.push(D(s.symbol?.color));
1277
- const v = String(s.value), m = o?.get(v) || s.label || v;
1278
- S.push({
1290
+ function Uo(e, n, t) {
1291
+ const o = e.field1, a = e.uniqueValueInfos || [], l = e.defaultSymbol;
1292
+ if (a.length === 0)
1293
+ return Et({ ...e, symbol: l }, n);
1294
+ const u = a[0]?.symbol || l, b = Qe(u);
1295
+ let y = {}, P = [], v = null;
1296
+ if (b === "fill") {
1297
+ const S = ["match", ["to-string", ["get", o]]];
1298
+ for (const r of a) {
1299
+ S.push(ct(r.value)), S.push(D(r.symbol?.color));
1300
+ const h = String(r.value), g = t?.get(h) || r.label || h;
1301
+ P.push({
1279
1302
  type: "fill",
1280
- color: D(s.symbol?.color),
1281
- label: m
1303
+ color: D(r.symbol?.color),
1304
+ label: g
1282
1305
  });
1283
1306
  }
1284
- if (h.push(a ? D(a.color) : "#888888"), d = {
1285
- "fill-color": h,
1286
- "fill-opacity": ue(n)
1287
- }, Fe(c?.outline)) {
1288
- const s = c.outline.width || 1, v = D(c.outline.color);
1289
- d["fill-outline-color"] = v, s > 1 && (y = {
1290
- "line-color": v,
1291
- "line-width": s
1307
+ if (S.push(l ? D(l.color) : "rgba(0, 0, 0, 0)"), y = {
1308
+ "fill-color": S,
1309
+ "fill-opacity": he(n)
1310
+ }, ze(u?.outline)) {
1311
+ const r = u.outline.width || 1, h = D(u.outline.color);
1312
+ y["fill-outline-color"] = h, r > 1 && (v = {
1313
+ "line-color": h,
1314
+ "line-width": r
1292
1315
  });
1293
1316
  }
1294
- } else if (p === "line") {
1295
- const h = ["match", ["to-string", ["get", t]]];
1296
- for (const s of l) {
1297
- h.push(tt(s.value)), h.push(D(s.symbol?.color));
1298
- const v = String(s.value), m = o?.get(v) || s.label || v;
1299
- S.push({
1317
+ } else if (b === "line") {
1318
+ const S = ["match", ["to-string", ["get", o]]];
1319
+ for (const r of a) {
1320
+ S.push(ct(r.value)), S.push(D(r.symbol?.color));
1321
+ const h = String(r.value), g = t?.get(h) || r.label || h;
1322
+ P.push({
1300
1323
  type: "line",
1301
- color: D(s.symbol?.color),
1302
- width: s.symbol?.width || 1,
1303
- label: m
1324
+ color: D(r.symbol?.color),
1325
+ width: r.symbol?.width || 1,
1326
+ label: g
1304
1327
  });
1305
1328
  }
1306
- h.push(a ? D(a.color) : "#888888"), d = {
1307
- "line-color": h,
1308
- "line-width": c?.width || 2,
1309
- "line-opacity": ue(n)
1329
+ S.push(l ? D(l.color) : "rgba(0, 0, 0, 0)"), y = {
1330
+ "line-color": S,
1331
+ "line-width": u?.width || 2,
1332
+ "line-opacity": he(n)
1310
1333
  };
1311
- } else if (p === "circle") {
1312
- const h = ["match", ["to-string", ["get", t]]];
1313
- for (const v of l) {
1314
- h.push(tt(v.value)), h.push(D(v.symbol?.color));
1315
- const E = String(v.value), C = o?.get(E) || v.label || E;
1316
- S.push({
1334
+ } else if (b === "circle") {
1335
+ const S = ["match", ["to-string", ["get", o]]];
1336
+ for (const h of a) {
1337
+ S.push(ct(h.value)), S.push(D(h.symbol?.color));
1338
+ const w = String(h.value), f = t?.get(w) || h.label || w;
1339
+ P.push({
1317
1340
  type: "circle",
1318
- color: D(v.symbol?.color),
1319
- label: C
1341
+ color: D(h.symbol?.color),
1342
+ label: f
1320
1343
  });
1321
1344
  }
1322
- h.push(a ? D(a.color) : "#888888");
1323
- const s = Math.round((c?.size || 6) * 0.71 * 100) / 100;
1324
- d = {
1325
- "circle-color": h,
1326
- "circle-radius": s,
1327
- "circle-opacity": ue(n)
1328
- }, Fe(c?.outline) && (d["circle-stroke-color"] = D(c.outline.color), d["circle-stroke-width"] = c.outline.width || 1);
1345
+ S.push(l ? D(l.color) : "rgba(0, 0, 0, 0)");
1346
+ const r = Math.round((u?.size || 6) * 0.71 * 100) / 100;
1347
+ y = {
1348
+ "circle-color": S,
1349
+ "circle-radius": r,
1350
+ "circle-opacity": he(n)
1351
+ }, ze(u?.outline) && (y["circle-stroke-color"] = D(u.outline.color), y["circle-stroke-width"] = u.outline.width || 1);
1329
1352
  }
1330
- return { paint: d, legend: S, geomType: p, outlinePaint: y };
1353
+ return { paint: y, legend: P, geomType: b, outlinePaint: v };
1331
1354
  }
1332
- function Zo(e, n) {
1333
- const o = e.field, t = e.classBreakInfos || [], l = e.visualVariables?.find((y) => y.type === "colorInfo");
1334
- if (l?.stops && l.stops.length > 0)
1335
- return Bo(l, o, e, n);
1336
- if (t.length === 0)
1355
+ function Wo(e, n) {
1356
+ const t = e.field, o = e.classBreakInfos || [], a = e.visualVariables?.find((v) => v.type === "colorInfo");
1357
+ if (a?.stops && a.stops.length > 0)
1358
+ return jo(a, t, e, n);
1359
+ if (o.length === 0)
1337
1360
  return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1338
- const a = t[0]?.symbol, c = Ve(a);
1339
- let p = {}, d = [], S = null;
1340
- if (c === "fill") {
1341
- const y = ["step", ["get", o]];
1342
- y.push(D(t[0]?.symbol?.color));
1343
- for (let h = 0; h < t.length; h++) {
1344
- const s = t[h];
1345
- h > 0 && (y.push(t[h - 1].classMaxValue), y.push(D(s.symbol?.color))), d.push({
1361
+ const l = o[0]?.symbol, u = Qe(l);
1362
+ let b = {}, y = [], P = null;
1363
+ if (u === "fill") {
1364
+ const v = ["step", ["get", t]];
1365
+ v.push(D(o[0]?.symbol?.color));
1366
+ for (let S = 0; S < o.length; S++) {
1367
+ const r = o[S];
1368
+ S > 0 && (v.push(o[S - 1].classMaxValue), v.push(D(r.symbol?.color))), y.push({
1346
1369
  type: "fill",
1347
- color: D(s.symbol?.color),
1348
- label: s.label || `${s.classMaxValue}`
1370
+ color: D(r.symbol?.color),
1371
+ label: r.label || `${r.classMaxValue}`
1349
1372
  });
1350
1373
  }
1351
- if (p = {
1352
- "fill-color": y,
1353
- "fill-opacity": ue(n)
1354
- }, Fe(a?.outline)) {
1355
- const h = a.outline.width || 1, s = D(a.outline.color);
1356
- p["fill-outline-color"] = s, h > 1 && (S = {
1357
- "line-color": s,
1358
- "line-width": h
1374
+ if (b = {
1375
+ "fill-color": v,
1376
+ "fill-opacity": he(n)
1377
+ }, ze(l?.outline)) {
1378
+ const S = l.outline.width || 1, r = D(l.outline.color);
1379
+ b["fill-outline-color"] = r, S > 1 && (P = {
1380
+ "line-color": r,
1381
+ "line-width": S
1359
1382
  });
1360
1383
  }
1361
- } else if (c === "line") {
1362
- const y = ["step", ["get", o]];
1363
- y.push(D(t[0]?.symbol?.color));
1364
- let h = e.minValue ?? 0;
1365
- for (let v = 0; v < t.length; v++) {
1366
- const E = t[v];
1367
- v > 0 && (y.push(t[v - 1].classMaxValue), y.push(D(E.symbol?.color))), d.push({
1384
+ } else if (u === "line") {
1385
+ const v = ["step", ["get", t]];
1386
+ v.push(D(o[0]?.symbol?.color));
1387
+ let S = e.minValue ?? 0;
1388
+ for (let h = 0; h < o.length; h++) {
1389
+ const w = o[h];
1390
+ h > 0 && (v.push(o[h - 1].classMaxValue), v.push(D(w.symbol?.color))), y.push({
1368
1391
  type: "line",
1369
- color: D(E.symbol?.color),
1370
- width: E.symbol?.width || a?.width || 2,
1371
- label: E.label || `${h} - ${E.classMaxValue}`
1372
- }), h = E.classMaxValue + 1;
1373
- }
1374
- const s = a?.width || 2;
1375
- p = {
1376
- "line-color": y,
1377
- "line-width": s,
1378
- "line-opacity": ue(n)
1392
+ color: D(w.symbol?.color),
1393
+ width: w.symbol?.width || l?.width || 2,
1394
+ label: w.label || `${S} - ${w.classMaxValue}`
1395
+ }), S = w.classMaxValue + 1;
1396
+ }
1397
+ const r = l?.width || 2;
1398
+ b = {
1399
+ "line-color": v,
1400
+ "line-width": r,
1401
+ "line-opacity": he(n)
1379
1402
  };
1380
1403
  }
1381
- return { paint: p, legend: d, geomType: c, outlinePaint: S };
1404
+ return { paint: b, legend: y, geomType: u, outlinePaint: P };
1382
1405
  }
1383
- function Bo(e, n, o, t) {
1384
- const l = e.stops || [];
1385
- if (l.length === 0)
1406
+ function jo(e, n, t, o) {
1407
+ const a = e.stops || [];
1408
+ if (a.length === 0)
1386
1409
  return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1387
- const a = o.classBreakInfos?.[0]?.symbol || o.defaultSymbol, c = Ve(a);
1388
- let p = {}, d = [], S = null;
1389
- if (c === "fill") {
1390
- const y = ["interpolate", ["linear"], ["get", n]];
1391
- for (const s of l)
1392
- y.push(s.value), y.push(D(s.color)), d.push({
1410
+ const l = t.classBreakInfos?.[0]?.symbol || t.defaultSymbol, u = Qe(l);
1411
+ let b = {}, y = [], P = null;
1412
+ if (u === "fill") {
1413
+ const v = ["interpolate", ["linear"], ["get", n]];
1414
+ for (const r of a)
1415
+ v.push(r.value), v.push(D(r.color)), y.push({
1393
1416
  type: "fill",
1394
- color: D(s.color),
1395
- label: s.label || `${s.value}`
1417
+ color: D(r.color),
1418
+ label: r.label || `${r.value}`
1396
1419
  });
1397
- if (p = {
1420
+ if (b = {
1398
1421
  "fill-color": [
1399
1422
  "case",
1400
1423
  ["==", ["get", n], null],
1401
1424
  "rgba(0, 0, 0, 0)",
1402
1425
  // Transparent for null/no-data values
1403
- y
1426
+ v
1404
1427
  // Otherwise use the interpolated color
1405
1428
  ],
1406
- "fill-opacity": ue(t)
1407
- }, Fe(a?.outline)) {
1408
- const s = a.outline.width || 1, v = D(a.outline.color);
1409
- p["fill-outline-color"] = v, s > 1 && (S = {
1410
- "line-color": v,
1411
- "line-width": s
1429
+ "fill-opacity": he(o)
1430
+ }, ze(l?.outline)) {
1431
+ const r = l.outline.width || 1, h = D(l.outline.color);
1432
+ b["fill-outline-color"] = h, r > 1 && (P = {
1433
+ "line-color": h,
1434
+ "line-width": r
1412
1435
  });
1413
1436
  }
1414
1437
  }
1415
- return { paint: p, legend: d, geomType: c, outlinePaint: S };
1438
+ return { paint: b, legend: y, geomType: u, outlinePaint: P };
1416
1439
  }
1417
- function Wo(e, n, o, t) {
1440
+ function qo(e, n, t, o) {
1418
1441
  if (!e?.renderer)
1419
- return console.warn("[Transformer] No renderer found in drawingInfo - layer will use service default (not available in WebMap)"), { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1420
- const l = e.renderer;
1421
- switch (l.type) {
1442
+ return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1443
+ const a = e.renderer;
1444
+ switch (a.type) {
1422
1445
  case "simple":
1423
- return Ct(l, n, t);
1446
+ return Et(a, n);
1424
1447
  case "uniqueValue":
1425
- return No(l, n, o);
1448
+ return Uo(a, n, t);
1426
1449
  case "classBreaks":
1427
- return Zo(l, n);
1450
+ return Wo(a, n);
1428
1451
  default:
1429
- return console.warn(`Unknown renderer type: ${l.type}`), { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1452
+ return { paint: {}, legend: [], geomType: "fill", outlinePaint: null };
1430
1453
  }
1431
1454
  }
1432
- function Uo(e) {
1455
+ function Go(e) {
1433
1456
  if (!e) return null;
1434
- const n = e.title || "", t = (e.fieldInfos || []).filter((l) => l.visible === !0).map((l) => {
1435
- const a = {
1436
- field: l.fieldName,
1437
- label: l.label || l.fieldName
1457
+ const n = e.title || "", o = (e.fieldInfos || []).filter((a) => a.visible === !0).map((a) => {
1458
+ const l = {
1459
+ field: a.fieldName,
1460
+ label: a.label || a.fieldName
1438
1461
  };
1439
- return l.format && (a.format = {}, l.format.dateFormat && (a.format.dateFormat = l.format.dateFormat), l.format.digitSeparator !== void 0 && (a.format.digitSeparator = l.format.digitSeparator), l.format.places !== void 0 && (a.format.places = l.format.places), Object.keys(a.format).length === 0 && delete a.format), a;
1462
+ return a.format && (l.format = {}, a.format.dateFormat && (l.format.dateFormat = a.format.dateFormat), a.format.digitSeparator !== void 0 && (l.format.digitSeparator = a.format.digitSeparator), a.format.places !== void 0 && (l.format.places = a.format.places), Object.keys(l.format).length === 0 && delete l.format), l;
1440
1463
  });
1441
1464
  return {
1442
1465
  title: n,
1443
- fields: t
1466
+ fields: o
1444
1467
  };
1445
1468
  }
1446
- function Vo(e) {
1469
+ function Ho(e) {
1447
1470
  return e?.definitionExpression;
1448
1471
  }
1449
- function jo(e) {
1472
+ function Jo(e) {
1450
1473
  return (e.includes("_") ? e.split("_").slice(1).join(" ") : e).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
1451
1474
  }
1452
- function qo(e) {
1475
+ function Ko(e) {
1453
1476
  return e.includes("_") ? e.split("_").slice(1).join(" ") : e;
1454
1477
  }
1455
- function Go(e) {
1478
+ function Qo(e) {
1456
1479
  const n = /* @__PURE__ */ new Map();
1457
1480
  if (!e)
1458
1481
  return n;
1459
- const o = e.split(`
1460
- `), t = /^(\d{1,3})\s+(.+)$/;
1461
- for (const l of o) {
1462
- const a = l.trim().match(t);
1463
- if (a) {
1464
- const [, c, p] = a;
1465
- c && p && n.set(c, p.trim());
1482
+ const t = e.split(`
1483
+ `), o = /^(\d{1,3})\s+(.+)$/;
1484
+ for (const a of t) {
1485
+ const l = a.trim().match(o);
1486
+ if (l) {
1487
+ const [, u, b] = l;
1488
+ u && b && n.set(u, b.trim());
1466
1489
  }
1467
1490
  }
1468
1491
  return n;
1469
1492
  }
1470
- async function Ho(e) {
1493
+ async function Xo(e) {
1471
1494
  try {
1472
- console.log(`[Transformer] Fetching service metadata from: ${e}`);
1473
1495
  const n = await fetch(`${e}?f=json`);
1474
1496
  if (!n.ok)
1475
- return console.warn(`[Transformer] Failed to fetch service metadata: ${n.status}`), null;
1476
- const o = await n.json();
1477
- return o.drawingInfo ? {
1478
- drawingInfo: o.drawingInfo,
1479
- description: o.description
1497
+ return null;
1498
+ const t = await n.json();
1499
+ return t.drawingInfo ? {
1500
+ drawingInfo: t.drawingInfo,
1501
+ description: t.description
1480
1502
  } : null;
1481
- } catch (n) {
1482
- return console.error("[Transformer] Error fetching service metadata:", n), null;
1503
+ } catch {
1504
+ return null;
1483
1505
  }
1484
1506
  }
1485
- async function kt(e) {
1486
- const n = e.operationalLayers || [], o = [], t = ["Zoning and Planning_Land Use"];
1487
- console.log("🔄 [Transformer] ===== STARTING FRESH TRANSFORMATION ====="), console.log("[Transformer] Starting transformation of", n.length, "layers");
1488
- for (const l of n) {
1489
- if (!l.url) {
1490
- console.log(`Skipping layer without URL: ${l.title}`);
1491
- continue;
1492
- }
1493
- if (l.itemId === "4f39b829b96d437da9231727d9c91fab") {
1494
- console.log(`Skipping layer with under-construction itemId: ${l.title}`);
1495
- continue;
1496
- }
1497
- console.log("[Transformer] Processing layer:", l.title), console.log(`[Transformer] Layer "${l.title}" - Renderer type:`, l.layerDefinition?.drawingInfo?.renderer?.type);
1498
- try {
1499
- let a = l.layerDefinition?.drawingInfo, c;
1500
- const p = !a || !a.renderer, d = t.includes(l.title);
1501
- if ((p || d) && l.url) {
1502
- console.log(d ? `[Transformer] Layer "${l.title}" configured to use service renderer instead of WebMap renderer` : `[Transformer] Layer "${l.title}" has no renderer in WebMap, fetching from service...`);
1503
- const M = await Ho(l.url);
1504
- M ? (a = M.drawingInfo, console.log(`[Transformer] Fetched renderer from service for "${l.title}":`, M.drawingInfo?.renderer?.type), M.description && (c = Go(M.description), c.size > 0 && console.log(`[Transformer] Parsed ${c.size} custom labels from service description`))) : console.warn(`[Transformer] Failed to fetch renderer from service for "${l.title}"`);
1507
+ async function Mt(e) {
1508
+ const n = e.operationalLayers || [], t = [], o = ["Zoning and Planning_Land Use"];
1509
+ for (const a of n)
1510
+ if (a.url && a.itemId !== "4f39b829b96d437da9231727d9c91fab")
1511
+ try {
1512
+ let l = a.layerDefinition?.drawingInfo, u;
1513
+ const b = !l || !l.renderer, y = o.includes(a.title);
1514
+ if ((b || y) && a.url) {
1515
+ const T = await Xo(a.url);
1516
+ T && (l = T.drawingInfo, T.description && (u = Qo(T.description), u.size > 0));
1517
+ }
1518
+ const { paint: P, legend: v, geomType: S, outlinePaint: r } = qo(
1519
+ l,
1520
+ a.opacity,
1521
+ u,
1522
+ a.title
1523
+ ), h = Go(a.popupInfo), w = Ho(a.layerDefinition), g = Vo(
1524
+ a.layerDefinition?.minScale,
1525
+ a.layerDefinition?.maxScale
1526
+ ), f = Jo(a.title), c = Ko(a.title);
1527
+ let L = a.opacity ?? 1;
1528
+ const F = {
1529
+ id: f,
1530
+ title: c,
1531
+ type: S,
1532
+ url: a.url,
1533
+ opacity: L,
1534
+ paint: P,
1535
+ legend: v,
1536
+ popup: h
1537
+ };
1538
+ w && (F.where = w), g.minZoom !== void 0 && (F.minZoom = g.minZoom), g.maxZoom !== void 0 && (F.maxZoom = g.maxZoom), r && (F.outlinePaint = r), t.push(F);
1539
+ } catch {
1505
1540
  }
1506
- const { paint: S, legend: y, geomType: h, outlinePaint: s } = Wo(
1507
- a,
1508
- l.opacity,
1509
- c,
1510
- l.title
1511
- );
1512
- console.log(`[Transformer] Layer "${l.title}" - Result: geomType=${h}, hasOutlinePaint=${!!s}`);
1513
- const v = Uo(l.popupInfo), E = Vo(l.layerDefinition), m = Ao(
1514
- l.layerDefinition?.minScale,
1515
- l.layerDefinition?.maxScale
1516
- ), C = jo(l.title), g = qo(l.title);
1517
- let w = l.opacity ?? 1;
1518
- const z = {
1519
- id: C,
1520
- title: g,
1521
- type: h,
1522
- url: l.url,
1523
- opacity: w,
1524
- paint: S,
1525
- legend: y,
1526
- popup: v
1527
- };
1528
- E && (z.where = E), m.minZoom !== void 0 && (z.minZoom = m.minZoom), m.maxZoom !== void 0 && (z.maxZoom = m.maxZoom), s && (z.outlinePaint = s), o.push(z);
1529
- } catch (a) {
1530
- console.error(`Error transforming layer ${l.title}:`, a);
1531
- }
1532
- }
1533
- return o.sort((l, a) => l.title.localeCompare(a.title)), o;
1541
+ return t.sort((a, l) => a.title.localeCompare(l.title)), t;
1534
1542
  }
1535
- const bt = {}, at = "376af635c84643cd816a8c5d017a53aa", Dn = at;
1536
- function Be(e, n) {
1537
- let o = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
1538
- return n && (o += `&token=${n}`), o;
1543
+ const $t = {}, yt = "376af635c84643cd816a8c5d017a53aa", Yn = yt;
1544
+ function gt(e, n) {
1545
+ let t = `https://www.arcgis.com/sharing/rest/content/items/${e}/data?f=json`;
1546
+ return n && (t += `&token=${n}`), t;
1539
1547
  }
1540
- function An() {
1541
- return Be(at);
1548
+ function ei() {
1549
+ return gt(yt);
1542
1550
  }
1543
- const We = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map();
1544
- function Jo(e) {
1545
- e ? (We.delete(e), ze.delete(e)) : (We.clear(), ze.clear());
1551
+ const Je = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ new Map();
1552
+ function Yo(e) {
1553
+ e ? (Je.delete(e), Ne.delete(e)) : (Je.clear(), Ne.clear());
1546
1554
  }
1547
- let Ae, wt = 0;
1548
- async function Qo() {
1549
- const e = typeof import.meta < "u" && bt?.VITE_AGO_USERNAME, n = typeof import.meta < "u" && bt?.VITE_AGO_PASSWORD;
1555
+ let Ge, xt = 0;
1556
+ async function en() {
1557
+ const e = typeof import.meta < "u" && $t?.VITE_AGO_USERNAME, n = typeof import.meta < "u" && $t?.VITE_AGO_PASSWORD;
1550
1558
  if (!(!e || !n)) {
1551
- if (Ae && Date.now() < wt - 3e5)
1552
- return console.log("[LayerConfigService] Using cached ArcGIS token"), Ae;
1553
- console.log("[LayerConfigService] Generating new ArcGIS token...");
1559
+ if (Ge && Date.now() < xt - 3e5)
1560
+ return Ge;
1554
1561
  try {
1555
- const t = await (await fetch("https://www.arcgis.com/sharing/rest/generateToken", {
1562
+ const o = await (await fetch("https://www.arcgis.com/sharing/rest/generateToken", {
1556
1563
  method: "POST",
1557
1564
  headers: {
1558
1565
  "Content-Type": "application/x-www-form-urlencoded"
@@ -1566,188 +1573,177 @@ async function Qo() {
1566
1573
  // 2 hours
1567
1574
  })
1568
1575
  })).json();
1569
- if (t.error) {
1570
- console.error("[LayerConfigService] Failed to generate token:", t.error);
1571
- return;
1572
- }
1573
- return Ae = t.token, wt = t.expires, console.log("[LayerConfigService] ArcGIS token generated successfully"), Ae;
1574
- } catch (o) {
1575
- console.error("[LayerConfigService] Error generating ArcGIS token:", o);
1576
+ return o.error ? void 0 : (Ge = o.token, xt = o.expires, Ge);
1577
+ } catch {
1576
1578
  return;
1577
1579
  }
1578
1580
  }
1579
1581
  }
1580
- async function Ko(e, n) {
1581
- const o = Be(e, n);
1582
- console.log(`[LayerConfigService] Fetching WebMap from: ${Be(e)}${n ? " (with token)" : ""}`);
1583
- const t = await fetch(o);
1584
- if (!t.ok)
1585
- throw new Error(`Failed to fetch WebMap: ${t.status} ${t.statusText}`);
1586
- const l = await t.json();
1587
- if (l.error)
1588
- throw new Error(`ArcGIS error: ${l.error.message || l.error.code || "Unknown error"}`);
1589
- return l;
1582
+ async function tn(e, n) {
1583
+ const t = gt(e, n), o = await fetch(t);
1584
+ if (!o.ok)
1585
+ throw new Error(`Failed to fetch WebMap: ${o.status} ${o.statusText}`);
1586
+ const a = await o.json();
1587
+ if (a.error)
1588
+ throw new Error(`ArcGIS error: ${a.error.message || a.error.code || "Unknown error"}`);
1589
+ return a;
1590
1590
  }
1591
- async function Xo(e) {
1591
+ async function on(e) {
1592
1592
  try {
1593
- console.log(`[LayerConfigService] Loading configs in DYNAMIC mode for WebMap: ${e}`);
1594
- const n = await Qo(), o = await Ko(e, n);
1595
- console.log("[LayerConfigService] Transforming WebMap to layer configs");
1596
- const t = await kt(o);
1597
- return console.log(`[LayerConfigService] Successfully loaded ${t.length} layer configs`), t;
1593
+ const n = await en(), t = await tn(e, n);
1594
+ return await Mt(t);
1598
1595
  } catch (n) {
1599
- throw console.error("[LayerConfigService] Error loading dynamic configs:", n), new Error(`Failed to load dynamic layer configs: ${n instanceof Error ? n.message : "Unknown error"}`);
1596
+ throw new Error(`Failed to load dynamic layer configs: ${n instanceof Error ? n.message : "Unknown error"}`);
1600
1597
  }
1601
1598
  }
1602
- async function lt(e = at) {
1603
- const n = We.get(e);
1599
+ async function pt(e = yt) {
1600
+ const n = Je.get(e);
1604
1601
  if (n)
1605
- return console.log(`[LayerConfigService] ⚠️ Returning CACHED configs for ${e} (transformer will NOT run)`), console.log("[LayerConfigService] To force refresh, call clearCache() or reload with Ctrl+Shift+R"), n;
1606
- const o = ze.get(e);
1607
- if (o)
1608
- return console.log(`[LayerConfigService] Load already in progress for ${e}, waiting...`), o;
1609
- console.log(`[LayerConfigService] Mode: dynamic, WebMap: ${e}`);
1610
- const t = (async () => {
1602
+ return n;
1603
+ const t = Ne.get(e);
1604
+ if (t)
1605
+ return t;
1606
+ const o = (async () => {
1611
1607
  try {
1612
- const l = await Xo(e);
1613
- return We.set(e, l), l;
1608
+ const a = await on(e);
1609
+ return Je.set(e, a), a;
1614
1610
  } finally {
1615
- ze.delete(e);
1611
+ Ne.delete(e);
1616
1612
  }
1617
1613
  })();
1618
- return ze.set(e, t), t;
1614
+ return Ne.set(e, o), o;
1619
1615
  }
1620
- function Yo(e) {
1621
- const n = $({}), o = /* @__PURE__ */ new Map();
1622
- for (const s of e)
1623
- n.value[s.id] = {
1616
+ function nn(e) {
1617
+ const n = C({}), t = /* @__PURE__ */ new Map();
1618
+ for (const r of e)
1619
+ n.value[r.id] = {
1624
1620
  data: null,
1625
1621
  loading: !1,
1626
1622
  error: null,
1627
1623
  lastFetched: null
1628
1624
  };
1629
- async function t(s) {
1630
- const v = s.id;
1625
+ async function o(r) {
1626
+ const h = r.id;
1631
1627
  n.value = {
1632
1628
  ...n.value,
1633
- [v]: {
1634
- data: n.value[v]?.data ?? null,
1635
- lastFetched: n.value[v]?.lastFetched ?? null,
1629
+ [h]: {
1630
+ data: n.value[h]?.data ?? null,
1631
+ lastFetched: n.value[h]?.lastFetched ?? null,
1636
1632
  loading: !0,
1637
1633
  error: null
1638
1634
  }
1639
1635
  };
1640
1636
  try {
1641
- let E;
1642
- if (s.type === "http-get") {
1643
- const m = await fetch(s.url, {
1637
+ let w;
1638
+ if (r.type === "http-get") {
1639
+ const g = await fetch(r.url, {
1644
1640
  method: "GET",
1645
- ...s.options
1641
+ ...r.options
1646
1642
  });
1647
- if (!m.ok)
1648
- throw new Error(`HTTP ${m.status}: ${m.statusText}`);
1649
- E = await m.json();
1650
- } else if (s.type === "http-post") {
1651
- const m = await fetch(s.url, {
1643
+ if (!g.ok)
1644
+ throw new Error(`HTTP ${g.status}: ${g.statusText}`);
1645
+ w = await g.json();
1646
+ } else if (r.type === "http-post") {
1647
+ const g = await fetch(r.url, {
1652
1648
  method: "POST",
1653
- ...s.options
1649
+ ...r.options
1654
1650
  });
1655
- if (!m.ok)
1656
- throw new Error(`HTTP ${m.status}: ${m.statusText}`);
1657
- E = await m.json();
1658
- } else if (s.type === "esri") {
1659
- const C = `${s.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, g = await fetch(C, s.options);
1660
1651
  if (!g.ok)
1661
1652
  throw new Error(`HTTP ${g.status}: ${g.statusText}`);
1662
- E = (await g.json()).features?.map((z) => z.attributes) || [];
1653
+ w = await g.json();
1654
+ } else if (r.type === "esri") {
1655
+ const f = `${r.url.replace(/\/$/, "")}/query?where=1%3D1&outFields=*&returnGeometry=false&f=json`, c = await fetch(f, r.options);
1656
+ if (!c.ok)
1657
+ throw new Error(`HTTP ${c.status}: ${c.statusText}`);
1658
+ w = (await c.json()).features?.map((F) => F.attributes) || [];
1663
1659
  } else
1664
- throw new Error(`Unknown data source type: ${s.type}`);
1665
- s.transform && (E = s.transform(E)), n.value = {
1660
+ throw new Error(`Unknown data source type: ${r.type}`);
1661
+ r.transform && (w = r.transform(w)), n.value = {
1666
1662
  ...n.value,
1667
- [v]: {
1668
- data: E,
1663
+ [h]: {
1664
+ data: w,
1669
1665
  loading: !1,
1670
1666
  error: null,
1671
1667
  lastFetched: Date.now()
1672
1668
  }
1673
1669
  };
1674
- } catch (E) {
1675
- const m = E instanceof Error ? E.message : "Unknown error";
1676
- console.error(`Failed to fetch data source "${v}":`, m), n.value = {
1670
+ } catch (w) {
1671
+ const g = w instanceof Error ? w.message : "Unknown error";
1672
+ n.value = {
1677
1673
  ...n.value,
1678
- [v]: {
1679
- data: n.value[v]?.data ?? null,
1680
- lastFetched: n.value[v]?.lastFetched ?? null,
1674
+ [h]: {
1675
+ data: n.value[h]?.data ?? null,
1676
+ lastFetched: n.value[h]?.lastFetched ?? null,
1681
1677
  loading: !1,
1682
- error: m
1678
+ error: g
1683
1679
  }
1684
1680
  };
1685
1681
  }
1686
1682
  }
1687
- async function l() {
1688
- await Promise.all(e.map((s) => t(s)));
1683
+ async function a() {
1684
+ await Promise.all(e.map((r) => o(r)));
1689
1685
  }
1690
- async function a(s) {
1691
- const v = e.find((E) => E.id === s);
1692
- v ? await t(v) : console.warn(`Data source "${s}" not found`);
1686
+ async function l(r) {
1687
+ const h = e.find((w) => w.id === r);
1688
+ h && await o(h);
1693
1689
  }
1694
- function c(s) {
1695
- return n.value[s]?.data ?? null;
1690
+ function u(r) {
1691
+ return n.value[r]?.data ?? null;
1696
1692
  }
1697
- const p = R(() => Object.values(n.value).some((s) => s.loading));
1698
- function d(s) {
1699
- return n.value[s]?.loading ?? !1;
1693
+ const b = I(() => Object.values(n.value).some((r) => r.loading));
1694
+ function y(r) {
1695
+ return n.value[r]?.loading ?? !1;
1700
1696
  }
1701
- function S(s) {
1702
- return n.value[s]?.error ?? null;
1697
+ function P(r) {
1698
+ return n.value[r]?.error ?? null;
1703
1699
  }
1704
- function y() {
1705
- for (const s of e)
1706
- if (s.pollInterval && s.pollInterval > 0) {
1707
- const v = window.setInterval(() => {
1708
- t(s);
1709
- }, s.pollInterval);
1710
- o.set(s.id, v);
1700
+ function v() {
1701
+ for (const r of e)
1702
+ if (r.pollInterval && r.pollInterval > 0) {
1703
+ const h = window.setInterval(() => {
1704
+ o(r);
1705
+ }, r.pollInterval);
1706
+ t.set(r.id, h);
1711
1707
  }
1712
1708
  }
1713
- function h() {
1714
- for (const [, s] of o)
1715
- window.clearInterval(s);
1716
- o.clear();
1709
+ function S() {
1710
+ for (const [, r] of t)
1711
+ window.clearInterval(r);
1712
+ t.clear();
1717
1713
  }
1718
- return Ze(() => {
1719
- l(), y();
1720
- }), Lt(() => {
1721
- h();
1714
+ return He(() => {
1715
+ a(), v();
1716
+ }), Pt(() => {
1717
+ S();
1722
1718
  }), {
1723
1719
  /** Reactive state for all data sources */
1724
- state: V(n),
1720
+ state: j(n),
1725
1721
  /** Whether any data source is currently loading */
1726
- isLoading: p,
1722
+ isLoading: b,
1727
1723
  /** Fetch all data sources */
1728
- fetchAll: l,
1724
+ fetchAll: a,
1729
1725
  /** Refetch a specific data source by id */
1730
- refetch: a,
1726
+ refetch: l,
1731
1727
  /** Get data for a specific source */
1732
- getData: c,
1728
+ getData: u,
1733
1729
  /** Check if a specific source is loading */
1734
- isSourceLoading: d,
1730
+ isSourceLoading: y,
1735
1731
  /** Get error for a specific source */
1736
- getError: S,
1732
+ getError: P,
1737
1733
  /** Stop all polling (useful for cleanup) */
1738
- stopPolling: h
1734
+ stopPolling: S
1739
1735
  };
1740
1736
  }
1741
- const en = { class: "layerboard-layout" }, tn = {
1737
+ const an = { class: "layerboard-layout" }, ln = ["aria-expanded"], rn = {
1742
1738
  key: 0,
1743
1739
  class: "layerboard-subtitle"
1744
- }, on = { class: "layerboard-mobile-menu-content" }, nn = { class: "layerboard-main" }, ln = {
1740
+ }, sn = { class: "layerboard-mobile-menu-content" }, cn = { class: "layerboard-main" }, un = {
1745
1741
  key: 0,
1746
1742
  class: "layerboard-loading"
1747
- }, an = {
1743
+ }, dn = {
1748
1744
  key: 1,
1749
1745
  class: "layerboard-error"
1750
- }, rn = { key: 0 }, sn = { key: 1 }, cn = { class: "layerboard-modal" }, un = /* @__PURE__ */ we({
1746
+ }, fn = { key: 0 }, pn = { key: 1 }, yn = /* @__PURE__ */ Se({
1751
1747
  __name: "Layerboard",
1752
1748
  props: {
1753
1749
  title: {},
@@ -1775,331 +1771,375 @@ const en = { class: "layerboard-layout" }, tn = {
1775
1771
  initialCenter: {}
1776
1772
  },
1777
1773
  emits: ["configs-loaded", "load-error", "zoom"],
1778
- setup(e, { expose: n, emit: o }) {
1779
- const t = e, l = o, a = $([]), c = $(!0), p = $(null), d = $(12), S = $(""), y = $(/* @__PURE__ */ new Set()), h = $({}), s = $(/* @__PURE__ */ new Set()), v = $({}), E = $({}), m = $(/* @__PURE__ */ new Set()), C = $({});
1780
- function g() {
1781
- const b = {};
1782
- for (const P of t.tiledLayers)
1783
- b[P.id] = P.opacity ?? 1;
1784
- C.value = b;
1785
- }
1786
- function w(b) {
1787
- m.value.has(b) ? m.value.delete(b) : m.value.add(b), m.value = new Set(m.value);
1788
- }
1789
- function z(b, P) {
1790
- P ? m.value.add(b) : m.value.delete(b), m.value = new Set(m.value);
1791
- }
1792
- function M(b, P) {
1793
- C.value = { ...C.value, [b]: P };
1794
- }
1795
- const N = t.dataSources.length > 0 ? Yo(t.dataSources) : null, q = R(() => N?.state.value ?? {}), ce = R(() => N?.isLoading.value ?? !1);
1796
- function Le(b) {
1797
- return N?.getData(b) ?? null;
1798
- }
1799
- function Se(b) {
1800
- return N?.refetch(b) ?? Promise.resolve();
1801
- }
1802
- U("layerboard-layers", V(a)), U("layerboard-visible", y), U("layerboard-opacities", h), U("layerboard-loading", V(s)), U("layerboard-errors", V(v)), U("layerboard-zoom", V(d)), U("layerboard-toggle-layer", Ce), U("layerboard-set-layer-visible", de), U("layerboard-set-layers-visible", ke), U("layerboard-set-opacity", fe), U("layerboard-tiled-layers", V(R(() => t.tiledLayers))), U("layerboard-visible-tiled", m), U("layerboard-tiled-opacities", C), U("layerboard-toggle-tiled", w), U("layerboard-set-tiled-opacity", M), U("layerboard-set-tiled-visible", z), U("layerboard-data-sources-state", q), U("layerboard-data-sources-loading", ce), U("layerboard-get-data-source", Le), U("layerboard-refetch-data-source", Se);
1803
- const je = R(() => ({
1804
- backgroundColor: t.themeColor
1805
- })), qe = R(() => ({
1806
- backgroundColor: t.themeColor
1807
- })), Me = R(() => ({
1808
- backgroundColor: t.themeColor
1809
- })), Ie = R(() => ({
1810
- width: ye.value ? "0" : t.sidebarWidth
1774
+ setup(e, { expose: n, emit: t }) {
1775
+ const o = e, a = t, l = C([]), u = C(!0), b = C(null), y = C(12), P = C(""), v = C(/* @__PURE__ */ new Set()), S = C({}), r = C(/* @__PURE__ */ new Set()), h = C({}), w = C({}), g = C(/* @__PURE__ */ new Set()), f = C({});
1776
+ function c() {
1777
+ const k = {};
1778
+ for (const $ of o.tiledLayers)
1779
+ k[$.id] = $.opacity ?? 1;
1780
+ f.value = k;
1781
+ }
1782
+ function L(k) {
1783
+ g.value.has(k) ? g.value.delete(k) : g.value.add(k), g.value = new Set(g.value);
1784
+ }
1785
+ function F(k, $) {
1786
+ $ ? g.value.add(k) : g.value.delete(k), g.value = new Set(g.value);
1787
+ }
1788
+ function T(k, $) {
1789
+ f.value = { ...f.value, [k]: $ };
1790
+ }
1791
+ const B = o.dataSources.length > 0 ? nn(o.dataSources) : null, q = I(() => B?.state.value ?? {}), fe = I(() => B?.isLoading.value ?? !1);
1792
+ function $e(k) {
1793
+ return B?.getData(k) ?? null;
1794
+ }
1795
+ function xe(k) {
1796
+ return B?.refetch(k) ?? Promise.resolve();
1797
+ }
1798
+ U("layerboard-layers", j(l)), U("layerboard-visible", v), U("layerboard-opacities", S), U("layerboard-loading", j(r)), U("layerboard-errors", j(h)), U("layerboard-zoom", j(y)), U("layerboard-toggle-layer", Pe), U("layerboard-set-layer-visible", ve), U("layerboard-set-layers-visible", _e), U("layerboard-set-opacity", be), U("layerboard-tiled-layers", j(I(() => o.tiledLayers))), U("layerboard-visible-tiled", g), U("layerboard-tiled-opacities", f), U("layerboard-toggle-tiled", L), U("layerboard-set-tiled-opacity", T), U("layerboard-set-tiled-visible", F), U("layerboard-data-sources-state", q), U("layerboard-data-sources-loading", fe), U("layerboard-get-data-source", $e), U("layerboard-refetch-data-source", xe);
1799
+ const Xe = I(() => ({
1800
+ backgroundColor: o.themeColor
1801
+ })), Ye = I(() => ({
1802
+ backgroundColor: o.themeColor
1803
+ })), Oe = I(() => ({
1804
+ backgroundColor: o.themeColor
1805
+ })), Ae = I(() => ({
1806
+ width: ie.value ? "0" : o.sidebarWidth
1811
1807
  }));
1812
- async function Ee() {
1808
+ async function Ie() {
1813
1809
  try {
1814
- c.value = !0, p.value = null;
1815
- const P = (await lt(t.webMapId)).map((Z) => {
1816
- const Q = t.layerStyleOverrides[Z.id];
1817
- return Q ? (console.log(`[Layerboard] Applying style override for layer: ${Z.id}`), {
1818
- ...Z,
1819
- paint: Q.paint ?? Z.paint,
1820
- outlinePaint: Q.outlinePaint ?? Z.outlinePaint,
1821
- legend: Q.legend ?? Z.legend,
1822
- type: Q.type ?? Z.type
1823
- }) : Z;
1810
+ u.value = !0, b.value = null;
1811
+ const $ = (await pt(o.webMapId)).map((A) => {
1812
+ const ae = o.layerStyleOverrides[A.id];
1813
+ return ae ? {
1814
+ ...A,
1815
+ paint: ae.paint ?? A.paint,
1816
+ outlinePaint: ae.outlinePaint ?? A.outlinePaint,
1817
+ legend: ae.legend ?? A.legend,
1818
+ type: ae.type ?? A.type
1819
+ } : A;
1824
1820
  });
1825
- a.value = P.map((Z) => ({
1826
- config: Z,
1827
- component: Z.type
1821
+ l.value = $.map((A) => ({
1822
+ config: A,
1823
+ component: A.type
1828
1824
  }));
1829
- const ae = {};
1830
- P.forEach((Z) => {
1831
- ae[Z.id] = Z.opacity ?? 1;
1832
- }), h.value = ae, console.log(`[Layerboard] Loaded ${P.length} layer configs from WebMap ${t.webMapId}`), console.log("[Layerboard] Layer IDs:", P.map((Z) => Z.id)), l("configs-loaded", P);
1833
- } catch (b) {
1834
- console.error("[Layerboard] Failed to load layer configs:", b);
1835
- const P = b instanceof Error ? b.message : "Failed to load layer configurations";
1836
- p.value = P, l("load-error", P);
1825
+ const Y = {};
1826
+ $.forEach((A) => {
1827
+ Y[A.id] = A.opacity ?? 1;
1828
+ }), S.value = Y, a("configs-loaded", $);
1829
+ } catch (k) {
1830
+ const $ = k instanceof Error ? k.message : "Failed to load layer configurations";
1831
+ b.value = $, a("load-error", $);
1837
1832
  } finally {
1838
- c.value = !1;
1833
+ u.value = !1;
1839
1834
  }
1840
1835
  }
1841
- function Oe(b) {
1842
- let P = b.split("?")[0] || b;
1843
- return P = P.replace(/\/query$/, ""), P = P.replace(/\/$/, ""), P.toLowerCase();
1836
+ function Ve(k) {
1837
+ let $ = k.split("?")[0] || k;
1838
+ return $ = $.replace(/\/query$/, ""), $ = $.replace(/\/$/, ""), $.toLowerCase();
1844
1839
  }
1845
- async function Ge() {
1846
- if (t.fetchMetadata)
1840
+ async function et() {
1841
+ if (o.fetchMetadata)
1847
1842
  try {
1848
- const b = "https://phl.carto.com/api/v2/sql?q=" + encodeURIComponent(
1843
+ const k = "https://phl.carto.com/api/v2/sql?q=" + encodeURIComponent(
1849
1844
  "select url_text, COALESCE(representation, '') as representation from phl.knack_metadata_reps_endpoints_join WHERE ( format = 'API' OR format = 'GeoService' ) AND url_text IS NOT null"
1850
- ), P = await fetch(b);
1851
- if (!P.ok) return;
1852
- const ae = await P.json(), Z = {};
1853
- for (const Q of ae.rows || [])
1854
- if (Q.url_text && Q.representation) {
1855
- const Ke = Oe(Q.url_text), Xe = `https://metadata.phila.gov/#home/representationdetails/${Q.representation}/`;
1856
- Z[Ke] = Xe;
1845
+ ), $ = await fetch(k);
1846
+ if (!$.ok) return;
1847
+ const Y = await $.json(), A = {};
1848
+ for (const ae of Y.rows || [])
1849
+ if (ae.url_text && ae.representation) {
1850
+ const qe = Ve(ae.url_text), lt = `https://metadata.phila.gov/#home/representationdetails/${ae.representation}/`;
1851
+ A[qe] = lt;
1857
1852
  }
1858
- E.value = Z;
1859
- } catch (b) {
1860
- console.error("[Layerboard] Error fetching metadata:", b);
1853
+ w.value = A;
1854
+ } catch {
1861
1855
  }
1862
1856
  }
1863
- function He(b) {
1864
- d.value = b, l("zoom", b);
1857
+ function tt(k) {
1858
+ y.value = k, a("zoom", k);
1865
1859
  }
1866
- function Ce(b) {
1867
- y.value.has(b) ? y.value.delete(b) : y.value.add(b), y.value = new Set(y.value);
1860
+ function Pe(k) {
1861
+ v.value.has(k) ? v.value.delete(k) : v.value.add(k), v.value = new Set(v.value);
1868
1862
  }
1869
- function de(b, P) {
1870
- P ? y.value.add(b) : y.value.delete(b), y.value = new Set(y.value);
1863
+ function ve(k, $) {
1864
+ $ ? v.value.add(k) : v.value.delete(k), v.value = new Set(v.value);
1871
1865
  }
1872
- function ke(b, P) {
1873
- for (const ae of b)
1874
- P ? y.value.add(ae) : y.value.delete(ae);
1875
- y.value = new Set(y.value);
1866
+ function _e(k, $) {
1867
+ for (const Y of k)
1868
+ $ ? v.value.add(Y) : v.value.delete(Y);
1869
+ v.value = new Set(v.value);
1876
1870
  }
1877
- function fe(b, P) {
1878
- h.value = { ...h.value, [b]: P };
1871
+ function be(k, $) {
1872
+ S.value = { ...S.value, [k]: $ };
1879
1873
  }
1880
- function Je(b, P) {
1881
- P ? s.value.add(b) : s.value.delete(b), s.value = new Set(s.value);
1874
+ function ot(k, $) {
1875
+ $ ? r.value.add(k) : r.value.delete(k), r.value = new Set(r.value);
1882
1876
  }
1883
- function oe(b, P) {
1884
- if (P)
1885
- v.value = { ...v.value, [b]: P };
1877
+ function oe(k, $) {
1878
+ if ($)
1879
+ h.value = { ...h.value, [k]: $ };
1886
1880
  else {
1887
- const { [b]: ae, ...Z } = v.value;
1888
- v.value = Z;
1881
+ const { [k]: Y, ...A } = h.value;
1882
+ h.value = A;
1889
1883
  }
1890
1884
  }
1891
- function pe(b) {
1892
- S.value = b;
1885
+ function we(k) {
1886
+ P.value = k;
1887
+ }
1888
+ const ne = C(null), ke = C(null), nt = C(null), Ue = C(null), Re = C(null), We = C(null), re = C("map");
1889
+ function Ce() {
1890
+ re.value = re.value === "sidebar" ? "map" : "sidebar", Ze(() => {
1891
+ re.value === "sidebar" && ne.value?.focus();
1892
+ });
1893
1893
  }
1894
- const J = $("map");
1895
- function $e() {
1896
- J.value = J.value === "sidebar" ? "map" : "sidebar";
1894
+ const se = C(!1);
1895
+ function je() {
1896
+ se.value = !se.value, se.value && Ze(() => {
1897
+ Ue.value?.focus();
1898
+ });
1897
1899
  }
1898
- const ve = $(!1);
1899
- function Qe() {
1900
- ve.value = !ve.value;
1900
+ function Ee() {
1901
+ se.value = !1, Ze(() => {
1902
+ ke.value?.focus();
1903
+ });
1901
1904
  }
1902
- function Re() {
1903
- ve.value = !1;
1905
+ const ie = C(!1);
1906
+ function it() {
1907
+ ie.value = !ie.value;
1904
1908
  }
1905
- const ye = $(!1);
1906
- function Pe() {
1907
- ye.value = !ye.value;
1909
+ const pe = C(!1), Le = C(null);
1910
+ function ye() {
1911
+ Le.value = document.activeElement, pe.value = !0, Ze(() => {
1912
+ We.value?.focus();
1913
+ });
1908
1914
  }
1909
- const te = $(!1);
1910
- function be() {
1911
- te.value = !0;
1915
+ function ue() {
1916
+ pe.value = !1, Ze(() => {
1917
+ Le.value?.focus(), Le.value = null;
1918
+ });
1912
1919
  }
1913
- function le() {
1914
- te.value = !1;
1920
+ function at(k) {
1921
+ k.target.classList.contains("layerboard-modal-backdrop") && ue();
1915
1922
  }
1916
- function De(b) {
1917
- b.target.classList.contains("layerboard-modal-backdrop") && le();
1923
+ function de(k) {
1924
+ if (k.key === "Escape") {
1925
+ ue();
1926
+ return;
1927
+ }
1928
+ if (k.key === "Tab" && Re.value) {
1929
+ const $ = Array.from(Re.value.querySelectorAll(
1930
+ 'a[href], button:not([disabled]), textarea, input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
1931
+ ));
1932
+ if ($.length === 0) return;
1933
+ const Y = $[0], A = $[$.length - 1];
1934
+ k.shiftKey ? document.activeElement === Y && (k.preventDefault(), A.focus()) : document.activeElement === A && (k.preventDefault(), Y.focus());
1935
+ }
1918
1936
  }
1919
- return U("layerboard-open-modal", be), U("layerboard-close-modal", le), U("layerboard-is-modal-open", V(te)), n({
1937
+ U("layerboard-open-modal", ye), U("layerboard-close-modal", ue), U("layerboard-is-modal-open", j(pe)), n({
1920
1938
  /** Layer configurations */
1921
- layerList: a,
1939
+ layerList: l,
1922
1940
  /** Set of visible layer IDs */
1923
- visibleLayers: y,
1941
+ visibleLayers: v,
1924
1942
  /** Layer opacity values */
1925
- layerOpacities: h,
1943
+ layerOpacities: S,
1926
1944
  /** Set of currently loading layer IDs */
1927
- loadingLayers: s,
1945
+ loadingLayers: r,
1928
1946
  /** Map of layer errors by ID */
1929
- layerErrors: v,
1947
+ layerErrors: h,
1930
1948
  /** Current map zoom level */
1931
- currentZoom: d,
1949
+ currentZoom: y,
1932
1950
  /** Toggle a layer's visibility */
1933
- toggleLayer: Ce,
1951
+ toggleLayer: Pe,
1934
1952
  /** Set a layer's visibility explicitly */
1935
- setLayerVisible: de,
1953
+ setLayerVisible: ve,
1936
1954
  /** Set multiple layers' visibility at once */
1937
- setLayersVisible: ke,
1955
+ setLayersVisible: _e,
1938
1956
  /** Set a layer's opacity */
1939
- setLayerOpacity: fe,
1957
+ setLayerOpacity: be,
1940
1958
  /** Reload layer configurations */
1941
- reloadConfigs: Ee,
1959
+ reloadConfigs: Ie,
1942
1960
  /** Clear configuration cache */
1943
- clearCache: () => Jo(t.webMapId),
1961
+ clearCache: () => Yo(o.webMapId),
1944
1962
  // Tiled layer APIs
1945
1963
  /** Set of visible tiled layer IDs */
1946
- visibleTiledLayers: m,
1964
+ visibleTiledLayers: g,
1947
1965
  /** Tiled layer opacity values */
1948
- tiledLayerOpacities: C,
1966
+ tiledLayerOpacities: f,
1949
1967
  /** Toggle a tiled layer's visibility */
1950
- toggleTiledLayer: w,
1968
+ toggleTiledLayer: L,
1951
1969
  /** Set a tiled layer's visibility explicitly */
1952
- setTiledLayerVisible: z,
1970
+ setTiledLayerVisible: F,
1953
1971
  /** Set a tiled layer's opacity */
1954
- setTiledLayerOpacity: M,
1972
+ setTiledLayerOpacity: T,
1955
1973
  // Data source APIs
1956
1974
  /** State of all data sources */
1957
1975
  dataSourcesState: q,
1958
1976
  /** Whether any data source is loading */
1959
- dataSourcesLoading: ce,
1977
+ dataSourcesLoading: fe,
1960
1978
  /** Get data from a specific data source */
1961
- getDataSourceData: Le,
1979
+ getDataSourceData: $e,
1962
1980
  /** Refetch a specific data source */
1963
- refetchDataSource: Se,
1981
+ refetchDataSource: xe,
1964
1982
  // Modal APIs
1965
1983
  /** Whether the modal is currently open */
1966
- isModalOpen: te,
1984
+ isModalOpen: pe,
1967
1985
  /** Open the modal */
1968
- openModal: be,
1986
+ openModal: ye,
1969
1987
  /** Close the modal */
1970
- closeModal: le
1971
- }), Ze(() => {
1972
- Ee(), Ge(), g();
1973
- }), (b, P) => (f(), L("div", en, [
1974
- F("header", {
1988
+ closeModal: ue
1989
+ });
1990
+ function De(k) {
1991
+ k.key === "Escape" && se.value && Ee();
1992
+ }
1993
+ return He(() => {
1994
+ Ie(), et(), c(), document.addEventListener("keydown", De);
1995
+ }), It(() => {
1996
+ document.removeEventListener("keydown", De);
1997
+ }), (k, $) => (d(), m("div", an, [
1998
+ $[5] || ($[5] = x("a", {
1999
+ href: "#main-content",
2000
+ class: "skip-to-main-content-link"
2001
+ }, "Skip to main content", -1)),
2002
+ x("header", {
1975
2003
  class: "layerboard-header",
1976
- style: Y(je.value)
2004
+ style: H(Xe.value)
1977
2005
  }, [
1978
- P[1] || (P[1] = F("a", {
2006
+ $[1] || ($[1] = x("a", {
1979
2007
  href: "https://www.phila.gov/",
1980
2008
  class: "layerboard-logo layerboard-desktop-only"
1981
2009
  }, [
1982
- F("img", {
2010
+ x("img", {
1983
2011
  src: "https://standards.phila.gov/img/logo/city-of-philadelphia-yellow-white.png",
1984
2012
  alt: "City of Philadelphia"
1985
2013
  })
1986
2014
  ], -1)),
1987
- P[2] || (P[2] = F("span", { class: "layerboard-header-divider layerboard-desktop-only" }, null, -1)),
1988
- F("button", {
2015
+ $[2] || ($[2] = x("span", { class: "layerboard-header-divider layerboard-desktop-only" }, null, -1)),
2016
+ x("button", {
2017
+ ref_key: "hamburgerRef",
2018
+ ref: ke,
1989
2019
  class: "layerboard-hamburger layerboard-mobile-only",
1990
- onClick: Qe,
2020
+ "aria-expanded": se.value,
2021
+ onClick: je,
1991
2022
  "aria-label": "Toggle menu"
1992
2023
  }, [
1993
- ee(_(me), {
1994
- "icon-definition": _(mo),
2024
+ K(O(ge), {
2025
+ "icon-definition": O(wo),
1995
2026
  size: "medium",
1996
2027
  decorative: ""
1997
2028
  }, null, 8, ["icon-definition"])
1998
- ]),
1999
- se(b.$slots, "header", {}, () => [
2000
- F("h1", null, j(e.title), 1),
2001
- e.subtitle ? (f(), L("span", tn, j(e.subtitle), 1)) : I("", !0)
2029
+ ], 8, ln),
2030
+ ce(k.$slots, "header", {}, () => [
2031
+ x("h1", null, W(e.title), 1),
2032
+ e.subtitle ? (d(), m("span", rn, W(e.subtitle), 1)) : z("", !0)
2002
2033
  ], !0),
2003
- ve.value ? (f(), L("div", {
2034
+ se.value ? (d(), m("div", {
2004
2035
  key: 0,
2005
2036
  class: "layerboard-mobile-menu",
2006
- style: Y({ backgroundColor: e.themeColor })
2037
+ style: H({ backgroundColor: e.themeColor })
2007
2038
  }, [
2008
- F("div", on, [
2009
- se(b.$slots, "footer", {
2010
- openModal: be,
2011
- closeModal: le,
2012
- isModalOpen: te.value
2039
+ x("div", sn, [
2040
+ ce(k.$slots, "footer", {
2041
+ openModal: ye,
2042
+ closeModal: ue,
2043
+ isModalOpen: pe.value
2013
2044
  }, () => [
2014
- P[0] || (P[0] = he(" City of Philadelphia ", -1))
2045
+ $[0] || ($[0] = me(" City of Philadelphia ", -1))
2015
2046
  ], !0)
2016
2047
  ]),
2017
- F("button", {
2048
+ x("button", {
2049
+ ref_key: "mobileMenuCloseRef",
2050
+ ref: Ue,
2018
2051
  class: "layerboard-mobile-menu-close",
2019
- onClick: Re,
2052
+ onClick: Ee,
2020
2053
  "aria-label": "Close menu"
2021
2054
  }, [
2022
- ee(_(me), {
2023
- "icon-definition": _(ht),
2055
+ K(O(ge), {
2056
+ "icon-definition": O(kt),
2024
2057
  size: "medium",
2025
2058
  decorative: ""
2026
2059
  }, null, 8, ["icon-definition"])
2027
- ])
2028
- ], 4)) : I("", !0),
2029
- ve.value ? (f(), L("div", {
2060
+ ], 512)
2061
+ ], 4)) : z("", !0),
2062
+ se.value ? (d(), m("div", {
2030
2063
  key: 1,
2031
2064
  class: "layerboard-mobile-menu-backdrop",
2032
- onClick: Re
2033
- })) : I("", !0)
2065
+ onClick: Ee
2066
+ })) : z("", !0)
2034
2067
  ], 4),
2035
- F("div", nn, [
2036
- c.value ? (f(), L("div", ln, [
2037
- F("div", {
2068
+ x("div", cn, [
2069
+ u.value ? (d(), m("div", un, [
2070
+ x("div", {
2038
2071
  class: "layerboard-spinner",
2039
- style: Y({ borderTopColor: e.themeColor })
2072
+ style: H({ borderTopColor: e.themeColor })
2040
2073
  }, null, 4),
2041
- F("p", null, "Loading " + j(e.title) + "...", 1)
2042
- ])) : p.value ? (f(), L("div", an, [
2043
- P[3] || (P[3] = F("h2", null, "Error Loading Layers", -1)),
2044
- F("p", null, j(p.value), 1),
2045
- F("button", {
2074
+ x("p", null, "Loading " + W(e.title) + "...", 1)
2075
+ ])) : b.value ? (d(), m("div", dn, [
2076
+ $[3] || ($[3] = x("h2", null, "Error Loading Layers", -1)),
2077
+ x("p", null, W(b.value), 1),
2078
+ x("button", {
2046
2079
  class: "layerboard-retry-button",
2047
- style: Y({ backgroundColor: e.themeColor }),
2048
- onClick: Ee
2080
+ style: H({ backgroundColor: e.themeColor }),
2081
+ onClick: Ie
2049
2082
  }, " Retry ", 4)
2050
- ])) : (f(), L(ie, { key: 2 }, [
2051
- F("aside", {
2052
- class: ne(["layerboard-sidebar", { "is-active": J.value === "sidebar" }]),
2053
- style: Y(Ie.value)
2083
+ ])) : (d(), m(ee, { key: 2 }, [
2084
+ x("aside", {
2085
+ ref_key: "sidebarRef",
2086
+ ref: ne,
2087
+ id: "main-content",
2088
+ class: te(["layerboard-sidebar", { "is-active": re.value === "sidebar" }]),
2089
+ style: H(Ae.value),
2090
+ "aria-label": "Map layers",
2091
+ tabindex: "-1"
2054
2092
  }, [
2055
- se(b.$slots, "sidebar", {
2056
- layers: a.value,
2057
- visibleLayers: y.value,
2058
- layerOpacities: h.value,
2059
- loadingLayers: s.value,
2060
- layerErrors: v.value,
2061
- currentZoom: d.value,
2062
- toggleLayer: Ce,
2063
- setLayerVisible: de,
2064
- setLayersVisible: ke,
2065
- setOpacity: fe,
2093
+ ce(k.$slots, "sidebar", {
2094
+ layers: l.value,
2095
+ visibleLayers: v.value,
2096
+ layerOpacities: S.value,
2097
+ loadingLayers: r.value,
2098
+ layerErrors: h.value,
2099
+ currentZoom: y.value,
2100
+ toggleLayer: Pe,
2101
+ setLayerVisible: ve,
2102
+ setLayersVisible: _e,
2103
+ setOpacity: be,
2066
2104
  tiledLayers: e.tiledLayers,
2067
- visibleTiledLayers: m.value,
2068
- tiledLayerOpacities: C.value,
2069
- toggleTiledLayer: w,
2070
- setTiledLayerVisible: z,
2071
- setTiledLayerOpacity: M,
2105
+ visibleTiledLayers: g.value,
2106
+ tiledLayerOpacities: f.value,
2107
+ toggleTiledLayer: L,
2108
+ setTiledLayerVisible: F,
2109
+ setTiledLayerOpacity: T,
2072
2110
  dataSourcesState: q.value,
2073
- dataSourcesLoading: ce.value,
2074
- getDataSource: Le,
2075
- refetchDataSource: Se
2111
+ dataSourcesLoading: fe.value,
2112
+ getDataSource: $e,
2113
+ refetchDataSource: xe
2076
2114
  }, () => [
2077
- e.showDefaultSidebar ? (f(), X(Ro, {
2115
+ e.showDefaultSidebar ? (d(), X(No, {
2078
2116
  key: 0,
2079
- "layer-list": a.value,
2080
- "visible-layers": y.value,
2081
- "layer-opacities": h.value,
2082
- "loading-layers": s.value,
2083
- "layer-errors": v.value,
2084
- "current-zoom": d.value,
2085
- "search-query": S.value,
2086
- "layer-metadata": E.value,
2087
- onToggleLayer: Ce,
2088
- onSetOpacity: fe,
2089
- onUpdateSearch: pe
2090
- }, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : I("", !0)
2117
+ "layer-list": l.value,
2118
+ "visible-layers": v.value,
2119
+ "layer-opacities": S.value,
2120
+ "loading-layers": r.value,
2121
+ "layer-errors": h.value,
2122
+ "current-zoom": y.value,
2123
+ "search-query": P.value,
2124
+ "layer-metadata": w.value,
2125
+ onToggleLayer: Pe,
2126
+ onSetOpacity: be,
2127
+ onUpdateSearch: we
2128
+ }, null, 8, ["layer-list", "visible-layers", "layer-opacities", "loading-layers", "layer-errors", "current-zoom", "search-query", "layer-metadata"])) : z("", !0)
2091
2129
  ], !0)
2092
2130
  ], 6),
2093
- F("div", {
2094
- class: ne(["layerboard-map", { "is-active": J.value === "map" }])
2131
+ x("div", {
2132
+ role: "main",
2133
+ "aria-label": "Map",
2134
+ class: te(["layerboard-map", { "is-active": re.value === "map" }])
2095
2135
  }, [
2096
- ee(Xt, {
2097
- "visible-layers": y.value,
2098
- "layer-opacities": h.value,
2099
- "layer-list": a.value,
2136
+ K(to, {
2137
+ "visible-layers": v.value,
2138
+ "layer-opacities": S.value,
2139
+ "layer-list": l.value,
2100
2140
  "tiled-layers": e.tiledLayers,
2101
- "visible-tiled-layers": m.value,
2102
- "tiled-layer-opacities": C.value,
2141
+ "visible-tiled-layers": g.value,
2142
+ "tiled-layer-opacities": f.value,
2103
2143
  "cyclomedia-config": e.cyclomediaConfig,
2104
2144
  "pictometry-credentials": e.pictometryCredentials,
2105
2145
  "basemap-control-position": e.basemapControlPosition,
@@ -2111,70 +2151,81 @@ const en = { class: "layerboard-layout" }, tn = {
2111
2151
  "pictometry-button-position": e.pictometryButtonPosition,
2112
2152
  "initial-zoom": e.initialZoom,
2113
2153
  "initial-center": e.initialCenter,
2114
- onZoom: He,
2115
- onLayerLoading: Je,
2154
+ onZoom: tt,
2155
+ onLayerLoading: ot,
2116
2156
  onLayerError: oe
2117
2157
  }, null, 8, ["visible-layers", "layer-opacities", "layer-list", "tiled-layers", "visible-tiled-layers", "tiled-layer-opacities", "cyclomedia-config", "pictometry-credentials", "basemap-control-position", "navigation-control-position", "geolocation-control-position", "search-control-position", "draw-control-position", "cyclomedia-button-position", "pictometry-button-position", "initial-zoom", "initial-center"])
2118
2158
  ], 2),
2119
- F("button", {
2120
- class: ne(["layerboard-sidebar-toggle", { "is-collapsed": ye.value }]),
2121
- style: Y({ left: ye.value ? "0" : t.sidebarWidth }),
2122
- onClick: Pe,
2159
+ x("button", {
2160
+ class: te(["layerboard-sidebar-toggle", { "is-collapsed": ie.value }]),
2161
+ style: H({ left: ie.value ? "0" : o.sidebarWidth }),
2162
+ onClick: it,
2123
2163
  "aria-label": "Toggle sidebar"
2124
2164
  }, [
2125
- ee(_(me), {
2126
- "icon-definition": ye.value ? _(yo) : _(go),
2165
+ K(O(ge), {
2166
+ "icon-definition": ie.value ? O(vo) : O(bo),
2127
2167
  size: "medium",
2128
2168
  decorative: ""
2129
2169
  }, null, 8, ["icon-definition"])
2130
2170
  ], 6)
2131
2171
  ], 64))
2132
2172
  ]),
2133
- F("button", {
2173
+ x("button", {
2174
+ ref_key: "mobileToggleRef",
2175
+ ref: nt,
2134
2176
  class: "layerboard-mobile-toggle",
2135
- style: Y(Me.value),
2136
- onClick: $e
2177
+ style: H(Oe.value),
2178
+ onClick: Ce
2137
2179
  }, [
2138
- J.value === "map" ? (f(), L("span", rn, j(e.sidebarLabel), 1)) : (f(), L("span", sn, j(e.mapLabel), 1))
2180
+ re.value === "map" ? (d(), m("span", fn, W(e.sidebarLabel), 1)) : (d(), m("span", pn, W(e.mapLabel), 1))
2139
2181
  ], 4),
2140
- F("footer", {
2182
+ x("footer", {
2141
2183
  class: "layerboard-footer",
2142
- style: Y(qe.value)
2184
+ style: H(Ye.value)
2143
2185
  }, [
2144
- se(b.$slots, "footer", {
2145
- openModal: be,
2146
- closeModal: le,
2147
- isModalOpen: te.value
2186
+ ce(k.$slots, "footer", {
2187
+ openModal: ye,
2188
+ closeModal: ue,
2189
+ isModalOpen: pe.value
2148
2190
  }, () => [
2149
- P[4] || (P[4] = he(" City of Philadelphia ", -1))
2191
+ $[4] || ($[4] = me(" City of Philadelphia ", -1))
2150
2192
  ], !0)
2151
2193
  ], 4),
2152
- te.value ? (f(), L("div", {
2194
+ pe.value ? (d(), m("div", {
2153
2195
  key: 0,
2154
2196
  class: "layerboard-modal-backdrop",
2155
- onClick: De
2197
+ onClick: at,
2198
+ onKeydown: de
2156
2199
  }, [
2157
- F("div", cn, [
2158
- F("button", {
2200
+ x("div", {
2201
+ ref_key: "modalRef",
2202
+ ref: Re,
2203
+ class: "layerboard-modal",
2204
+ role: "dialog",
2205
+ "aria-modal": "true"
2206
+ }, [
2207
+ x("button", {
2208
+ ref_key: "modalCloseRef",
2209
+ ref: We,
2159
2210
  class: "layerboard-modal-close",
2160
- onClick: le,
2211
+ onClick: ue,
2161
2212
  "aria-label": "Close modal"
2162
2213
  }, [
2163
- ee(_(me), {
2164
- "icon-definition": _(ht),
2214
+ K(O(ge), {
2215
+ "icon-definition": O(kt),
2165
2216
  size: "medium",
2166
2217
  decorative: ""
2167
2218
  }, null, 8, ["icon-definition"])
2168
- ]),
2169
- se(b.$slots, "modal", { closeModal: le }, void 0, !0)
2170
- ])
2171
- ])) : I("", !0)
2219
+ ], 512),
2220
+ ce(k.$slots, "modal", { closeModal: ue }, void 0, !0)
2221
+ ], 512)
2222
+ ], 32)) : z("", !0)
2172
2223
  ]));
2173
2224
  }
2174
- }), Nn = /* @__PURE__ */ _e(un, [["__scopeId", "data-v-54d854f8"]]), dn = ["aria-expanded"], fn = {
2225
+ }), ti = /* @__PURE__ */ Fe(yn, [["__scopeId", "data-v-b6286f9f"]]), gn = ["aria-expanded"], hn = {
2175
2226
  key: 0,
2176
2227
  class: "topic-icon"
2177
- }, pn = { class: "topic-title" }, yn = { class: "topic-content" }, gn = /* @__PURE__ */ we({
2228
+ }, mn = { class: "topic-title" }, vn = /* @__PURE__ */ Se({
2178
2229
  __name: "TopicAccordion",
2179
2230
  props: {
2180
2231
  title: {},
@@ -2185,40 +2236,42 @@ const en = { class: "layerboard-layout" }, tn = {
2185
2236
  },
2186
2237
  emits: ["toggle", "layerChange"],
2187
2238
  setup(e, { emit: n }) {
2188
- const o = e, t = n, l = $(o.expanded);
2189
- xe(
2190
- () => o.expanded,
2191
- (c) => {
2192
- l.value = c;
2239
+ const t = e, o = n, a = C(t.expanded), l = `topic-panel-${vt()}`, u = `topic-header-${vt()}`;
2240
+ Me(
2241
+ () => t.expanded,
2242
+ (y) => {
2243
+ a.value = y;
2193
2244
  }
2194
2245
  );
2195
- function a() {
2196
- l.value = !l.value, t("toggle", l.value);
2246
+ function b() {
2247
+ a.value = !a.value, o("toggle", a.value);
2197
2248
  }
2198
- return (c, p) => {
2199
- const d = _t("font-awesome-icon");
2200
- return f(), L("div", {
2201
- class: ne(["topic-accordion", { "is-expanded": l.value }])
2249
+ return (y, P) => {
2250
+ const v = Rt("font-awesome-icon");
2251
+ return d(), m("div", {
2252
+ class: te(["topic-accordion", { "is-expanded": a.value }])
2202
2253
  }, [
2203
- F("button", {
2204
- class: ne(["topic-header", e.headerClass]),
2254
+ x("button", {
2255
+ id: u,
2256
+ class: te(["topic-header", e.headerClass]),
2205
2257
  type: "button",
2206
- "aria-expanded": l.value,
2207
- onClick: a
2258
+ "aria-expanded": a.value,
2259
+ "aria-controls": l,
2260
+ onClick: b
2208
2261
  }, [
2209
- e.icon || c.$slots.icon ? (f(), L("span", fn, [
2210
- se(c.$slots, "icon", {}, () => [
2211
- e.icon ? (f(), X(d, {
2262
+ e.icon || y.$slots.icon ? (d(), m("span", hn, [
2263
+ ce(y.$slots, "icon", {}, () => [
2264
+ e.icon ? (d(), X(v, {
2212
2265
  key: 0,
2213
2266
  icon: ["fas", e.icon]
2214
- }, null, 8, ["icon"])) : I("", !0)
2267
+ }, null, 8, ["icon"])) : z("", !0)
2215
2268
  ], !0)
2216
- ])) : I("", !0),
2217
- F("span", pn, j(e.title), 1),
2218
- F("span", {
2219
- class: ne(["topic-chevron", { "is-rotated": l.value }])
2220
- }, [...p[0] || (p[0] = [
2221
- F("svg", {
2269
+ ])) : z("", !0),
2270
+ x("span", mn, W(e.title), 1),
2271
+ x("span", {
2272
+ class: te(["topic-chevron", { "is-rotated": a.value }])
2273
+ }, [...P[0] || (P[0] = [
2274
+ x("svg", {
2222
2275
  xmlns: "http://www.w3.org/2000/svg",
2223
2276
  width: "20",
2224
2277
  height: "20",
@@ -2227,44 +2280,50 @@ const en = { class: "layerboard-layout" }, tn = {
2227
2280
  stroke: "currentColor",
2228
2281
  "stroke-width": "2",
2229
2282
  "stroke-linecap": "round",
2230
- "stroke-linejoin": "round"
2283
+ "stroke-linejoin": "round",
2284
+ "aria-hidden": "true"
2231
2285
  }, [
2232
- F("polyline", { points: "6 9 12 15 18 9" })
2286
+ x("polyline", { points: "6 9 12 15 18 9" })
2233
2287
  ], -1)
2234
2288
  ])], 2)
2235
- ], 10, dn),
2236
- St(F("div", yn, [
2237
- se(c.$slots, "default", {}, () => [
2238
- p[1] || (p[1] = F("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
2289
+ ], 10, gn),
2290
+ _t(x("div", {
2291
+ id: l,
2292
+ role: "region",
2293
+ "aria-labelledby": u,
2294
+ class: "topic-content"
2295
+ }, [
2296
+ ce(y.$slots, "default", {}, () => [
2297
+ P[1] || (P[1] = x("p", { class: "topic-empty" }, "No content provided for this topic.", -1))
2239
2298
  ], !0)
2240
2299
  ], 512), [
2241
- [It, l.value]
2300
+ [Dt, a.value]
2242
2301
  ])
2243
2302
  ], 2);
2244
2303
  };
2245
2304
  }
2246
- }), Zn = /* @__PURE__ */ _e(gn, [["__scopeId", "data-v-fb48c75b"]]), mn = { class: "layer-checkbox-set" }, hn = ["checked", "disabled", "onChange"], vn = { class: "layer-title" }, bn = {
2305
+ }), oi = /* @__PURE__ */ Fe(vn, [["__scopeId", "data-v-d477f7ce"]]), bn = { class: "layer-checkbox-set" }, wn = ["checked", "disabled", "onChange"], Ln = { class: "layer-title" }, Sn = {
2247
2306
  key: 0,
2248
2307
  class: "loading-indicator"
2249
- }, wn = ["title"], Ln = {
2308
+ }, kn = ["aria-label"], Cn = {
2250
2309
  key: 2,
2251
2310
  class: "zoom-indicator"
2252
- }, Sn = { class: "layer-title" }, Cn = {
2311
+ }, $n = { class: "layer-title" }, xn = {
2253
2312
  key: 0,
2254
2313
  class: "loading-indicator"
2255
- }, kn = ["title"], $n = {
2314
+ }, Pn = ["aria-label"], _n = {
2256
2315
  key: 2,
2257
2316
  class: "zoom-indicator"
2258
- }, Pn = {
2317
+ }, En = {
2259
2318
  key: 2,
2260
2319
  class: "opacity-control"
2261
- }, xn = { class: "opacity-label" }, Tn = ["value", "onInput"], Fn = {
2320
+ }, Mn = ["for"], Tn = ["id", "value", "aria-label", "onInput"], zn = {
2262
2321
  key: 3,
2263
2322
  class: "layer-legend"
2264
- }, Mn = { class: "legend-label" }, En = {
2323
+ }, Fn = { class: "legend-label" }, On = {
2265
2324
  key: 0,
2266
2325
  class: "empty-state"
2267
- }, zn = /* @__PURE__ */ we({
2326
+ }, In = /* @__PURE__ */ Se({
2268
2327
  __name: "LayerCheckboxSet",
2269
2328
  props: {
2270
2329
  layers: {},
@@ -2278,326 +2337,472 @@ const en = { class: "layerboard-layout" }, tn = {
2278
2337
  },
2279
2338
  emits: ["toggleLayer", "setOpacity"],
2280
2339
  setup(e, { emit: n }) {
2281
- const o = e, t = n;
2282
- function l(m) {
2283
- return o.visibleLayerIds.has(m);
2340
+ const t = e, o = n;
2341
+ function a(g) {
2342
+ return t.visibleLayerIds.has(g);
2284
2343
  }
2285
- function a(m) {
2286
- return o.layerOpacities[m] ?? 1;
2344
+ function l(g) {
2345
+ return t.layerOpacities[g] ?? 1;
2287
2346
  }
2288
- function c(m) {
2289
- return o.loadingLayerIds.has(m);
2347
+ function u(g) {
2348
+ return t.loadingLayerIds.has(g);
2290
2349
  }
2291
- function p(m) {
2292
- return o.layerErrors[m] || null;
2350
+ function b(g) {
2351
+ return t.layerErrors[g] || null;
2293
2352
  }
2294
- function d(m) {
2295
- const C = o.currentZoom, g = m.minZoom, w = m.maxZoom;
2296
- return !(g !== void 0 && C < g || w !== void 0 && C > w);
2353
+ function y(g) {
2354
+ const f = t.currentZoom, c = g.minZoom, L = g.maxZoom;
2355
+ return !(c !== void 0 && f < c || L !== void 0 && f > L);
2297
2356
  }
2298
- function S(m) {
2299
- return m.displayOptions?.shouldShowCheckbox !== !1;
2357
+ function P(g) {
2358
+ return g.displayOptions?.shouldShowCheckbox !== !1;
2300
2359
  }
2301
- function y(m) {
2302
- return o.showOpacity ? m.displayOptions?.shouldShowSlider !== !1 : !1;
2360
+ function v(g) {
2361
+ return t.showOpacity ? g.displayOptions?.shouldShowSlider !== !1 : !1;
2303
2362
  }
2304
- function h(m) {
2305
- return o.showLegend ? m.displayOptions?.shouldShowLegendBox !== !1 : !1;
2363
+ function S(g) {
2364
+ return t.showLegend ? g.displayOptions?.shouldShowLegendBox !== !1 : !1;
2306
2365
  }
2307
- function s(m) {
2308
- return m.displayOptions?.layerNameChange || m.title;
2366
+ function r(g) {
2367
+ return g.displayOptions?.layerNameChange || g.title;
2309
2368
  }
2310
- function v(m) {
2311
- t("toggleLayer", m);
2369
+ function h(g) {
2370
+ o("toggleLayer", g);
2312
2371
  }
2313
- function E(m, C) {
2314
- const g = C.target;
2315
- t("setOpacity", m, parseFloat(g.value));
2372
+ function w(g, f) {
2373
+ const c = f.target;
2374
+ o("setOpacity", g, parseFloat(c.value));
2316
2375
  }
2317
- return (m, C) => (f(), L("div", mn, [
2318
- (f(!0), L(ie, null, re(e.layers, (g) => (f(), L("div", {
2319
- key: g.id,
2376
+ return (g, f) => (d(), m("div", bn, [
2377
+ (d(!0), m(ee, null, le(e.layers, (c) => (d(), m("div", {
2378
+ key: c.id,
2320
2379
  class: "layer-item"
2321
2380
  }, [
2322
- S(g) ? (f(), L("label", {
2381
+ P(c) ? (d(), m("label", {
2323
2382
  key: 0,
2324
- class: ne(["layer-checkbox", {
2325
- "layer-unavailable": !d(g),
2326
- "layer-error": p(g.id)
2383
+ class: te(["layer-checkbox", {
2384
+ "layer-unavailable": !y(c),
2385
+ "layer-error": b(c.id)
2327
2386
  }])
2328
2387
  }, [
2329
- F("input", {
2388
+ x("input", {
2330
2389
  type: "checkbox",
2331
- checked: l(g.id),
2332
- disabled: !d(g),
2333
- onChange: (w) => v(g.id)
2334
- }, null, 40, hn),
2335
- F("span", vn, [
2336
- he(j(s(g)) + " ", 1),
2337
- c(g.id) ? (f(), L("span", bn, " Loading... ")) : I("", !0),
2338
- p(g.id) ? (f(), L("span", {
2390
+ checked: a(c.id),
2391
+ disabled: !y(c),
2392
+ onChange: (L) => h(c.id)
2393
+ }, null, 40, wn),
2394
+ x("span", Ln, [
2395
+ me(W(r(c)) + " ", 1),
2396
+ u(c.id) ? (d(), m("span", Sn, " Loading... ")) : z("", !0),
2397
+ b(c.id) ? (d(), m("span", {
2339
2398
  key: 1,
2340
2399
  class: "error-indicator",
2341
- title: p(g.id) || ""
2342
- }, " Error ", 8, wn)) : I("", !0),
2343
- d(g) ? I("", !0) : (f(), L("span", Ln, " (zoom in) "))
2400
+ "aria-label": b(c.id) || "Error"
2401
+ }, " Error ", 8, kn)) : z("", !0),
2402
+ y(c) ? z("", !0) : (d(), m("span", Cn, " (zoom in) "))
2344
2403
  ])
2345
- ], 2)) : (f(), L("div", {
2404
+ ], 2)) : (d(), m("div", {
2346
2405
  key: 1,
2347
- class: ne(["layer-label-only", {
2348
- "layer-unavailable": !d(g),
2349
- "layer-error": p(g.id)
2406
+ class: te(["layer-label-only", {
2407
+ "layer-unavailable": !y(c),
2408
+ "layer-error": b(c.id)
2350
2409
  }])
2351
2410
  }, [
2352
- F("span", Sn, [
2353
- he(j(s(g)) + " ", 1),
2354
- c(g.id) ? (f(), L("span", Cn, " Loading... ")) : I("", !0),
2355
- p(g.id) ? (f(), L("span", {
2411
+ x("span", $n, [
2412
+ me(W(r(c)) + " ", 1),
2413
+ u(c.id) ? (d(), m("span", xn, " Loading... ")) : z("", !0),
2414
+ b(c.id) ? (d(), m("span", {
2356
2415
  key: 1,
2357
2416
  class: "error-indicator",
2358
- title: p(g.id) || ""
2359
- }, " Error ", 8, kn)) : I("", !0),
2360
- d(g) ? I("", !0) : (f(), L("span", $n, " (zoom in) "))
2417
+ "aria-label": b(c.id) || "Error"
2418
+ }, " Error ", 8, Pn)) : z("", !0),
2419
+ y(c) ? z("", !0) : (d(), m("span", _n, " (zoom in) "))
2361
2420
  ])
2362
2421
  ], 2)),
2363
- y(g) && l(g.id) ? (f(), L("div", Pn, [
2364
- F("label", xn, " Opacity: " + j(Math.round(a(g.id) * 100)) + "% ", 1),
2365
- F("input", {
2422
+ v(c) && a(c.id) ? (d(), m("div", En, [
2423
+ x("label", {
2424
+ class: "opacity-label",
2425
+ for: "opacity-" + c.id
2426
+ }, " Opacity: " + W(Math.round(l(c.id) * 100)) + "% ", 9, Mn),
2427
+ x("input", {
2428
+ id: "opacity-" + c.id,
2366
2429
  type: "range",
2367
2430
  min: "0",
2368
2431
  max: "1",
2369
2432
  step: "0.05",
2370
- value: a(g.id),
2433
+ value: l(c.id),
2434
+ "aria-label": "Opacity for " + r(c),
2371
2435
  class: "opacity-slider",
2372
- onInput: (w) => E(g.id, w)
2436
+ onInput: (L) => w(c.id, L)
2373
2437
  }, null, 40, Tn)
2374
- ])) : I("", !0),
2375
- h(g) && l(g.id) && g.legend?.length ? (f(), L("ul", Fn, [
2376
- (f(!0), L(ie, null, re(g.legend, (w, z) => (f(), L("li", {
2377
- key: z,
2438
+ ])) : z("", !0),
2439
+ S(c) && a(c.id) && c.legend?.length ? (d(), m("ul", zn, [
2440
+ (d(!0), m(ee, null, le(c.legend, (L, F) => (d(), m("li", {
2441
+ key: F,
2378
2442
  class: "legend-item"
2379
2443
  }, [
2380
- w.type === "circle" ? (f(), L("span", {
2444
+ L.type === "circle" ? (d(), m("span", {
2381
2445
  key: 0,
2382
2446
  class: "legend-symbol legend-circle",
2383
- style: Y({ backgroundColor: w.color })
2384
- }, null, 4)) : w.type === "line" ? (f(), L("span", {
2447
+ style: H({ backgroundColor: L.color }),
2448
+ "aria-hidden": "true"
2449
+ }, null, 4)) : L.type === "line" ? (d(), m("span", {
2385
2450
  key: 1,
2386
2451
  class: "legend-symbol legend-line",
2387
- style: Y({
2388
- backgroundColor: w.color,
2389
- height: `${w.width || 2}px`
2390
- })
2391
- }, null, 4)) : w.type === "fill" ? (f(), L("span", {
2452
+ style: H({
2453
+ backgroundColor: L.color,
2454
+ height: `${L.width || 2}px`
2455
+ }),
2456
+ "aria-hidden": "true"
2457
+ }, null, 4)) : L.type === "fill" ? (d(), m("span", {
2392
2458
  key: 2,
2393
2459
  class: "legend-symbol legend-fill",
2394
- style: Y({ backgroundColor: w.color })
2395
- }, null, 4)) : I("", !0),
2396
- F("span", Mn, j(w.label), 1)
2460
+ style: H({ backgroundColor: L.color }),
2461
+ "aria-hidden": "true"
2462
+ }, null, 4)) : z("", !0),
2463
+ x("span", Fn, W(L.label), 1)
2397
2464
  ]))), 128))
2398
- ])) : I("", !0)
2465
+ ])) : z("", !0)
2399
2466
  ]))), 128)),
2400
- e.layers.length === 0 ? (f(), L("div", En, " No layers available ")) : I("", !0)
2467
+ e.layers.length === 0 ? (d(), m("div", On, " No layers available ")) : z("", !0)
2401
2468
  ]));
2402
2469
  }
2403
- }), Bn = /* @__PURE__ */ _e(zn, [["__scopeId", "data-v-cc5e50fd"]]);
2404
- function Wn(e) {
2405
- const n = $([]), o = $(/* @__PURE__ */ new Set()), t = $({}), l = $(/* @__PURE__ */ new Set()), a = $({}), c = $(""), p = $(!1), d = $(!1), S = $(null), y = R(() => {
2406
- if (!c.value.trim())
2470
+ }), ni = /* @__PURE__ */ Fe(In, [["__scopeId", "data-v-e07d84cd"]]), Rn = { class: "layer-radio-set" }, Dn = ["name", "checked", "disabled", "onChange"], Zn = { class: "layer-title" }, Bn = {
2471
+ key: 0,
2472
+ class: "loading-indicator"
2473
+ }, Nn = ["aria-label"], An = {
2474
+ key: 2,
2475
+ class: "zoom-indicator"
2476
+ }, Vn = {
2477
+ key: 0,
2478
+ class: "opacity-control"
2479
+ }, Un = ["for"], Wn = ["id", "value", "aria-label", "onInput"], jn = {
2480
+ key: 1,
2481
+ class: "layer-legend"
2482
+ }, qn = { class: "legend-label" }, Gn = {
2483
+ key: 0,
2484
+ class: "empty-state"
2485
+ }, Hn = /* @__PURE__ */ Se({
2486
+ __name: "LayerRadioButtonSet",
2487
+ props: {
2488
+ layers: {},
2489
+ visibleLayerIds: {},
2490
+ layerOpacities: { default: () => ({}) },
2491
+ loadingLayerIds: { default: () => /* @__PURE__ */ new Set() },
2492
+ layerErrors: { default: () => ({}) },
2493
+ currentZoom: { default: 12 },
2494
+ showOpacity: { type: Boolean, default: !0 },
2495
+ showLegend: { type: Boolean, default: !0 },
2496
+ groupName: { default: "layer-radio-group" }
2497
+ },
2498
+ emits: ["selectLayer", "setOpacity"],
2499
+ setup(e, { emit: n }) {
2500
+ const t = e, o = n;
2501
+ function a(w) {
2502
+ return t.visibleLayerIds.has(w);
2503
+ }
2504
+ function l(w) {
2505
+ return t.layerOpacities[w] ?? 1;
2506
+ }
2507
+ function u(w) {
2508
+ return t.loadingLayerIds.has(w);
2509
+ }
2510
+ function b(w) {
2511
+ return t.layerErrors[w] || null;
2512
+ }
2513
+ function y(w) {
2514
+ const g = t.currentZoom, f = w.minZoom, c = w.maxZoom;
2515
+ return !(f !== void 0 && g < f || c !== void 0 && g > c);
2516
+ }
2517
+ function P(w) {
2518
+ return t.showOpacity ? w.displayOptions?.shouldShowSlider !== !1 : !1;
2519
+ }
2520
+ function v(w) {
2521
+ return t.showLegend ? w.displayOptions?.shouldShowLegendBox !== !1 : !1;
2522
+ }
2523
+ function S(w) {
2524
+ return w.displayOptions?.layerNameChange || w.title;
2525
+ }
2526
+ function r(w) {
2527
+ const g = t.layers.filter((f) => t.visibleLayerIds.has(f.id) && f.id !== w).map((f) => f.id);
2528
+ o("selectLayer", w, g);
2529
+ }
2530
+ function h(w, g) {
2531
+ const f = g.target;
2532
+ o("setOpacity", w, parseFloat(f.value));
2533
+ }
2534
+ return (w, g) => (d(), m("div", Rn, [
2535
+ (d(!0), m(ee, null, le(e.layers, (f) => (d(), m("div", {
2536
+ key: f.id,
2537
+ class: "layer-item"
2538
+ }, [
2539
+ x("label", {
2540
+ class: te(["layer-radio", {
2541
+ "layer-unavailable": !y(f),
2542
+ "layer-error": b(f.id)
2543
+ }])
2544
+ }, [
2545
+ x("input", {
2546
+ type: "radio",
2547
+ name: e.groupName,
2548
+ checked: a(f.id),
2549
+ disabled: !y(f),
2550
+ onChange: (c) => r(f.id)
2551
+ }, null, 40, Dn),
2552
+ x("span", Zn, [
2553
+ me(W(S(f)) + " ", 1),
2554
+ u(f.id) ? (d(), m("span", Bn, " Loading... ")) : z("", !0),
2555
+ b(f.id) ? (d(), m("span", {
2556
+ key: 1,
2557
+ class: "error-indicator",
2558
+ "aria-label": b(f.id) || "Error"
2559
+ }, " Error ", 8, Nn)) : z("", !0),
2560
+ y(f) ? z("", !0) : (d(), m("span", An, " (zoom in) "))
2561
+ ])
2562
+ ], 2),
2563
+ P(f) && a(f.id) ? (d(), m("div", Vn, [
2564
+ x("label", {
2565
+ class: "opacity-label",
2566
+ for: "opacity-" + f.id
2567
+ }, " Opacity: " + W(Math.round(l(f.id) * 100)) + "% ", 9, Un),
2568
+ x("input", {
2569
+ id: "opacity-" + f.id,
2570
+ type: "range",
2571
+ min: "0",
2572
+ max: "1",
2573
+ step: "0.05",
2574
+ value: l(f.id),
2575
+ "aria-label": "Opacity for " + S(f),
2576
+ class: "opacity-slider",
2577
+ onInput: (c) => h(f.id, c)
2578
+ }, null, 40, Wn)
2579
+ ])) : z("", !0),
2580
+ v(f) && a(f.id) && f.legend?.length ? (d(), m("ul", jn, [
2581
+ (d(!0), m(ee, null, le(f.legend, (c, L) => (d(), m("li", {
2582
+ key: L,
2583
+ class: "legend-item"
2584
+ }, [
2585
+ c.type === "circle" ? (d(), m("span", {
2586
+ key: 0,
2587
+ class: "legend-symbol legend-circle",
2588
+ style: H({ backgroundColor: c.color }),
2589
+ "aria-hidden": "true"
2590
+ }, null, 4)) : c.type === "line" ? (d(), m("span", {
2591
+ key: 1,
2592
+ class: "legend-symbol legend-line",
2593
+ style: H({
2594
+ backgroundColor: c.color,
2595
+ height: `${c.width || 2}px`
2596
+ }),
2597
+ "aria-hidden": "true"
2598
+ }, null, 4)) : c.type === "fill" ? (d(), m("span", {
2599
+ key: 2,
2600
+ class: "legend-symbol legend-fill",
2601
+ style: H({ backgroundColor: c.color }),
2602
+ "aria-hidden": "true"
2603
+ }, null, 4)) : z("", !0),
2604
+ x("span", qn, W(c.label), 1)
2605
+ ]))), 128))
2606
+ ])) : z("", !0)
2607
+ ]))), 128)),
2608
+ e.layers.length === 0 ? (d(), m("div", Gn, " No layers available ")) : z("", !0)
2609
+ ]));
2610
+ }
2611
+ }), ii = /* @__PURE__ */ Fe(Hn, [["__scopeId", "data-v-f6d42644"]]);
2612
+ function ai(e) {
2613
+ const n = C([]), t = C(/* @__PURE__ */ new Set()), o = C({}), a = C(/* @__PURE__ */ new Set()), l = C({}), u = C(""), b = C(!1), y = C(!1), P = C(null), v = I(() => {
2614
+ if (!u.value.trim())
2407
2615
  return n.value;
2408
- const M = c.value.toLowerCase();
2616
+ const T = u.value.toLowerCase();
2409
2617
  return n.value.filter(
2410
- (N) => N.title.toLowerCase().includes(M)
2618
+ (B) => B.title.toLowerCase().includes(T)
2411
2619
  );
2412
- }), h = R(() => n.value.map((M) => ({
2413
- config: M,
2414
- component: M.type
2620
+ }), S = I(() => n.value.map((T) => ({
2621
+ config: T,
2622
+ component: T.type
2415
2623
  // "circle", "fill", or "line"
2416
2624
  })));
2417
- async function s() {
2418
- if (d.value) {
2419
- console.warn("[useLayerboard] Already initialized");
2420
- return;
2421
- }
2422
- p.value = !0, S.value = null;
2423
- try {
2424
- let M;
2425
- e.mode === "dynamic" || !e.mode ? e.webMapId ? M = await v(e.webMapId) : M = await lt() : M = await lt(), n.value = M;
2426
- const N = {};
2427
- M.forEach((q) => {
2428
- N[q.id] = q.opacity ?? 1;
2429
- }), t.value = N, d.value = !0, console.log(`[useLayerboard] Initialized with ${M.length} layers`);
2430
- } catch (M) {
2431
- S.value = M instanceof Error ? M : new Error("Failed to initialize layerboard"), console.error("[useLayerboard] Initialization error:", M);
2432
- } finally {
2433
- p.value = !1;
2625
+ async function r() {
2626
+ if (!y.value) {
2627
+ b.value = !0, P.value = null;
2628
+ try {
2629
+ let T;
2630
+ e.mode === "dynamic" || !e.mode ? e.webMapId ? T = await h(e.webMapId) : T = await pt() : T = await pt(), n.value = T;
2631
+ const B = {};
2632
+ T.forEach((q) => {
2633
+ B[q.id] = q.opacity ?? 1;
2634
+ }), o.value = B, y.value = !0;
2635
+ } catch (T) {
2636
+ P.value = T instanceof Error ? T : new Error("Failed to initialize layerboard");
2637
+ } finally {
2638
+ b.value = !1;
2639
+ }
2434
2640
  }
2435
2641
  }
2436
- async function v(M) {
2437
- const N = Be(M);
2438
- console.log(`[useLayerboard] Fetching WebMap from: ${N}`);
2439
- const q = await fetch(N);
2642
+ async function h(T) {
2643
+ const B = gt(T), q = await fetch(B);
2440
2644
  if (!q.ok)
2441
2645
  throw new Error(`Failed to fetch WebMap: ${q.status} ${q.statusText}`);
2442
- const ce = await q.json();
2443
- return kt(ce);
2646
+ const fe = await q.json();
2647
+ return Mt(fe);
2444
2648
  }
2445
- function E(M) {
2446
- const N = new Set(o.value);
2447
- N.has(M) ? N.delete(M) : N.add(M), o.value = N;
2649
+ function w(T) {
2650
+ const B = new Set(t.value);
2651
+ B.has(T) ? B.delete(T) : B.add(T), t.value = B;
2448
2652
  }
2449
- function m(M, N) {
2450
- t.value = {
2451
- ...t.value,
2452
- [M]: Math.max(0, Math.min(1, N))
2653
+ function g(T, B) {
2654
+ o.value = {
2655
+ ...o.value,
2656
+ [T]: Math.max(0, Math.min(1, B))
2453
2657
  };
2454
2658
  }
2455
- function C(M) {
2456
- c.value = M;
2659
+ function f(T) {
2660
+ u.value = T;
2457
2661
  }
2458
- function g(M, N) {
2459
- const q = new Set(l.value);
2460
- N ? q.add(M) : q.delete(M), l.value = q;
2662
+ function c(T, B) {
2663
+ const q = new Set(a.value);
2664
+ B ? q.add(T) : q.delete(T), a.value = q;
2461
2665
  }
2462
- function w(M, N) {
2463
- if (N)
2464
- a.value = { ...a.value, [M]: N };
2666
+ function L(T, B) {
2667
+ if (B)
2668
+ l.value = { ...l.value, [T]: B };
2465
2669
  else {
2466
- const { [M]: q, ...ce } = a.value;
2467
- a.value = ce;
2670
+ const { [T]: q, ...fe } = l.value;
2671
+ l.value = fe;
2468
2672
  }
2469
2673
  }
2470
- function z() {
2471
- n.value = [], o.value = /* @__PURE__ */ new Set(), t.value = {}, l.value = /* @__PURE__ */ new Set(), a.value = {}, c.value = "", p.value = !1, d.value = !1, S.value = null;
2674
+ function F() {
2675
+ n.value = [], t.value = /* @__PURE__ */ new Set(), o.value = {}, a.value = /* @__PURE__ */ new Set(), l.value = {}, u.value = "", b.value = !1, y.value = !1, P.value = null;
2472
2676
  }
2473
2677
  return {
2474
2678
  // State (readonly)
2475
- layerConfigs: V(n),
2476
- visibleLayers: V(o),
2477
- layerOpacities: V(t),
2478
- loadingLayers: V(l),
2479
- layerErrors: V(a),
2480
- searchQuery: V(c),
2481
- isLoading: V(p),
2482
- isInitialized: V(d),
2483
- error: V(S),
2679
+ layerConfigs: j(n),
2680
+ visibleLayers: j(t),
2681
+ layerOpacities: j(o),
2682
+ loadingLayers: j(a),
2683
+ layerErrors: j(l),
2684
+ searchQuery: j(u),
2685
+ isLoading: j(b),
2686
+ isInitialized: j(y),
2687
+ error: j(P),
2484
2688
  // Computed
2485
- filteredLayerConfigs: y,
2486
- layerList: h,
2689
+ filteredLayerConfigs: v,
2690
+ layerList: S,
2487
2691
  // Config
2488
2692
  config: e,
2489
2693
  // Methods
2490
- initialize: s,
2491
- toggleLayer: E,
2492
- setLayerOpacity: m,
2493
- filterLayers: C,
2494
- setLayerLoading: g,
2495
- setLayerError: w,
2496
- reset: z
2694
+ initialize: r,
2695
+ toggleLayer: w,
2696
+ setLayerOpacity: g,
2697
+ filterLayers: f,
2698
+ setLayerLoading: c,
2699
+ setLayerError: L,
2700
+ reset: F
2497
2701
  };
2498
2702
  }
2499
- function Un() {
2500
- const e = $([]), n = $(/* @__PURE__ */ new Set()), o = $(/* @__PURE__ */ new Set());
2501
- function t(a) {
2502
- n.value.has(a) ? n.value.delete(a) : n.value.add(a);
2703
+ function li() {
2704
+ const e = C([]), n = C(/* @__PURE__ */ new Set()), t = C(/* @__PURE__ */ new Set());
2705
+ function o(l) {
2706
+ n.value.has(l) ? n.value.delete(l) : n.value.add(l);
2503
2707
  }
2504
- function l(a) {
2505
- e.value = a;
2708
+ function a(l) {
2709
+ e.value = l;
2506
2710
  }
2507
2711
  return {
2508
- layers: R(() => e.value),
2509
- visibleLayerIds: R(() => n.value),
2510
- loadingLayerIds: R(() => o.value),
2511
- toggleLayer: t,
2512
- setLayers: l
2712
+ layers: I(() => e.value),
2713
+ visibleLayerIds: I(() => n.value),
2714
+ loadingLayerIds: I(() => t.value),
2715
+ toggleLayer: o,
2716
+ setLayers: a
2513
2717
  };
2514
2718
  }
2515
- function _n(e) {
2516
- const n = $(null), o = $(!1), t = $(null), l = $(0);
2517
- async function a(d = {}) {
2518
- o.value = !0, t.value = null;
2519
- const S = e.pageSize || 2e3;
2520
- let y = 0, h = [], s = !0;
2719
+ function Jn(e) {
2720
+ const n = C(null), t = C(!1), o = C(null), a = C(0);
2721
+ async function l(y = {}) {
2722
+ t.value = !0, o.value = null;
2723
+ const P = e.pageSize || 2e3;
2724
+ let v = 0, S = [], r = !0;
2521
2725
  try {
2522
- for (; s; ) {
2523
- const E = e.url.replace(/\/$/, ""), m = encodeURIComponent(d.where || e.where || "1=1");
2524
- let C = `${E}/query?where=${m}&outFields=*&returnGeometry=true&resultRecordCount=${S}&resultOffset=${y}&f=geojson`;
2525
- if (d.bounds) {
2526
- const z = JSON.stringify({
2527
- xmin: d.bounds.west,
2528
- ymin: d.bounds.south,
2529
- xmax: d.bounds.east,
2530
- ymax: d.bounds.north,
2726
+ for (; r; ) {
2727
+ const w = e.url.replace(/\/$/, ""), g = encodeURIComponent(y.where || e.where || "1=1");
2728
+ let f = `${w}/query?where=${g}&outFields=*&returnGeometry=true&resultRecordCount=${P}&resultOffset=${v}&f=geojson`;
2729
+ if (y.bounds) {
2730
+ const F = JSON.stringify({
2731
+ xmin: y.bounds.west,
2732
+ ymin: y.bounds.south,
2733
+ xmax: y.bounds.east,
2734
+ ymax: y.bounds.north,
2531
2735
  spatialReference: { wkid: 4326 }
2532
2736
  });
2533
- C += `&geometry=${encodeURIComponent(z)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
2737
+ f += `&geometry=${encodeURIComponent(F)}&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects`;
2534
2738
  }
2535
- const g = await fetch(C);
2536
- if (!g.ok)
2537
- throw new Error(`HTTP ${g.status}: ${g.statusText}`);
2538
- const w = await g.json();
2539
- w.features && w.features.length > 0 ? (h = h.concat(w.features), y += w.features.length, s = w.features.length === S) : s = !1;
2739
+ const c = await fetch(f);
2740
+ if (!c.ok)
2741
+ throw new Error(`HTTP ${c.status}: ${c.statusText}`);
2742
+ const L = await c.json();
2743
+ L.features && L.features.length > 0 ? (S = S.concat(L.features), v += L.features.length, r = L.features.length === P) : r = !1;
2540
2744
  }
2541
- const v = {
2745
+ const h = {
2542
2746
  type: "FeatureCollection",
2543
- features: h
2747
+ features: S
2544
2748
  };
2545
- return n.value = v, l.value = h.length, v;
2546
- } catch (v) {
2547
- const E = v instanceof Error ? v : new Error("Failed to fetch features");
2548
- throw t.value = E, E;
2749
+ return n.value = h, a.value = S.length, h;
2750
+ } catch (h) {
2751
+ const w = h instanceof Error ? h : new Error("Failed to fetch features");
2752
+ throw o.value = w, w;
2549
2753
  } finally {
2550
- o.value = !1;
2754
+ t.value = !1;
2551
2755
  }
2552
2756
  }
2553
- function c() {
2554
- n.value = null, l.value = 0, t.value = null;
2757
+ function u() {
2758
+ n.value = null, a.value = 0, o.value = null;
2555
2759
  }
2556
- async function p(d = {}) {
2557
- return a(d);
2760
+ async function b(y = {}) {
2761
+ return l(y);
2558
2762
  }
2559
2763
  return {
2560
2764
  // State (readonly)
2561
- data: V(n),
2562
- isLoading: V(o),
2563
- error: V(t),
2564
- totalFeatures: V(l),
2765
+ data: j(n),
2766
+ isLoading: j(t),
2767
+ error: j(o),
2768
+ totalFeatures: j(a),
2565
2769
  // Config
2566
2770
  config: e,
2567
2771
  // Methods
2568
- fetch: a,
2569
- refetch: p,
2570
- clear: c
2772
+ fetch: l,
2773
+ refetch: b,
2774
+ clear: u
2571
2775
  };
2572
2776
  }
2573
- function Vn(e, n, o) {
2574
- const t = _n(e);
2575
- return xe(
2777
+ function ri(e, n, t) {
2778
+ const o = Jn(e);
2779
+ return Me(
2576
2780
  n,
2577
- async (l) => {
2578
- if (l) {
2579
- const a = o(l);
2580
- await t.fetch(a);
2781
+ async (a) => {
2782
+ if (a) {
2783
+ const l = t(a);
2784
+ await o.fetch(l);
2581
2785
  }
2582
2786
  },
2583
2787
  { immediate: !0 }
2584
- ), t;
2788
+ ), o;
2585
2789
  }
2586
2790
  export {
2587
- Bn as LayerCheckboxSet,
2588
- Ro as LayerPanel,
2589
- Nn as Layerboard,
2590
- Xt as MapPanel,
2591
- Zn as TopicAccordion,
2592
- Dn as WEBMAP_ID,
2593
- Be as buildWebMapUrl,
2594
- Jo as clearCache,
2595
- lt as getLayerConfigs,
2596
- An as getWebMapUrl,
2597
- kt as transformWebMapToLayerConfigs,
2598
- Yo as useApiDataSources,
2599
- _n as useDataSource,
2600
- Un as useLayerConfig,
2601
- Wn as useLayerboard,
2602
- Vn as useReactiveDataSource
2791
+ ni as LayerCheckboxSet,
2792
+ No as LayerPanel,
2793
+ ii as LayerRadioButtonSet,
2794
+ ti as Layerboard,
2795
+ to as MapPanel,
2796
+ oi as TopicAccordion,
2797
+ Yn as WEBMAP_ID,
2798
+ gt as buildWebMapUrl,
2799
+ Yo as clearCache,
2800
+ pt as getLayerConfigs,
2801
+ ei as getWebMapUrl,
2802
+ Mt as transformWebMapToLayerConfigs,
2803
+ nn as useApiDataSources,
2804
+ Jn as useDataSource,
2805
+ li as useLayerConfig,
2806
+ ai as useLayerboard,
2807
+ ri as useReactiveDataSource
2603
2808
  };