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

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